/* gosling.pro: a generative interface in the DesignTech look (dark navy, Poppins + Roboto Slab, the
   cyan-violet-magenta accent). Every answer is composed by the model from the components styled below. */

@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-weight: 400 700; font-display: swap; src: url("/fonts/roboto-slab.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #060b1f;
  --bg-2: #0a1230;
  --fg: #eef2f8;
  --fg-2: #c3cad8;          /* body secondary, 11:1 on --bg */
  --muted: #9aa6bb;         /* labels, 7.4:1 */
  --card: rgba(16, 24, 54, 0.72);
  --card-2: rgba(22, 32, 70, 0.8);
  --edge: rgba(226, 232, 255, 0.1);
  --edge-2: rgba(226, 232, 255, 0.18);
  --primary: #5b8cff;
  --primary-ink: #a9c3ff;
  --violet: #8b5cf6;
  --ok: #43d9a0;
  --warn: #f5c35b;
  --gap: #ff8f9c;
  --grad: linear-gradient(90deg, #06b6d4, #3b82f6 35%, #8b5cf6 65%, #d946ef);
  --grad-ring: conic-gradient(from 0deg, #06b6d4, #3b82f6, #8b5cf6, #d946ef, #8b5cf6, #3b82f6, #06b6d4);
  --font-body: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Roboto Slab", ui-serif, Georgia, serif;
  --panel-w: 320px;
  --col: 50rem;
  --radius: 12px;
  font-family: var(--font-body);
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(60rem 40rem at 90% -10%, rgba(101, 65, 206, 0.16), transparent 60%),
    radial-gradient(50rem 35rem at 10% 110%, rgba(6, 182, 212, 0.07), transparent 60%),
    var(--bg);
  color: var(--fg);
  line-height: 1.6;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-ink); text-underline-offset: 0.2em; }
button, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #8fb0ff; outline-offset: 2px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 60; top: 0.75rem; left: 0.75rem; padding: 0.6rem 0.9rem; border-radius: 8px; background: var(--primary); color: #fff; transform: translateY(-220%); }
.skip-link:focus { transform: none; }
.block-label { margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

/* ================= Layout ================= */

.app { display: grid; grid-template-columns: var(--panel-w) minmax(0, 1fr); height: 100dvh; }

.panel {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  padding: 1.5rem 1.25rem 0;
  border-right: 1px solid var(--edge);
  background: rgba(4, 8, 24, 0.4);
}
.me { display: grid; gap: 0; }
.avatar {
  width: 88px; height: 88px; margin-bottom: 0.85rem; padding: 3px; border-radius: 50%;
  background: var(--grad-ring);
}
.avatar img { display: block; width: 100%; height: 100%; border: 3px solid var(--bg); border-radius: 50%; object-fit: cover; }
.me-name { margin: 0; font-family: var(--font-heading); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.me-title { margin: 0.15rem 0 0.7rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.05rem; font-weight: 600; width: fit-content; }
.me-status { display: inline-flex; align-items: center; gap: 0.5rem; width: fit-content; margin: 0; padding: 0.25rem 0.7rem; border: 1px solid rgba(67, 217, 160, 0.35); border-radius: 999px; background: rgba(67, 217, 160, 0.09); color: var(--ok); font-size: 0.8rem; font-weight: 500; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2.4s ease-out infinite; }
.me-bio { margin: 0.8rem 0 1rem; color: var(--fg-2); font-size: 0.9rem; line-height: 1.55; }
.topics-toggle { display: none; }

.topics { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -0.5rem; padding: 0 0.5rem 0.5rem; scrollbar-width: thin; }
.topics-label { margin: 0 0 0.4rem 0.7rem; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.topics ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.topics :is(button, .topic-link) {
  display: flex; align-items: center; gap: 0.7rem; width: 100%; min-height: 44px; padding: 0.4rem 0.7rem;
  border: 1px solid transparent; border-radius: 10px; background: none; color: rgba(238, 242, 248, 0.86);
  font-size: 0.9rem; text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.topics :is(button, .topic-link) .icon { color: var(--muted); }
.topics :is(button, .topic-link):hover { background: rgba(226, 232, 255, 0.06); color: var(--fg); }
.topics :is(button, .topic-link)[data-paste] { color: var(--fg); }
.topics :is(button, .topic-link)[data-paste] .icon { color: #c4a8ff; }
.topics :is(button, .topic-link)[aria-current="true"] { border-color: rgba(91, 140, 255, 0.45); background: linear-gradient(90deg, rgba(91, 140, 255, 0.18), rgba(91, 140, 255, 0.04)); color: var(--fg); }
.topics :is(button, .topic-link)[aria-current="true"] .icon { color: var(--primary-ink); }

.panel-foot { flex: none; display: flex; gap: 0.25rem; margin: 0 -1.25rem; padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--edge); background: rgba(6, 11, 31, 0.92); }
.panel-foot a { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 0.4rem; min-height: 44px; padding: 0.4rem; border-radius: 10px; color: var(--fg-2); font-size: 0.85rem; text-decoration: none; }
.panel-foot a:hover { background: rgba(226, 232, 255, 0.06); color: var(--fg); }
.panel-foot .icon { width: 16px; height: 16px; }

.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 2.75rem clamp(1rem, 4vw, 3rem) 2rem; overscroll-behavior: contain; }
.thread:focus { outline: none; }
.thread > * { max-width: var(--col); margin-inline: auto; }

/* ================= Opening state (static HTML, no model call) ================= */

.eyebrow { margin: 0 0 0.8rem; color: var(--primary-ink); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.opening-title { max-width: 22ch; margin: 0 0 1rem; font-family: var(--font-heading); font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
.opening-title em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.opening-lede { max-width: 62ch; margin: 0 0 1.75rem; color: var(--fg-2); font-size: 1.02rem; }

.entries { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.entries .entry { grid-column: span 3; }
.entries .entry-jd { grid-column: span 6; }
.entry-brief { background: linear-gradient(120deg, rgba(67, 217, 160, 0.12), rgba(59, 130, 246, 0.14) 55%, rgba(139, 92, 246, 0.12)); }
.entry-brief .entry-kicker { color: var(--ok); }
.opening.is-compact > :not(.eyebrow, .opening-title, .opening-lede, .opening-again) { display: none !important; }
.opening.is-compact .opening-lede { margin-bottom: 0.6rem; }
.opening-again { min-height: 40px; padding: 0 0.9rem; border: 1px solid var(--edge-2); border-radius: 10px; background: none; color: var(--fg-2); font-size: 0.84rem; cursor: pointer; }
.opening-again:hover { color: var(--fg); border-color: rgba(91, 140, 255, 0.6); }
.entry {
  display: grid; align-content: start; gap: 0.35rem; min-height: 96px; padding: 1rem 1.1rem;
  border: 1px solid var(--edge); border-radius: var(--radius); background: var(--card);
  text-align: left; cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.entry:hover { border-color: rgba(91, 140, 255, 0.5); background: var(--card-2); transform: translateY(-1px); }
.entry strong { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.entry-kicker { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.entry-kicker .icon { width: 15px; height: 15px; }
.entry-note { color: var(--fg-2); font-size: 0.86rem; line-height: 1.5; }
.entry-jd { position: relative; padding: 1rem 1.15rem; background: linear-gradient(120deg, rgba(59, 130, 246, 0.16), rgba(139, 92, 246, 0.14) 55%, rgba(217, 70, 239, 0.1)); }
.entry-jd::before { position: absolute; inset: 0; padding: 1px; border-radius: inherit; background: linear-gradient(120deg, #06b6d4, #3b82f6, #8b5cf6, #d946ef); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; content: ""; opacity: 0.8; pointer-events: none; }
.entry-jd strong { font-size: 1.12rem; }
@media (min-width: 861px) { .entries .entry { min-height: 0; } }
.entry-jd .entry-kicker { color: #c4a8ff; }

.strip-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 0.6rem; }
.strip-note { margin: 0; color: var(--muted); font-size: 0.82rem; }
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.piece-label { margin: 0.4rem 0 0; color: var(--fg-2); font-size: 0.82rem; line-height: 1.4; }
.opening-foot { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Proof clips: his technology running, first thing after the headline */
.proof-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0.9rem; align-items: start; margin: 0 0 1.5rem; }
.clip { display: grid; gap: 0.5rem; margin: 0; min-width: 0; }
.clip-frame { position: relative; overflow: hidden; border: 1px solid var(--edge-2); border-radius: var(--radius); background: #050918; }
.clip-frame video { display: block; width: 100%; height: auto; }
/* The tight cut keeps the agent's text legible by cropping the recording's right side; that edge fades so it reads as a crop, not a cut-off. */
.clip-frame video[src*="-tight"] { -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent 99%); mask-image: linear-gradient(90deg, #000 86%, transparent 99%); }
.clip-main .clip-frame { box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 18px 48px rgba(0, 0, 0, 0.45); }
.clip-toggle { position: absolute; right: 0.6rem; bottom: 0.6rem; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 40px; padding: 0 0.85rem; border: 1px solid var(--edge-2); border-radius: 999px; background: rgba(6, 11, 31, 0.86); color: var(--fg); font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.clip-toggle:hover { background: var(--primary); }
.clip-toggle .icon { width: 15px; height: 15px; }
.clip-tag { position: absolute; left: 0.6rem; bottom: 0.75rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: rgba(6, 11, 31, 0.86); color: var(--ok); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; }
.clip figcaption { color: var(--fg-2); font-size: 0.84rem; line-height: 1.5; }
.clip figcaption strong { color: var(--fg); font-weight: 600; }

/* Logos from goslingmedia.com: light single-color marks at matched optical size */
.logo-band { display: grid; gap: 1rem; margin: 0 0 1.75rem; padding: 1rem 1.1rem; border: 1px solid var(--edge); border-radius: var(--radius); background: rgba(10, 18, 48, 0.5); }
.logo-row { display: grid; gap: 0.6rem; }
.logo-label { margin: 0; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.logo-label span { color: var(--muted); font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 0.8rem; }
.logo-row ul { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.6rem; margin: 0; padding: 0; list-style: none; }
.logo-row li { display: flex; align-items: center; height: 36px; }
.logo-row img { display: block; opacity: 0.86; }
.c-logos { display: grid; gap: 1rem; }
.c-clip { display: grid; gap: 0.6rem; max-width: 40rem; }
.answer > .c-clip.paired { grid-template-columns: 1fr; }

.strip-head-client { margin-top: 0.25rem; }
.strip-builds .piece-open img { object-position: top left; }
.strip.strip-builds { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.piece-label { cursor: pointer; }
.piece-label:hover { color: var(--fg); }

/* code excerpt */
.c-code .code-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.c-code .code-head .c-title { margin: 0; }
.code-file { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; }
.c-code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.c-code pre, .trace pre, .code-file, .trace-name { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.c-code pre, .trace pre { margin: 0.75rem 0 0; padding: 0.85rem 1rem; overflow-x: auto; border: 1px solid var(--edge); border-radius: 10px; background: #040817; color: #d6def0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; line-height: 1.55; tab-size: 2; }

/* the trace drawer under every answer */
.trace { border: 1px solid var(--edge); border-radius: 10px; background: rgba(10, 18, 48, 0.45); font-size: 0.86rem; }
.trace > summary { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem; color: var(--fg-2); cursor: pointer; list-style: none; }
.trace > summary::-webkit-details-marker { display: none; }
.trace > summary::after { margin-left: auto; color: var(--muted); content: "Show"; font-size: 0.78rem; }
.trace[open] > summary::after { content: "Hide"; }
.trace > summary .icon { width: 16px; height: 16px; color: var(--primary-ink); }
.trace-body { padding: 0 0.9rem 0.9rem; }
.trace-facts { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 0.3rem 0.9rem; margin: 0; }
.trace-facts dt { color: var(--muted); }
.trace-facts dd { margin: 0; color: var(--fg); font-variant-numeric: tabular-nums; }
.trace-h { margin: 1rem 0 0.4rem; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.trace-calls { display: grid; gap: 0.3rem; margin: 0; padding-left: 1.4rem; }
.trace-calls li { color: var(--fg-2); }
.trace-calls summary { display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem; cursor: pointer; }
.trace-name { color: var(--fg); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
.trace-state { color: var(--ok); font-size: 0.78rem; }
.trace-calls li:not(.is-shown) .trace-state { color: var(--gap); }
.trace-calls li:not(.is-shown) { display: flex; gap: 0.75rem; }
.trace-calls pre { max-height: 18rem; }
.trace-removed { display: grid; gap: 0.3rem; margin: 0; padding-left: 1.2rem; color: var(--fg-2); }
.trace-none { margin: 0; color: var(--fg-2); }

/* copy summary (job description page) */
.copy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.copy-status { color: var(--fg-2); font-size: 0.86rem; }
.copy-fallback { width: 100%; padding: 0.6rem; border: 1px solid var(--edge-2); border-radius: 8px; background: #040817; color: var(--fg); font-size: 0.82rem; }
.copy-scratch { position: fixed; top: -100px; left: 0; width: 1px; height: 1px; opacity: 0; }

/* A piece of work: a button that opens the proof view */
.piece-open { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--edge); border-radius: 10px; background: #0d1532; cursor: zoom-in; }
.piece-open img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.piece-open:hover img { transform: scale(1.03); }
.piece-open:hover { border-color: rgba(91, 140, 255, 0.55); }
.play-badge { position: absolute; left: 0.6rem; bottom: 0.6rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: rgba(6, 11, 31, 0.85); color: var(--fg); font-size: 0.75rem; font-weight: 600; }

/* ================= The thread ================= */

.turn { padding-top: 0.5rem; margin-top: 2.5rem; }
.turn-q { width: fit-content; max-width: min(80%, 36rem); margin: 0 0 1.25rem auto; padding: 0.6rem 1rem; border: 1px solid rgba(91, 140, 255, 0.35); border-radius: 14px 14px 4px 14px; background: rgba(91, 140, 255, 0.13); font-size: 0.98rem; overflow-wrap: anywhere; }
.turn-q:focus { outline: none; }
.turn-q.is-jd { max-width: 100%; width: 100%; }
.jd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.jd-head strong { font-weight: 600; }
.jd-head button { min-height: 36px; padding: 0 0.75rem; border: 1px solid var(--edge-2); border-radius: 8px; background: none; color: var(--fg-2); font-size: 0.82rem; cursor: pointer; }
.jd-body { margin: 0.6rem 0 0; color: var(--fg-2); font-size: 0.88rem; white-space: pre-wrap; max-height: 16rem; overflow: auto; }
.jd-body[hidden] { display: none; }

.answer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.answer > * { grid-column: 1 / -1; min-width: 0; }
.answer > .paired { grid-column: auto; }
.turn:not(:last-child) .c-follow { opacity: 0.75; }
.status { display: inline-flex; align-items: center; gap: 0.6rem; width: fit-content; padding: 0.35rem 0.85rem 0.35rem 0.55rem; border: 1px solid var(--edge); border-radius: 999px; background: var(--card); color: var(--fg-2); font-size: 0.86rem; }
.spinner { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 25%, #06b6d4, #8b5cf6, #d946ef); -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); animation: spin 0.9s linear infinite; }
.prose { max-width: 66ch; margin: 0; font-size: 1.04rem; line-height: 1.7; }
.prose.streaming::after { display: inline-block; width: 0.45em; height: 1.05em; margin-left: 3px; vertical-align: -0.15em; border-radius: 2px; background: var(--grad); content: ""; animation: blink 1s steps(2) infinite; }
.skeleton { display: flex; align-items: center; gap: 0.6rem; min-height: 64px; padding: 0 1.1rem; border: 1px dashed var(--edge-2); border-radius: var(--radius); background: linear-gradient(90deg, rgba(226, 232, 255, 0.02), rgba(226, 232, 255, 0.06), rgba(226, 232, 255, 0.02)) 0 0 / 200% 100%; color: var(--muted); font-size: 0.86rem; animation: shimmer 1.4s linear infinite; }
.skeleton.tall { min-height: 180px; }
.note { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; padding: 0.75rem 1rem; border: 1px solid rgba(245, 195, 91, 0.35); border-radius: 10px; background: rgba(245, 195, 91, 0.07); color: var(--fg); font-size: 0.92rem; }
.note button { min-height: 40px; padding: 0 0.9rem; border: 1px solid var(--edge-2); border-radius: 8px; background: var(--card-2); cursor: pointer; }
.note.quiet { border-color: var(--edge); background: none; color: var(--muted); }

.is-partial { position: relative; }
.is-partial::after { position: absolute; left: 1.25rem; bottom: 0.5rem; width: 3rem; height: 2px; border-radius: 2px; background: var(--grad); content: ""; animation: blink 1s steps(2) infinite; }
.c { animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.card { padding: 1.15rem 1.25rem; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--card); }
.c-title { margin: 0 0 0.85rem; font-family: var(--font-heading); font-size: 1.12rem; font-weight: 600; line-height: 1.3; }
.from { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.8rem; }

/* headline */
.c-headline { position: relative; padding: clamp(1.25rem, 3vw, 1.9rem); border-radius: 16px; background: linear-gradient(135deg, rgba(24, 34, 78, 0.9), rgba(12, 18, 44, 0.9)); overflow: hidden; }
.c-headline::before { position: absolute; inset: 0; padding: 1px; border-radius: inherit; background: linear-gradient(120deg, #06b6d4, #3b82f6, #8b5cf6, #d946ef); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; content: ""; opacity: 0.7; pointer-events: none; }
.c-headline .kicker { margin: 0 0 0.6rem; color: var(--primary-ink); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.c-headline h3 { margin: 0; max-width: 26ch; font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2.15rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.16; }
.c-headline .sub { margin: 0.8rem 0 0; max-width: 60ch; color: var(--fg-2); }

/* stat tiles */
.c-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; }
.stat { display: grid; align-content: start; gap: 0.2rem; padding: 1rem 1.1rem; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--card); }
.stat-value { font-family: var(--font-heading); font-size: 2.1rem; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.stat-label { font-weight: 500; line-height: 1.35; }
.stat-source { margin-top: 0.35rem; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }

/* timeline */
.c-timeline ol { margin: 0; padding: 0; list-style: none; }
.c-timeline li { position: relative; display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 0.25rem 1.25rem; padding: 0.8rem 0 0.8rem; border-top: 1px solid var(--edge); }
.c-timeline li:first-child { border-top: 0; padding-top: 0; }
.tl-when { color: var(--primary-ink); font-size: 0.82rem; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.tl-role { margin: 0; font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.tl-org { margin: 0.1rem 0 0.35rem; color: var(--muted); font-size: 0.86rem; }
.tl-framing { margin: 0; color: var(--fg-2); font-size: 0.95rem; }

/* work gallery: an even grid, so any mix of shapes the model picks reads as one set */
.c-gallery .rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem 0.9rem; }
.c-gallery .rows[data-n="1"] { grid-template-columns: minmax(0, 0.66fr); }
.c-gallery .rows[data-n="2"], .c-gallery .rows[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.c-gallery .rows[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.c-gallery .rows:is([data-n="5"], [data-n="7"]) > figure:first-child { grid-column: span 2; }
.c-gallery figure { display: grid; align-content: start; gap: 0.55rem; margin: 0; min-width: 0; }
.c-gallery .piece-open img { aspect-ratio: 3 / 2; object-fit: cover; }
.c-gallery .piece-open.product img { object-position: left top; }
.c-gallery figcaption { display: grid; gap: 0.2rem; }
.c-gallery .why { color: var(--fg); font-size: 0.92rem; line-height: 1.45; }
.c-gallery .what { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }

/* system card */
.c-system { display: grid; gap: 1rem; }
.sys-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; }
.sys-name { margin: 0; font-family: var(--font-heading); font-size: 1.35rem; font-weight: 600; }
.sys-kind { color: var(--muted); font-size: 0.86rem; }
.sys-status { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0.6rem; border: 1px solid rgba(67, 217, 160, 0.35); border-radius: 999px; color: var(--ok); font-size: 0.76rem; font-weight: 500; }
.sys-angle { margin: 0; font-size: 1.04rem; line-height: 1.55; }
.sys-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.sys-body.no-image { grid-template-columns: 1fr; }
.paired .sys-body { grid-template-columns: 1fr; }
.facts { display: grid; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.facts li { position: relative; padding-left: 1.2rem; color: var(--fg-2); font-size: 0.93rem; line-height: 1.5; }
.facts li::before { position: absolute; top: 0.55em; left: 0; width: 0.45rem; height: 0.45rem; border-radius: 2px; background: var(--grad); content: ""; transform: rotate(45deg); }
.sys-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sys-built { color: var(--fg-2); font-size: 0.78rem; }
.piece-open.natural img { aspect-ratio: auto; object-fit: contain; }

/* request flow */
.c-flow ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.paired .c-flow ol, .c-flow.paired ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.c-flow li { position: relative; padding-top: 2.6rem; }
.c-flow li::before { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgba(91, 140, 255, 0.2); color: var(--fg); font-size: 0.85rem; font-weight: 600; counter-increment: step; content: counter(step); }
.c-flow li.on::before { background: var(--grad); box-shadow: 0 0 18px rgba(139, 92, 246, 0.45); }
.c-flow li::after { position: absolute; top: 1rem; left: 2.5rem; right: -0.6rem; height: 2px; background: linear-gradient(90deg, rgba(139, 92, 246, 0.7), rgba(59, 130, 246, 0.12)); content: ""; }
.c-flow li:last-child::after { display: none; }
.c-flow strong { display: block; font-weight: 600; }
.c-flow span { color: var(--fg-2); font-size: 0.86rem; line-height: 1.45; }
.caption { margin: 0.9rem 0 0; color: var(--fg-2); font-size: 0.92rem; }

/* brief chart: the same 3B model untuned and fine-tuned, with the prompted 11B and 70B as ticks */
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin: 0 0 0.9rem; color: var(--fg-2); font-size: 0.8rem; }
.lg { display: inline-flex; align-items: center; gap: 0.4rem; }
.lg::before { width: 0.9rem; height: 0.55rem; border-radius: 3px; background: rgba(195, 202, 216, 0.55); content: ""; }
.lg-after::before { background: var(--grad); }
.lg-11::before, .lg-70::before { width: 3px; height: 0.95rem; border-radius: 1px; background: #f5b84b; }
.lg-70::before { background: #5ee0ff; }
.groups { display: grid; gap: 0.85rem; }
.group-name { margin: 0 0 0.3rem; color: var(--fg); font-size: 0.84rem; font-weight: 600; }
.bar { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr) 2.6rem; align-items: center; gap: 0.7rem; margin-bottom: 0.3rem; font-size: 0.82rem; }
.bar-label { color: var(--muted); }
.bar-track { position: relative; height: 0.7rem; border-radius: 999px; background: rgba(226, 232, 255, 0.08); }
.bar-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: rgba(195, 202, 216, 0.55); transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.bar.after .bar-fill { background: var(--grad); }
.mark { position: absolute; top: -0.2rem; width: 3px; height: 1.1rem; margin-left: -1.5px; border-radius: 1px; background: #f5b84b; box-shadow: 0 0 0 1px rgba(6, 11, 31, 0.8); }
.mark-70 { background: #5ee0ff; }
.bar-value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.axis { display: flex; justify-content: space-between; margin: 0.2rem 3.3rem 0 6.3rem; color: var(--muted); font-size: 0.72rem; }
.axis-title { margin: 0.15rem 3.3rem 0 6.3rem; color: var(--muted); font-size: 0.72rem; text-align: center; }

/* the brief model's evaluation table and this site's live evaluation */
.eval-method { margin: 0 0 0.8rem; color: var(--fg-2); font-size: 0.9rem; line-height: 1.55; }
.table-wrap { overflow-x: auto; margin: 0 -0.25rem; padding: 0 0.25rem; scrollbar-width: thin; }
.eval-table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: 0.84rem; font-variant-numeric: tabular-nums; }
.c-site-eval .eval-table { min-width: 0; }
.eval-table th, .eval-table td { padding: 0.5rem 0.6rem 0.5rem 0; border-top: 1px solid var(--edge); text-align: right; vertical-align: top; }
.eval-table thead th { border-top: 0; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; }
.eval-table th:first-child { position: sticky; left: 0; z-index: 1; min-width: 9rem; padding-right: 0.8rem; background: #0e1633; text-align: left; font-weight: 500; }
.eval-table tbody th { color: var(--fg); }
.eval-table tr.best th, .eval-table tr.best td { color: #fff; font-weight: 600; background: rgba(91, 140, 255, 0.1); }
.eval-table tr.failing th, .eval-table tr.failing td { color: #ffb4b4; }
.eval-metrics { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.25rem 0.9rem; margin: 0.9rem 0 0; font-size: 0.82rem; }
.eval-metrics dt { color: var(--fg); font-weight: 600; }
.eval-metrics dd { margin: 0; color: var(--fg-2); }
.eval-weak { margin: 0.9rem 0 0; padding: 0.6rem 0.8rem; border-left: 3px solid #f5b84b; border-radius: 4px; background: rgba(245, 184, 75, 0.08); color: var(--fg); font-size: 0.88rem; }
.eval-failed { margin: 0.7rem 0 0; padding-left: 1.1rem; color: #ffb4b4; font-size: 0.85rem; }

/* fit table */
.c-fit table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.c-fit th { padding: 0 0.75rem 0.5rem 0; color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; }
.c-fit td { padding: 0.8rem 0.75rem 0.8rem 0; border-top: 1px solid var(--edge); vertical-align: top; line-height: 1.5; }
.c-fit td:first-child { width: 30%; font-weight: 500; }
.c-fit td:last-child { width: 7.5rem; padding-right: 0; text-align: right; }
.c-fit td.ev { color: var(--fg-2); }
.strength { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.strength::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.strength.strong { background: rgba(67, 217, 160, 0.12); color: var(--ok); }
.strength.related { background: rgba(91, 140, 255, 0.14); color: var(--primary-ink); }
.fit-h { margin: 1.1rem 0 0.5rem; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.fit-top { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; counter-reset: top; }
.fit-top li { display: grid; gap: 0.2rem; padding: 0.8rem 1rem 0.8rem 3rem; position: relative; border: 1px solid rgba(67, 217, 160, 0.3); border-radius: 10px; background: rgba(67, 217, 160, 0.06); }
.fit-top li::before { position: absolute; top: 0.8rem; left: 1rem; color: var(--ok); font-weight: 600; counter-increment: top; content: counter(top); }
.fit-top strong { font-weight: 600; }
.fit-top span, .fit-absent span { color: var(--fg-2); font-size: 0.92rem; }
.fit-absent ul { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.fit-absent li { display: grid; gap: 0.15rem; padding-left: 1rem; border-left: 2px solid var(--edge-2); }
.fit-absent strong { font-weight: 500; }
.fit-key { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.9rem 0 0; color: var(--muted); font-size: 0.8rem; }
.fit-tally { margin: -0.4rem 0 0.9rem; color: var(--fg-2); font-size: 0.88rem; }

/* gaps */
.c-gaps ul { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.c-gaps li { display: grid; gap: 0.15rem; padding-left: 1.1rem; border-left: 2px solid rgba(255, 143, 156, 0.45); }
.c-gaps strong { font-weight: 600; }
.c-gaps span { color: var(--fg-2); font-size: 0.9rem; }

/* quote */
.c-quote { margin: 0; padding: 0.4rem 0 0.4rem 1.25rem; border-left: 3px solid; border-image: linear-gradient(#06b6d4, #8b5cf6, #d946ef) 1; }
.c-quote p { margin: 0; font-family: var(--font-heading); font-size: 1.3rem; font-weight: 500; line-height: 1.4; }
.c-quote footer { margin-top: 0.5rem; color: var(--muted); font-size: 0.82rem; }

/* resume excerpt */
.c-resume ul { display: grid; gap: 0.5rem; margin: 0; padding-left: 1.1rem; color: var(--fg-2); font-size: 0.93rem; }
.c-resume .head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 0.75rem; }
.c-resume .head h3 { margin: 0; font-size: 0.98rem; font-weight: 600; }
.c-resume .why { margin: 0 0 0.75rem; color: var(--fg); font-size: 0.92rem; }

/* pitch */
.c-pitch { position: relative; padding: 1.4rem 1.5rem; border-radius: 16px; background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(217, 70, 239, 0.08)); }
.c-pitch::before { position: absolute; inset: 0; padding: 1px; border-radius: inherit; background: linear-gradient(120deg, #06b6d4, #8b5cf6, #d946ef); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; content: ""; opacity: 0.6; pointer-events: none; }
.c-pitch .to { margin: 0 0 0.6rem; color: var(--primary-ink); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.c-pitch p.text { margin: 0; font-size: 1.06rem; line-height: 1.65; }

/* video */
.c-video .frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--edge); border-radius: var(--radius); background: #000; }
.c-video .frame img, .c-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.c-video .play { position: absolute; left: 1rem; bottom: 1rem; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 48px; padding: 0 1.2rem; border: 0; border-radius: 999px; background: rgba(6, 11, 31, 0.88); color: var(--fg); font-weight: 600; cursor: pointer; }
.c-video .play:hover { background: var(--primary); }
.c-video p { margin: 0.6rem 0 0; }
.c-video .what { color: var(--muted); font-size: 0.82rem; }

/* contact, actions, follow-ups */
.c-contact .email { display: block; margin: 0.1rem 0 0.4rem; color: var(--fg); font-family: var(--font-heading); font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 600; overflow-wrap: anywhere; text-decoration: none; }
.c-contact .email:hover { color: var(--primary-ink); }
.c-contact .where { margin: 0 0 1rem; color: var(--fg-2); font-size: 0.9rem; }
.btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 1rem; border: 1px solid rgba(91, 140, 255, 0.45); border-radius: 10px; background: rgba(91, 140, 255, 0.14); color: var(--fg); font-size: 0.92rem; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { background: rgba(91, 140, 255, 0.28); }
.btn.primary { border-color: transparent; background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
.btn.primary:hover { filter: brightness(1.12); }
.btn .icon { width: 16px; height: 16px; }
.c-follow { display: grid; gap: 0.5rem; }
.c-follow .chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.45rem 0.95rem; border: 1px solid var(--edge-2); border-radius: 12px; background: rgba(22, 32, 70, 0.6); color: var(--fg); font-size: 0.92rem; text-align: left; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.chip:hover { border-color: rgba(91, 140, 255, 0.6); background: rgba(91, 140, 255, 0.14); }
.chip .icon { width: 15px; height: 15px; color: var(--primary-ink); }
.chip.jd { border-color: rgba(196, 168, 255, 0.45); }
.chip.jd .icon { color: #c4a8ff; }

/* fallback card (model unavailable, resting, rate limited) */
.c-fallback h3 { margin: 0 0 0.4rem; font-family: var(--font-heading); font-size: 1.2rem; font-weight: 600; }
.c-fallback p { margin: 0 0 1rem; color: var(--fg-2); }
.c-fallback .from { margin: 1.5rem 0 0.6rem; }
.c-fallback .strip { margin: 0; }

/* ================= Composer ================= */

.composer { position: relative; display: flex; align-items: flex-end; gap: 0.5rem; width: min(var(--col), calc(100% - 2rem)); margin: 0 auto; padding: 0.4rem 0.4rem 0.4rem 1.1rem; border-radius: 16px; background: #070d26; }
.composer::before { position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; background: linear-gradient(90deg, #06b6d4, #3b82f6, #8b5cf6, #d946ef); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; content: ""; pointer-events: none; }
.composer:focus-within { box-shadow: 0 0 32px rgba(139, 92, 246, 0.28); }
.composer textarea { flex: 1; min-width: 0; min-height: 2.75rem; max-height: 40vh; padding: 0.6rem 0; border: 0; background: none; color: var(--fg); font-size: 16px; line-height: 1.5; resize: none; outline: none; }
.composer textarea::placeholder { color: var(--muted); }
.send { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff; cursor: pointer; }
.send.is-stop { background: #2a3566; }
.composer-note { width: min(var(--col), calc(100% - 2rem)); margin: 0.5rem auto 0.9rem; color: var(--muted); font-size: 0.8rem; text-align: center; }
.composer-note.counting { color: var(--fg-2); }

/* ================= Proof view (dark light-table, white proof sheet) ================= */

.proof-view { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: #050918; color: var(--fg); }
.proof-view::backdrop { background: rgba(2, 5, 16, 0.75); }
.proof-view[open] { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "count tools close" "stage stage stage" "foot foot foot"; }
.pv-count { grid-area: count; align-self: center; margin: 0; padding: 0.5rem 1.25rem; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.pv-plates { grid-area: tools; display: flex; align-items: center; gap: 0.35rem; padding: 0.5rem 0; }
.pv-plates[hidden] { display: none; }
.pv-plates-label { margin-right: 0.3rem; color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.plate-btn { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 44px; min-height: 44px; padding: 0 0.7rem; border: 1px solid var(--edge-2); border-radius: 10px; background: var(--card-2); font-weight: 600; cursor: pointer; }
.plate-btn i { width: 12px; height: 12px; border-radius: 3px; }
.plate-btn[data-plate="c"] i { background: #00a3e0; }
.plate-btn[data-plate="m"] i { background: #e6007e; }
.plate-btn[data-plate="y"] i { background: #ffd400; }
.plate-btn[data-plate="k"] i { background: #f4f4f4; border: 1px solid #000; background: #111; box-shadow: 0 0 0 1px #888; }
.plate-btn[aria-pressed="false"] { background: transparent; color: var(--muted); }
.plate-btn[aria-pressed="false"] i { opacity: 0.25; }
.pv-composite { min-height: 44px; padding: 0 0.9rem; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--fg-2); font-size: 0.85rem; cursor: pointer; }
.pv-composite[aria-pressed="true"] { border-color: rgba(91, 140, 255, 0.55); color: var(--fg); }
.pv-close-wrap { grid-area: close; display: flex; justify-content: flex-end; padding: 0.5rem 1rem; }
.pv-btn { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 1rem; border: 1px solid var(--edge-2); border-radius: 10px; background: var(--card-2); cursor: pointer; }
.pv-btn:hover { border-color: rgba(91, 140, 255, 0.6); }
.pv-stage { grid-area: stage; position: relative; display: grid; place-items: center; min-height: 0; padding: 1.5rem; overflow: hidden; touch-action: pan-y pinch-zoom; background: radial-gradient(ellipse at center, #0e1736, #050918 70%); }
.proof-sheet { position: relative; display: grid; place-items: center; max-width: 100%; max-height: 100%; margin: 0; padding: 18px; border-radius: 4px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.proof-sheet img, .proof-sheet canvas { grid-area: 1 / 1; max-width: 100%; max-height: calc(100dvh - 220px); width: auto; height: auto; user-select: none; -webkit-user-drag: none; }
.proof-sheet canvas[hidden] { display: none; }
.proof-sheet.is-video { width: min(100%, calc((100dvh - 220px) * 16 / 9 + 36px)); background: #000; }
.proof-sheet iframe { grid-area: 1 / 1; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.pv-sheet-reg { position: absolute; top: -9px; left: 50%; width: 18px; height: 18px; translate: -50% 0; fill: none; stroke: #9aa6bb; stroke-width: 1.2; }
.pv-sheet-reg.bottom { top: auto; bottom: -9px; }
.pv-play { grid-area: 1 / 1; place-self: end start; z-index: 2; margin: 0 0 14px 14px; min-height: 48px; padding: 0 1.25rem; border: 0; border-radius: 999px; background: rgba(6, 11, 31, 0.9); color: #fff; font-weight: 600; cursor: pointer; }
.pv-play[hidden] { display: none; }
.pv-foot { grid-area: foot; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.6rem 1.25rem calc(0.6rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--edge); }
.pv-slug { display: grid; flex: 1 1 360px; gap: 0.1rem; }
.pv-title { margin: 0; font-weight: 600; }
.pv-alt { margin: 0; color: var(--muted); font-size: 0.85rem; }
.pv-nav { display: flex; gap: 0.5rem; }
.pv-nav [hidden] { display: none; }

/* ================= Motion ================= */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(67, 217, 160, 0.6); } 100% { box-shadow: 0 0 0 9px rgba(67, 217, 160, 0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ================= Medium widths ================= */

@media (max-width: 1180px) {
  :root { --panel-w: 280px; }
  .entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entries .entry { grid-column: span 1; }
  .entries .entry-jd { grid-column: span 2; }
}

/* ================= Phones and small tablets: the panel becomes a compact header; topics open as a sheet ================= */

@media (max-width: 860px) {
  .app { display: flex; flex-direction: column; }
  .panel { position: relative; z-index: 20; flex: none; overflow: visible; padding: 0.6rem 1rem; border-right: 0; border-bottom: 1px solid var(--edge); background: rgba(6, 11, 31, 0.96); }
  .me { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 0.75rem; }
  .avatar { width: 48px; height: 48px; margin: 0; padding: 2px; }
  .avatar img { border-width: 2px; }
  .me-name { font-size: 1.15rem; }
  .me-title { margin: 0; font-size: 0.86rem; }
  .me-status { display: none; }
  .me-bio, .panel-foot { display: none; }
  .topics-toggle { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.85rem; border: 1px solid var(--edge-2); border-radius: 10px; background: var(--card-2); font-size: 0.88rem; font-weight: 500; cursor: pointer; }
  .topics { margin: 0; flex: none; position: absolute; top: 100%; left: 0; right: 0; display: none; max-height: calc(100dvh - 72px); overflow-y: auto; padding: 0.75rem 0.75rem 1rem; border-bottom: 1px solid var(--edge-2); background: #070d26; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55); }
  .topics.open { display: block; }
  .topics :is(button, .topic-link) { min-height: 48px; }
  .topics .sheet-foot { display: flex; gap: 0.5rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--edge); }
  .topics .sheet-foot a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 44px; border: 1px solid var(--edge); border-radius: 10px; color: var(--fg-2); font-size: 0.85rem; text-decoration: none; }
  .thread { padding: 1.25rem 1rem 1rem; }
  .eyebrow { display: none; }
  body { letter-spacing: 0; font-kerning: normal; }
  .opening { display: flex; flex-flow: row wrap; align-items: flex-start; }
  .opening > .entries, .opening > .proof-row { display: contents; }
  .opening > *, .opening > .entries > *, .opening > .proof-row > * { flex: 0 0 100%; min-width: 0; }
  .opening > noscript { display: none; }
  .opening .entry-jd { order: 1; flex: 0 0 calc(50% - 0.25rem); margin: 0 0 0.6rem; padding: 0.75rem 0.8rem; }
  .opening .entry-jd + .entry-jd { margin-left: 0.5rem; }
  .opening .entry-jd strong { font-size: 0.95rem; line-height: 1.25; }
  .opening .entry-jd .entry-kicker { font-size: 0.72rem; }
  .opening .entry-jd .entry-note { display: none; }
  .wide-only { display: none; }
  .opening .entry:not(.entry-jd) { order: 2; }
  /* Finished client work comes straight after the two main cards, so the first phone screen shows real work. */
  .opening .strip-head.strip-head-client { order: 6; margin: 0.35rem 0 0.4rem; }
  .opening .strip-client { order: 7; }
  .opening .strip.strip-client li { flex-basis: 46%; }
  .opening .strip-client .piece-label { font-size: 0.74rem; }
  /* Generative work first: DesignTech running, large, right under the cards; client work follows. */
  .opening .clip-main { order: 3; margin: 0.3rem 0 1rem; }
  .opening .logo-band { order: 5; }
  .opening .strip-head { order: 8; }
  .opening .strip-builds { order: 8; }
  .opening .clip-side { order: 9; margin-bottom: 1.25rem; }
  .opening .strip { display: flex; gap: 0.6rem; margin: 0 -1rem 1.25rem; padding: 0 1rem 0.25rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 1rem; scrollbar-width: none; }
  .opening .strip li { flex: 0 0 62%; scroll-snap-align: start; }
  .opening .opening-foot { order: 10; }
  /* The three suggested questions sit right under the proof, as compact chips */
  .opening .entry:not(.entry-jd) { flex: 0 0 auto; display: inline-flex; width: auto; min-height: 44px; margin: 0 0.4rem 0.45rem 0; padding: 0.45rem 0.75rem; border-radius: 12px; }
  .opening .entry:not(.entry-jd) .entry-kicker { display: none; }
  .opening .entry:not(.entry-jd) strong { font-family: var(--font-body); font-size: 0.86rem; font-weight: 500; }
  /* On a phone the chips stay on one line; the work strip right below them already answers "Show me the work". */
  @media (max-width: 560px) { .opening .entry[data-intent="work"]:not(.entry-jd) { display: none; } }
  .opening .clip figcaption { font-size: 0.8rem; }
  .logo-band { padding: 0.85rem 0.9rem; }
  .opening .logo-band { margin: 0 -1rem 1.25rem; padding: 0.75rem 0; border-inline: 0; border-radius: 0; }
  .opening .logo-label { padding-inline: 1rem; }
  .opening > .logo-band, .opening > .strip { flex-basis: calc(100% + 2rem); }
  .opening .logo-row ul { flex-wrap: nowrap; gap: 1.4rem; overflow-x: auto; padding: 0 1rem 0.2rem; scrollbar-width: none; }
  .opening .logo-row li { flex: none; height: 28px; }
  .opening .logo-row img { max-height: 24px; width: auto; }
  .c-logos .logo-row ul { gap: 0.7rem 1.15rem; }
  .c-logos .logo-row img { max-height: 26px; width: auto; }
  .c-clip { grid-template-columns: 1fr; }
  .trace-facts { grid-template-columns: 1fr; }
  .trace-facts dt { margin-top: 0.35rem; }
  .strip-note { display: none; }
  .opening-title { font-size: 1.6rem; margin-bottom: 0.6rem; }
  .opening-lede { margin-bottom: 0.9rem; font-size: 0.9rem; line-height: 1.55; }
  .entry { min-height: 0; padding: 0.8rem 0.9rem; }
  .entry strong { font-size: 0.95rem; }

  .answer { grid-template-columns: 1fr; }
  .c-gallery .rows, .c-gallery .rows[data-n] { grid-template-columns: 1fr 1fr; gap: 0.9rem 0.6rem; }
  .c-gallery .rows > figure:first-child { grid-column: auto; }
  .c-gallery .rows:is([data-n="1"], [data-n="3"], [data-n="5"], [data-n="7"]) > figure:first-child { grid-column: 1 / -1; }
  .c-gallery .why { font-size: 0.86rem; }
  .answer > .paired { grid-column: 1 / -1; }
  .sys-body { grid-template-columns: 1fr; }
  .c-flow ol { grid-template-columns: 1fr 1fr; }
  .c-timeline li { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 4.4rem minmax(0, 1fr) 2.4rem; gap: 0.5rem; }
  .axis, .axis-title { margin-left: 4.9rem; margin-right: 2.9rem; }
  .c-fit thead { display: none; }
  .c-fit tr { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--edge); }
  .c-fit td { padding: 0; border: 0; width: auto !important; text-align: left !important; }
  .c-fit td.ev { grid-column: 1 / -1; grid-row: 2; }
  .c-fit td:last-child { grid-column: 2; grid-row: 1; }
  .composer { width: calc(100% - 1.5rem); }
  .composer-note { display: none; }
  .composer-note.counting { display: block; width: calc(100% - 1.5rem); margin: 0.35rem auto 0; font-size: 0.74rem; }
  .composer { margin-bottom: max(0.6rem, env(safe-area-inset-bottom)); margin-top: 0.4rem; }
  .fit-top li { padding-left: 2.4rem; }
  .fit-top li::before { left: 0.9rem; }
  .proof-view[open] { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "count close" "stage stage" "tools tools" "foot foot"; }
  .pv-plates { justify-content: center; padding: 0.4rem 0.75rem; border-top: 1px solid var(--edge); }
  .pv-plates-label { display: none; }
  .pv-stage { padding: 1rem; }
  .proof-sheet { padding: 8px; }
  .proof-sheet img, .proof-sheet canvas { max-width: calc(100vw - 50px); max-height: calc(100dvh - 300px); }
}
@media (min-width: 861px) { .topics .sheet-foot { display: none; } }

/* ================= Plain pages (404) ================= */
body.page-plain { overflow: auto; }
.plain { max-width: 40rem; margin: 0 auto; padding: clamp(2rem, 8vh, 6rem) 1.25rem 3rem; }
.plain-me { display: inline-flex; align-items: center; gap: 0.8rem; margin-bottom: 2.5rem; color: var(--fg); text-decoration: none; }
.plain-me img { width: 52px; height: 52px; padding: 2px; border-radius: 50%; background: var(--grad-ring); object-fit: cover; }
.plain-me strong { display: block; font-family: var(--font-heading); font-size: 1.15rem; }
.plain-me span span { color: var(--muted); font-size: 0.86rem; }
.topics .topic-link { text-decoration: none; }

/* ================= Round 5: the case study, the client stories, the visible trace line ================= */
.trace-wrap { display: grid; gap: 0.4rem; }
.trace-line { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.trace-line .icon { width: 15px; height: 15px; color: var(--primary-ink); }
.c-case { display: grid; gap: 1.1rem; }
.c-case .c-title { margin-bottom: 0; }
.case-lede { margin: -0.4rem 0 0; color: var(--fg-2); font-size: 0.92rem; }
.case { display: grid; gap: 0.6rem; padding-top: 1rem; border-top: 1px solid var(--edge); }
.case > summary { display: grid; gap: 0.3rem; list-style: none; cursor: pointer; }
.case > summary::-webkit-details-marker { display: none; }
.case:not([open]) > summary::after { content: "Show this case"; width: fit-content; margin-top: 0.2rem; padding: 0.3rem 0.7rem; border: 1px solid var(--edge-2); border-radius: 8px; color: var(--fg-2); font-size: 0.8rem; }
.case[open] > summary { margin-bottom: 0.6rem; }
/* The tight cut of the studio recording is cropped on the right on purpose (legible at phone width): fade the edge so it reads as a crop. */
.clip-tight video { -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); }
.case-meta { margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.case-title { margin: 0; font-family: var(--font-heading); font-size: 1.08rem; font-weight: 600; line-height: 1.3; }
.case-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 0.75rem; }
.case-col { display: grid; align-content: start; gap: 0.7rem; padding: 0.85rem 0.9rem; border: 1px solid var(--edge); border-radius: 10px; background: rgba(6, 11, 31, 0.45); min-width: 0; }
.case-col.change { border-color: rgba(139, 92, 246, 0.45); background: rgba(139, 92, 246, 0.08); }
.case-col.after { border-color: rgba(67, 217, 160, 0.35); background: rgba(67, 217, 160, 0.05); }
.case-col-label { margin: 0; color: var(--fg); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.case-col.before .case-col-label { color: var(--gap); }
.case-col.change .case-col-label { color: #c4a8ff; }
.case-col.after .case-col-label { color: var(--ok); }
.case-block p { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--fg-2); }
.case-block p.case-step, .case-grade .case-step { margin: 0 0 0.2rem; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; }
.case-block pre { margin: 0.5rem 0 0.2rem; padding: 0.6rem 0.7rem; overflow-x: auto; border: 1px solid var(--edge); border-radius: 8px; background: #040817; color: #d6def0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.74rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; font-variant-ligatures: none; }
.case-block .code-file { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.72rem; }
.case-grade ul { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.case-grade li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.1rem 0.5rem; align-items: baseline; font-size: 0.84rem; }
.case-grade .verdict { padding: 0 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; }
.case-grade .is-pass .verdict { background: rgba(67, 217, 160, 0.16); color: var(--ok); }
.case-grade .is-fail .verdict { background: rgba(255, 143, 156, 0.16); color: var(--gap); }
.case-grade .is-weak .verdict { background: rgba(245, 195, 91, 0.16); color: var(--warn); }
.case-grade .what { color: var(--fg); }
.case-grade .value { color: var(--fg); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.case-grade .value.long { grid-column: 2 / -1; text-align: left; font-weight: 500; color: var(--fg-2); }
.case-grade .why { grid-column: 2 / -1; color: var(--muted); font-size: 0.78rem; }
.case-rubric { display: grid; gap: 0.6rem; padding-top: 1rem; border-top: 1px solid var(--edge); }
.rubric-table { width: 100%; min-width: 0; }
.rubric-table td { text-align: left; }
.rubric-table td:last-child { white-space: nowrap; color: var(--fg); }
.rubric-table th[scope="row"] { white-space: nowrap; }
.rubric-table td { font-size: 0.84rem; }
.c-stories { display: grid; gap: 0.9rem; }
.c-story { display: grid; gap: 0.75rem; }
.story-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.6rem 1.25rem; }
.story-client { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.story-title { margin: 0.15rem 0 0; font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.story-figure { display: grid; margin: 0; padding: 0.55rem 0.85rem; border: 1px solid rgba(67, 217, 160, 0.35); border-radius: 10px; background: rgba(67, 217, 160, 0.07); max-width: 15rem; }
.story-figure strong { font-family: var(--font-heading); font-size: 1.45rem; line-height: 1.15; color: var(--fg); }
.story-figure span { color: var(--fg-2); font-size: 0.78rem; line-height: 1.35; }
.story-steps { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.45rem 1rem; margin: 0; }
.story-steps dt { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; padding-top: 0.12rem; }
.story-steps dd { margin: 0; color: var(--fg-2); font-size: 0.9rem; line-height: 1.5; }
.story-steps dd.derived { grid-column: 2; color: var(--muted); font-size: 0.8rem; font-style: italic; }
.opening-proof { max-width: 62ch; margin: -1rem 0 1.5rem; color: var(--fg-2); font-size: 0.92rem; }
.opening-proof strong { color: var(--fg); font-weight: 600; }
@media (max-width: 1180px) { .case-cols { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .story-steps { grid-template-columns: 1fr; gap: 0.15rem; }
  .story-steps dt { margin-top: 0.45rem; }
  .story-steps dd.derived { grid-column: 1; }
  .story-figure { max-width: none; width: 100%; }
  .opening-proof { order: 0; margin: -0.4rem 0 0.9rem; font-size: 0.84rem; line-height: 1.5; }
  .eyebrow { display: block; order: -1; margin-bottom: 0.35rem; font-size: 0.72rem; }
  /* Tables become one card per row on a phone: no column is cut off at the right edge. */
  .c-eval .eval-table thead, .rubric-table thead { display: none; }
  .c-eval .eval-table, .c-eval .eval-table tbody, .rubric-table, .rubric-table tbody { display: block; width: 100%; }
  .c-eval .eval-table tr, .rubric-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.15rem 0.9rem; padding: 0.65rem 0; border-top: 1px solid var(--edge); }
  .c-eval .eval-table th[scope="row"], .rubric-table th[scope="row"] { grid-column: 1 / -1; padding: 0; border: 0; text-align: left; white-space: normal; }
  .c-eval .eval-table td, .rubric-table td { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0; border: 0; text-align: right; font-size: 0.84rem; }
  .c-eval .eval-table td::before, .rubric-table td::before { content: attr(data-label); color: var(--muted); text-align: left; font-size: 0.76rem; }
  .rubric-table td[data-label="Rule"] { grid-column: 1 / -1; display: block; text-align: left; }
  .rubric-table td[data-label="Rule"]::before { display: none; }
  .c-eval .table-wrap { overflow: visible; }
  .c-eval .eval-table { min-width: 0; }
  .c-eval .eval-table tr.best { margin: 0 -0.5rem; padding: 0.65rem 0.5rem; border-radius: 8px; background: rgba(91, 140, 255, 0.12); }
  .c-eval .eval-table tr.best th, .c-eval .eval-table tr.best td { background: none; }
  .rubric-table td:last-child { white-space: normal; }
  .eval-table th:first-child { position: static; background: none; min-width: 0; }
}

