/* ============================================================
   tuiboard — landing
   Reduced-motion is the PRIMARY render path: every element is at
   its final, visible state by default. Animations are added only
   when JS confirms motion is allowed (html.motion). The blinking
   cursor is pure CSS gated on prefers-reduced-motion.
   ============================================================ */

/* ---- Fonts (self-hosted JetBrains Mono; falls back to system mono) ---- */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-700.woff2") format("woff2");
}

:root {
  --bg: #0b0d10;
  --bg-raised: #0d1117;
  --hair: #1c2128;
  --text: #e6edf3;
  --dim: #8b94a0;            /* lifted from #6e786e for AA on dark */
  --dimmer: #6e786e;
  --blue: #7eb6d6;
  --orange: #e8a05c;
  --yellow: #eaf6ad;
  --green: #7fae7f;
  --cta-text: #0b0d10;
  --glow-blue: rgba(126,182,214,0.16);
  --glow-yellow: rgba(234,246,173,0.30);
  --scanline: rgba(255,255,255,0.02);
  --mono: "JetBrains Mono", "JetBrainsMono Nerd Font", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --maxw: 1120px;
}

* { 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;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #1c2128; color: var(--text); }

a { color: inherit; text-decoration: none; }

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

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--yellow); color: var(--cta-text); padding: 8px 14px;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---- shared cursor ---- */
.cursor { color: var(--yellow); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .cursor { animation: blink 1.1s steps(2, end) infinite; }
}
@keyframes blink { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---- buttons ---- */
.btn {
  display: inline-block;
  font: inherit; font-weight: 500;
  padding: 9px 16px;
  border: 1px solid var(--hair);
  background: transparent; color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--yellow); color: var(--cta-text); border-color: var(--yellow); font-weight: 700; }
.btn--primary:hover { background: #f2fbc0; }
.btn--blue { color: var(--blue); border-color: var(--blue); }
.btn--blue:hover { background: rgba(126,182,214,0.10); }
.btn--dim { color: var(--dim); border-color: var(--hair); }
.btn--dim:hover { color: var(--text); border-color: var(--dim); }
.btn--lg { padding: 12px 22px; font-size: 17px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cta-row--quiet { margin-top: 30px; justify-content: center; }
/* Hero: keep the three buttons on one line once there's room (phones still wrap). */
.hero .cta-row .btn { padding: 9px 13px; }
@media (min-width: 560px) { .hero .cta-row { flex-wrap: nowrap; } }

.eyebrow { color: var(--dim); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 500; margin: 0 0 12px; }
h2 { font-size: clamp(22px, 3vw, 32px); line-height: 1.2; font-weight: 700; margin: 0 0 16px; letter-spacing: -0.01em; }
.sub { color: var(--text); opacity: .82; }
.note { color: var(--dim); font-size: 13.5px; margin-top: 10px; }
.caption { color: var(--dim); font-size: 13.5px; }
.maker { color: var(--dim); font-style: italic; font-size: 14px; }
.bul { list-style: none; padding: 0; margin: 18px 0 0; }
.bul li { position: relative; padding-left: 22px; margin: 9px 0; color: var(--text); opacity: .92; }
.bul li::before { content: "›"; position: absolute; left: 2px; color: var(--yellow); font-weight: 700; }
.bul code, p code, h2 code { color: var(--yellow); background: rgba(234,246,173,0.06); padding: 0 4px; border-radius: 2px; font-size: .92em; }

/* ============================== HERO ============================== */
.hero { position: relative; overflow: clip; padding: clamp(40px, 7vh, 90px) 0 clamp(48px, 8vh, 96px); min-height: 100svh; display: flex; align-items: center; }
.hero__scanline { position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, var(--scanline) 2px 3px); }
.hero__glow { position: absolute; right: -10%; top: 20%; width: 60%; height: 60%; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, var(--glow-blue), transparent); filter: blur(8px); }
.hero__grid { position: relative; z-index: 1; display: grid; gap: clamp(32px, 5vw, 56px); align-items: center; width: 100%; }
@media (min-width: 1024px) { .hero__grid { grid-template-columns: 46% 54%; } }

.wordmark-h1 { margin: 0; }
.wordmark {
  display: inline-block; margin: 0; color: var(--yellow);
  font-size: clamp(8px, 2.4vw, 15px); line-height: 1; letter-spacing: 0;
  text-shadow: 0 0 6px var(--glow-yellow);
  overflow-x: clip; white-space: pre;
}
.bootline { color: var(--dim); font-size: 13.5px; margin: 16px 0 26px; white-space: nowrap; overflow: hidden; }
.lede { font-size: clamp(26px, 4vw, 42px); line-height: 1.16; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 16px; color: var(--text); }
.hero .sub { font-size: 17px; max-width: 58ch; margin: 0 0 26px; }

.install-line {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  border: 1px solid var(--hair); background: var(--bg-raised);
  padding: 12px 14px; max-width: 520px;
}
.install-line--center { margin: 22px auto 24px; }
.install-line__code { font-size: 15px; color: var(--text); overflow-x: auto; }
.prompt, .pkg { color: var(--yellow); }
.copybtn {
  font: inherit; font-size: 13px; color: var(--dim);
  background: transparent; border: 1px solid var(--hair); padding: 4px 9px; cursor: pointer;
  white-space: nowrap; transition: color .12s, border-color .12s;
}
.copybtn:hover { color: var(--text); border-color: var(--dim); }
.copybtn.is-done { color: var(--yellow); border-color: var(--yellow); }

/* ---- faux terminal ---- */
.term { border: 1px solid var(--hair); background: var(--bg-raised); border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 24px 60px -30px rgba(126,182,214,.25); overflow: hidden; }
.term__bar { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-bottom: 1px solid var(--hair); background: #0a0c0f; }
.term__dots { display: inline-flex; gap: 6px; }
.term__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--hair); display: inline-block; }
.term__tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.term__tab { font: inherit; font-size: 12.5px; color: var(--dim); background: transparent; border: 0; padding: 3px 8px; cursor: pointer; border-radius: 3px; }
.term__tab:hover { color: var(--text); }
.term__tab.is-active { color: var(--yellow); background: rgba(234,246,173,0.06); }
.term__file { color: var(--dim); font-size: 12px; }
.termframe--flagship { box-shadow: 0 0 0 1px rgba(126,182,214,.18), 0 20px 60px -34px rgba(126,182,214,.4); }
/* Fixed height (not min-height) so every panel — including the taller agenda —
   occupies the exact same box: switching tabs no longer nudges the layout. */
.term__body { padding: 16px; height: 264px; overflow: hidden; font-size: 13px; position: relative; }
.panel { display: none; }
.panel.is-active { display: block; }
.panel__prompt { margin-top: 12px; color: var(--dim); }
.panel__hint { margin-top: 10px; color: var(--dim); font-size: 12px; }
.term__cap { color: var(--dimmer); font-size: 12.5px; text-align: center; margin-top: 12px; }

.kb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kb__h { color: var(--dim); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.kb__c { border: 1px solid var(--hair); border-left: 2px solid var(--blue); padding: 6px 8px; margin-bottom: 7px; color: var(--text); font-size: 12px; line-height: 1.4; }
.kb__c.done { color: var(--dim); border-left-color: var(--green); }
.em { font-size: 12px; }

.pl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pl__h { color: var(--yellow); font-weight: 500; margin-bottom: 10px; font-size: 12.5px; }
.pl__r { color: var(--text); margin: 6px 0; font-size: 12.5px; }
.pl__r .t { color: var(--dim); margin-right: 8px; }

.ag__row { display: flex; align-items: center; gap: 10px; height: 40px; border-top: 1px dashed var(--hair); }
.ag__t { color: var(--dim); width: 22px; font-size: 12px; }
.ag__rail { flex: 1; }
.ag__ev { flex: 1; padding: 4px 8px; font-size: 12px; border-left: 2px solid; }
.ev--g { color: var(--blue); border-color: var(--blue); background: rgba(126,182,214,.07); }
.ev--m { color: var(--orange); border-color: var(--orange); background: rgba(232,160,92,.07); }

.agts__r { display: flex; align-items: center; gap: 10px; padding: 7px 8px; font-size: 12.5px; color: var(--text); }
.agts__r.is-sel { background: rgba(234,246,173,0.05); border-left: 2px solid var(--yellow); }
.agts__r .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.agts__r .br { color: var(--blue); }
.agts__r .ago { color: var(--dim); margin-left: auto; }
.agts__r .resume { color: var(--yellow); margin-left: auto; }

/* ============================== TRUST STRIP ============================== */
.trust { background: var(--bg-raised); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 26px 20px; }
.trust__list { list-style: none; margin: 0 auto; padding: 0; max-width: 780px; }
.trust__list li { white-space: pre; overflow-x: auto; font-size: 13.5px; line-height: 2; color: var(--dim); }
.trust__list .ok { color: var(--green); font-weight: 500; }
.trust__list .k { color: var(--text); }
.trust__list .d { color: var(--dim); }
@media (max-width: 640px) {
  .trust__list li { white-space: normal; line-height: 1.5; margin-bottom: 12px; }
  .trust__list .k, .trust__list .d { display: block; }
}

/* ============================== FEATURES ============================== */
.feat { padding: clamp(60px, 10vh, 120px) 0; }
.feat__grid { display: grid; gap: clamp(28px, 4vw, 56px); align-items: center; }
@media (min-width: 900px) {
  .feat__grid { grid-template-columns: 1fr 1fr; }
  .feat--rev .feat__grid > .feat__visual { order: -1; }
}
.wrap--flush { padding-inline: 0; }
.feat__head { margin-bottom: 24px; }
.feat__copy h2 { margin-top: 0; }
.feat__copy p { color: var(--text); opacity: .9; }

.codeproof { margin-top: 20px; border: 1px solid var(--hair); background: #0a0c0f; }
.codeproof pre { margin: 0; padding: 14px 16px; font-size: 12.5px; line-height: 1.7; color: var(--dim); overflow-x: auto; border-top: 2px solid var(--hair); border-bottom: 2px solid var(--hair); }

.callout { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; border: 1px solid var(--hair); border-left: 3px solid var(--orange); background: rgba(232,160,92,.05); padding: 12px 16px; margin: 4px 0 28px; }
.callout__tag { color: var(--orange); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.callout__dot { font-size: 9px; vertical-align: middle; }
.callout > span:last-child { color: var(--text); }

.maker { margin-top: 18px; }

/* screenshots */
.shot { margin: 0; border: 1px solid var(--dim); border-radius: 4px; overflow: hidden; background: var(--bg-raised); }
.shot--flagship { box-shadow: 0 0 0 1px rgba(126,182,214,.18), 0 20px 60px -34px rgba(126,182,214,.4); }
.shot__bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--hair); background: #0a0c0f; }
.shot__name { color: var(--dim); font-size: 12px; }
.shot__img { position: relative; width: 100%; aspect-ratio: 16 / 10; background: var(--bg); }
.shot__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.shot__placeholder { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--dimmer); font-size: 13px; }
.shot__img.is-empty img { display: none; }
.shot__img.is-empty .shot__placeholder { display: flex; }

/* ============================== SHOWCASE ============================== */
.showcase { padding: clamp(40px, 7vh, 80px) 0; }
.showcase__frame {
  max-width: 1000px; margin-inline: auto;
  /* the screenshot is background-free (matches the page), so a soft glow lets
     the terminal "float" off the page instead of blending into it. */
  box-shadow:
    0 0 0 1px var(--hair),
    0 30px 90px -45px rgba(126, 182, 214, 0.45),
    0 0 80px -24px rgba(234, 246, 173, 0.10);
}
.showcase__img { position: relative; width: 100%; background: var(--bg); }
.showcase__img img { display: block; width: 100%; height: auto; }
.showcase__img.is-empty { aspect-ratio: 1600 / 873; }
.showcase__img.is-empty img { display: none; }
.showcase__img .shot__placeholder { display: none; }
.showcase__img.is-empty .shot__placeholder { display: flex; }

/* ============================== COMPOSE ============================== */
.compose { padding: clamp(60px, 9vh, 110px) 0; border-top: 1px solid var(--hair); }
.compose__inner { max-width: 640px; margin-inline: auto; text-align: center; }
.compose__inner .sub { margin: 0 auto 28px; max-width: 60ch; }
.toggles { display: inline-block; border: 1px solid var(--hair); background: var(--bg-raised); padding: 16px 22px; text-align: left; }
.toggles pre { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--text); }
.toggles .tg { color: var(--green); }

/* ============================== INSTALL ============================== */
.install { padding: clamp(60px, 9vh, 110px) 0; border-top: 1px solid var(--hair); }
.install__inner { max-width: 720px; margin-inline: auto; }
.install .feat__head { text-align: left; }
.cmd { border: 1px solid var(--hair); background: var(--bg-raised); margin-bottom: 16px; }
.cmd--primary { border-left: 2px solid var(--yellow); }
.cmd__tab { display: inline-block; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; padding: 7px 14px 0; }
.cmd__body { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 14px 12px; }
.cmd__body code { font-size: 15px; overflow-x: auto; }
.cmd__note { color: var(--dim); font-size: 12.5px; margin: 0 0 10px; padding: 0 14px; }
.install__foot { margin-top: 22px; line-height: 1.7; }

/* ============================== FINAL ============================== */
.final { padding: clamp(70px, 11vh, 130px) 0; border-top: 1px solid var(--hair); text-align: center; }
.final__inner { max-width: 680px; margin-inline: auto; }
.final h2 { font-size: clamp(24px, 3.4vw, 36px); }
.final .sub { margin: 0 auto 8px; max-width: 56ch; }
.maker--center { text-align: center; margin-top: 24px; }
.maker--center a { color: var(--blue); }
.maker--center a:hover { text-decoration: underline dotted; }

/* ============================== FOOTER ============================== */
.foot { border-top: 1px solid var(--hair); background: var(--bg); padding-top: 40px; }
.foot__top { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; padding-bottom: 30px; }
.foot__mark { color: var(--yellow); font-weight: 700; font-size: 17px; }
.foot__tag { color: var(--dim); font-size: 13px; margin: 8px 0 0; max-width: 36ch; }
.foot__links { display: flex; flex-direction: column; gap: 8px; }
.foot__links a { color: var(--dim); font-size: 13.5px; }
.foot__links a:hover { color: var(--blue); text-decoration: underline dotted; }
.foot__links .g { color: var(--dimmer); margin-right: 4px; }
.foot__bottom { border-top: 1px solid var(--hair); padding: 16px 0 26px; color: var(--dimmer); font-size: 12.5px; }
@media (max-width: 640px) { .foot__bottom { line-height: 1.6; } }

/* ============================================================
   MOTION LAYER — only active when html.motion is set by JS
   (i.e. NOT reduced-motion). Default state above is final/visible.
   ============================================================ */
html.motion [data-reveal],
html.motion [data-reveal-group] > * {
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
}
html.motion [data-reveal].is-in,
html.motion [data-reveal-group].is-in > * { opacity: 1; transform: none; }
html.motion [data-reveal-group].is-in > *:nth-child(2) { transition-delay: .06s; }
html.motion [data-reveal-group].is-in > *:nth-child(3) { transition-delay: .12s; }
html.motion [data-reveal-group].is-in > *:nth-child(4) { transition-delay: .18s; }

html.motion .shot { border-color: var(--dim); transition: border-color .4s ease; }
html.motion .shot.is-in { border-color: var(--blue); }

html.motion .trust__list .ok { color: var(--dimmer); transition: color .3s ease; }
html.motion .trust__list.is-in li:nth-child(1) .ok { color: var(--green); transition-delay: 0s; }
html.motion .trust__list.is-in li:nth-child(2) .ok { color: var(--green); transition-delay: .08s; }
html.motion .trust__list.is-in li:nth-child(3) .ok { color: var(--green); transition-delay: .16s; }
html.motion .trust__list.is-in li:nth-child(4) .ok { color: var(--green); transition-delay: .24s; }
html.motion .trust__list.is-in li:nth-child(5) .ok { color: var(--green); transition-delay: .32s; }
html.motion .trust__list.is-in li:nth-child(6) .ok { color: var(--green); transition-delay: .40s; }

html.motion .toggles .tg { color: var(--dimmer); transition: color .25s ease; }
html.motion .toggles.is-in .tg[data-on="1"] { color: var(--green); }

/* hero boot reveal (motion only) */
html.motion .wordmark.is-booting { clip-path: inset(0 0 100% 0); }
html.motion .wordmark.is-revealed { clip-path: inset(0 0 0 0); transition: clip-path .6s steps(8, end); }
html.motion .bootline.is-booting { clip-path: inset(0 100% 0 0); }
html.motion .bootline.is-revealed { clip-path: inset(0 0 0 0); transition: clip-path .7s steps(26, end); }
