/* site.css — additive layer on top of v5-base.css for the combined site.
   Holds inline photo-section overrides for subpages + small subpage-specific classes. */

/* Hero overlay + frame chrome — lifted from v7-a inline styles so all pages share. */
.photo-section::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,17,13,0.32) 0%, rgba(20,17,13,0.16) 50%, rgba(20,17,13,0.42) 100%);
  z-index: 1; pointer-events: none;
}
.frame-inset {
  position: absolute; inset: var(--gutter-frame);
  border: 1px solid rgba(245,241,232,0.55);
  z-index: 2; pointer-events: none;
}
.frame-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(72px, 10vw, 140px) var(--gutter-x);
  z-index: 3; color: var(--paper);
}
.frame-content h1 {
  font-family: 'Cormorant Garamond', serif; font-weight: 400;
  font-size: clamp(4rem, 11vw, 9rem); line-height: 0.95; letter-spacing: -0.025em;
  color: var(--paper);
  text-shadow: 0 4px 32px rgba(0,0,0,0.55), 0 1px 4px rgba(0,0,0,0.6);
}
.frame-content h1 em { font-style: italic; }
.frame-content .lede {
  margin-top: 24px; max-width: 42ch;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: clamp(1.3rem, 2vw, 1.7rem); line-height: 1.35;
  color: var(--paper);
  text-shadow: 0 2px 18px rgba(0,0,0,0.65), 0 1px 3px rgba(0,0,0,0.6);
}
.frame-content.bot { justify-content: center; align-items: flex-start; padding: 0 var(--inset-h); }
.frame-content.bot h1 { font-size: clamp(3.5rem, 9vw, 7rem); }
.frame-content.bot .channels {
  display: flex; gap: 32px; flex-wrap: wrap; margin-top: 32px;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
}
.frame-content.bot .channels a {
  color: var(--paper);
  border-bottom: 1px solid rgba(245,241,232,0.4);
  padding-bottom: 2px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.55);
}
.frame-content.bot .channels a:hover { border-bottom-color: var(--paper); }

/* #hi lede — bigger and slightly weightier so it reads over the New York photo. */
.frame-content.bot .lede {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: 500;
  line-height: 1.4;
}

/* --- Contextual top bar internals --- */

/* Brand name — Cormorant italic, matches hero h1.
   Home: hidden over hero, fades in once topbar goes solid.
   Subpages: also hidden over hero; .show added by JS once past hero. */
.topbar .brand-name {
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500;
  font-size: 1.25rem; letter-spacing: -0.01em;
  opacity: 0; transform: translateY(-2px);
  transition: opacity 240ms ease, transform 240ms ease;
  pointer-events: none;
}
.topbar .brand-name em { font-style: italic; }
.topbar .brand-name.show,
.topbar.brand-active .brand-name { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Section suffix — `· Work`, `· Designing`, etc. */
.topbar .topbar-suffix {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 1.05rem; letter-spacing: -0.01em;
  color: var(--fg-soft);
  opacity: 0; transform: translateX(-6px);
  transition: opacity 240ms ease, transform 240ms ease;
}
.topbar .topbar-suffix.show,
.topbar.brand-active .topbar-suffix { opacity: 1; transform: translateX(0); }
.topbar:not(.solid) .topbar-suffix { color: var(--paper); }

/* Hamburger — 52×52 hitbox, 26×26 visual. Two equal bars.
   Negative right-margin shifts the visible icon out toward the frame so its
   right edge is at the same inset as the brand text's left edge. */
.menu-toggle {
  position: relative;
  width: 52px; height: 52px;
  margin: 0;
  background: transparent; border: 0; cursor: pointer;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: inherit;
  transition: filter 240ms ease, opacity 240ms ease;
}
/* Cream bars over photos get an ambient dark halo so they read against any
   photo content — drop-shadow on the toggle puts a soft glow around both
   bars together. Off over body where ink-on-paper contrast is sufficient. */
.topbar:not(.solid) .menu-toggle {
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.55)) drop-shadow(0 0 2px rgba(0,0,0,0.4));
}
/* Hamburger icon is an inline SVG (26×10 viewBox), centered in the 52×52
   button by flex. Vector geometry → identical bar y-positions across browsers,
   no font-metrics drift. */
.menu-toggle svg { display: block; overflow: visible; }
.menu-toggle svg .bar {
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: butt;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 260ms ease, stroke 240ms ease;
}
/* Open state — converge both lines to the icon's vertical center (y=5) and
   rotate them into an X. translateY moves the line to y=5 first, then rotate
   spins it around the line's own center. */
.menu-toggle[aria-expanded="true"] svg .bar-top {
  transform: translateY(3px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] svg .bar-bot {
  transform: translateY(-3px) rotate(-45deg);
}

/* Nav panel — right-side slide-in on desktop, full-screen on mobile.
   No solid background: a strong backdrop-filter blur frosts whatever's behind,
   and the link text carries its own paper-colored halo so it reads cleanly
   over paper body content AND over the hero photo when opened at the top. */
.nav-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 33.333vw;
  background: transparent;
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  color: var(--fg);
  z-index: 60;
  padding: calc(var(--gutter-y) + 76px) clamp(32px, 5vw, 48px) 48px;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(.4,.0,.2,1);
  display: flex; flex-direction: column; gap: 32px;
  overflow-y: auto;
}
.nav-panel[aria-hidden="false"] { transform: translateX(0); }
.nav-panel ul { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.nav-panel li a {
  font-family: 'Cormorant Garamond', serif; font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.02em;
  color: var(--fg); line-height: 1;
  display: inline-block;
  border-bottom: 1px solid transparent;
  padding-bottom: 4px;
  padding-left: clamp(30px, 5vw, 68px);
  text-shadow: 0 1px 14px var(--halo), 0 0 2px var(--halo-soft);
  transition: border-color 240ms ease, color 240ms ease, padding-left 240ms ease;
}
.nav-panel li a:hover { border-bottom-color: var(--line-strong); }
.nav-panel li a[aria-current="page"] { font-style: italic; color: var(--fg-soft); padding-left: 0; }
.nav-panel .nav-meta {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 4px;
  align-items: center; text-align: center;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-mute);
  text-shadow: 0 1px 10px var(--halo-soft);
}

/* Body lock while panel is open (no scroll). */
body.nav-open { overflow: hidden; }

/* Lift the topbar above the panel so the X (rotated hamburger) stays visible. */
body.nav-open .topbar { z-index: 70; }
/* Hide the brand link while the panel is open so it doesn't float over content. */
body.nav-open .brand { opacity: 0; pointer-events: none; transition: opacity 240ms ease; }
/* Suppress the .brand-active translucent bar while the menu is open — otherwise
   it draws above the panel and covers the top menu item. */
body.nav-open .topbar.brand-active {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Replace the browser's default (often blue) focus ring on nav links with a
   subtle site-palette ring that only shows for keyboard focus. */
.nav-panel li a:focus { outline: none; }
.nav-panel li a:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 4px;
}

@media (max-width: 720px) {
  .nav-panel { width: 66.666vw; }
  /* Auto-hide hamburger mid-scroll: visible at the top (over hero photo) and
     at the bottom (#hi on home, pager on subpages), hidden through body in
     between. body.chrome-hidden is toggled in topbar.js. */
  body.chrome-hidden .menu-toggle { opacity: 0; pointer-events: none; }
}

@media (max-width: 540px) {
  .nav-panel li a { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar, .topbar .brand-name, .topbar .topbar-suffix,
  .menu-toggle .bar, .nav-panel { transition: opacity 160ms ease; }
  .topbar .brand-name { transform: none; }
  .topbar .topbar-suffix { transform: none; }
  .nav-panel { transition: opacity 160ms ease, transform 0s; }
}

/* Colophon — index has the centered chrome line, subpages reuse it for back-home. */
.colophon {
  max-width: 720px; margin: 64px auto 0;
  padding: 24px clamp(24px, 4vw, 48px) 0;
  border-top: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--fg-mute);
  text-align: center;
}

/* --- Subpage-specific additions --- */

/* Quiet section label on the home page above the rows. */
.section-label {
  margin: 0 auto clamp(40px, 6vw, 72px);
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 400;
  font-size: clamp(1.2rem, 1.6vw, 1.5rem);
  color: var(--fg-mute);
  text-align: center;
  letter-spacing: 0.01em;
}

/* Italic editorial lede between hero and project rows. */
.subpage-lede {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: clamp(1.3rem, 2vw, 1.65rem); line-height: 1.5;
  color: var(--fg-soft);
  max-width: 56ch;
  margin: clamp(48px, 8vw, 88px) auto;
  padding: 0 clamp(24px, 4vw, 48px);
  text-align: center;
}
.subpage-lede em { color: var(--fg); font-style: italic; }

/* The throughline back to everething, before the back-home colophon. */
.everething-bridge {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem); line-height: 1.55;
  color: var(--fg-soft);
  max-width: 60ch;
  margin: clamp(56px, 8vw, 96px) auto clamp(16px, 3vw, 32px);
  padding-top: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--line);
  text-align: center;
}
.everething-bridge em { font-style: italic; color: var(--fg); }
.everething-bridge .label {
  display: block; margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fg-mute);
}

/* "← back to start" link in subpage colophon. */
.back-home {
  color: var(--fg-soft);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: color 0.3s ease;
}
.back-home:hover { color: var(--fg); }

/* Paired pager under the everething-bridge — italic editorial voice,
   monospace arrow accents (see .arrow rule below). */
.pager {
  max-width: 720px; margin: 64px auto 0;
  padding: 24px clamp(24px, 4vw, 48px) 0;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px; flex-wrap: wrap;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-mute);
}
.pager .pager-next {
  color: var(--fg-soft);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: color 0.3s ease;
}
.pager .pager-next:hover { color: var(--fg); }

/* Home #hi brand — anchored to the photo's top-left frame corner so it scrolls
   with the section instead of hovering in the fixed topbar. Fades in on entry. */
.photo-section.bot > .hi-brand {
  position: absolute;
  top: calc(var(--inset-v) + env(safe-area-inset-top));
  left: var(--inset-h);
  z-index: 4;
  /* match the subpage topbar's geometry — the topbar brand lives in a 52px
     flex row with the hamburger and gets vertically centered. Giving the
     hi-brand the same 52px flex container puts its text center on the same
     y as the hamburger that's still in the fixed topbar above this section. */
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500;
  font-size: 1.25rem; letter-spacing: -0.01em;
  color: var(--paper);
  text-shadow: 0 2px 18px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.5);
  opacity: 0; transform: translateY(-2px);
  transition: opacity 320ms ease, transform 320ms ease;
  pointer-events: none;
}
.photo-section.bot > .hi-brand em { font-style: italic; }
.photo-section.bot > .hi-brand.show { opacity: 1; transform: translateY(0); }

/* Home's "see more" CTA in #hi — anchored to the writing column on the left
   and --gutter-y above the section bottom, mirroring the top-bar brand row. */
.photo-section.bot > .pager-next {
  position: absolute;
  left: var(--inset-h);
  /* On mobile the photo card already insets from the home indicator via its
     margin-bottom — no need to re-add safe-area-inset-bottom here. */
  bottom: var(--inset-v);
  transform: none;
  z-index: 4;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 1.55vw, 1.4rem);
  letter-spacing: 0;
  text-transform: none;
  color: var(--paper);
  border-bottom: 1px solid rgba(245,241,232,0.4);
  padding-bottom: 2px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.55);
  transition: border-color 0.3s ease;
}
.photo-section.bot > .pager-next:hover { border-bottom-color: var(--paper); }

/* Monospace arrow accent — small chrome separator between editorial label
   and the action glyph. Used in any CTA wrapping its arrow in <span class="arrow">. */
.pager-next .arrow,
.back-home .arrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-style: normal;
  font-size: 0.85em;
  letter-spacing: 0.08em;
  margin: 0 0.15em;
  vertical-align: 1px;
}

@media (max-width: 540px) {
  .pager { gap: 14px; }
}

/* Mock-tag is debug-only; hide on the live combined site. */
.mock-tag { display: none; }

/* Hero responsive — same breakpoint as v7-a.
   Horizontal/vertical gutters mobile-override via :root tokens in v5-base.css.
   .photo-section min-height is reset in v5-base.css's mobile block so the
   section can fall back to 100dvh on phones. */
@media (max-width: 720px) {
  /* Hero h1 — shrink so "Adam Raabe" (and the subpage titles) fill ~2/3 of
     the screen width on phones, not the entire viewport. */
  .frame-content h1     { font-size: clamp(2.6rem, 11vw, 4rem); }
  .frame-content.bot h1 { font-size: clamp(2.4rem, 10vw, 3.5rem); }
  .subpage-lede { margin: 56px auto; }
  .everething-bridge { margin-left: 16px; margin-right: 16px; }

  /* --- Mobile rounded-card photo treatment ---
     iOS 26 Safari dropped support for the theme-color meta tag and now tints
     the status-bar area by sampling the background-color of fixed/sticky
     elements near the viewport edges (falling back to body bg). In normal
     browser mode there is no way to make the status-bar area disappear or
     match a hero image. Embrace it: make the photo a rounded card floating
     on the cream paper bg, and the status bar area becomes intentional
     matting around the print. Same pattern Daylight Computer uses. */
  .photo-section {
    border-radius: 12px;
    margin: 14px;
    /* svh (small viewport — assumes browser chrome fully shown) guarantees
       the card fits even in Chrome iOS, whose dvh value lags the actual
       chrome state and was clipping the bottom of the photo. Trade-off: in
       Safari iOS when the URL bar collapses, a small cream strip appears
       below the card instead of the photo growing. Acceptable for the gain
       in cross-browser reliability. */
    height: calc(100svh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .photo-section.top { margin-top: calc(env(safe-area-inset-top) + 14px); }
  .photo-section.bot { margin-bottom: calc(env(safe-area-inset-bottom) + 14px); }
  /* The hairline rectangle is the desktop frame. On mobile the rounded card
     edge replaces it — keeping both would be visual noise. */
  .frame-inset { display: none; }
}
