/* Shared components. Variants restyle these through tokens and their own selectors. */

/* ------------------------------------------------------------ scroll progress */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(var(--scroll, 0));
}

/* ------------------------------------------------------------ design bar + switcher */
.design-bar {
  position: relative;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 0.25rem 0.5rem;
  flex-wrap: wrap;
  min-height: var(--bar-h);
  padding: 0.35rem var(--gutter);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.design-bar a, .design-bar button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.25rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: inherit;
  text-decoration: none;
  font: inherit;
}
.design-bar a:hover, .design-bar button:hover { border-color: currentColor; }
.db-all { margin-right: auto; font-weight: 500; }
.switcher { position: relative; }
.switcher-toggle { border-color: rgb(255 255 255 / 0.25) !important; }
.sw-curname { font-weight: 500; }
.switcher-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 2rem));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 0.5rem;
  background: #111;
  color: #f4f4f0;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.35);
}
.sw-head { margin: 0.4rem 0.6rem 0.6rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; }
.switcher-panel a {
  display: grid !important;
  grid-template-columns: 2.2rem 1fr;
  gap: 0 0.5rem;
  border-radius: var(--radius-sm) !important;
  padding: 0.55rem 0.6rem !important;
  width: 100%;
}
.switcher-panel a small { grid-column: 2; opacity: 0.65; font-size: 0.72rem; }
.switcher-panel a[aria-current="page"] { background: rgb(255 255 255 / 0.1); }
.switcher-panel a[aria-current="page"] .sw-n::after { content: " ●"; color: var(--accent); }
.motion-toggle { border-color: rgb(255 255 255 / 0.25) !important; }
.mt-icon { display: none; }
.sw-short { display: none; }
.motion-toggle[aria-pressed="true"] { background: rgb(255 255 255 / 0.12) !important; }

/* ------------------------------------------------------------ site header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 0.15rem; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.7rem;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 999px;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="true"] { background: var(--fg); color: var(--bg); }
.menu-toggle { display: none; }

@media (max-width: 920px) {
  .js .menu-toggle {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    padding: 0 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
  }
  .js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 0.5rem var(--gutter) 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgb(0 0 0 / 0.12);
  }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; }
  .no-js .site-nav ul { flex-direction: row; flex-wrap: wrap; }
  .site-header { flex-wrap: wrap; }
  .no-js .site-header { position: relative; }
  .db-step-t, .sw-cur { display: none; }
  .design-bar { gap: 0.25rem; }
  .design-bar a, .design-bar button { min-height: 44px; padding: 0.25rem 0.6rem; }
}

/* ------------------------------------------------------------ buttons + shared text */
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block: 1.5rem 1rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border: 2px solid var(--fg);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  line-height: 1.1;
  transition: transform 200ms var(--ease-out), background-color 200ms, color 200ms;
}
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: inherit; }
.btn:hover { transform: translateY(-2px); }
.btn--ghost:hover { background: var(--fg); color: var(--bg); }

.idline { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; font-size: var(--step--1); font-family: var(--font-mono); letter-spacing: 0.02em; }
.idline span { padding: 0.2rem 0.55rem; border: 1px solid var(--line); border-radius: 999px; }
.stamp { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; }
.note { padding-left: 0.9rem; border-left: 3px solid var(--accent); color: var(--muted); }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.chip {
  min-height: 40px;
  padding: 0.35rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
}
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ------------------------------------------------------------ hero base */
.hero { position: relative; padding: clamp(2rem, 1rem + 4vw, 5rem) var(--gutter); }
.hero h1 { font-size: var(--step-5); letter-spacing: -0.02em; line-height: 0.95; margin-bottom: 1.25rem; }
.hero img { width: 100%; }
.hero-img { object-fit: cover; }

/* ------------------------------------------------------------ sections */
.sec { padding: var(--section-pad) var(--gutter); }
.sec-inner { max-width: var(--max); margin: 0 auto; }
.sec-head { max-width: 60ch; margin-bottom: clamp(1.5rem, 1rem + 2vw, 3rem); }
.sec-head h2 { margin-bottom: 0.75rem; }
.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.45; }

/* ------------------------------------------------------------ footage */
.clip-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 1rem;
  align-items: start;
}
.clip--featured { grid-column: 1 / -1; }
.clip-frame { position: relative; overflow: hidden; border-radius: var(--radius); background: #000; }
.clip-frame video { width: 100%; aspect-ratio: 9 / 16; object-fit: contain; }
.clip--landscape .clip-frame video { aspect-ratio: 16 / 9; }
.clip--featured .clip-frame video { max-height: 78vh; }
.clip-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.35rem 0.75rem; padding: 0.6rem 0.1rem; font-family: var(--font-mono); font-size: 0.8rem; }
.clip-no { font-weight: 600; }
.clip-meta { color: var(--muted); }
.clip-desc { flex: 1 0 100%; color: var(--muted); font-family: var(--font-body); font-size: 0.88rem; line-height: 1.45; }
@media (min-width: 921px) {
  .clip-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .clip--featured { grid-column: span 4; grid-row: span 2; }
  .clip--landscape:not(.clip--featured) { grid-column: span 2; }
}

/* ------------------------------------------------------------ profile */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1.5rem, 1rem + 3vw, 4rem); }
@media (min-width: 921px) { .profile-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.profile-copy p { font-size: var(--step-1); line-height: 1.5; }
.profile-facts h3 { margin-top: 0; }
.facts { display: grid; border-top: 1px solid var(--line); }
.fact { display: grid; grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr); gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.fact dt { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding-top: 0.2rem; }
.fact dd { font-weight: 500; }

.traits { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.trait { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.trait h4 { font-size: var(--step-1); margin-bottom: 0.6rem; }
.evidence { display: grid; gap: 0.35rem; margin-top: 0.9rem; font-size: 0.9rem; }
.evidence a::before { content: "→ "; color: var(--accent); }

/* ------------------------------------------------------------ trial */
.trial-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 921px) { .trial-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; } }
.trial-club { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; line-height: 1.1; }
.trial-club span { display: block; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 0.5rem; color: var(--muted); }
.trial-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 0.75rem; }
.trial-item img, .screens img, .g-link img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.cap { display: block; padding-top: 0.4rem; font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.lb-link { text-decoration: none; }

.timeline { position: relative; display: grid; gap: 1.25rem; padding-left: 1.5rem; border-left: 2px solid var(--line); }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: calc(-1.5rem - 7px); top: 0.35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.tl-item time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.tl-item h4 { margin: 0.2rem 0 0.3rem; }

.stops { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.stop { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stop-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.stop-copy { padding: 1rem 1.1rem 1.25rem; }
.stop-coord { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); margin: 0.2rem 0 0.6rem; }

/* ------------------------------------------------------------ data */
.caveat {
  max-width: 75ch;
  padding: 1rem 1.2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 0.35rem; padding: 1.25rem; background: var(--surface); }
.stat-value { font-family: var(--font-display); font-size: var(--step-3); font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.unit { font-size: 0.45em; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.stat-label { font-size: 0.85rem; color: var(--muted); }

.data-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 3rem; }
@media (min-width: 921px) { .data-split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.pairs { display: grid; gap: 1.1rem; }
.pair {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) 1fr minmax(4.5rem, auto);
  grid-template-areas: "label label label" "l bars r";
  align-items: center;
  gap: 0.35rem 0.75rem;
}
.pair-label { grid-area: label; font-weight: 600; }
.pair-val { font-family: var(--font-mono); font-size: 0.85rem; white-space: nowrap; }
.pair-val small { color: var(--muted); }
.pair-val--l { grid-area: l; text-align: right; }
.pair-val--r { grid-area: r; }
.pair-bars { grid-area: bars; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; height: 14px; }
.bar { position: relative; display: block; height: 100%; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar-fill { position: absolute; inset: 0; width: var(--w); background: var(--accent-2); transition: transform 900ms var(--ease-out); }
.bar--l .bar-fill { left: auto; right: 0; transform-origin: 100% 50%; }
.bar--r .bar-fill { background: var(--accent); transform-origin: 0 50%; }
.turns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.turn { padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.turn dt { font-size: 0.8rem; color: var(--muted); }
.turn dd { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; line-height: 1.1; }
.screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr)); gap: 0.75rem; max-width: 760px; }
.screens img { aspect-ratio: 9 / 16; object-position: top; }

/* ------------------------------------------------------------ gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 1rem; }
.g-link { display: block; text-decoration: none; }
.g-link img { transition: transform 500ms var(--ease-out), filter 300ms; }
.g-link:hover img { transform: scale(1.02); }
.g-cap { display: block; padding-top: 0.5rem; font-size: 0.82rem; line-height: 1.35; color: var(--muted); }
.g-no { font-family: var(--font-mono); color: var(--fg); margin-right: 0.25rem; }
.badge { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.7rem; font-weight: 600; vertical-align: 1px; }
.g-item--match.g-item[data-new] .g-link img { aspect-ratio: 4 / 3; }

/* ------------------------------------------------------------ lightbox */
.lightbox {
  width: min(1100px, 100vw - 1.5rem);
  max-width: none;
  max-height: calc(100vh - 1.5rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #0c0c0c;
  color: #f2f2ee;
}
.lightbox::backdrop { background: rgb(0 0 0 / 0.82); }
.lb-inner { display: grid; gap: 0.75rem; padding: 0.75rem; }
.lb-figure { display: grid; gap: 0.5rem; justify-items: center; }
.lb-img { width: auto; max-width: 100%; max-height: calc(100vh - 11rem); object-fit: contain; }
.lb-caption { font-size: 0.9rem; text-align: center; color: #cfcfca; }
.lb-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem; }
.lb-btn { min-height: 44px; padding: 0.4rem 1rem; border: 1px solid rgb(255 255 255 / 0.3); border-radius: 999px; background: transparent; color: inherit; }
.lb-btn:hover { background: rgb(255 255 255 / 0.1); }
.lb-count { margin: 0 0.5rem; font-family: var(--font-mono); font-size: 0.8rem; }
.lightbox :focus-visible { outline-color: #8fb4ff; }

/* ------------------------------------------------------------ contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 921px) { .contact-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; } }
.rep-card { padding: clamp(1.25rem, 1rem + 1vw, 2rem); border-radius: var(--radius); background: var(--fg); color: var(--bg); }
.rep-card h3 { margin-top: 0; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; }
.rep-name { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; margin: 0.5rem 0; line-height: 1.1; }
.rep-mail { font-size: var(--step-1); overflow-wrap: anywhere; }
.rep-card h4 { margin: 1.5rem 0 0.6rem; font-size: 0.9rem; }
.ticks { display: grid; gap: 0.35rem; font-size: 0.92rem; }
.ticks li::before { content: "✓ "; color: var(--accent); }
.contact-form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 600; font-size: 0.92rem; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--fg) 35%, transparent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
}
.field textarea { resize: vertical; }
.contact-form button { justify-self: start; }
.privacy { font-size: 0.85rem; color: var(--muted); }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status[data-state="error"] { color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------ provenance + footer */
.prov-list { display: grid; border-top: 1px solid var(--line); }
.prov { display: grid; gap: 0.25rem 2rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 721px) { .prov { grid-template-columns: 14rem 1fr; } }
.prov dt { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.prov dd { color: var(--muted); }

.site-footer { padding: 2.5rem var(--gutter); background: var(--fg); color: var(--bg); font-size: 0.9rem; }
.foot-inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 0.35rem; }
.foot-name { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }

/* ------------------------------------------------------------ overflow guards */
.facts a, .rep-mail, .site-footer a[href^="mailto:"] { overflow-wrap: anywhere; word-break: break-word; }

/* ------------------------------------------------------------ compact phones: one-row design bar, tighter hero */
@media (max-width: 600px) {
  .design-bar { flex-wrap: nowrap; gap: 2px; padding-inline: 8px; font-size: 0.75rem; }
  .design-bar a, .design-bar button { padding-inline: 6px; justify-content: center; }
  .db-all { white-space: nowrap; }
  .sw-cur, .sw-curname, .mt-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .sw-short { display: inline; }
  .switcher { position: static; }
  .switcher-panel { left: 8px; right: 8px; width: auto; }
  .mt-icon { display: inline-block; width: 12px; height: 12px; border-left: 4px solid currentColor; border-right: 4px solid currentColor; }
  .motion-toggle[aria-pressed="true"] .mt-icon { width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 11px; border-color: transparent transparent transparent currentColor; }

  .hero .idline { display: block; font-size: 0.74rem; line-height: 1.5; }
  .hero .idline span { display: inline; padding: 0; border: 0; }
  .hero .idline span:not(:last-child)::after { content: " ·"; }
  .hero .cta-row { flex-wrap: nowrap; margin-block: 1rem 0.5rem; gap: 0.5rem; }
  .hero .btn { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0.45rem 0.6rem; font-size: 0.88rem; line-height: 1.15; text-align: center; white-space: normal; }
  .hero h1 { margin-bottom: 0.75rem; }
  .hero .stamp { margin-bottom: 0; }
  .hero .kicker { margin-bottom: 0.5rem; }
  .site-header { min-height: 52px; }
}
