/* =========================================================
   DESIGN TOKENS
   Concept: a darkroom, not a gallery wall. Black backgrounds
   like undeveloped film, a safelight red for the one thing
   that matters, a color-shift teal + amber for playful accents
   (like light leaks / cross-processed film). Frames are treated
   like actual negatives — frame numbers, exposed rebate edges.
   ========================================================= */
:root {
  --ink: #ede6d6;          /* darkroom black */
  --ink-soft: #e2dbc8;      /* raised panels */
  --paper: #131110;         /* photo paper white */
  --paper-dim: #4a4038;     /* aged paper / captions */
  --safelight: #c8272c;     /* darkroom safelight red — primary accent */
  --emulsion: #4a9d95;      /* color-shift teal — secondary accent */
  --leak: #8E62B5;          /* purple — tertiary accent */

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", -apple-system, sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  --edge: 3px solid var(--paper);
  --container: 1240px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  cursor: none; /* replaced by custom viewfinder cursor on pointer devices */
}

@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: var(--safelight);
  color: var(--ink);
}

:focus-visible {
  outline: 2px dashed var(--leak);
  outline-offset: 4px;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* =========================================================
   FILM STRIP NAV — a canister label bolted to the top.
   ========================================================= */
.filmnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  border-bottom: var(--edge);
}

.filmnav__row {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 28px 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.filmnav__brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.filmnav__brand span {
  color: var(--safelight);
}

.filmnav__links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filmnav__links a {
  position: relative;
  padding-bottom: 4px;
}

.filmnav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--safelight);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.filmnav__links a:hover::after,
.filmnav__links a:focus-visible::after,
.filmnav__links a[aria-current="page"]::after {
  transform: scaleX(1);
}

.filmnav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--paper);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 16px;
}

@media (max-width: 720px) {
  .filmnav__row { padding: 16px 20px 14px; }

  .filmnav__toggle { display: inline-block; }

  .filmnav__links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 14px;
  }

  .filmnav__links.is-open { display: flex; }

  .filmnav__links li {
    border-top: 1px solid var(--ink-soft);
  }

  .filmnav__links a {
    display: block;
    padding: 15px 2px;
  }

  .filmnav__links a::after { display: none; }

  .filmnav__links a[aria-current="page"] {
    color: var(--safelight);
  }
}

/* =========================================================
   CUSTOM CURSOR — corner-bracket viewfinder + ticking
   frame counter that advances like winding film.
   ========================================================= */
#viewfinder {
  position: fixed;
  top: 0;
  left: 0;
  width: 46px;
  height: 46px;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  color: #ffffff;
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  #viewfinder { display: block; }
}

#viewfinder svg { width: 100%; height: 100%; }

/* =========================================================
   HEATMAP
   Fixed full-viewport blurred layer behind all content.
   ========================================================= */
#heatmap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    filter: blur(45px);
    opacity: .9;
}
main,
header,
footer {
    position: relative;
    z-index: 1;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  /* padding-left/right deliberately omitted — this element
     shares a .wrap class in the HTML, which already provides
     side padding. Using the padding SHORTHAND here (instead of
     padding-top/padding-bottom only) would explicitly set
     left/right to 0 and — since .hero appears later in this
     file than .wrap, with equal specificity — silently override
     and cancel .wrap's side padding entirely. This was the bug
     behind text running edge-to-edge with no padding. */
  padding-top: 64px;
  padding-bottom: 40px;
  border-bottom: var(--edge);
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--leak);
  margin: 0 0 14px;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: 0.98;
  margin: 0 0 22px;
  max-width: 14ch;
}

.hero__title em {
  font-style: italic;
  color: var(--safelight);
}

.hero__sub {
  max-width: 46ch;
  color: var(--paper-dim);
  font-size: 1.05rem;
  margin: 0 0 32px;
}

/* =========================================================
   NEGATIVE FRAME — a single image treated like a strip
   of film: frame number, exposed rebate edge.
   ========================================================= */
.negative {
  position: relative;
  background: var(--ink-soft);
  border: 3px solid var(--ink-soft);
  border-image-source: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20200%20200%22%3E%0A%3Cfilter%20id%3D%22f%22%20x%3D%22-20%25%22%20y%3D%22-20%25%22%20width%3D%22140%25%22%20height%3D%22140%25%22%3E%0A%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%220.8%22%20numOctaves%3D%222%22%20seed%3D%2211%22%20result%3D%22n%22/%3E%0A%3CfeDisplacementMap%20in%3D%22SourceGraphic%22%20in2%3D%22n%22%20scale%3D%226%22%20xChannelSelector%3D%22R%22%20yChannelSelector%3D%22G%22/%3E%0A%3C/filter%3E%0A%3Cpath%20d%3D%22M0%2C0%20H200%20V200%20H0%20Z%20M40%2C40%20H160%20V160%20H40%20Z%22%20fill-rule%3D%22evenodd%22%20fill%3D%22%23000%22%20filter%3D%22url%28%23f%29%22/%3E%0A%3C/svg%3E");
  border-image-slice: 20%;
  border-image-width: 10px;
  border-image-repeat: round;
  overflow: hidden;
}

.negative__frame {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2622, #100e0d);
}

.negative__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(.16,1,.3,1), filter 0.6s ease;
  filter: grayscale(15%) contrast(1.05);
}

.negative:hover .negative__frame img {
  transform: scale(1.04);
  filter: grayscale(0%) contrast(1.1) saturate(1.15);
}

.negative__leak {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(232,163,61,0.55), transparent 45%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.negative:hover .negative__leak { opacity: 1; }

.negative__tag {
  position: absolute;
  bottom: 22px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #f4efe3;
  background: rgba(19,17,16,0.72);
  padding: 3px 8px;
  letter-spacing: 0.05em;
}

.negative__placeholder-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #b8afa0;
  letter-spacing: 0.04em;
}

/* =========================================================
   CONTACT SHEET GRID — for portfolio landing sections
   ========================================================= */
.section {
  /* See the note on .hero above — padding-left/right deliberately
     omitted so .wrap's side padding (shared on the same element)
     isn't overridden. */
  padding-top: 72px;
  padding-bottom: 72px;
  border-bottom: var(--edge);
}

.section:last-of-type { border-bottom: none; }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.section__kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--emulsion);
  margin: 0 0 8px;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  margin: 0;
  font-weight: 600;
}

.section__link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--safelight);
  padding-bottom: 3px;
  white-space: nowrap;
}

.section__link:hover { color: var(--safelight); }

.contact-sheet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 900px) {
  .contact-sheet { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .contact-sheet { grid-template-columns: 1fr; }
}

.contact-sheet .negative__frame { aspect-ratio: 1 / 1; }

/* =========================================================
   MASONRY GALLERY — native-aspect-ratio gallery used on
   Weddings and Events. CSS multi-column layout instead of a
   uniform grid, so each photo keeps its real height instead
   of being cropped to a square. Order is shuffled on load by
   each page's own script (weddings-grid.js / events-gallery.js).
   ========================================================= */
.masonry-gallery {
  column-count: 3;
  column-gap: 18px;
}

.masonry-gallery .negative {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 18px;
}

.masonry-gallery .negative__frame {
  aspect-ratio: auto;
  height: auto;
}

.masonry-gallery .negative__frame img {
  width: 100%;
  height: auto;
  object-fit: initial;
  display: block;
}

@media (max-width: 900px) {
  .masonry-gallery { column-count: 2; }
}

@media (max-width: 560px) {
  .masonry-gallery { column-count: 1; }
}

/* =========================================================
   FOOTER — the box the negatives get filed away in
   ========================================================= */
.filmfoot {
  /* See the note on .hero above — padding-left/right deliberately
     omitted so .wrap's side padding (shared on the same element)
     isn't overridden. */
  padding-top: 48px;
  padding-bottom: 60px;
  color: var(--paper-dim);
}

.filmfoot__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.filmfoot a:hover { color: var(--leak); }

/* =========================================================
   EASTER EGG — a stray sprocket hole hiding a link.
   Small, unlabeled until hovered, rewards the curious.
   ========================================================= */
.egg-hole {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--paper-dim);
  vertical-align: middle;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.egg-hole:hover,
.egg-hole:focus-visible {
  background: var(--leak);
  transform: scale(1.4) rotate(90deg);
  box-shadow: 0 0 14px var(--leak);
}

.egg-link {
  display: inline-block;
  padding: 10px;
  margin: -10px;
}

/* =========================================================
   PAGE INTRO (subpages)
   ========================================================= */
.page-intro {
  /* See the note on .hero above — padding-left/right deliberately
     omitted so .wrap's side padding (shared on the same element)
     isn't overridden. This was the specific rule causing "About
     me" / "love stories" text to run flush to the screen edge. */
  padding-top: 56px;
  padding-bottom: 40px;
  border-bottom: var(--edge);
}

.page-intro__kicker {
  font-family: var(--font-mono);
  font-size: 1.0rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--leak);
  margin: 0 0 14px;
}

.page-intro__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin: 0 0 20px;
  font-weight: 600;
}

.page-intro__body {
  max-width: 60ch;
  color: var(--paper-dim);
  font-size: 1.25rem;
}

/* button */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 1px solid var(--paper);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
  background: var(--safelight);
  border-color: var(--safelight);
  color: var(--ink);
}

/* =========================================================
   MOBILE SPACING — the desktop paddings (64–72px) feel
   bloated on a phone screen; tighten them up below 600px.
   ========================================================= */
@media (max-width: 600px) {
  .wrap { padding: 0 20px; }

  /* Same shorthand-vs-.wrap cascade issue as the base rules
     above applies here too — using padding-top/padding-bottom
     only, not the shorthand, so .wrap's 20px side padding
     survives at this breakpoint. */
  .hero { padding-top: 40px; padding-bottom: 26px; }
  .hero__sub { font-size: 1rem; }

  .page-intro { padding-top: 36px; padding-bottom: 28px; }
  .page-intro__body { font-size: 1rem; }

  .section { padding-top: 44px; padding-bottom: 44px; }
  .section__head { margin-bottom: 24px; }

  .filmfoot { padding-top: 36px; padding-bottom: 48px; }
  .filmfoot__row { flex-direction: column; align-items: flex-start; }

  /* Extra inset for text only — the .wrap padding above already
     applies to photos too, so this adds breathing room specifically
     for type without pushing image frames in any further. */
  .hero__eyebrow,
  .hero__title,
  .hero__sub,
  .page-intro__kicker,
  .page-intro__title,
  .page-intro__body,
  .section__kicker,
  .section__title,
  .section__link,
  .filmfoot__row {
    padding-left: 8px;
    padding-right: 8px;
  }
}