/* Tokens follow the Firecrawl design system (ui-skills.com/design-md/firecrawl); Geist stands in for SuisseIntl. */
:root {
  --bg: #f9f9f9;
  --bg-lighter: #fbfbfb;
  --surface: #ffffff;
  --text: #262626;
  --muted: #262626a3;   /* black-alpha-64 */
  --faint: #2626267a;   /* black-alpha-48 */
  --alpha-4: #0000000a;
  --alpha-8: #00000014;
  --border-faint: #ededed;
  --border: #e8e8e8;
  --border-loud: #dcdcdc;
  --illus: #dbdbdb;
  --heat: #fa5d19;
  --heat-8: #fa5d1914;
  --heat-12: #fa5d191f;
  --heat-20: #fa5d1933;
  --on-heat: #ffffff;
  --heat-shadow: inset 0 -6px 12px 0 rgba(255, 0, 0, 0.2), 0 0.6px 0.8px 0 rgba(255, 139, 0, 0.22), 0 1.3px 1.7px 0 rgba(255, 139, 0, 0.19),
    0 2.5px 3.1px 0 rgba(255, 139, 0, 0.16), 0 4.4px 5.5px 0 rgba(255, 139, 0, 0.13), 0 8.3px 10.3px 0 rgba(255, 139, 0, 0.1), 0 2px 4px 0 rgba(250, 93, 25, 0.3);
  --shadow: 0 1px 2px #0000000a, 0 8px 24px -12px #0000001f;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --font: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --bg-lighter: #141414;
    --surface: #171717;
    --text: #f5f5f5;
    --muted: #f5f5f5a3;
    --faint: #f5f5f57a;
    --alpha-4: #ffffff0a;
    --alpha-8: #ffffff14;
    --border-faint: #2a2a2a;
    --border: #333333;
    --border-loud: #404040;
    --illus: #3d3d3d;
    --shadow: 0 1px 2px #00000066;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; overflow-x: clip; /* rail crosshairs poke 5px past a full-width column */ background: var(--bg); color: var(--text); font: 400 15px/24px var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--heat); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--heat-20); }
h1, h2, h3 { font-weight: 500; }

/* ~1200px column with rails */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; border-inline: 1px solid var(--border-faint); }
@media (max-width: 768px) { .wrap { padding: 0 16px; border-inline: 0; } }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Full-width rules between rows, with a crosshair where each rule meets a rail */
.hero, .demo, .stats-band, .label-row, .section-head, .toolbar, .how, .site-footer, .site-header + main.wrap { border-top: 1px solid var(--border-faint); }
:is(.hero, .demo, .stats-band, .label-row, .section-head, .toolbar, .how, .site-footer) > .wrap { position: relative; }
:is(.hero, .demo, .stats-band, .label-row, .section-head, .toolbar, .how, .site-footer) > .wrap::before,
:is(.hero, .demo, .stats-band, .label-row, .section-head, .toolbar, .how, .site-footer) > .wrap::after {
  content: ""; position: absolute; top: -6px; width: 11px; height: 11px; pointer-events: none; z-index: 1;
  background: linear-gradient(var(--illus), var(--illus)) center / 1px 100% no-repeat,
              linear-gradient(var(--illus), var(--illus)) center / 100% 1px no-repeat;
}
:is(.hero, .demo, .stats-band, .label-row, .section-head, .toolbar, .how, .site-footer) > .wrap::before { left: -6px; }
:is(.hero, .demo, .stats-band, .label-row, .section-head, .toolbar, .how, .site-footer) > .wrap::after { right: -6px; }
@media (max-width: 768px) { :is(.hero, .demo, .stats-band, .label-row, .section-head, .toolbar, .how, .site-footer) > .wrap::before,
  :is(.hero, .demo, .stats-band, .label-row, .section-head, .toolbar, .how, .site-footer) > .wrap::after { display: none; } }

/* ASCII fields: decorative, theme-inverting illustration color */
.ascii { margin: 0; font: 12px/12px var(--mono); color: var(--illus); white-space: pre; overflow: hidden; user-select: none; pointer-events: none; }
.ascii-hero { position: absolute; inset: 0; z-index: 0; -webkit-mask-image: radial-gradient(ellipse 46% 60% at 50% 46%, transparent 55%, #000 100%); mask-image: radial-gradient(ellipse 46% 60% at 50% 46%, transparent 55%, #000 100%); }
@media (max-width: 768px) { .ascii-hero { -webkit-mask-image: linear-gradient(#000, transparent 30%); mask-image: linear-gradient(#000, transparent 30%); } }
.ascii-band { position: absolute; inset: 0 0 auto; height: 132px; -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.ascii-loading { grid-column: 1 / -1; height: 240px; color: var(--heat-20); }

/* Buttons: 40px, 8px radius, label-medium */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-sm); font: 450 14px/20px var(--font); text-decoration: none; color: var(--text); background: var(--alpha-4); cursor: pointer; transition: all 0.2s var(--ease); }
.btn:hover { background: var(--alpha-8); }
.btn:active { transform: scale(0.98); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.primary { color: var(--on-heat); background: var(--heat); box-shadow: var(--heat-shadow); }
.btn.primary:hover { background: color-mix(in srgb, var(--heat) 92%, #000); }
.btn.primary:active { transform: scale(0.995); }

/* Header */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark { display: flex; align-items: center; gap: 8px; font: 500 18px/1 var(--font); letter-spacing: -0.02em; text-decoration: none; }
.wordmark i { width: 16px; height: 18px; border-radius: 4px 4px 8px 8px; background: var(--heat); box-shadow: inset 0 -5px 8px rgba(255, 0, 0, 0.25); }
.site-nav { display: flex; align-items: center; gap: 24px; font: 450 14px/20px var(--font); }
.site-nav a:not(.btn) { color: var(--muted); text-decoration: none; transition: color 0.2s var(--ease); }
.site-nav a:not(.btn):hover { color: var(--text); }
@media (max-width: 480px) { .site-nav a[href="#gallery"] { display: none; } }

/* Hero */
.hero .wrap { padding-block: 96px 80px; text-align: center; display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.hero .wrap > :not(.ascii) { position: relative; z-index: 1; }
@media (max-width: 768px) { .hero .wrap { padding-block: 64px 48px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--border); font: 450 13px/20px var(--font); text-decoration: none; transition: box-shadow 0.2s var(--ease); }
.eyebrow:hover { box-shadow: 0 0 0 1px var(--border-loud); }
.eyebrow span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 14px; line-height: 1; }
.hero h1 { margin: 24px 0 0; font-size: clamp(40px, 6vw, 60px); line-height: 1.07; letter-spacing: -0.005em; max-width: 13ch; text-wrap: balance; }
.hero h1 em, .section-head h2 em, .how h2 em { font-style: normal; color: var(--heat); }
.hero p { margin: 20px 0 0; max-width: 54ch; color: var(--muted); font: 400 18px/28px var(--font); text-wrap: pretty; }
@media (max-width: 768px) { .hero p { font-size: 16px; line-height: 24px; } }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 32px; }

/* Demo window */
.demo .wrap { padding-block: 40px; }
.window { border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 0 0 1px var(--border), var(--shadow); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--border-faint); font: 400 12px/16px var(--mono); color: var(--faint); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--border-loud); }
.window-bar span { margin-left: auto; margin-right: auto; padding-right: 48px; }
.hero-demo:empty { min-height: 200px; }
.hero-demo .frame { border: 0; border-radius: 0; box-shadow: none; }
.hero-demo .live { height: auto; aspect-ratio: 16 / 9; }
.hero-demo .note { margin: 0; padding: 10px 14px; border-top: 1px solid var(--border-faint); text-align: center; font: 400 13px/20px var(--font); }
.hero-demo .note a { color: var(--heat); text-decoration: none; }
.hero-demo .note a:hover { text-decoration: underline; }

/* Stats band: ruled cells like a logo strip */
.stats-band .wrap { padding: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stats span { display: flex; flex-direction: column-reverse; gap: 2px; padding: 24px 32px; font: 400 12px/16px var(--mono); color: var(--faint); text-transform: uppercase; box-shadow: 1px 0 0 var(--border-faint), 0 1px 0 var(--border-faint); }
.stats b { font: 500 24px/32px var(--font); letter-spacing: -0.01em; color: var(--text); text-transform: none; overflow-wrap: anywhere; }
@media (max-width: 768px) { .stats span { padding: 16px; } }

/* Section labels: [ 01 / 02 ] · Gallery */
.label-row .wrap { padding-block: 12px; }
.section-label { font: 400 12px/16px var(--mono); color: var(--faint); text-transform: uppercase; }
.section-label b { color: var(--heat); font-weight: 400; }

/* Section heads */
.section-head .wrap { padding-block: 64px 48px; text-align: center; }
.kicker { display: inline-block; font: 400 13px/20px var(--mono); color: var(--faint); }
.section-head h2, .how h2 { margin: 12px 0 0; font-size: clamp(32px, 4.5vw, 52px); line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }
.section-head p { margin: 16px auto 0; max-width: 52ch; color: var(--muted); }

/* Toolbar */
.toolbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); }
.toolbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-block: 12px; border-bottom: 1px solid var(--border-faint); }
.seg { display: inline-flex; padding: 2px; background: var(--alpha-4); border-radius: var(--r-sm); gap: 2px; }
.seg button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 6px; font: 450 13px/20px var(--font); color: var(--muted); cursor: pointer; transition: all 0.2s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border), 0 1px 2px var(--alpha-8); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--alpha-4); font: 450 13px/20px var(--font); color: var(--muted); cursor: pointer; transition: all 0.2s var(--ease); }
.chip:hover { color: var(--text); background: var(--alpha-8); }
.chip[aria-pressed="true"] { background: var(--heat-12); color: var(--heat); }
.chip small { font: 400 12px var(--mono); opacity: 0.7; margin-left: 4px; }
.search { margin-left: auto; width: 240px; height: 32px; padding: 0 12px; border: 0; background: var(--surface); box-shadow: 0 0 0 1px var(--border); border-radius: var(--r-sm); font: 400 14px/20px var(--font); transition: box-shadow 0.2s var(--ease); }
.search:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--heat), 0 0 0 4px var(--heat-12); }
@media (max-width: 768px) { .search { margin-left: 0; width: 100%; } }

/* Grid: ruled cells, no gaps */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); margin-inline: -32px; }
@media (max-width: 768px) { .grid { margin-inline: -16px; } }
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }
.card { display: block; padding: 24px; text-decoration: none; box-shadow: 1px 0 0 var(--border-faint), 0 1px 0 var(--border-faint); transition: background 0.2s var(--ease); }
@media (max-width: 768px) { .card { padding: 16px; } }
.card:hover, .card:focus-visible { background: var(--bg-lighter); }
.shot { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-md); overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--border), var(--shadow); transition: transform 0.3s var(--ease); }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card { content-visibility: auto; contain-intrinsic-size: auto 360px; }
.shot .before { opacity: 0; transition: opacity 0.2s var(--ease); }
.card:hover .shot, .card:focus-visible .shot { transform: translateY(-2px); }
.card:hover .before, .card:focus-visible .before { opacity: 1; }
.tag { position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: 6px; font: 500 12px/16px var(--mono); background: #262626b8; color: #fff; backdrop-filter: blur(6px); }
.tag.a { background: var(--heat); }
.tag.b { opacity: 0; transition: opacity 0.2s var(--ease); }
.card:hover .tag.b, .card:focus-visible .tag.b { opacity: 1; }
.card:hover .tag.a, .card:focus-visible .tag.a { opacity: 0; }
.card-meta { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px; margin-top: 16px; }
.card .num { font: 400 12px/16px var(--mono); color: var(--heat); }
.card h3 { margin: 0; font: 500 16px/24px var(--font); letter-spacing: -0.01em; overflow-wrap: anywhere; transition: color 0.2s var(--ease); }
.card:hover h3 { color: var(--heat); }
.card .by { font: 400 12px/16px var(--mono); color: var(--faint); white-space: nowrap; }
.card p { margin: 4px 0 0; font: 400 14px/20px var(--font); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { padding: 72px 0; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* How it works */
.how .wrap { padding-block: 72px 0; text-align: center; overflow: hidden; }
.how .wrap > :not(.ascii) { position: relative; }
.steps { list-style: none; padding: 0; margin: 48px -32px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: s; border-top: 1px solid var(--border-faint); text-align: left; background: var(--bg); }
@media (max-width: 768px) { .steps { margin-inline: -16px; } }
.steps li { counter-increment: s; padding: 24px 24px 32px; box-shadow: 1px 0 0 var(--border-faint), 0 1px 0 var(--border-faint); }
.steps li::before { content: "[ 0" counter(s) " ]"; font: 400 12px/16px var(--mono); color: var(--heat); }
.steps h3 { margin: 12px 0 4px; font: 500 16px/24px var(--font); }
.steps p { margin: 0; color: var(--muted); font: 400 14px/20px var(--font); }

.site-footer .wrap { padding-block: 24px 40px; font: 400 13px/20px var(--font); color: var(--faint); }
.site-footer p { margin: 4px 0; max-width: 80ch; }

/* Skill page */
.back { display: inline-block; margin-top: 24px; font: 450 13px/20px var(--font); color: var(--muted); text-decoration: none; }
.back:hover { color: var(--heat); }
.skill-head { display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; align-items: end; padding: 16px 0 32px; }
@media (max-width: 860px) { .skill-head { grid-template-columns: 1fr; } }
.skill-head h1 { margin: 12px 0 0; font-size: clamp(32px, 4.5vw, 52px); line-height: 1.08; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.skill-head .desc { margin: 12px 0 0; color: var(--muted); max-width: 64ch; font: 400 16px/24px var(--font); }
.topic-row { display: flex; flex-wrap: wrap; gap: 6px; }
.topic { font: 450 12px/20px var(--font); padding: 0 10px; border-radius: 999px; background: var(--alpha-4); color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.facts { display: grid; grid-template-columns: auto auto; margin: 0; border-radius: var(--r-md); background: var(--surface); box-shadow: 0 0 0 1px var(--border); overflow: hidden; }
.facts dt, .facts dd { padding: 8px 16px; border-top: 1px solid var(--border-faint); }
.facts dt:first-of-type, .facts dd:first-of-type { border-top: 0; }
.facts dt { color: var(--muted); font: 450 13px/20px var(--font); }
.facts dd { margin: 0; font: 400 12px/20px var(--mono); text-align: right; }

.controls { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding: 12px 0; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-block: 1px solid var(--border-faint); }
.controls label { font: 400 12px/16px var(--mono); color: var(--faint); text-transform: uppercase; margin-right: 8px; }

.viewer { margin-top: 24px; }
.frame { position: relative; border-radius: var(--r-lg); background: var(--surface); overflow: auto; max-height: 78vh; box-shadow: 0 0 0 1px var(--border), var(--shadow); overscroll-behavior: contain; }
.handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: var(--heat); }
.knob { position: sticky; top: calc(39vh - 18px); margin-left: -17px; width: 36px; height: 36px; border-radius: 50%; background: var(--heat); color: var(--on-heat); display: grid; place-items: center; box-shadow: var(--heat-shadow); cursor: grab; }
.knob:active { cursor: grabbing; }
.knob svg { width: 18px; height: 18px; }
.labels { position: sticky; top: 0; z-index: 2; height: 0; }
.labels span { position: absolute; top: 12px; padding: 2px 8px; border-radius: 6px; font: 500 12px/16px var(--mono); background: #262626b8; color: #fff; backdrop-filter: blur(6px); }
.labels .l { left: 12px; }
.labels .r { right: 12px; background: var(--heat); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pair.mobile { grid-template-columns: repeat(2, minmax(0, 390px)); justify-content: center; }
@media (max-width: 768px) { .pair { grid-template-columns: 1fr; } .pair.mobile { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.pair figure { margin: 0; }
.pair figcaption { font: 400 12px/16px var(--mono); color: var(--muted); margin-bottom: 8px; }
.note { margin: 12px 0 0; font: 400 13px/20px var(--font); color: var(--faint); }

/* Live views: scaled iframes inside fixed-height cells */
.live, .live-pane { position: relative; overflow: hidden; background: #fff; max-height: none; }
.live { height: 78vh; }
.live-pane { height: 76vh; }
.cell { position: absolute; inset: 0; overflow: hidden; }
.cell iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; transform-origin: 0 0; }
.live .after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.live .labels { position: absolute; inset: 0; height: auto; z-index: 2; pointer-events: none; }
.live .handle { z-index: 3; width: 24px; margin-left: -12px; background: none; cursor: ew-resize; touch-action: none; }
.live .handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 11px; width: 2px; background: var(--heat); }
.live .knob { position: absolute; top: calc(50% - 18px); left: 50%; margin-left: -18px; }
.live.dragging iframe { pointer-events: none; }
.pair.mobile .live-pane { height: min(76vh, 844px); }

.changes { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 48px 0 32px; border-bottom: 1px solid var(--border-faint); }
@media (max-width: 768px) { .changes { grid-template-columns: 1fr; } }
.changes h2 { margin: 0; font: 500 20px/28px var(--font); }
.changes ul { margin: 0; padding-left: 18px; color: var(--muted); }
.changes li { margin-bottom: 8px; }
.changes li::marker { color: var(--heat); }
.pager { display: flex; justify-content: space-between; gap: 12px; padding: 32px 0 64px; }
.pager a { text-decoration: none; font: 450 13px/20px var(--font); color: var(--faint); }
.pager a:hover b { color: var(--heat); }
.pager b { display: block; font: 500 16px/24px var(--font); color: var(--text); transition: color 0.2s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; }
}
