/* ==========================================================================
   Extra Sauce — shared components
   ========================================================================== */

/* ---------- Design-preview strip ---------- */
.proto-strip { background: var(--ink); color: var(--paper); font-size: 0.875rem; line-height: 1.4; --focus: var(--paper); }
.proto-strip__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding-block: 6px; }
.proto-strip p { color: var(--muted-on-ink); }
.proto-strip__tag { font-family: var(--mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); background: var(--tomato); padding: 3px 6px; border-radius: 3px; margin-right: 8px; white-space: nowrap; }
.proto-strip__actions { display: flex; align-items: center; gap: 4px; flex: none; }
.proto-strip__link { display: inline-flex; align-items: center; min-height: 44px; color: var(--paper); font-weight: 600; text-underline-offset: .2em; padding: 8px; }
.proto-strip__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--paper); border-radius: 50%; }
.proto-strip__close:hover { background: var(--ink-3); }
.proto-strip__close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.proto-strip__short { display: none; }
@media (max-width: 479px) { .proto-strip__inner { flex-wrap: wrap; } .proto-strip__link { white-space: normal; } }
@media (max-width: 767px) { .proto-strip p { font-size: 0.8125rem; } .proto-strip__long { display: none; } .proto-strip__short { display: inline; } .proto-strip__link { white-space: nowrap; } }

/* ---------- Header (brief §4.2) ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(14px); backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); background: color-mix(in srgb, var(--paper) 97%, transparent); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); transition: height 200ms var(--ease); }
.site-header__brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--ink); }
.site-header__brand .wordmark { font-size: 1.5rem; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; position: relative;
  text-decoration: none; font-weight: 520; font-size: 1rem; color: var(--ink);
}
.site-nav ul a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 9px; height: 2px; border-radius: 2px;
  background: var(--tomato); transform: scaleX(0); transform-origin: left; transition: transform 180ms var(--ease);
}
.site-nav ul a:hover::after { transform: scaleX(1); }
.site-nav ul a[aria-current="page"]::after { transform: scaleX(1); background: var(--ink); }
.site-header__mobile { display: none; align-items: center; gap: 8px; }
.menu-toggle {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 6px 0 12px;
  border: 0; background: transparent; font-weight: 600; font-size: 1rem; color: var(--ink); border-radius: var(--r-pill);
}
.menu-toggle__icon { position: relative; width: 22px; height: 14px; display: block; }
.menu-toggle__icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; border-radius: 2px; transition: transform 200ms var(--ease), top 200ms var(--ease); }
.menu-toggle__icon i:first-child { top: 2px; } .menu-toggle__icon i:last-child { top: 10px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:first-child { top: 6px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon i:last-child { top: 6px; transform: rotate(-45deg); }
@media (max-width: 899px) {
  .site-nav { display: none; }
  .site-header__mobile { display: flex; }
}
@media (max-width: 359px) { .site-header__start { display: none; } }

/* ---------- Mobile menu (brief §4.3) ---------- */
.mobile-menu {
  position: fixed; inset: calc(var(--header-h) + env(safe-area-inset-top, 0px)) 0 0 0; z-index: 49;
  background: var(--paper); overflow-y: auto; overscroll-behavior: contain;
  border-top: 1px solid var(--rule); animation: fade 180ms var(--ease) both;
}
.mobile-menu__inner { display: flex; flex-direction: column; gap: 32px; padding-block: 24px calc(32px + env(safe-area-inset-bottom, 0px)); min-height: 100%; }
.mobile-menu__links { list-style: none; margin: 0; padding: 0; }
.mobile-menu__links li { border-bottom: 1px solid var(--rule); }
.mobile-menu__links a {
  display: flex; align-items: center; justify-content: space-between; min-height: 64px;
  font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; font-variation-settings: "wdth" 84; text-decoration: none; color: var(--ink);
}
.mobile-menu__links a[aria-current="page"] { color: var(--tomato-deep); }
.mobile-menu__links a[aria-current="page"]::after { content: "Current page"; font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.mobile-menu__cta { width: 100%; }
.mobile-menu__email { display: grid; gap: 6px; margin-top: auto; }
.mobile-menu__address { font-size: 1.125rem; font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; word-break: break-all; }

/* ---------- Footer (brief §4.5) ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding-top: clamp(56px, 7vw, 96px); padding-bottom: 28px; overflow: hidden; --focus: var(--paper); --fg-2: var(--muted-on-ink); --fg: var(--paper); --line: var(--rule-on-ink); }
.site-footer__top { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 32px var(--gutter); }
.site-footer__descriptor { grid-column: 1 / span 5; font-size: var(--t-lead); line-height: 1.45; max-width: 26em; }
.site-footer__nav { grid-column: 7 / span 2; }
.site-footer__nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.site-footer__nav a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; font-weight: 520; color: var(--paper); }
.site-footer__nav a:hover, .site-footer__nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: .22em; }
.site-footer__contact { grid-column: 9 / span 4; display: grid; gap: 8px; align-content: start; }
.site-footer__email { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 1.25rem; font-weight: 620; word-break: break-all; }
.site-footer__note { font-size: .875rem; color: var(--muted-on-ink); }
.site-footer__wordmark { margin-top: clamp(48px, 7vw, 104px); line-height: .8; container-type: inline-size; }
.site-footer__wordmark .wordmark--xl { font-size: 18.6cqi; }
.wordmark--xl { font-size: clamp(4rem, 19.2vw, 17rem); letter-spacing: -0.03em; }
.site-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule-on-ink); font-size: .875rem; color: var(--muted-on-ink); }
.site-footer__base a { color: var(--paper); position: relative; }
.site-footer__base a::after { content: ""; position: absolute; inset: -14px -8px; } /* 44px hit area, no layout shift */
@media (max-width: 1023px) {
  .site-footer__descriptor { grid-column: 1 / -1; }
  .site-footer__nav { grid-column: 1 / span 4; }
  .site-footer__contact { grid-column: 5 / -1; }
}
@media (max-width: 767px) {
  .site-footer__top { grid-template-columns: 1fr; }
  .site-footer__nav, .site-footer__contact { grid-column: 1 / -1; }
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill);
  font-family: var(--font); font-size: 1rem; font-weight: 600; letter-spacing: -0.005em; text-transform: none; line-height: 1; white-space: nowrap; word-break: normal;
  border: 1px solid currentColor; background: transparent; color: inherit;
}
.copy-btn .icon { width: 16px; height: 16px; }
.copy-btn:hover { background: var(--fg); color: var(--bg); }
.site-footer .copy-btn:hover { background: var(--paper); color: var(--ink); }

/* ---------- Media frame ---------- */
.player__poster, .frame__fit, .frame__ambient, .hero__rear img { color: transparent; font-size: 0; }
.frame { position: relative; border-radius: var(--r-media); overflow: hidden; background: var(--ink-2); isolation: isolate; max-width: 100%; }
.frame--4x5 { aspect-ratio: 4 / 5; }
.frame__ambient { position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: cover; filter: blur(28px) saturate(1.15) brightness(.82); transform: scale(1.04); z-index: 0; }
.frame__fit { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.frame__cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }

/* ---------- Player (brief §7.4) ---------- */
.player { position: relative; width: min(100%, calc(var(--player-maxh, 100000px) * var(--rw, 16) / var(--rh, 9))); margin-inline: auto; background: var(--ink-2); border-radius: var(--r-media); overflow: hidden; color: var(--paper); isolation: isolate; --focus: var(--paper); max-width: 100%; }
.player__stage { position: relative; aspect-ratio: var(--ratio, 16 / 9); width: 100%; max-height: inherit; }
.player__poster, .player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.player__poster { z-index: 1; transition: opacity 200ms var(--ease); }
.player video { z-index: 2; }
.player.has-frame .player__poster { opacity: 0; }
.player.is-poster-missing .player__poster { visibility: hidden; }
.player__scrim { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: 3; pointer-events: none; background: linear-gradient(to top, rgba(10,10,9,.72), rgba(10,10,9,0)); opacity: 0; transition: opacity 200ms var(--ease); }
.player__big {
  position: absolute; inset: 0; margin: auto; z-index: 4; width: 84px; height: 84px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: var(--paper); color: var(--ink);
  box-shadow: 0 10px 40px rgba(0,0,0,.25); transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.player__big:hover { transform: scale(1.06); background: var(--tomato); }
.player__big:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--paper); }
.player--full:not(.has-started) .player__bar { visibility: hidden; }
.player__big .icon { width: 30px; height: 30px; margin-left: 4px; }
.player__big-label { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--mono); font-size: .75rem; letter-spacing: .04em; line-height: 1; color: var(--paper); background: rgba(23,23,22,.74); padding: 5px 9px; border-radius: 999px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.player.has-started .player__big { display: none; }
.player__state { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; }
.player__spinner { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(244,240,231,.35); border-top-color: var(--paper); animation: spin 800ms linear infinite; display: none; }
.player.is-waiting .player__spinner { display: block; }
.player__fail {
  pointer-events: auto; display: none; max-width: min(340px, 86%); text-align: left; background: var(--ink); color: var(--paper);
  border-radius: var(--r-sm); padding: 18px 18px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.35); gap: 10px;
}
.player__fail { --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-hover-bg: var(--tomato); --btn-hover-fg: var(--ink); --fg: var(--paper); --bg: var(--ink); }
.player.is-failed .player__fail { display: grid; }
.player.is-failed .player__big { display: none; }
.player__fail p { font-size: .9375rem; line-height: 1.45; }
.player__fail strong { font-weight: 650; display: block; }
.player__fail .btn-row { gap: 8px; }
.player__ended { position: absolute; inset: 0; z-index: 5; display: none; place-items: center; background: rgba(10,10,9,.55); }
.player.is-ended .player__ended { display: grid; }
.player__ended-inner { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 16px; }

.player__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 4px;
  padding: 10px 10px 10px; opacity: 0; transform: translateY(6px); transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}
.player.has-started.is-paused .player__bar, .player.has-started:hover .player__bar, .player.has-started:focus-within .player__bar, .player.has-started.show-controls .player__bar { opacity: 1; transform: none; }
.player.has-started.is-paused .player__scrim, .player.has-started:hover .player__scrim, .player.has-started:focus-within .player__scrim, .player.has-started.show-controls .player__scrim { opacity: 1; }
.pbtn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--paper); }
.pbtn:hover { background: rgba(244,240,231,.14); }
.pbtn[aria-pressed="true"] { background: rgba(244,240,231,.18); }
.pbtn .icon { width: 22px; height: 22px; }
.pbtn--cc { font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .02em; }
.pbtn--cc span { border: 1.5px solid currentColor; border-radius: 3px; padding: 2px 4px; line-height: 1; }
.pbtn--cc[aria-pressed="true"] span { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.player__time { flex: none; font-family: var(--mono); font-size: .75rem; letter-spacing: .02em; font-variant-numeric: tabular-nums; padding: 0 6px; color: var(--paper); white-space: nowrap; }
.player__seek { flex: 1; min-width: 40px; position: relative; display: flex; align-items: center; height: 44px; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; cursor: pointer; margin: 0; --pct: 0%; --buf: 0%; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--tomato) 0 var(--pct), rgba(244,240,231,.55) var(--pct) var(--buf), rgba(244,240,231,.25) var(--buf)); }
.range::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--tomato) 0 var(--pct), rgba(244,240,231,.55) var(--pct) var(--buf), rgba(244,240,231,.25) var(--buf)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); margin-top: -5px; border: 0; transition: transform 120ms var(--ease); }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 0; }
.range:hover::-webkit-slider-thumb { transform: scale(1.2); }
.range:focus-visible { outline: 2px solid var(--paper); outline-offset: -8px; }
.player__vol { width: 72px; flex: none; display: flex; align-items: center; }
/* The bar's contents follow the player's own width (a 9:16 player is narrow on any screen); nothing is ever clipped. */
.player--full .player__stage { container: pstage / inline-size; }
@container pstage (max-width: 440px) { .player__vol { display: none; } }
@container pstage (max-width: 350px) { .player__time--dur { display: none; } }
@container pstage (max-width: 305px) { .player__time--cur { display: none; } }
@container pstage (max-width: 259px) { .player__bar { flex-wrap: wrap; justify-content: space-between; row-gap: 0; } .player__seek { order: -1; flex: 1 0 100%; } .player__scrim { height: 190px; } .player .player__stage video { --cue-lift: 108px; } }
@container pstage (max-width: 207px) { .player .player__stage video { --cue-lift: 152px; } }
.player__vol .range { --pct: 100%; --buf: 100%; }
@media (hover: none), (max-width: 600px) { .player__vol { display: none; } }
@media (max-width: 420px) { .player__time--dur { display: none; } }
@media (max-width: 359px) { .player__time--cur { display: none; } }
.player video::cue { font-family: var(--font); font-size: 1rem; background: rgba(10,10,9,.78); color: #fff; }
.player video { --cue-lift: 64px; } /* = the control bar's height; raised further where the bar wraps (below) */
.player video::-webkit-media-text-track-container { transition: transform 180ms var(--ease); }
.player.has-started:is(.is-paused, :hover, :focus-within, .show-controls) video::-webkit-media-text-track-container { transform: translateY(calc(-1 * var(--cue-lift))); }
.player:fullscreen { display: grid; place-items: center; background: #000; border-radius: 0; }
.player:fullscreen .player__stage { max-height: 100vh; height: 100%; aspect-ratio: auto; }

/* Preview mode (hero / cards): muted loop, one pause control */
.player--preview .player__bar, .player--preview .player__scrim { display: none; }
.preview-toggle {
  position: absolute; z-index: 7; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 10px; border-radius: var(--r-pill); border: 0;
  background: rgba(23,23,22,.72); color: var(--paper); font-family: var(--mono); font-size: .75rem; letter-spacing: .03em;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); --focus: var(--paper);
}
.preview-toggle:hover { background: rgba(23,23,22,.9); }
.preview-toggle .icon { width: 16px; height: 16px; }
.preview-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--paper); }
.player__fallback { display: none; }
.player--preview.is-poster-missing .player__fallback {
  position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 16px; text-align: center;
  color: var(--muted-on-ink); font-family: var(--mono); font-size: var(--t-meta);
  background: repeating-linear-gradient(135deg, rgba(244,240,231,.04) 0 1px, transparent 1px 11px), var(--ink-2);
}
.player__fallback .icon { width: 28px; height: 28px; }
.player--preview.is-failed .preview-toggle { display: none; }

/* ---------- Work card (brief §6.3) ---------- */
.work-card { display: grid; gap: 14px; align-content: start; position: relative; }
.work-card__media { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--r-media); overflow: hidden; background: var(--ink-2); border: 0; padding: 0; color: var(--paper); text-align: left; isolation: isolate; cursor: pointer; }
.work-card__media .frame__ambient { inset: -25%; width: 150%; height: 150%; filter: blur(56px) saturate(.55) brightness(.42); }
.work-card__media img.frame__fit, .work-card__media video { transition: transform 300ms var(--ease-out); }
.work-card__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 2; opacity: 0; transition: opacity 180ms var(--ease); }
.work-card__media.is-previewing video { opacity: 1; }
.work-card__media:hover img.frame__fit { transform: scale(1.015); }
.work-card__play {
  position: absolute; z-index: 3; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px 0 8px; border-radius: var(--r-pill); background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .03em; box-shadow: 0 4px 18px rgba(0,0,0,.18);
  transition: background-color 160ms var(--ease);
}
.work-card__play .icon { width: 22px; height: 22px; background: var(--ink); color: var(--paper); border-radius: 50%; padding: 6px; }
.work-card__media:hover .work-card__play { background: var(--tomato); }
.work-card__ratio { position: absolute; z-index: 3; right: 12px; top: 12px; font-family: var(--mono); font-size: .6875rem; letter-spacing: .04em; color: var(--paper); background: rgba(23,23,22,.6); padding: 4px 6px; border-radius: 3px; }
.work-card__body { display: grid; gap: 8px; }
.work-card__brand { font-family: var(--mono); font-size: var(--t-meta); letter-spacing: .03em; color: var(--fg-2); }
.work-card__title { font-size: 1.25rem; line-height: 1.22; font-weight: 640; letter-spacing: -0.01em; font-variation-settings: "wdth" 92; }
.work-card__title a { position: relative; text-decoration: none; color: inherit; background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1.5px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 220ms var(--ease); }
.work-card__title a:hover, .work-card__title a:focus-visible { background-size: 100% 1.5px; }
.work-card__title a::before { content: ""; position: absolute; inset: -11px -4px; }
.work-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.work-card .work-card__meta { display: grid; justify-items: start; gap: 8px; }
.work-card__media:has(.work-card__failed) img { visibility: hidden; }
.work-card__failed { position: absolute; z-index: 4; left: 12px; right: 12px; top: 12px; background: var(--ink); color: var(--paper); font-size: .8125rem; padding: 8px 10px; border-radius: var(--r-sm); }

/* ---------- Viewer overlay (brief §7.3) ---------- */
.viewer {
  width: min(1320px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 14px;
  background: var(--ink); color: var(--paper); overflow: hidden; --focus: var(--paper); --fg: var(--paper); --fg-2: var(--muted-on-ink); --line: var(--rule-on-ink);
  --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-hover-bg: var(--tomato); --btn-hover-fg: var(--ink);
}
.viewer::backdrop { background: rgba(14,14,13,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.viewer[open] { animation: viewer-in 220ms var(--ease-out) both; }
.viewer[open]::backdrop { animation: fade 220ms var(--ease) both; }
@keyframes viewer-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.viewer { --player-maxh: calc(100dvh - 96px); }
.viewer__layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "media top" "media info"; max-height: calc(100dvh - 48px); }
.viewer__media { grid-area: media; display: grid; place-items: center; padding: 24px; background: var(--viewer-bg); min-height: 0; min-width: 0; }
.viewer__top { grid-area: top; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 16px 0 24px; border-left: 1px solid var(--rule-on-ink); }
.viewer__info { grid-area: info; display: flex; flex-direction: column; gap: 18px; padding: 12px 24px 28px; overflow-y: auto; border-left: 1px solid var(--rule-on-ink); min-height: 0; }
.viewer__close { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--rule-on-ink); background: transparent; color: var(--paper); font-weight: 600; }
.viewer__close:hover { background: var(--ink-3); }
.viewer__close .icon { width: 18px; height: 18px; }
.viewer__title { font-size: 1.75rem; line-height: 1.12; font-weight: 700; letter-spacing: -0.018em; font-variation-settings: "wdth" 88; }
.viewer__facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .9375rem; }
.viewer__facts dt { font-family: var(--mono); font-size: var(--t-meta); color: var(--muted-on-ink); padding-top: 3px; }
.viewer__actions { display: grid; gap: 10px; margin-top: auto; padding-top: 8px; }
.viewer__actions .btn { width: 100%; }
.viewer__static { display: grid; justify-items: center; }
.viewer__static img { max-height: calc(100dvh - 130px); width: auto; max-width: 100%; border-radius: var(--r-media); }
.viewer__static-fail { display: none; }
.viewer__static.is-failed img { display: none; }
.viewer__static.is-failed .viewer__static-fail {
  display: grid; place-content: center; justify-items: center; gap: 8px; width: min(480px, calc(100vw - 48px), calc(100dvh - 130px)); aspect-ratio: 1; border-radius: var(--r-media);
  color: var(--muted-on-ink); font-family: var(--mono); font-size: var(--t-meta);
  background: repeating-linear-gradient(135deg, rgba(244,240,231,.05) 0 1px, transparent 1px 11px), var(--ink-2);
}
.viewer__static-fail .icon { width: 28px; height: 28px; }
.viewer__thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.viewer__thumbs button { border: 2px solid transparent; padding: 0; border-radius: 6px; overflow: hidden; background: none; width: 64px; height: 64px; }
.viewer__thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.viewer__thumbs button[aria-pressed="true"] { border-color: var(--paper); }
.viewer__thumbs button.is-missing { background: var(--ink-2); }
.viewer__thumbs button.is-missing img { visibility: hidden; }
@media (max-width: 900px) {
  .viewer { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; --player-maxh: 62dvh; }
  .viewer__layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "top" "media" "info"; max-height: none; height: 100%; overflow-y: auto; align-content: start; }
  .viewer__media, .viewer__info { min-height: auto; }
  .viewer__top { position: sticky; top: 0; z-index: 10; background: var(--ink); padding: 10px 12px 10px 16px; border-left: 0; border-bottom: 1px solid var(--rule-on-ink); }
  .viewer__media { padding: 12px; }
  .viewer__static img { max-height: 62dvh; }
  .viewer__info { border-left: 0; padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px)); overflow: visible; }
  .viewer__actions { margin-top: 8px; }
}

/* ---------- Accordion (brief §10.6) ---------- */
.accordion { border-top: 1px solid var(--line); }
.acc-item { border-bottom: 1px solid var(--line); }
.acc-item h3, .acc-item h4 { margin: 0; font: inherit; }
.acc-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; padding: 18px 0;
  border: 0; background: transparent; text-align: left; color: var(--fg);
  font-size: var(--t-sub); font-weight: 620; letter-spacing: -0.01em; line-height: 1.2; font-variation-settings: "wdth" 92; text-wrap: balance;
}
.acc-trigger:hover .acc-sign { background: var(--fg); color: var(--bg); }
.acc-sign { flex: none; position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid currentColor; transition: background-color 160ms var(--ease), color 160ms var(--ease); }
.acc-sign::before, .acc-sign::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; margin: -1px 0 0 -7px; background: currentColor; border-radius: 2px; transition: transform 200ms var(--ease); }
.acc-sign::after { transform: rotate(90deg); }
.acc-trigger[aria-expanded="true"] .acc-sign::after { transform: rotate(0deg); }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 220ms var(--ease); }
.acc-panel > div { overflow: hidden; }
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel__inner { padding: 0 64px 28px 0; max-width: 46em; font-size: var(--t-body); line-height: 1.6; color: var(--fg); }
.acc-panel__inner > * + * { margin-top: .8em; }
@media (max-width: 767px) { .acc-panel__inner { padding-right: 0; } .acc-trigger { min-height: 64px; } }

/* ---------- Forms (brief §9, §10.6) ---------- */
.field { display: grid; gap: 8px; }
.field__label { font-weight: 620; font-size: 1.0625rem; line-height: 1.3; color: var(--ink); }
.field__opt { font-weight: 400; color: var(--muted); font-size: .9375rem; margin-left: 6px; }
.field__help { font-size: .9375rem; line-height: 1.45; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; min-height: 54px; padding: 14px 16px; border-radius: 8px; border: 1.5px solid var(--field);
  background: var(--field-bg); color: var(--ink); font-size: 1.0625rem; line-height: 1.35;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.textarea { min-height: 132px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .textarea:hover { border-color: var(--ink); }
.input:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.field.has-error .input, .field.has-error .textarea, .field.has-error .choices { border-color: var(--error); }
.field__error { display: flex; gap: 8px; align-items: flex-start; color: var(--error); font-size: .9375rem; font-weight: 560; line-height: 1.4; }
.field__error .icon { width: 18px; height: 18px; margin-top: 1px; }

.choices { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.choices legend { padding: 0; margin-bottom: 8px; }
.choices--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 520px) { .choices--grid { grid-template-columns: 1fr; } }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.choice__box {
  display: flex; align-items: flex-start; gap: 12px; min-height: 56px; padding: 15px 16px; border-radius: 8px;
  border: 1.5px solid var(--field); background: var(--field-bg); transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.choice__dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--field); margin-top: 1px; position: relative; background: #fff; }
.choice__text { display: grid; gap: 2px; }
.choice__title { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.choice__desc { font-size: .9375rem; color: var(--muted); line-height: 1.4; }
.choice input:hover + .choice__box { border-color: var(--ink); }
.choice input:checked + .choice__box { border-color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input:checked + .choice__box .choice__dot { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 4px #fff; }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--ink); outline-offset: 3px; }

.notice { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: 10px; background: var(--paper-2); color: var(--ink); line-height: 1.5; }
.notice .icon { margin-top: 2px; }
.notice--error { background: var(--error-bg); box-shadow: inset 4px 0 0 var(--error); }
.notice--error .icon { color: var(--error); }
.notice h2, .notice h3 { font-size: 1.0625rem; font-weight: 680; margin-bottom: 4px; }
.notice ul { margin: 6px 0 0; padding-left: 1.1em; }
.notice a { color: inherit; font-weight: 600; }

/* ---------- Misc ---------- */
.placeholder-note { font-family: var(--mono); font-size: var(--t-meta); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2); display: inline-flex; gap: 6px; align-items: center; }
.placeholder-note::before { content: ""; width: 8px; height: 8px; border: 1.5px dashed currentColor; border-radius: 2px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 300; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--r-pill); font-weight: 560; box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: rise-sm 200ms var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::after, .player__spinner, .spinner { animation-duration: 900ms !important; animation-iteration-count: infinite !important; }
}
