/* Tutyr — terminal site
   No build step, no framework, one stylesheet. JetBrains Mono is the only
   external request on the page; everything falls back to the system mono
   stack if Google Fonts is blocked or slow. */

:root {
  --bg: #0a0a0a;
  --bg-deep: #060606;
  --panel: #0e100e;
  --panel-hi: #131613;
  --bar: #111311;

  --fg: #d3e8da;          /* body text — green-tinted white */
  --green: #3bf58c;       /* prompts, the machine's voice */
  --green-dim: #2ba360;
  --purple: #b57cff;      /* the student's voice, links, brand */
  --purple-dim: #8b5cf6;
  --amber: #ffc857;       /* notes and warnings */
  --muted: #6f8577;

  --border: #1d2620;
  --border-hi: #2a3a30;

  --wrap: 860px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg-deep);
}

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

/* Faint CRT scanlines. Static, cheap, and skippable. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0 1px,
    transparent 1px 3px
  );
}

a { color: var(--purple); text-decoration: none; border-bottom: 1px solid var(--purple-dim); }
a:hover { color: #d5b3ff; }

::selection { background: var(--green-dim); color: #041008; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 18px;
}

.narrow { max-width: 720px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================ window chrome ============================ */

.chrome {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.tdots { display: flex; gap: 6px; flex: none; }
.tdot { width: 11px; height: 11px; border-radius: 50%; background: #262a26; }
.tdot:nth-child(1) { background: #ff5f57; }
.tdot:nth-child(2) { background: #febc2e; }
.tdot:nth-child(3) { background: #28c840; }

.chrome-title {
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chrome-title b { color: var(--fg); font-weight: 700; }

.chrome-link {
  flex: none;
  color: var(--green);
  border-bottom: none;
  font-size: 12.5px;
}
.chrome-link:hover { color: #7dffb8; }

/* ============================= hero terminal ========================== */

.hero { padding: 26px 0 8px; }

.term {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(59, 245, 140, 0.05), 0 18px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.term-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.term-body {
  padding: 16px 14px 12px;
  min-height: 255px;
  max-height: 62vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}

.term-body::-webkit-scrollbar { width: 8px; }
.term-body::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }

.line { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }
.line:last-child { margin-bottom: 0; }

.boot { color: var(--muted); font-size: 13.5px; }
.boot b { color: var(--green); font-weight: 400; }

.gap { height: 12px; }

/* transcript rows */
.row { margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; }
.row .who { user-select: none; }

.row-you .who { color: var(--purple); }
.row-you { color: #efe6ff; }

.row-tutyr .who { color: var(--green); }
.row-tutyr { color: var(--fg); }

.row-sys { color: var(--muted); font-size: 13.5px; }
.row-err { color: var(--amber); font-size: 13.5px; }

.thinking { color: var(--green-dim); }

/* the prompt line the student types on */
.inputline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel-hi);
}

.inputline[hidden] { display: none; }

.inputline .who { color: var(--purple); flex: none; user-select: none; }

#cmd {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #efe6ff;
  font: inherit;
  caret-color: var(--purple);
  padding: 0;
}

#cmd::placeholder { color: #4c5a51; }

/* blinking block cursor */
.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--green);
  animation: blink 1.1s step-end infinite;
}

.cursor-purple { background: var(--purple); }

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

/* download nudge that appears mid-conversation */
.nudge {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px dashed var(--green-dim);
  border-radius: 4px;
  background: rgba(59, 245, 140, 0.045);
}

.nudge p { margin: 0 0 10px; color: var(--fg); font-size: 14px; }

/* The turn-3 download, dressed as a command line rather than a web button —
   it sits inside the transcript, so it should read like the next thing you'd
   type, not like an ad dropped into the terminal. */
.dl-cmd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--green-dim);
  border-radius: 3px;
  background: rgba(59, 245, 140, 0.07);
  color: var(--green);
  font: inherit;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-bottom: 1px solid var(--green-dim);
  transition: background 120ms ease, color 120ms ease;
}

.dl-cmd:hover,
.dl-cmd:focus-visible {
  background: rgba(59, 245, 140, 0.16);
  color: #7dffb8;
}

.dl-cmd .dl-prompt { color: var(--purple); user-select: none; }

/* The caret rides along inside the button; it shouldn't eat the click. */
.dl-cmd .cursor { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .dl-cmd .cursor { animation: none; }
}

/* ============================== buttons =============================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid var(--green-dim);
  border-radius: 3px;
  background: rgba(59, 245, 140, 0.09);
  color: var(--green);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--green-dim);
}

.btn:hover { background: rgba(59, 245, 140, 0.18); color: #8dffc0; }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.btn-lg { padding: 11px 20px; font-size: 15px; }

.os-icon { width: 17px; height: 17px; flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

/* ============================== sections ============================== */

.section { padding: 34px 0 6px; }

.cmdline {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--fg);
  scroll-margin-top: 60px;
}

.cmdline .who { color: var(--green); user-select: none; }
.cmdline b { font-weight: 700; color: #fff; }

.blurb { color: var(--muted); margin: 0 0 18px; }

.steps { margin: 0; padding: 0; list-style: none; }

.step {
  padding: 13px 0 13px 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 4.2em 1fr;
  gap: 4px 14px;
}

.step:last-child { border-bottom: 1px solid var(--border); }

.step .n { color: var(--green-dim); }
.step h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--fg); }
.step p { margin: 4px 0 0; color: var(--muted); grid-column: 2; }

.facts { margin: 0; padding: 0; list-style: none; }

.facts li {
  position: relative;
  padding: 0 0 12px 22px;
  color: var(--muted);
}

.facts li::before {
  content: "›";
  position: absolute;
  left: 4px;
  color: var(--green-dim);
}

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

.callout {
  margin: 8px 0 0;
  padding: 13px 15px;
  border-left: 2px solid var(--purple-dim);
  background: rgba(181, 124, 255, 0.06);
  color: var(--muted);
}

.callout strong { color: #efe6ff; }

.note {
  margin: 12px 0 0;
  padding: 11px 14px;
  border: 1px solid #3d3520;
  border-radius: 3px;
  background: rgba(255, 200, 87, 0.05);
  color: var(--amber);
  font-size: 13.5px;
}

.alt-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 4px 0 0;
  font-size: 13.5px;
}

.reqs {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.reqs .sep { color: var(--border-hi); padding: 0 8px; }

/* ============================== footer ================================ */

.site-footer {
  margin-top: 44px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
}

.site-footer p { margin: 0 0 6px; }
.footer-tag { color: var(--green-dim); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
}

/* =========================== legal pages ============================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bar);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  padding-bottom: 9px;
}

.logo {
  color: var(--fg);
  border-bottom: none;
  font-weight: 700;
  font-size: 14px;
}

.logo .mark { color: var(--green); }
.header-link { color: var(--green); border-bottom: none; font-size: 13.5px; }

.legal { padding: 30px 0 10px; }

.legal h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
}

.legal h1::before { content: "# "; color: var(--green-dim); }

.legal h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 30px 0 8px;
  color: var(--fg);
}

.legal h2::before { content: "## "; color: var(--green-dim); }

.legal p { margin: 0 0 14px; color: var(--muted); }
.legal strong { color: var(--fg); }

.legal ul { margin: 0 0 16px; padding: 0; list-style: none; }

.legal li {
  position: relative;
  padding: 0 0 10px 22px;
  color: var(--muted);
}

.legal li::before {
  content: "-";
  position: absolute;
  left: 6px;
  color: var(--green-dim);
}

.updated { color: var(--muted); font-size: 13px; }

.draft-banner {
  margin: 16px 0 26px;
  padding: 12px 14px;
  border: 1px solid #3d3520;
  border-radius: 3px;
  background: rgba(255, 200, 87, 0.05);
  color: var(--amber);
  font-size: 13.5px;
}

.draft-banner strong { color: #ffd98a; }

.back-link { display: inline-block; margin-top: 24px; font-size: 13.5px; }

/* ============================= responsive ============================= */

@media (max-width: 620px) {
  body { font-size: 14px; }
  .term-body { max-height: none; min-height: 260px; padding: 13px 11px 10px; }
  .chrome-title { font-size: 11.5px; }
  .step { grid-template-columns: 1fr; }
  .step p { grid-column: 1; }
  .term-head { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
}

/* Light-mode viewers still get the terminal — that is the point of the page.
   Nudge the contrast up slightly for bright rooms. */
@media (prefers-color-scheme: light) {
  :root { --muted: #82998a; --fg: #ddf2e4; }
}
