/* nookos.dev — the marketing site wears the product's own skin.
   Palette lifted verbatim from frontend/packages/ui/src/global.css so the
   site and the app read as one system. Static, self-hosted, no CDN: the
   font stack is the app's stack and degrades to the platform's mono. */

:root {
  --bg: #0e1012;
  --bg-panel: #16181b;
  --bg-raised: #1d2024;
  --fg: #d8d5cf;
  --fg-bright: #ffffff;
  --fg-dim: #9aa0a9;
  --fg-faint: #6b717a;
  --accent: #f5b301;
  --border: #26292e;
  --border-bright: #3a3f46;
  --ok: #2dd4a7;
  --warn: #f5b301;
  --err: #ff5c5c;
  --info: #58a6ff;
  --selection: #2c2f35;
  --terminal-bg: #101214;

  --mono: "JetBrains Mono", "Cascadia Code", "Cascadia Mono", Consolas,
    Menlo, "DejaVu Sans Mono", "Noto Sans Mono", "IBM Plex Mono",
    ui-monospace, monospace;

  --radius: 8px;
  --glow: 0 0 8px rgba(245, 179, 1, 0.22);
  --glow-strong: 0 0 14px rgba(245, 179, 1, 0.4);

  --measure: 68ch;
  --gutter: 24px;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* The sticky masthead must not eat anchor targets. */
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

@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;
  }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.62;
  /* Nothing on this page is allowed to push the viewport sideways. */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--selection);
  color: var(--fg-bright);
}

/* The CRT is a whisper, not a costume: one fixed scanline wash at very low
   opacity, pointer-transparent, dropped entirely for reduced motion users
   who often also want reduced visual noise. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.014) 0px,
    rgba(255, 255, 255, 0.014) 1px,
    transparent 1px,
    transparent 3px
  );
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    display: none;
  }
}

a {
  color: var(--accent);
  text-decoration-color: rgba(245, 179, 1, 0.4);
  text-underline-offset: 3px;
}

a:hover {
  color: #ffc933;
  text-decoration-color: currentColor;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3,
h4 {
  color: var(--fg-bright);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(28px, 6.2vw, 58px);
}

h2 {
  font-size: clamp(23px, 3.6vw, 34px);
}

h3 {
  font-size: clamp(16px, 2vw, 19px);
}

p {
  max-width: var(--measure);
}

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

/* ── layout ─────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(56px, 9vw, 104px);
  border-top: 1px solid var(--border);
}

.section--flush {
  border-top: 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: var(--glow);
  margin-bottom: 14px;
}

.lede {
  color: var(--fg-dim);
  font-size: clamp(15px, 1.7vw, 17px);
  margin-top: 16px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #0b0c0d;
  padding: 10px 16px;
  z-index: 200;
  font-weight: 700;
}

.skip:focus {
  left: 8px;
  top: 8px;
}

/* ── masthead ───────────────────────────────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(14, 16, 18, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--fg-bright);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.brand__mark {
  color: var(--accent);
  text-shadow: var(--glow);
}

.brand__tag {
  color: var(--fg-faint);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The wordmark wins the fight for the top bar on small screens. */
@media (max-width: 560px) {
  .brand__tag {
    display: none;
  }
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav a {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 13px;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--accent);
}

.nav__cta {
  color: var(--accent) !important;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 5px 12px;
}

.nav__cta:hover {
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
}

@media (max-width: 780px) {
  .nav-toggle {
    display: inline-block;
  }

  .nav {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav[data-open="true"] {
    display: flex;
  }

  .nav a {
    padding: 13px var(--gutter);
    border-top: 1px solid var(--border);
    font-size: 14px;
  }

  .nav__cta {
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
  }
}

/* ── hero ───────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(44px, 7vw, 84px) clamp(48px, 8vw, 88px);
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 420px;
  background: radial-gradient(
    62% 100% at 18% 0%,
    rgba(245, 179, 1, 0.09),
    transparent 70%
  );
  pointer-events: none;
}

.hero__inner {
  position: relative;
}

.hero h1 {
  max-width: 20ch;
}

.hero h1 .amber {
  color: var(--accent);
  text-shadow: var(--glow);
}

.hero__sub {
  margin-top: 20px;
  font-size: clamp(15px, 1.9vw, 18px);
  color: var(--fg-dim);
  max-width: 60ch;
}

.hero__sub strong {
  color: var(--fg);
  font-weight: 700;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.badge {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  background: var(--bg-panel);
  white-space: nowrap;
}

.badge--accent {
  color: var(--accent);
  border-color: rgba(245, 179, 1, 0.35);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-bright);
  background: var(--bg-panel);
  color: var(--fg-bright);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  box-shadow: var(--glow);
  color: var(--fg-bright);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0c0d;
}

.btn--primary:hover {
  background: #ffc933;
  border-color: #ffc933;
  color: #0b0c0d;
  box-shadow: var(--glow-strong);
}

/* ── terminal ───────────────────────────────────────────────────────── */

.term {
  margin-top: 34px;
  background: var(--terminal-bg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding-inline: 12px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.06em;
}

.term__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(45, 212, 167, 0.5);
  flex: 0 0 auto;
}

.term__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term__meta {
  margin-left: auto;
  color: var(--fg-faint);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .term__meta {
    display: none;
  }
}

.term__body {
  margin: 0;
  padding: 16px 18px;
  /* Wide transcripts scroll inside the frame; the page never does. */
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.72;
  color: var(--fg);
  tab-size: 2;
}

@media (max-width: 480px) {
  .term__body {
    font-size: 12px;
    padding: 13px 14px;
  }
}

.term__body .cmd {
  color: var(--fg-bright);
  font-weight: 700;
}

.term__body .prompt {
  color: var(--accent);
  text-shadow: var(--glow);
}

.term__body .ok {
  color: var(--ok);
}

.term__body .dim {
  color: var(--fg-faint);
}

.term__body .out {
  color: var(--fg-dim);
}

.term__body .flag {
  color: var(--info);
}

.caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  vertical-align: text-bottom;
  background: var(--accent);
  box-shadow: var(--glow);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

/* ── boot sequence ──────────────────────────────────────────────────── */

.boot {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--fg-faint);
  margin-bottom: 22px;
  min-height: 5.2em;
  white-space: pre;
  overflow-x: auto;
}

.boot b {
  color: var(--ok);
  font-weight: 400;
}

.boot i {
  color: var(--accent);
  font-style: normal;
}

@media (max-width: 480px) {
  .boot {
    font-size: 11px;
  }
}

/* ── hero command as headline ───────────────────────────────────────── */

/* The headline is the command, so it breaks where a person would break it:
   the invocation on one line, its flags indented under it. Never mid-token —
   a split "--run / time" reads as a rendering bug, not a headline. */
.hero__cmd {
  font-size: clamp(17px, 3.4vw, 34px);
  line-height: 1.34;
  letter-spacing: -0.02em;
}

.hero__line {
  display: block;
}

.hero__line--cont {
  padding-left: 1.6ch;
  color: var(--fg);
}

.hero__cmd .tok-flag,
.hero__cmd .tok-arg {
  white-space: nowrap;
}

.hero__dollar {
  color: var(--accent);
  text-shadow: var(--glow-strong);
}

.hero__cmd .tok-flag {
  color: var(--info);
}

.hero__cmd .tok-arg {
  color: var(--accent);
  text-shadow: var(--glow);
}

.caret--h1 {
  width: 0.48em;
  height: 0.86em;
  margin-left: 0.18em;
  vertical-align: -0.04em;
}

/* ── the live shell ─────────────────────────────────────────────────── */

.term--live {
  margin-top: 34px;
}

.term--live .term__body {
  padding: 0;
  overflow: hidden;
  cursor: text;
}

.term__log {
  margin: 0;
  padding: 16px 18px 6px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 340px;
  font-size: 13px;
  line-height: 1.72;
  scrollbar-width: thin;
  scrollbar-color: var(--border-bright) transparent;
}

.term__log::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.term__log::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 4px;
}

.term__form {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 18px 15px;
}

.term__prompt {
  color: var(--accent);
  text-shadow: var(--glow);
  font-size: 13px;
  flex: 0 0 auto;
  cursor: text;
}

.term__input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--fg-bright);
  font-family: inherit;
  font-size: 13px;
  padding: 0;
  caret-color: var(--accent);
}

.term__input::placeholder {
  color: var(--fg-faint);
}

.term--live:focus-within {
  border-color: rgba(245, 179, 1, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), var(--glow);
}

.term__hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  max-width: none;
  margin: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  font-size: 12px;
  color: var(--fg-dim);
}

.chip {
  font-family: inherit;
  font-size: 11.5px;
  color: var(--fg-dim);
  background: var(--bg-raised);
  border: 1px solid var(--border-bright);
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer;
}

.chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 480px) {
  .term__log {
    font-size: 12px;
    padding: 13px 14px 6px;
    max-height: 260px;
  }
  .term__form {
    padding: 4px 14px 13px;
  }
  .term__hint {
    padding: 9px 14px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── code blocks ────────────────────────────────────────────────────── */

.code {
  position: relative;
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 16px;
}

.code pre {
  margin: 0;
  padding: 15px 17px;
  padding-right: 84px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg);
}

.code .prompt {
  color: var(--accent);
  user-select: none;
}

.code .comment {
  color: var(--fg-faint);
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: var(--bg-raised);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
}

.copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.copy[data-copied="true"] {
  color: var(--ok);
  border-color: var(--ok);
}

/* ── panels & grids ─────────────────────────────────────────────────── */

/* A grid/flex item's automatic minimum size is its content, so a wide
   transcript inside one shoves the whole page sideways no matter how many
   `overflow-x: auto` containers it sits in. min-width:0 is what actually
   lets the inner scroller do its job. */
.grid > *,
.shots > *,
.steps > *,
.step .code,
.step .code pre,
.panel,
.term,
.term__body,
.code,
.code pre {
  min-width: 0;
}

.grid {
  display: grid;
  gap: 16px;
  margin-top: 36px;
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.panel h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}

.panel h3::before {
  content: "▸";
  color: var(--accent);
  font-size: 13px;
  flex: 0 0 auto;
}

.panel p {
  color: var(--fg-dim);
  font-size: 14px;
}

.panel code {
  color: var(--accent);
  font-size: 0.92em;
}

/* ── numbered steps ─────────────────────────────────────────────────── */

.steps {
  list-style: none;
  counter-reset: step;
  margin-top: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.step {
  counter-increment: step;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.step__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.step__head::before {
  content: counter(step, decimal-leading-zero);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  text-shadow: var(--glow);
  flex: 0 0 auto;
}

.step p {
  color: var(--fg-dim);
  font-size: 14px;
  margin-top: 7px;
}

.step .code {
  margin-top: 13px;
}

/* ── shots ──────────────────────────────────────────────────────────── */

.shots {
  display: grid;
  gap: 26px;
  margin-top: 36px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.shot {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shot--wide {
  grid-column: 1 / -1;
}

.shot img {
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: var(--terminal-bg);
}

.shot figcaption {
  padding: 15px 18px;
  font-size: 13px;
  color: var(--fg-dim);
}

.shot figcaption b {
  display: block;
  color: var(--fg-bright);
  font-size: 14px;
  margin-bottom: 3px;
}

/* ── callout ────────────────────────────────────────────────────────── */

.callout {
  border: 1px solid rgba(245, 179, 1, 0.32);
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    rgba(245, 179, 1, 0.06),
    rgba(245, 179, 1, 0.015)
  );
  padding: 26px;
  margin-top: 32px;
}

.callout p {
  color: var(--fg);
  max-width: 74ch;
}

.callout p + p {
  margin-top: 12px;
}

/* ── table ──────────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  margin-top: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 13.5px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg-raised);
  color: var(--fg-bright);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td code {
  color: var(--accent);
}

td:first-child {
  color: var(--fg);
  white-space: nowrap;
}

/* ── faq ────────────────────────────────────────────────────────────── */

.faq {
  margin-top: 30px;
  display: grid;
  gap: 10px;
}

details {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 20px;
}

details[open] {
  border-color: var(--border-bright);
}

summary {
  cursor: pointer;
  padding: 16px 0;
  color: var(--fg-bright);
  font-weight: 700;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 11px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  color: var(--accent);
  font-weight: 700;
  flex: 0 0 auto;
}

details[open] summary::before {
  content: "−";
}

details p {
  color: var(--fg-dim);
  font-size: 14px;
  padding-bottom: 18px;
}

details p + p {
  margin-top: -8px;
  padding-bottom: 18px;
}

/* ── final cta ──────────────────────────────────────────────────────── */

.finale {
  text-align: center;
  padding-block: clamp(64px, 10vw, 116px);
}

.finale p {
  margin-inline: auto;
}

.finale .cta-row {
  justify-content: center;
}

/* ── footer ─────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding-block: 34px 46px;
  color: var(--fg-faint);
  font-size: 13px;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
}

.footer a {
  color: var(--fg-dim);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

.footer__legal {
  margin-left: auto;
}

@media (max-width: 640px) {
  .footer__legal {
    margin-left: 0;
  }
}

/* ── reveal ─────────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ── 360px ──────────────────────────────────────────────────────────── */

@media (max-width: 420px) {
  :root {
    --gutter: 16px;
  }

  .panel,
  .step,
  .callout {
    padding: 18px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
