/* MyDy LMS Helper website. Same tokens as the terminal app (tui/src/theme.ts): colour marks state, orange is the accent. */
:root {
  --bg: #0d0e10;
  --panel: #131518;
  --raised: #1a1d21;
  --bar: #08090a;
  --strip: var(--raised);
  --line: #31363d;
  --text: #d2d6db;
  --strong: #f5f6f7;
  --muted: #8b929a;
  --faint: #5c636b;
  --accent: #ff6500;
  --accent-track: #392214;
  --on-accent: #08090a;
  --ok: #6fcf97;
  --warn: #f2c94c;
  --low: #ff4f9a; /* rose, not red: a red sits too close to the orange accent */
  --ok-track: #24362f;
  --warn-track: #3b3521;
  --low-track: #422132;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 var(--mono);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--strong); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; background: var(--accent); color: var(--on-accent); padding: 6px 10px; z-index: 10; }
.skip:focus { top: 8px; }

kbd, code {
  font: inherit;
  font-size: 0.92em;
  background: var(--strip);
  color: var(--strong);
  padding: 0.05em 0.4em;
  border-radius: 4px;
}
kbd { color: var(--accent); }

.ic { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

/* ---- top bar: like the TUI's ---- */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bar); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { color: var(--strong); font-weight: 800; }
.brand-sub { color: var(--muted); }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 4px; }
.topbar nav a:hover { background: var(--accent); color: var(--on-accent); }
@media (max-width: 560px) { .brand-sub { display: none; } .topbar nav a { padding: 4px 6px; } .topbar nav a[href="#demo"] { display: none; } }

/* ---- hero: dithered waves (dither.js) behind the headline ---- */
/* No overflow clipping: the hero's "Set up with AI" menu drops below the band. */
.hero-band { position: relative; z-index: 2; isolation: isolate; }
#hero-dither {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.4s ease; pointer-events: none; image-rendering: pixelated;
}
#hero-dither.ready { opacity: 0.8; }
/* Keep the words readable: fade the waves out behind the text and into the page below. */
.hero-band::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(13, 14, 16, 0.88) 38%, rgba(13, 14, 16, 0.2) 78%, rgba(13, 14, 16, 0) 100%),
    linear-gradient(180deg, rgba(13, 14, 16, 0) 55%, var(--bg) 100%);
}
@media (max-width: 720px) { .hero-band::after { background: linear-gradient(180deg, rgba(13, 14, 16, 0.55), var(--bg)); } }
.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(28px, 4vw, 40px); }
h1 {
  margin: 0 0 20px;
  color: var(--strong);
  font-size: clamp(34px, 6.4vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.lede { max-width: 64ch; margin: 0 0 28px; color: var(--text); font-size: clamp(15px, 1.7vw, 17px); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.button {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-radius: 6px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 0;
}
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: var(--strong); }
.button.ghost { color: var(--muted); padding-inline: 0; font-weight: 500; }
.button.ghost:hover { color: var(--strong); }
.fineprint { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.fineprint code { color: var(--text); }

/* One-line install commands: the command wraps inside the block rather than widen the page, and Copy sits beside it. */
.cards > .card { min-width: 0; }
.cmd { display: flex; align-items: center; gap: 12px; max-width: 100%; margin: 8px 0 0; padding: 8px 8px 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.cmd pre { flex: 1; min-width: 0; margin: 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmd pre code { color: var(--strong); white-space: inherit; background: none; padding: 0; }
.cmd.hero-cmd { max-width: 700px; margin-top: 18px; }
.card code { white-space: nowrap; }
.cmd-copy { flex: none; padding: 3px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--raised); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.cmd-copy:hover { color: var(--strong); border-color: var(--muted); }
.cmd-label { margin: 14px 0 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- live demo ---- */
.demo { padding-bottom: clamp(56px, 8vw, 96px); }
.terminal {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  overflow: hidden;
  cursor: default;
  box-shadow: 0 24px 60px -30px rgba(255, 101, 0, 0.25);
}
.terminal:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* The frame is painted on a canvas (main.js), sized in whole device pixels so its cells meet exactly. */
.terminal-screen { display: block; margin-inline: auto; }
.terminal noscript img { width: 100%; height: auto; display: block; }

.demo-bar { margin-top: 12px; padding: 10px 14px 8px; background: var(--strip); border-radius: 6px; }
.demo-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tour-progress { display: flex; gap: 3px; margin-bottom: 8px; }
.tour-progress .seg {
  flex: 1; height: 4px; padding: 0; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--line); overflow: hidden; position: relative;
}
.tour-progress .seg::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.tour-progress .seg.done::after { transform: scaleX(1); }
.tour-progress .seg.current::after { animation: fill var(--dur, 3s) linear forwards; }
.tour-progress.paused .seg.current::after { animation-play-state: paused; }
.tour-progress.hidden { visibility: hidden; }
.tour-progress .seg:hover { background: var(--muted); }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .tour-progress .seg.current::after { animation: none; transform: scaleX(1); } }
.step { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.caption { margin: 0; color: var(--strong); min-height: 1.65em; }
.demo-controls { display: flex; align-items: center; gap: 14px; flex: none; }
.mode { background: var(--accent); color: var(--on-accent); font-weight: 700; padding: 1px 8px; border-radius: 3px; font-size: 13px; }
.mode.driving { background: var(--strong); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--strong); }

.keypad { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.keypad button {
  font: inherit; font-size: 13px; cursor: pointer;
  background: var(--panel); color: var(--accent); border: 1px solid var(--line); border-radius: 5px; padding: 5px 10px;
}
.keypad button span { color: var(--muted); }
.keypad button:hover { border-color: var(--accent); }
.keypad button:active { background: var(--accent); color: var(--on-accent); }
.keypad button:active span { color: var(--on-accent); }
.demo-hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
@media (max-width: 640px) { .demo-bar-row { flex-direction: column; align-items: flex-start; } .demo-controls { flex-wrap: wrap; } }

/* ---- sections ---- */
h2 { color: var(--strong); font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.02em; margin: 0 0 8px; }
h3 { color: var(--strong); font-size: 16px; margin: 28px 0 8px; }
.section-lede { color: var(--muted); margin: 0 0 24px; }
.section-lede ~ .bento { margin-top: 0; }
section.install, section.better, section.ai { padding-bottom: clamp(56px, 8vw, 96px); }

/* ---- install cards ---- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card.wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; gap: 12px; background: var(--panel); border-radius: 10px; padding: 20px; }
.card h3 { display: flex; align-items: center; gap: 10px; margin: 0; }
.card h3 .ic { color: var(--accent); }
.card p { margin: 0; color: var(--muted); }
.card .more { margin-top: auto; align-self: flex-start; }
.card .more::after { content: " →"; color: var(--accent); }
.platforms { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.platforms a { display: inline-block; padding: 6px 12px; border-radius: 5px; background: var(--strip); text-decoration: none; }
.platforms a:hover { background: var(--accent); color: var(--on-accent); }
.platforms a.unavailable { color: var(--muted); }
.platforms a.unavailable:hover { color: var(--on-accent); }
/* ---- privacy: a strip with a muted uppercase label, like the TUI's "needs you" row ---- */
.privacy { padding-bottom: clamp(56px, 8vw, 96px); }
.strip { display: flex; align-items: flex-start; gap: 16px; background: var(--strip); border-radius: 8px; padding: 16px 18px; }
.badge { flex: none; margin: 0; font-size: 15px; font-weight: 400; letter-spacing: 0; line-height: inherit; text-transform: uppercase; color: var(--muted); }
.strip p { margin: 0; max-width: 80ch; }
@media (max-width: 640px) { .strip { flex-direction: column; } }

/* ---- footer: the TUI's key-hint bar ---- */
.footer { background: var(--bar); color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 14px 0; }
.footer p { margin: 0; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer nav a { color: var(--muted); text-decoration: none; }
.footer nav a:hover { color: var(--strong); }
.footer kbd { background: none; padding: 0; color: var(--strong); font-weight: 700; }

/* ---- MyDy vs MyDy LMS Helper: cards with a slice of the app in each ---- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.bento-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; background: var(--panel); border-radius: 12px; padding: 20px; }
.bento-card.lead { grid-column: span 2; display: grid; grid-template-columns: 1fr 1.15fr; gap: 28px; align-items: center; padding: 28px; }
.lead-text { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 960px) { .bento { grid-template-columns: 1fr 1fr; } .bento-card.lead { grid-column: 1 / -1; } }
@media (max-width: 640px) { .bento { grid-template-columns: 1fr; } .bento-card.lead { grid-template-columns: 1fr; padding: 20px; } }
.kicker { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--accent); font-size: 13px; font-weight: 700; }
.bento-card h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.lead h3 { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; }
.was { margin: 0; color: var(--muted); font-size: 13px; }
.was s { text-decoration-color: rgba(255, 79, 154, 0.55); }
.tag { display: inline-block; margin-right: 8px; padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; font-size: 11px; }
.now { margin: 0; color: var(--text); }

/* Slices of the app, in its quiet style: colour marks state only (thin bars, small dots), numbers stay in text ink,
   and orange is left for marked checkboxes and the download bar. */
.tui {
  margin-top: auto; min-width: 0; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: 13px; line-height: 1.75; white-space: nowrap; color: var(--text);
}
.lead .tui { margin-top: 0; }
.tl { display: flex; align-items: center; gap: 1ch; min-width: 0; }
.tl.split { justify-content: space-between; }
.tl > span { overflow: hidden; text-overflow: ellipsis; }
.tl .ic { width: 1.25em; height: 1.25em; }
.tl.label { color: var(--muted); }
.dot { display: inline-block; flex: none; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--dot, var(--muted)); }
.dot.ok { --dot: var(--ok); } .dot.warn { --dot: var(--warn); } .dot.low { --dot: var(--low); }
.wordmark { letter-spacing: 0; }

/* A thin meter: the fill carries the state colour; a tick marks the 75% line. */
.meter { position: relative; display: block; height: 3px; background: var(--track, var(--line)); }
.meter > i { display: block; height: 100%; width: var(--v); background: var(--fill, var(--muted)); }
.meter::after { content: ""; position: absolute; left: 75%; top: -4px; width: 2px; height: 11px; margin-left: -1px; background: var(--muted); }
.meter.plain::after { display: none; }
.meter.ok { --fill: var(--ok); --track: var(--ok-track); }
.meter.warn { --fill: var(--warn); --track: var(--warn-track); }
.meter.low { --fill: var(--low); --track: var(--low-track); }
/* Attendance: a name and its percentage, then the meter and what to do about it (the sidebar's two-line rows). */
.att { display: grid; grid-template-columns: 1fr 8ch; column-gap: 1.5ch; row-gap: 2px; align-items: center; margin-bottom: 8px; }
.att:last-child { margin-bottom: 0; }
.att > :nth-child(2), .att > :nth-child(4) { justify-self: end; }
.att .name, .gr .name { overflow: hidden; text-overflow: ellipsis; }
/* Grades: name, meter, score. */
.gr { display: grid; grid-template-columns: 1fr 7ch auto; column-gap: 1.5ch; align-items: center; }
.gr > :nth-child(3) { justify-self: end; }

/* The download panel: a plain bordered card with a block progress bar in the accent. */
.drawer { margin-top: 12px; padding: 8px 12px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.drawer .split > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.drawer .split > span { flex: none; }
.blocks { flex: 1; height: 10px; background: var(--accent-track); }
.blocks i { display: block; height: 100%; background: var(--accent); }
.c-accent { color: var(--accent); } .c-strong { color: var(--strong); } .c-muted { color: var(--muted); }
.c-faint { color: var(--faint); } .c-low { color: var(--low); }

/* ---- AI section ---- */
.ai-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .ai-grid { grid-template-columns: 1fr; } }
.chat { display: flex; flex-direction: column; gap: 14px; background: var(--panel); border-radius: 10px; padding: 16px; }
/* A terminal transcript: marker column, text that keeps its indent when it wraps. */
.msg, .tool { display: grid; grid-template-columns: 2ch 1fr; margin: 0; }
.msg::before, .tool::before { font-weight: 700; }
.msg.you { background: var(--strip); color: var(--strong); padding: 8px 12px; border-radius: 6px; }
.msg.you::before { content: ">"; color: var(--accent); }
.msg.ai { color: var(--text); padding: 0 12px; }
.msg.ai::before { content: "●"; color: var(--accent); }
.msg b { color: var(--strong); }
.tool { color: var(--muted); font-size: 13px; padding: 0 12px; white-space: pre-wrap; }
.tool::before { content: "●"; color: var(--ok); }
.prompts ul { list-style: none; padding: 0; margin: 0 0 16px; }
.prompts li { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.prompts li:first-child { border-top: 1px solid var(--line); }
.button.small { padding: 8px 14px; font-size: 14px; }

/* ---- assistants that can use the MCP server ---- */
.works-with { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 24px; }
.works-label { color: var(--muted); font-size: 13px; }
.logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.logos li { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.logos svg { width: 20px; height: 20px; fill: var(--strong); flex: none; }

/* ---- "Set up with AI" menu ---- */
.prompt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.button.outline { background: var(--panel); color: var(--strong); border: 1px solid var(--line); }
.button.outline:hover, .button.outline[aria-expanded="true"] { background: var(--strip); border-color: var(--muted); }
.ai-menu { position: relative; }
.ai-menu-button .ic { color: var(--accent); }
.ai-menu-button .chevron { color: var(--muted); transition: transform 0.15s; }
.ai-menu-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.ai-menu-list {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; min-width: 270px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
}
.ai-menu.up .ai-menu-list { top: auto; bottom: calc(100% + 8px); }
.ai-menu-list [role="menuitem"] {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: 6px; background: none; color: var(--text);
  font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.ai-menu-list [role="menuitem"]:hover, .ai-menu-list [role="menuitem"]:focus-visible { background: var(--strip); color: var(--strong); outline: none; }
.ai-menu-list .ic { width: 18px; height: 18px; color: var(--muted); }
.ai-menu-list [role="menuitem"]:hover .ic { color: var(--strong); }
.ai-menu-list .done .ic { color: var(--ok); }
.ai-menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
@media (max-width: 480px) { .ai-menu-list { min-width: 240px; } }
