/* The deck's palette, from internal/deck/styles.go. Dark only: the deck
   draws for a dark terminal whatever the client says. */
:root {
  --ink: #0B0F14;
  --ink-2: #0E141B;
  --cyan: #00F0FF;
  --cyanmid: #00A3B5;
  --cyanlo: #0A5A66;
  --magenta: #FF2A6D;
  --dim: #5C6B73;
  --mute: #8D9EA8;
  --amber: #FFB000;
  --red: #FF3B3B;
  --green: #39FF14;
  --greenlo: #1B7A0F;
  --white: #E6F1FF;
  --mono: "JetBrains Mono", "Fira Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 16px; }

/* Header: the deck's own top bar. */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--ink);
  display: flex; align-items: center; gap: 1ch;
  padding: 10px 0 8px;
  white-space: nowrap;
}
.title { background: var(--cyan); color: var(--ink); font-weight: bold; padding: 0 1ch; }
.topbar .line { flex: 1; border-top: 1px solid var(--cyanlo); margin-top: 2px; min-width: 2ch; }
.topbar .dim, .dim { color: var(--dim); }
.topbar nav a { color: var(--cyan); }
.topbar nav a.here { color: var(--white); }
.topbar nav .sep { color: var(--dim); }

/* Hero: the deck's attract screen, drawn live at the size of the
   viewport (deck.js), the capture standing in without script. */
.hero {
  position: relative;
  margin: 0 calc(50% - 50vw);
  height: calc(100svh - 44px);
  min-height: 420px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
}
.hero .screen { border: 0; background: transparent; box-shadow: none; padding: 0; }
.hero .screen::after { display: none; }
#sky { display: block; position: absolute; inset: 0; cursor: pointer; }
#boot { position: absolute; top: 12px; left: 16px; font-size: clamp(9px, 1.6vw, 15px); }
#boot:not([hidden]) ~ #attract, #boot:not([hidden]) ~ .hero-small { visibility: hidden; }
.logo-row { text-shadow: 0 0 14px rgba(0, 240, 255, .45), 0 0 2px rgba(0, 240, 255, .6); }
.press { color: var(--magenta); }
.press:hover { color: var(--white); text-decoration: none; }
.hero-small { display: none; text-align: center; padding: 0 16px; }
.hero-small .logo-text { color: var(--cyan); font-size: clamp(1.3rem, 6.5vw, 2rem); font-weight: bold; text-shadow: 0 0 14px rgba(0, 240, 255, .45); }
.hero-small .tag, .hero-small .by { color: var(--dim); font-size: .85em; }
.hero-small .epi { color: var(--white); margin: 14px 0 4px; }
.hero-small .press { display: inline-block; margin-top: 18px; }

.lead {
  text-align: center;
  padding: 18px 0 8px;
}
.cmd {
  display: inline-flex; align-items: baseline; gap: 1ch; flex-wrap: wrap;
  border: 1px solid var(--cyanlo);
  background: var(--ink-2);
  padding: .55em 1em;
  font-size: clamp(1rem, 2.8vw, 1.5rem);
  max-width: 100%;
  text-align: left;
}
.cmd .ps { color: var(--magenta); font-weight: bold; }
.cmd code { color: var(--white); }
.copy {
  font: inherit; font-size: .75em;
  background: none; border: 0; color: var(--dim); cursor: pointer;
  padding: 0; margin-left: .5ch;
}
.copy:hover { color: var(--cyan); }
.lead p { color: var(--mute); margin: .8em 0 0; }

/* Sections read like a session: a prompt line, a screen, the words. */
section { padding: 34px 0 6px; }
section h2 {
  font-size: 1.15rem; font-weight: normal; margin: 0 0 14px;
  color: var(--white);
}
section h2::before { content: "> "; color: var(--magenta); font-weight: bold; }
.rule {
  color: var(--cyanlo); white-space: nowrap; overflow: hidden;
  margin: 0 0 8px; letter-spacing: 0; user-select: none;
}
.rule b { color: var(--dim); font-weight: normal; }

p { margin: .7em 0; max-width: 80ch; }
.muted { color: var(--mute); }
.cap { color: var(--mute); margin: 6px 0 22px; max-width: none; }
.cap b { color: var(--white); font-weight: normal; }
kbd {
  font: inherit; color: var(--ink); background: var(--cyanmid);
  padding: 0 .4ch; border-radius: 2px;
}
code { font: inherit; color: var(--cyan); }
.amber { color: var(--amber); }
.green { color: var(--green); }
.cyan { color: var(--cyan); }
.magenta { color: var(--magenta); }

/* Captured deck screens. The font shrinks so --cols columns fit the
   viewport; below that the frame scrolls sideways, the page never does. */
.screen {
  --cols: 100;
  position: relative;
  margin: 0;
  padding: .7em 1ch;
  background: var(--ink-2);
  border: 1px solid #142129;
  box-shadow: 0 0 40px rgba(0, 240, 255, .035) inset;
  font-family: var(--mono);
  font-size: clamp(6px, calc((100vw - 36px) / (var(--cols) * 0.615)), 14px);
  line-height: 1.22;
  white-space: pre;
  overflow-x: auto;
  color: var(--white);
  font-variant-ligatures: none;
  tab-size: 8;
}
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px);
}
.hero .screen::after { display: none; }
.c-cyan { color: var(--cyan); }
.c-cyanmid { color: var(--cyanmid); }
.c-cyanlo { color: var(--cyanlo); }
.c-magenta { color: var(--magenta); }
.c-dim { color: var(--dim); }
.c-amber { color: var(--amber); }
.c-red { color: var(--red); }
.c-green { color: var(--green); }
.c-greenlo { color: var(--greenlo); }
.c-white { color: var(--white); }
.c-ink { color: var(--ink); }
.b-cyan { background: var(--cyan); }
.b-cyanlo { background: var(--cyanlo); }
.b-dim { background: var(--dim); }
.b-red { background: var(--red); }
.bold { font-weight: bold; }

/* Two screens side by side when there is room. */
.pair { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1100px) {
  .pair { grid-template-columns: 1fr 1fr; }
  .pair .screen { font-size: clamp(6px, calc((100vw - 60px) / 2 / (var(--cols) * 0.615)), 12px); }
}

/* The node legend, in the editor's own glyphs. */
.nodes { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); max-width: none; }
.nodes li { color: var(--mute); }
.nodes .g { color: var(--cyan); display: inline-block; width: 1.5ch; }
.nodes .k { color: var(--white); }

/* Phases: the sky, in order. */
.phases { list-style: none; padding: 0; margin: 16px 0 0; border-left: 1px solid var(--cyanlo); }
.phases li { padding: 6px 0 10px 18px; position: relative; }
.phases li::before { content: "·"; color: var(--cyanlo); position: absolute; left: -3px; top: 6px; }
.phases .n { color: var(--dim); }
.phases .name { color: var(--cyan); }
.phases q { display: block; color: var(--white); quotes: none; max-width: 72ch; }
.phases .by { color: var(--dim); font-size: .9em; }

/* Commands. */
.cmds { width: 100%; border-collapse: collapse; margin-top: 8px; }
.cmds td { padding: 2px 0; vertical-align: top; }
.cmds td:first-child { color: var(--cyan); white-space: nowrap; padding-right: 3ch; }
.cmds td:last-child { color: var(--mute); }
.cmds tr.key td:first-child::before { content: "* "; color: var(--dim); }
.cmds tr:not(.key) td:first-child::before { content: "  "; }

footer { padding: 40px 0 56px; color: var(--mute); }
footer p { max-width: 80ch; }
footer .small { font-size: .9em; color: var(--dim); }

/* Status: the deck's bottom bar, kept honest by the clock alone. */
.status {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--ink); border-top: 1px solid var(--cyanlo);
  padding: 4px 16px; color: var(--dim); font-size: .85em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status b { color: var(--mute); font-weight: normal; }
body.has-status { padding-bottom: 34px; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { font-size: .9em; }
  .topbar .host { display: none; }
  section { padding-top: 26px; }
  /* without script, the deck's small-terminal hero stands in for the capture */
  html:not(.js) #attract { display: none; }
  html:not(.js) .hero-small { display: block; }
  .copy { display: none; }
  .status { white-space: normal; line-height: 1.35; }
  body.has-status { padding-bottom: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
html { scroll-behavior: smooth; }
