:root {
  --paper: #f3efe6;
  --surface: #fbf9f4;
  --surface-2: #ebe5d8;
  --ink: #1b1a17;
  --ink-2: #3b3934;
  --muted: #6b675e;
  --line: #dcd4c4;
  --line-strong: #c4baa6;
  --accent: #c2462a;
  --accent-ink: #9e3219;
  --ok: #2f6b4f;
  --font-display: 'Gambetta', 'Georgia', serif;
  --font-body: 'Switzer', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --text-xs: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --text-sm: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --text-base: clamp(0.95rem, 0.93rem + 0.12vw, 1.02rem);
  --text-lg: clamp(1.1rem, 1.02rem + 0.35vw, 1.3rem);
  --text-xl: clamp(1.4rem, 1.2rem + 0.9vw, 2rem);
  --text-2xl: clamp(2rem, 1.5rem + 2.4vw, 3.4rem);
  --radius: 10px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --max: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-ink); }
.mono { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main { outline: none; min-height: 70vh; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem var(--gutter); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.wordmark { display: flex; align-items: center; gap: 0.6rem; background: none; border: 0; padding: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.topnav { display: flex; gap: 0.4rem; align-items: center; }
.topnav > button:not(.btn) { background: none; border: 0; padding: 0.5rem 0.8rem; border-radius: 999px; color: var(--ink-2); font-size: var(--text-sm); }
.topnav > button:not(.btn):hover { background: var(--surface-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; border-radius: 999px; padding: 0.62rem 1.15rem; border: 1px solid transparent; font-size: var(--text-sm); font-weight: 500; text-decoration: none; transition: background 0.18s var(--ease), border-color 0.18s, transform 0.12s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #000; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: #8f2a1a; color: #fff; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--ink); }
.section-head h2 { font-size: var(--text-xl); }
.section-head .mono { margin-bottom: 0.3rem; }

/* intro + intake */
.intro { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(2rem, 5vw, 4.5rem) 0 clamp(2rem, 4vw, 3.5rem); align-items: start; }
.intro h1 { font-size: var(--text-2xl); max-width: 14ch; }
.intro .lede { margin-top: 1.1rem; color: var(--ink-2); font-size: var(--text-lg); max-width: 46ch; }
.steps-list { list-style: none; margin: 1.8rem 0 0; padding: 0; display: grid; gap: 0.7rem; max-width: 48ch; }
.steps-list li { display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.6rem; font-size: var(--text-sm); color: var(--ink-2); }
.steps-list b { font-family: var(--font-mono); font-weight: 500; color: var(--accent); }
.intake { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1.1rem, 2.5vw, 1.6rem); box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(40, 30, 10, 0.35); }
.tabs { display: flex; gap: 0.3rem; background: var(--surface-2); padding: 0.25rem; border-radius: 999px; margin-bottom: 1.1rem; }
.tabs button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 0.5rem; font-size: var(--text-sm); color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.field label { display: block; font-size: var(--text-sm); font-weight: 500; margin-bottom: 0.4rem; }
.field input[type=text], .field input[type=url] { width: 100%; padding: 0.8rem 0.95rem; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font: inherit; color: var(--ink); }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.hint { font-size: var(--text-xs); color: var(--muted); margin-top: 0.45rem; }
.drop { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 1.8rem 1rem; text-align: center; background: #fff; transition: border-color 0.15s, background 0.15s; cursor: pointer; }
.drop.over { border-color: var(--accent); background: #fff5f0; }
.drop strong { display: block; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; }
.drop .file-name { margin-top: 0.6rem; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent-ink); overflow-wrap: anywhere; }
.intake .actions { margin-top: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.error-msg { color: #8f2a1a; font-size: var(--text-sm); margin-top: 0.7rem; }
.try-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.7rem; }
.chip-btn { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 0.25rem 0.7rem; font-size: var(--text-xs); color: var(--ink-2); }
.chip-btn:hover { border-color: var(--ink); }

/* hero reel */
.reel { margin: 0 0 clamp(2.5rem, 5vw, 4rem); }
.reel-nav { display: flex; align-items: center; gap: 0.5rem; }
.reel-nav .icon-btn[disabled] { opacity: 0.35; cursor: default; }
.reel-nav .icon-btn:not([disabled]):hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.reel-viewport { overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.reel-viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.reel-track { display: flex; transition: transform 0.6s var(--ease); }
.slide { flex: 0 0 100%; min-width: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.slide-img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-right: 1px solid var(--line); }
.slide-img img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.slide-cap { padding: clamp(1.2rem, 3vw, 2.2rem); display: flex; flex-direction: column; gap: 0.75rem; justify-content: center; align-items: flex-start; }
.slide-cap h3 { font-size: var(--text-xl); overflow-wrap: anywhere; }
.slide-about { color: var(--ink-2); }
.slide-purpose { font-size: var(--text-sm); color: var(--ink); border-top: 1px solid var(--line); padding-top: 0.75rem; width: 100%; }
.slide-purpose b { display: block; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 0.2rem; }
.slide-cap .btn { margin-top: 0.4rem; }
.reel-dots { display: flex; gap: 0.4rem; margin-top: 0.8rem; flex-wrap: wrap; }
.reel-dots button { border: 0; background: none; padding: 0.35rem 0; flex: 1 1 0; min-width: 60px; text-align: left; }
.reel-dots button::before { content: ''; display: block; height: 3px; border-radius: 2px; background: var(--line-strong); margin-bottom: 0.4rem; transition: background 0.2s; }
.reel-dots button[aria-selected="true"]::before { background: var(--accent); }
.reel-dots span { font-size: var(--text-xs); color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reel-dots button[aria-selected="true"] span { color: var(--ink); }
@media (max-width: 900px) {
  .slide { grid-template-columns: 1fr; }
  .slide-img { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .reel-dots span { display: none; }
  .reel-dots button { min-width: 0; }
}

/* canon rail */
.canon { margin: 0 0 clamp(2.5rem, 5vw, 4rem); }
.canon-rail { display: flex; flex-wrap: wrap; gap: 0.35rem; counter-reset: c; }
.canon-rail span { font-size: var(--text-xs); border: 1px solid var(--line); border-radius: 6px; padding: 0.3rem 0.55rem; background: var(--surface); color: var(--ink-2); display: inline-flex; gap: 0.4rem; align-items: center; }
.canon-rail span b { font-family: var(--font-mono); font-weight: 400; color: var(--muted); }
.canon p { color: var(--muted); font-size: var(--text-sm); max-width: 70ch; margin-bottom: 0.9rem; }

/* library */
.library { padding-bottom: 4rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -22px rgba(40, 30, 10, 0.5); }
.card .thumb { aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; border-bottom: 1px solid var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card .body { padding: 0.95rem 1rem 1rem; display: grid; gap: 0.35rem; flex: 1; }
.card h3 { font-size: var(--text-lg); overflow-wrap: anywhere; }
.card .meta { font-size: var(--text-xs); color: var(--muted); overflow-wrap: anywhere; }
.coverage { display: grid; grid-template-columns: repeat(19, 1fr); gap: 2px; margin-top: 0.55rem; }
.coverage i { height: 6px; border-radius: 1px; background: var(--surface-2); }
.coverage i.on { background: var(--ink); }
.counts { display: flex; gap: 0.9rem; font-size: var(--text-xs); color: var(--ink-2); margin-top: 0.4rem; }
.counts b { font-weight: 600; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sh 1.4s infinite; border-radius: var(--radius); height: 280px; }
@keyframes sh { to { background-position: -200% 0; } }

/* matrix */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 2.5rem; }
.matrix { border-collapse: collapse; width: 100%; font-size: var(--text-xs); }
.matrix th, .matrix td { padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { text-align: left; padding-left: 0.9rem; position: sticky; left: 0; background: var(--surface); max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.matrix thead th { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 500; color: var(--muted); height: 130px; vertical-align: bottom; text-align: left; }
.matrix thead th:first-child { writing-mode: horizontal-tb; transform: none; vertical-align: bottom; }
.matrix .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.matrix .no { display: inline-block; width: 10px; height: 1px; background: var(--line-strong); vertical-align: middle; }
.matrix tbody tr:last-child td { border-bottom: 0; }
.matrix button { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; font-size: var(--text-sm); }

/* job */
.job { max-width: 640px; margin: clamp(3rem, 8vw, 6rem) auto; padding: 0 var(--gutter); }
.job h1 { font-size: var(--text-xl); margin: 0.4rem 0 1.5rem; overflow-wrap: anywhere; }
.job ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line-strong); }
.job li { position: relative; padding: 0 0 1rem 1.4rem; color: var(--ink-2); }
.job li::before { content: ''; position: absolute; left: -5px; top: 0.45em; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.job li.current { color: var(--ink); font-weight: 500; }
.job li.current::before { background: var(--accent); box-shadow: 0 0 0 0 rgba(194, 70, 42, 0.5); animation: pulse 1.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(194, 70, 42, 0); } 100% { box-shadow: 0 0 0 0 rgba(194, 70, 42, 0); } }
.job .note { margin-top: 1rem; font-size: var(--text-sm); color: var(--muted); }

/* showcase */
.show-head { padding: clamp(1.6rem, 4vw, 3rem) 0 1.5rem; display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: end; }
.back { background: none; border: 0; padding: 0; color: var(--muted); font-size: var(--text-sm); margin-bottom: 1rem; }
.back:hover { color: var(--ink); }
.show-head h1 { font-size: var(--text-2xl); overflow-wrap: anywhere; }
.show-head .desc { margin-top: 0.8rem; color: var(--ink-2); max-width: 62ch; }
.show-head .src { margin-top: 0.6rem; font-size: var(--text-sm); overflow-wrap: anywhere; }
.show-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.stat-row div { padding: 0.9rem 1rem 0.9rem 0; }
.stat-row div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.stat-row b { display: block; font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: var(--text-xs); color: var(--muted); }

.hero-pair { display: grid; grid-template-columns: 1fr 220px; gap: 1.5rem; align-items: end; margin-bottom: 0.7rem; }
.browser { border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 30px 60px -40px rgba(40, 30, 10, 0.55); }
.browser .bar { display: flex; gap: 6px; align-items: center; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.browser .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.browser .bar span { margin-left: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone { border: 6px solid var(--ink); border-radius: 26px; overflow: hidden; background: #fff; aspect-ratio: 390 / 844; box-shadow: 0 30px 60px -40px rgba(40, 30, 10, 0.6); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
figcaption.fig-cap { font-size: var(--text-sm); color: var(--muted); margin-top: 0.6rem; }
.fig-cap b { color: var(--ink); font-weight: 600; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: clamp(2.5rem, 5vw, 4rem) 0 1.2rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--ink); }
.toolbar h2 { font-size: var(--text-xl); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 0.4rem 0.85rem; border-radius: 999px; font-size: var(--text-xs); color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.toc { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 2rem; }
.toc button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 0.3rem 0.6rem; font-size: var(--text-xs); color: var(--ink-2); display: inline-flex; gap: 0.4rem; }
.toc button b { font-family: var(--font-mono); font-weight: 400; color: var(--accent); }
.toc button:hover { border-color: var(--ink); }

.plate { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1rem, 3vw, 2.5rem); padding: 1.8rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.plate .info { position: sticky; top: 84px; align-self: start; display: grid; gap: 0.55rem; }
.plate .num { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent); letter-spacing: 0.08em; }
.plate h3 { font-size: var(--text-lg); }
.plate .heading { font-family: var(--font-display); font-style: italic; color: var(--ink-2); overflow-wrap: anywhere; }
.plate .caption { font-size: var(--text-sm); color: var(--ink); }
.plate .excerpt { font-size: var(--text-sm); color: var(--muted); border-left: 2px solid var(--line-strong); padding-left: 0.7rem; overflow-wrap: anywhere; }
.plate .facts { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.2rem; }
.tag { font-size: 11px; font-family: var(--font-mono); padding: 0.15rem 0.45rem; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); }
.frame { position: relative; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: #fff; max-height: 560px; }
.frame img { width: 100%; height: auto; }
.frame.tall::after { content: ''; position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(transparent, rgba(251, 249, 244, 0.96)); pointer-events: none; }
.frame .expand { position: absolute; right: 10px; bottom: 10px; z-index: 2; }
.plate figure { margin: 0; }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 1.1rem; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; margin: 0; }
.feat .shot { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); padding: 10px; cursor: zoom-in; border: 0; width: 100%; }
.feat .shot img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); background: #fff; }
.feat figcaption { padding: 0.85rem 1rem 1rem; display: grid; gap: 0.3rem; }
.feat h4 { font-family: var(--font-body); font-size: var(--text-base); font-weight: 600; }
.feat p { font-size: var(--text-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.feat .where { font-size: var(--text-xs); color: var(--muted); }

.bts { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.2rem, 3vw, 2.5rem); align-items: start; }
.bts-groups { display: grid; gap: 1.4rem; }
.bts-group h4 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 0.45rem; }
.bts-group dl { margin: 0; border-top: 1px solid var(--line); }
.bts-group dl > div { display: grid; grid-template-columns: minmax(120px, 2fr) 5fr; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.bts-group dt { font-weight: 600; }
.bts-group dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.side { display: grid; gap: 1.2rem; position: sticky; top: 84px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.panel h4 { font-size: var(--text-lg); margin-bottom: 0.7rem; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 0.5rem; }
.sw { display: grid; gap: 0.3rem; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.sw i { height: 44px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.12); }
.fonts { display: grid; gap: 0.45rem; margin-top: 0.9rem; font-size: var(--text-sm); }
.fonts div { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 0.45rem; }
.fonts span:last-child { text-align: right; overflow-wrap: anywhere; }
.prompt-panel { background: var(--ink); color: #efe9dc; border-radius: var(--radius); padding: 1.1rem; }
.prompt-panel .row { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; margin-bottom: 0.7rem; }
.prompt-panel h4 { color: #fff; font-size: var(--text-lg); }
.prompt-panel p.sub { font-size: var(--text-xs); color: #b7af9f; margin-bottom: 0.7rem; }
.prompt-panel pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; max-height: 460px; overflow: auto; background: #252420; border-radius: 8px; padding: 0.9rem; color: #e6dfcf; }
.prompt-panel .btn { background: var(--paper); color: var(--ink); }

.whole { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.5rem; }
.scrollframe { height: 520px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.scrollframe.m { border-radius: 22px; border: 6px solid var(--ink); }
.scrollframe img { width: 100%; height: auto; }

/* dialogs */
dialog { border: 0; padding: 0; background: var(--surface); color: var(--ink); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,0.35); }
dialog::backdrop { background: rgba(20, 18, 14, 0.6); }
.lightbox { width: min(1100px, 94vw); max-height: 92vh; display: none; flex-direction: column; }
.lightbox[open] { display: flex; }
.lb-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.lb-head h3 { font-size: var(--text-lg); }
.lb-body { overflow: auto; background: var(--surface-2); padding: 1rem; flex: 1; }
.lb-body img { margin: 0 auto; background: #fff; }
.lb-cap { padding: 0.8rem 1.1rem 1rem; font-size: var(--text-sm); color: var(--ink-2); border-top: 1px solid var(--line); }
.confirm { width: min(420px, 92vw); padding: 1.4rem; }
.confirm h3 { font-size: var(--text-lg); margin-bottom: 0.5rem; }
.confirm p { color: var(--ink-2); font-size: var(--text-sm); margin-bottom: 1.2rem; }
.row-end { display: flex; justify-content: flex-end; gap: 0.5rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; border-radius: 999px; font-size: var(--text-sm); opacity: 0; pointer-events: none; transition: all 0.25s var(--ease); z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sitefoot { border-top: 1px solid var(--line); padding: 1.4rem var(--gutter); font-size: var(--text-xs); color: var(--muted); text-align: center; }

.fade-in { animation: fi 0.45s var(--ease) both; }
@keyframes fi { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; }
  .plate { grid-template-columns: 1fr; }
  .plate .info { position: static; }
  .bts { grid-template-columns: 1fr; }
  .side { position: static; }
  .show-head { grid-template-columns: 1fr; }
  .show-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .hero-pair { grid-template-columns: 1fr; }
  .hero-pair .phone-col { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat-row div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat-row div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .whole { grid-template-columns: 1fr; }
  .whole .desk { display: none; }
  .scrollframe.m { max-width: 300px; margin: 0 auto; }
  .bts-group dl > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .topnav > button:not(.btn) { display: none; }
  .wordmark span { font-size: 1.1rem; }
}

/* ---------- library management ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: var(--text-sm); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.lib-actions { display: flex; align-items: center; gap: 0.9rem; }
.lib-actions .mono { margin: 0; }
.manage-bar { position: sticky; top: 0.6rem; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; padding: 0.6rem 0.8rem; margin-bottom: 1.1rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 10px 24px -20px rgba(40, 30, 10, 0.6); font-size: var(--text-sm); }
.manage-bar .grow { flex: 1; }
.card { position: relative; }
.card.selectable { cursor: pointer; }
.card.selectable:hover { transform: none; }
.card .check { position: absolute; top: 0.7rem; left: 0.7rem; z-index: 2; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 6px; border: 2px solid #fff; background: rgba(20, 16, 10, 0.45); color: #fff; font-weight: 700; font-size: 0.95rem; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.card.selected .check { background: var(--accent); border-color: var(--accent); }
.card.selected .thumb img { opacity: 0.8; }
.cf-list { margin: 0 0 0.8rem 1.1rem; color: var(--ink); font-size: var(--text-sm); }
.cf-list li { margin: 0.15rem 0; }
.owner-input { width: 100%; font: inherit; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em; padding: 0.65rem 0.8rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper, #fff); color: var(--ink); margin-bottom: 0.4rem; }
.owner-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#owner .error-msg { margin: 0 0 0.8rem; }

/* longer brand name: keep the top bar on one line */
.wordmark { white-space: nowrap; text-align: left; min-width: 0; }
[data-testid=button-new-breakdown] { gap: 0.28em; }
.wordmark svg, .wordmark img { flex-shrink: 0; }
@media (max-width: 480px) {
  .topbar { gap: 0.6rem; }
  .wordmark { gap: 0.45rem; }
  .wordmark span { font-size: 1rem; }
  .topbar .btn-ink { padding-inline: 1rem; white-space: nowrap; flex-shrink: 0; }
  .nb-rest { display: none; }
}
@media (max-width: 340px) {
  .wordmark span { font-size: 0.9rem; }
}

/* =========================================================
   TT Quaris-inspired theme: yellow / charcoal / off-white
   type-specimen blocks, high-contrast sans, pill labels, diamonds
   ========================================================= */
:root {
  --paper: #f2f2ee;
  --surface: #fbfbf8;
  --surface-2: #e5e5df;
  --ink: #242424;
  --ink-2: #3b3b3b;
  --muted: #6b6b66;
  --line: #d4d4cd;
  --line-strong: #b4b4ac;
  --yellow: #f4e03a;
  --yellow-2: #e3cd14;
  --charcoal: #262626;
  --accent: #f4e03a;
  --accent-ink: #242424;
  --font-display: 'Ranade', 'Optima', 'Candara', sans-serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;
  --radius: 4px;
}
::selection { background: var(--yellow); color: var(--ink); }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.025em; }
h1 em, h2 em { font-style: italic; font-weight: 300; }
a { color: var(--ink); text-decoration-color: var(--yellow-2); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* pill labels, like the specimen's FEATURES / FONT IN USE tags */
.mono { font-family: var(--font-body); font-weight: 500; letter-spacing: 0.04em; }
.section-head .mono, .toolbar .mono:first-child, .intro .mono, #lb-kicker:not(:empty) {
  display: inline-block; background: var(--ink); color: #fff; border-radius: 999px; padding: 0.22rem 0.75rem 0.2rem; font-size: 0.7rem; line-height: 1.4;
}
.toolbar > .mono, .lib-actions .mono { border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.7rem; color: var(--muted); }
.section-head, .toolbar { border-bottom: 1px solid var(--ink); }
.section-head h2, .toolbar h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem); margin-top: 0.5rem; }

/* top bar */
.topbar { background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 1px solid var(--ink); }
.wordmark { font-weight: 500; letter-spacing: -0.02em; }
.wordmark span { font-size: 1.3rem; }
.topnav > button:not(.btn) { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.74rem; font-weight: 500; border: 1px solid var(--line-strong); padding: 0.4rem 0.9rem; }
.topnav > button:not(.btn):hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* buttons */
.btn { font-weight: 500; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; }
.btn-accent { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.btn-accent:hover { background: var(--yellow-2); }
.btn-ghost { border-color: var(--ink); }
.btn-ghost:hover { background: var(--yellow); }
.icon-btn { border-color: var(--ink); background: transparent; }

/* hero: full-bleed yellow specimen block */
.intro { position: relative; background: var(--yellow); box-shadow: 0 0 0 100vmax var(--yellow); clip-path: inset(0 -100vmax); padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4.5rem); margin-bottom: clamp(3rem, 6vw, 5rem); }
.intro h1 { font-size: clamp(2.6rem, 1.4rem + 5.2vw, 5.6rem); line-height: 0.98; letter-spacing: -0.035em; max-width: 12ch; font-weight: 500; }
.intro h1 em { font-weight: 300; }
.intro .lede { color: var(--ink); }
.steps-list li { color: var(--ink); border-top: 1px solid rgba(36,36,36,0.35); padding-top: 0.6rem; grid-template-columns: 2.6rem 1fr; }
.steps-list b { font-family: var(--font-body); font-weight: 600; color: var(--ink); display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--ink); color: var(--yellow); font-size: 0.72rem; letter-spacing: 0; }
.intake { background: var(--surface); border: 1px solid var(--ink); border-radius: 6px; box-shadow: 8px 8px 0 var(--ink); }
.tabs { background: var(--surface-2); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.field input[type=text], .field input[type=url] { border-color: var(--ink); border-radius: 4px; }
.field input:focus { outline: 3px solid var(--yellow); outline-offset: 0; border-color: var(--ink); }
.chip-btn { border-color: var(--line-strong); background: transparent; }
.chip-btn:hover { background: var(--yellow); border-color: var(--ink); }
.drop { border-color: var(--ink); }
.drop.over { border-color: var(--ink); background: #fdf8cf; }
.drop .file-name { color: var(--ink); }

/* hero reel: charcoal block */
.reel { position: relative; background: var(--charcoal); color: #f2f2ee; box-shadow: 0 0 0 100vmax var(--charcoal); clip-path: inset(0 -100vmax); padding: clamp(2.5rem, 5vw, 4rem) 0; margin-bottom: clamp(3rem, 6vw, 5rem); }
.reel .section-head { border-bottom-color: rgba(255,255,255,0.4); }
.reel .section-head .mono { background: var(--yellow); color: var(--ink); }
.reel .section-head .mono, .reel .reel-nav .mono, .reel .reel-nav span { color: inherit; }
.reel .section-head .mono { color: var(--ink); }
.reel .icon-btn { border-color: rgba(255,255,255,0.6); color: #fff; }
.reel .reel-nav .icon-btn:not([disabled]):hover { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.reel-viewport { border: 1px solid rgba(255,255,255,0.18); border-radius: 6px; background: #1c1c1c; }
.slide-img { border-right-color: rgba(255,255,255,0.12); background: #333; }
.slide-cap h3 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); color: #fff; }
.slide-about { color: #cfcfca; }
.slide-purpose { color: #f2f2ee; border-top-color: rgba(255,255,255,0.18); }
.slide-purpose b { font-family: var(--font-body); color: var(--yellow); }
.slide-cap .btn-ink, .slide-cap .btn-accent, .slide-cap .btn { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.reel-dots button::before { background: rgba(255,255,255,0.22); }
.reel-dots button[aria-selected="true"]::before { background: var(--yellow); }
.reel-dots span { color: #9a9a95; }
.reel-dots button[aria-selected="true"] span { color: #fff; }
@media (max-width: 900px) { .slide-img { border-bottom-color: rgba(255,255,255,0.12); } }

/* canon rail with diamond markers */
.canon-rail span { border-color: var(--ink); border-radius: 999px; background: transparent; color: var(--ink); padding: 0.3rem 0.75rem; }
.canon-rail span b { font-family: var(--font-body); font-weight: 600; color: var(--ink); }
.canon-rail span::before { content: ''; width: 6px; height: 6px; background: var(--ink); transform: rotate(45deg); }
.canon-rail span:nth-child(3n+1)::before { background: var(--yellow-2); }

/* library cards */
.card { border: 1px solid var(--ink); border-radius: 6px; background: var(--surface); }
.card:hover { transform: translateY(-3px); box-shadow: 6px 6px 0 var(--ink); }
.card .thumb { border-bottom: 1px solid var(--ink); }
.card h3 { font-size: 1.45rem; }
.coverage i.on { background: var(--ink); }
.coverage i { background: var(--surface-2); }
.card.selected { border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow), 0 0 0 4px var(--ink); }
.card.selected .check { background: var(--yellow); border-color: var(--ink); color: var(--ink); }
.matrix-wrap { border-color: var(--ink); border-radius: 6px; }
.matrix .dot { width: 9px; height: 9px; border-radius: 1px; transform: rotate(45deg); }
.manage-bar { border-color: var(--ink); background: var(--yellow); box-shadow: none; }

/* job progress */
.job li::before { border-radius: 1px; transform: rotate(45deg); }
.job li.current::before { background: var(--yellow); outline: 1px solid var(--ink); box-shadow: none; animation: none; }

/* showcase page */
.show-head h1 { font-size: clamp(2.4rem, 1.4rem + 4vw, 4.6rem); line-height: 1; letter-spacing: -0.035em; }
.stat-row { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.stat-row b { font-size: clamp(2rem, 1.4rem + 2vw, 3.2rem); font-weight: 300; letter-spacing: -0.03em; }
.stat-row span { text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.browser { border-color: var(--ink); border-radius: 6px; box-shadow: 10px 10px 0 var(--yellow); }
.browser .bar { background: var(--ink); border-bottom-color: var(--ink); }
.browser .bar i { background: #777; }
.browser .bar i:first-child { background: var(--yellow); }
.browser .bar span { color: #cfcfca; }
.phone { border-color: var(--ink); box-shadow: 10px 10px 0 var(--yellow); }
.seg { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.toc button { border-color: var(--ink); border-radius: 999px; background: transparent; color: var(--ink); padding: 0.3rem 0.75rem; }
.toc button b { font-family: var(--font-body); font-weight: 600; color: var(--ink); }
.toc button:hover { background: var(--yellow); }
.plate { border-bottom-color: var(--line-strong); }
.plate .num { display: inline-block; justify-self: start; background: var(--yellow); color: var(--ink); font-family: var(--font-body); font-weight: 600; border-radius: 999px; padding: 0.15rem 0.6rem; }
.plate h3 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.8rem); }
.plate .heading { font-weight: 300; font-size: 1.15rem; color: var(--ink); }
.plate .excerpt { border-left-color: var(--yellow-2); }
.tag { font-family: var(--font-body); font-weight: 500; border-radius: 999px; background: transparent; border: 1px solid var(--line-strong); }
.frame { border-color: var(--ink); border-radius: 4px; }
.feat { border-color: var(--ink); border-radius: 6px; }
.feat .shot { background: var(--surface-2); border-bottom: 1px solid var(--ink); }
.feat h4 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; letter-spacing: -0.015em; }
.bts-group h4 { font-family: var(--font-body); font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 0.45rem; }
.bts-group h4::before { content: ''; width: 7px; height: 7px; background: var(--yellow-2); transform: rotate(45deg); }
.bts-group dl { border-top-color: var(--ink); }
.panel { border-color: var(--ink); border-radius: 6px; }
.prompt-panel { background: var(--charcoal); color: #f2f2ee; border-radius: 6px; }
.prompt-panel p.sub { color: #a9a9a3; }
.prompt-panel pre { background: #1a1a1a; color: #ecece6; }
.prompt-panel .btn { background: var(--yellow); color: var(--ink); }
.scrollframe { border-color: var(--ink); }

/* dialogs, toast, footer */
dialog { border: 1px solid var(--ink); border-radius: 8px; }
.btn-danger { background: #b3261e; }
.toast { background: var(--ink); color: #fff; }
.toast::before { content: '◆ '; color: var(--yellow); }
.sitefoot { background: var(--charcoal); color: #bdbdb7; border-top: 0; padding: 1.8rem var(--gutter); }
.sitefoot span::before { content: '◆'; color: var(--yellow); margin-right: 0.6rem; }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; }

@media (max-width: 640px) {
  .wordmark span { font-size: 1.1rem; }
  .intake { box-shadow: 5px 5px 0 var(--ink); }
}
@media (max-width: 480px) {
  .wordmark span { font-size: 1.02rem; }
}
@media (max-width: 340px) {
  .wordmark span { font-size: 0.92rem; }
}
.section-head .lib-actions .mono, .section-head .reel-nav .mono { background: transparent; color: var(--muted); border: 1px solid var(--line-strong); }
.reel .section-head .reel-nav .mono { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.slide { align-items: stretch; }
.slide-img { position: relative; height: 100%; }
.slide-img img { position: absolute; inset: 0; }

/* ---- cross-browser fixes (Safari) ---- */
/* real full-width bands instead of box-shadow/clip-path bleed */
.band { width: 100%; overflow: hidden; }
.band-yellow { background: var(--yellow); }
.band-dark { background: var(--charcoal); color: #f2f2ee; margin-bottom: clamp(3rem, 6vw, 5rem); }
.band-dark:has(#reel-slot:empty) { display: none; }
.intro, .reel { box-shadow: none !important; clip-path: none !important; background: transparent !important; margin-bottom: 0 !important; }
.band-yellow { margin-bottom: clamp(3rem, 6vw, 5rem); }

/* keep slides fully inside the rounded frame */
.reel-viewport { position: relative; overflow: hidden; isolation: isolate; -webkit-mask-image: -webkit-radial-gradient(white, black); transform: translateZ(0); }
.reel-track { will-change: transform; }
.slide { overflow: hidden; align-items: stretch; }
.slide-img { position: relative; height: auto; aspect-ratio: auto; min-height: clamp(260px, 30vw, 430px); overflow: hidden; }
.slide-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
@media (max-width: 900px) { .slide-img { min-height: 0; aspect-ratio: 16 / 9; } }

/* coverage table headers: rotate a span (Safari ignores writing-mode on table cells) */
.matrix thead th.rot { writing-mode: horizontal-tb; transform: none; position: relative; height: 140px; min-width: 30px; padding: 0; vertical-align: bottom; }
.matrix thead th.rot > span { position: absolute; left: 50%; bottom: 10px; transform-origin: 0 50%; transform: translateY(50%) rotate(-90deg); white-space: nowrap; line-height: 1; font-weight: 500; color: var(--muted); }
/* only the current slide is visible at rest (no slivers of neighbours) */
.slide { visibility: visible; transition: visibility 0s 0s; }
.slide[aria-hidden="true"] { visibility: hidden; transition: visibility 0s 0.65s; }

/* contact */
.band-contact { margin-bottom: 0; border-top: 1px solid var(--ink); }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(2.5rem, 6vw, 4.5rem) 0; scroll-margin-top: 70px; }
.contact h2 { font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem); line-height: 1; letter-spacing: -0.035em; margin: 0.7rem 0 0.9rem; max-width: 14ch; }
.contact-copy > p:last-child { max-width: 44ch; color: var(--ink); }
.contact-links { display: grid; gap: 0.8rem; }
.contact-link { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label go" "value go"; align-items: center; gap: 0.15rem 1rem; padding: 1.05rem 1.25rem; background: var(--surface); border: 1px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--ink); color: var(--ink); text-decoration: none; transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.contact-link:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.contact-link:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.cl-label { grid-area: label; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.cl-value { grid-area: value; font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem); font-weight: 500; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.cl-go { grid-area: go; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--yellow); }
@media (max-width: 800px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .contact-link { box-shadow: 4px 4px 0 var(--ink); } }
.contact .mono { display: inline-block; background: var(--ink); color: #fff; border-radius: 999px; padding: 0.22rem 0.75rem 0.2rem; font-size: 0.7rem; line-height: 1.4; }
