/* flashlite — site styles
   Palette mirrors the CLI's own theme (src/ui.ts):
   accent #ffe066, orange #ff9f40, warm near-black ground.
   Every text role clears 4.5:1 against its background. */

:root {
  --bg:        #0d0b08;
  --bg-2:      #110e09;
  --panel:     #17130c;
  --panel-2:   #1d1810;
  --line:      rgba(255, 224, 102, 0.12);
  --line-2:    rgba(255, 224, 102, 0.24);

  --accent:    #ffe066;
  --accent-2:  #ffd54e;
  --orange:    #ff9f40;

  --text:      #f4efe3;
  --muted:     #a99f8b;
  --faint:     #8f8878; /* raised from #7a7466: now ≥5:1 on every surface */

  --green:     #86d98a;
  --red:       #ff8f8f;
  --cyan:      #7fd1d8;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "JetBrains Mono",
          "Fira Code", "Cascadia Code", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui,
          Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1120px;
  --radius: 14px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);

  /* rhythm + surfaces */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --section-y: clamp(56px, 8vw, 96px);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35), 0 10px 30px -22px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 30px 80px -40px rgba(255, 159, 64, 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 0.22s;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* keep sticky working; layout is verified overflow-free */
}

/* warm ambience: a single soft glow at the top, plus a faint grid */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 720px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(820px 420px at 22% -8%, rgba(255, 159, 64, 0.14), transparent 62%),
    radial-gradient(760px 380px at 88% -12%, rgba(255, 224, 102, 0.10), transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 224, 102, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 224, 102, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(1100px 640px at 50% -6%, #000 8%, transparent 72%);
          mask-image: radial-gradient(1100px 640px at 50% -6%, #000 8%, transparent 72%);
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

code, pre, .mono { font-family: var(--mono); }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(13, 11, 8, 0.78);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .glyph {
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  text-shadow: 0 0 22px rgba(255, 224, 102, 0.45);
}
.brand .v { color: var(--faint); font-weight: 400; font-size: 12px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  color: var(--muted);
  font-size: 14.5px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 224, 102, 0.06);
  text-decoration: none;
}
.nav-links a.cta {
  color: var(--bg);
  background: var(--accent);
  font-weight: 650;
  margin-left: 8px;
}
.nav-links a.cta:hover { background: var(--accent-2); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--mono);
  cursor: pointer;
}

/* ------------------------------------------------------------------ hero */

.hero {
  padding: 74px 0 8px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 54px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid var(--line-2);
  background: rgba(255, 224, 102, 0.045);
  border-radius: 999px;
  padding: 5px 13px 5px 10px;
  margin-bottom: 24px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(134, 217, 138, 0.8);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

h1.hero-title {
  font-size: clamp(2.05rem, 5.1vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.032em;
  font-weight: 760;
  margin: 0 0 20px;
}
h1.hero-title .grad {
  background: linear-gradient(96deg, var(--orange), var(--accent) 72%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.09rem;
  color: var(--muted);
  max-width: 33ch;
  margin: 0 0 30px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s;
  font-family: var(--sans);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #14110a;
}
.btn-primary:hover { background: var(--accent-2); text-decoration: none; }
.btn-ghost {
  background: rgba(255, 224, 102, 0.05);
  border-color: var(--line-2);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 224, 102, 0.1); text-decoration: none; }

.hero-install {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13.4px;
  color: var(--text);
  background: #0a0806;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 8px 9px 8px 14px;
  max-width: 100%;
}
.hero-install .prompt { color: var(--accent); font-weight: 700; }
.hero-install code { color: var(--text); white-space: nowrap; }
.hero-install .copy { position: static; flex: none; }

.hero-meta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  color: var(--faint);
  font-family: var(--mono);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta b { color: var(--muted); font-weight: 500; }

/* big ascii F */
.glyph-block {
  font-family: var(--mono);
  font-size: clamp(15px, 2.55vw, 24px);
  line-height: 1.06;
  white-space: pre;
  color: var(--accent);
  text-shadow: 0 0 26px rgba(255, 224, 102, 0.30);
  margin: 0;
}
.art-right { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.art-caption {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --------------------------------------------------------- terminal demo */

.term {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13.3px;
  line-height: 1.72;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}
.term-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.term-title {
  margin-left: 8px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.term-body {
  padding: 16px 18px 18px;
  min-height: 336px;
  overflow-x: auto;
}
.term-body > div { white-space: pre-wrap; word-break: break-word; }

.ln { opacity: 0; animation: rise 0.34s ease forwards; }
.ln.on { opacity: 1; animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.t-prompt  { color: var(--accent); font-weight: 700; }
.t-user    { color: var(--text); }
.t-ans     { color: #d9d2c2; }
.t-mut     { color: var(--faint); }
.t-ok      { color: var(--green); }
.t-red     { color: var(--red); }
.t-warn    { color: var(--orange); }
.t-file    { color: var(--muted); }
.t-cmt     { color: var(--cyan); }
.t-cur     { color: var(--accent); animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.t-card {
  display: inline-block;
  border-left: 2px solid var(--line-2);
  padding-left: 10px;
}

.term-foot {
  border-top: 1px solid var(--line);
  padding: 10px 18px 12px;
  background: rgba(0, 0, 0, 0.22);
}
.term-foot .model-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--orange);
  font-size: 12.6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}
.term-foot .model-row .sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 159, 64, 0.28), transparent);
  transform: translateX(-100%);
  animation: sweep 3.6s ease-in-out infinite;
}
@keyframes sweep { 0% { transform: translateX(-100%);} 55%,100% { transform: translateX(100%);} }
.term-foot .status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.4px;
  color: var(--faint);
}
.term-foot .status b { color: var(--accent); font-weight: 600; }
.term-foot .status .eff { color: var(--orange); font-weight: 600; }

/* -------------------------------------------------------------- sections */

section { padding: 84px 0; position: relative; }
.sec-head { max-width: 640px; margin-bottom: 46px; }
.sec-head .kicker {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 14px;
}
h2 {
  font-size: clamp(1.6rem, 3.3vw, 2.4rem);
  line-height: 1.14;
  letter-spacing: -0.026em;
  font-weight: 720;
  margin: 0 0 14px;
}
.sec-head p { color: var(--muted); font-size: 1.03rem; margin: 0; }

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--line-2) 18%, var(--line-2) 82%, transparent);
}

/* features */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 16px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 224, 102, 0.028), rgba(255, 224, 102, 0.008));
  padding: 24px 22px;
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}
.card:hover {
  border-color: var(--line-2);
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(255, 159, 64, 0.06), rgba(255, 224, 102, 0.012));
}
.card .ic {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}
.card h3 {
  font-size: 1.04rem;
  margin: 0 0 8px;
  font-weight: 640;
  letter-spacing: -0.012em;
}
.card p { margin: 0; color: var(--muted); font-size: 0.945rem; line-height: 1.6; }
.card code {
  background: rgba(255, 224, 102, 0.09);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.85em;
  color: var(--accent);
  white-space: nowrap;
}

/* modes */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.mode {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.mode::before {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 2px;
  background: var(--line-2);
}
.mode.ask::before     { background: var(--faint); }
.mode.files::before   { background: var(--cyan); }
.mode.auto::before    { background: var(--orange); }
.mode.guard::before   { background: var(--red); }
.mode .tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 2px 8px;
  display: inline-block;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.25);
}
.mode h3 { font-size: 0.99rem; margin: 0 0 8px; font-weight: 640; }
.mode p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.58; }

/* code blocks */
.code {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0a0806;
  overflow: hidden;
}
.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.4px;
  line-height: 1.7;
  color: #e8e1d2;
}
.code .c { color: var(--faint); }
.code .k { color: var(--orange); }
.code .s { color: var(--green); }
.code .p { color: var(--accent); }

.copy {
  position: absolute;
  top: 9px; right: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 224, 102, 0.07);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 9px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.copy:hover { color: var(--text); background: rgba(255, 224, 102, 0.14); }
.copy.done { color: var(--green); border-color: rgba(134, 217, 138, 0.4); }

/* install steps */
.steps { display: grid; gap: 14px; counter-reset: s; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; align-items: start; }
.step > div { min-width: 0; }
.step .n {
  counter-increment: s;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
}
.step .n::before { content: counter(s); }
.step h4 { margin: 3px 0 10px; font-size: 0.99rem; font-weight: 640; }
.step p { margin: 0 0 12px; color: var(--muted); font-size: 0.93rem; }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 224, 102, 0.028); }
td code {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9em;
}
td .appr { font-family: var(--mono); font-size: 0.85em; color: var(--muted); }
td .yes { color: var(--orange); }
td .no  { color: var(--green); }

/* banner */
.banner {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 34px 30px;
  background:
    radial-gradient(600px 200px at 12% 0%, rgba(255, 159, 64, 0.12), transparent 60%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
}
.banner h2 { margin: 0 0 6px; font-size: 1.5rem; }
.banner p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* faq */
details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 0 20px;
  margin-bottom: 10px;
}
details[open] { border-color: var(--line-2); }
summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--orange);
  font-size: 1.15rem;
  line-height: 1;
  flex: none;
}
details[open] summary::after { content: "–"; }
details .answer { color: var(--muted); font-size: 0.93rem; padding-bottom: 18px; margin-top: -4px; }
details .answer p { margin: 0 0 10px; }
details .answer p:last-child { margin-bottom: 0; }

/* docs layout */
.docs { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 52px; align-items: start; }
.docs > * { min-width: 0; }
.toc {
  position: sticky;
  top: 88px;
  font-size: 13.6px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}
.toc .t { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.toc a { display: block; color: var(--muted); padding: 5px 0; }
.toc a:hover { color: var(--accent); text-decoration: none; }
.docs h2 { font-size: 1.62rem; margin-top: 8px; scroll-margin-top: 88px; }
.docs h3 { font-size: 1.06rem; margin: 30px 0 10px; font-weight: 650; scroll-margin-top: 88px; }
.docs p { color: var(--muted); }
.docs ul { color: var(--muted); padding-left: 20px; }
.docs ul li { margin-bottom: 7px; }
.docs ul li strong { color: var(--text); font-weight: 600; }
.docs code {
  background: rgba(255, 224, 102, 0.08);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.86em;
  color: var(--accent);
}
.docs .group { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.docs .group:last-child { border-bottom: 0; }

.note {
  border-left: 2px solid var(--orange);
  background: rgba(255, 159, 64, 0.06);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 0.93rem;
  margin: 18px 0;
}
.note strong { color: var(--text); }
.note.warn { border-left-color: var(--red); background: rgba(255, 143, 143, 0.055); }

/* footer */
footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 54px;
  margin-top: 40px;
  color: var(--faint);
  font-size: 13.6px;
}
.foot-grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: flex-start; }
.foot-brand { max-width: 340px; }
.foot-brand .brand { margin-bottom: 10px; }
.foot-brand p { margin: 0; color: var(--faint); }
.foot-links { display: flex; flex-wrap: wrap; gap: 40px; }
.foot-col h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 600;
}
.foot-col a { display: block; color: var(--faint); padding: 3px 0; }
.foot-col a:hover { color: var(--accent); text-decoration: none; }
.foot-base {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
}

/* reveal on scroll — the hidden state only applies when JS is running,
   so content stays visible without JS and in non-rendering crawlers. */
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 54px; }
  .art-right { order: -1; }
  .docs { grid-template-columns: 1fr; gap: 30px; }
  .toc { position: static; border-left: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; }
  .toc a { display: inline-block; margin-right: 16px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  section { padding: 62px 0; }
  .nav-links {
    display: none;
    position: absolute;
    top: 66px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 24px 18px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-links a.cta { margin-left: 0; text-align: center; margin-top: 6px; }
  .nav-toggle { display: block; }
  .term-body { min-height: 300px; font-size: 12.2px; }
  .banner { padding: 26px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
  .ln { opacity: 1; }
}

@media print {
  body::before, body::after, .site-header, .term-foot .sweep { display: none; }
}

/* ================================================================ polish
   Refresh pass: rhythm, contrast, skip link, header elevation, docs
   scrollspy, scrollbars and a dedicated small-screen layout.
   Still plain CSS — no build step, no dependencies. */

::selection { background: rgba(255, 224, 102, 0.26); color: #fffdf6; }

h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }

section { padding: var(--section-y) 0; }

/* keyboard skip link */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #14110a;
  font-weight: 650;
  font-size: 14px;
  transform: translateY(-180%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus {
  transform: none;
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 11, 8, 0.9), 0 0 0 5px var(--accent);
}

/* header gains depth once the page scrolls */
.site-header {
  transition: background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.site-header.scrolled {
  background: rgba(13, 11, 8, 0.94);
  border-bottom-color: var(--line-2);
  box-shadow: 0 18px 40px -34px rgba(0, 0, 0, 0.95);
}

/* hero */
.hero { padding-top: clamp(48px, 7vw, 82px); }
.hero-install { flex-wrap: wrap; row-gap: 6px; }
.hero-install code { min-width: 0; overflow-x: auto; }
.art-right { position: relative; }
.art-right::before {
  content: "";
  position: absolute;
  inset: -14% 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 224, 102, 0.16), transparent 72%);
  filter: blur(6px);
}

/* feature cards */
.card { position: relative; overflow: hidden; }
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.card:hover::after { opacity: 1; }
.card .ic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: rgba(255, 224, 102, 0.07);
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  text-shadow: 0 0 16px rgba(255, 224, 102, 0.35);
}
.card h3 { margin-bottom: 6px; }

/* mode cards */
.mode {
  transition: border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.mode:hover {
  border-color: var(--line-2);
  background: var(--panel-2);
  transform: translateY(-2px);
}

/* terminal sheen */
.term { position: relative; }
.term::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 102, 0.5), transparent);
  z-index: 2;
}

/* tables */
.tbl-wrap { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
tbody tr:nth-child(even) { background: rgba(255, 224, 102, 0.012); }
td { overflow-wrap: break-word; }
td code { overflow-wrap: anywhere; }

/* quiet scrollbars on overflow surfaces */
.code pre, .term-body, .tbl-wrap { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.code pre::-webkit-scrollbar,
.term-body::-webkit-scrollbar,
.tbl-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.code pre::-webkit-scrollbar-thumb,
.term-body::-webkit-scrollbar-thumb,
.tbl-wrap::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
.code pre::-webkit-scrollbar-track,
.term-body::-webkit-scrollbar-track,
.tbl-wrap::-webkit-scrollbar-track { background: transparent; }

/* docs table of contents: active section */
.toc a { position: relative; transition: color var(--dur) var(--ease); }
.toc a.active { color: var(--accent); }
.toc a.active::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 50%;
  width: 2px;
  height: 16px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--accent);
}
.docs h2 { margin-top: 4px; }

/* gentle stagger for card grids */
.grid .reveal:nth-child(3n + 2),
.modes .reveal:nth-child(2n) { transition-delay: 60ms; }
.grid .reveal:nth-child(3n),
.modes .reveal:nth-child(2n + 1) { transition-delay: 110ms; }

/* buttons */
.btn {
  transition: transform 0.12s var(--ease), background var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn-primary { box-shadow: 0 10px 30px -18px rgba(255, 224, 102, 0.7); }
.btn-primary:hover { box-shadow: 0 14px 34px -16px rgba(255, 224, 102, 0.85); }
.btn:focus-visible { outline-offset: 3px; }

footer a { transition: color var(--dur) var(--ease); }

/* ---------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .toc a.active::before { display: none; }
  .toc a.active { text-decoration: underline; text-underline-offset: 3px; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 18px; }
  .hero-sub { font-size: 1.02rem; max-width: none; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .hero-install { width: 100%; justify-content: space-between; }
  .hero-install code { font-size: 12.6px; }
  .hero-meta { font-size: 12px; gap: 6px 14px; }
  .term { font-size: 12px; }
  .term-body { padding: 14px; }
  .tbl-wrap { border-radius: 10px; }
  table { min-width: 520px; }
  .banner { flex-direction: column; align-items: flex-start; }
  .banner .btn { width: 100%; justify-content: center; }
  .foot-links { gap: 22px; }
  .step { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .step .n { width: 30px; height: 30px; }
}

@media print {
  .skip-link { display: none; }
}

/* ------------------------------------------------------------ fit guards */
.hero > * { min-width: 0; }
.hero-sub { max-width: min(33ch, 100%); overflow-wrap: break-word; }
.hero-meta { width: 100%; }
.hero-install { max-width: 100%; }
.glyph-block { max-width: 100%; overflow-x: auto; }
.term, .term-body { min-width: 0; max-width: 100%; }
.term-foot .model-row { min-width: 0; }
.tbl-wrap { max-width: 100%; }
h1.hero-title .grad { white-space: nowrap; }

/* slightly stronger section rhythm */
.rule {
  background: linear-gradient(90deg, transparent,
    rgba(255, 224, 102, 0.34) 18%,
    rgba(255, 224, 102, 0.34) 82%, transparent);
}

/* current page in the header nav */
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 224, 102, 0.06);
}

/* ---------------------------------------------------------- footer polish */
.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: start;
}
.foot-brand p { color: var(--muted); }
.foot-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, auto));
  gap: 48px;
}
.foot-col h5 { color: var(--text); }
.foot-col a { color: var(--muted); }
.foot-base { color: var(--muted); }

/* copy affordance: a little easier to read at a glance */
.copy { font-size: 12px; padding: 5px 10px; }

@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
}

/* progressive enhancement: controls that need JS stay hidden without it */
html:not(.js) .copy { display: none; }

/* keep the terminal visually connected to the hero above it */
section[aria-label="A sample flashlite session"] { padding-top: clamp(28px, 4vw, 52px); }
