/* Colours and shapes match https://khadir-syed.github.io
   (same tokens as k_ai-agent-skills web/style.css) */
:root {
  --bg: #0b0a09;
  --card: #1c1917;
  --card-hover: #24201c;
  --line: #292524;
  --text: #f5f5f4;
  --muted: #a8a29e;
  --soft: #d6d3d1;
  --amber: #fbbf24;
  --amber-soft: #fcd34d;
  --orange: #d97706;
  --glow: rgba(217, 119, 6, 0.18);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg) radial-gradient(circle at 50% 0%, var(--glow) 0%, rgba(11, 10, 9, 0) 60%) no-repeat;
  color: var(--text);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* Top bar and story progress */
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; max-width: 760px; margin: 0 auto;
}
.brand-link {
  display: inline-block; padding: 4px 12px; border-radius: 9999px; text-decoration: none;
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber-soft); font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
}
.tier { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--amber); }

.progress {
  display: flex; gap: 6px; list-style: none; margin: 0 auto; padding: 0 16px;
  max-width: 760px;
}
.progress li {
  flex: 1; min-width: 0; font-size: 11px; color: var(--muted); text-align: center;
  border-top: 3px solid var(--line); padding-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.progress li.done { border-color: var(--orange); }
.progress li.on { border-color: var(--amber); color: var(--text); font-weight: 700; }

.stage { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }

/* Brand header, same as https://khadir-syed.github.io */
.hero { text-align: center; margin: 12px 0 20px; }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 9999px; text-decoration: none;
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber-soft); font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
}
.brand .brand-frame {
  width: 112px; height: 112px; margin: 0 auto 16px; padding: 2.5px; border-radius: 28px;
  background: linear-gradient(to bottom, #fbbf24, #f59e0b, #78350f);
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.35), inset 0 0 10px rgba(245, 158, 11, 0.2);
}
.brand img { display: block; width: 100%; height: 100%; border-radius: 25.5px; object-fit: cover; background: #0c0a09; }
.brand-name {
  margin: 10px 0 2px; font-size: 30px; font-weight: 900; letter-spacing: -0.6px;
  text-transform: uppercase; color: #fff; line-height: 1.2;
}
.brand-name span { color: var(--amber); }
.subtitle {
  margin: 0; color: rgba(253, 230, 138, 0.9); font-size: 13px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase;
}

/* Playground: a compact version, so the sentence picker shows on a phone's first screen */
.hero.compact { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: left; margin: 4px 0 12px; }
.hero.compact .brand-frame { width: 56px; height: 56px; margin: 0; padding: 2px; border-radius: 16px; flex: none; }
.hero.compact img { border-radius: 14px; }
.hero.compact .brand-name { margin: 0 0 4px; font-size: 22px; }

/* Headings */
h1 {
  margin: 0 0 8px; font-size: 22px; line-height: 1.25; font-weight: 900; letter-spacing: -0.6px;
  text-transform: uppercase; color: #fff;
}
h2 {
  margin: 4px 0 4px; font-size: 26px; line-height: 1.2; font-weight: 900; letter-spacing: -0.6px;
  text-transform: uppercase; color: #fff;
}
.card h2 { font-size: 18px; font-weight: 800; text-transform: none; letter-spacing: 0; margin-top: 0; }
h2:focus { outline: none; }
h3 { font-size: 16px; font-weight: 800; margin: 20px 0 8px; }
.eyebrow { margin: 0; color: var(--amber); font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; margin: 16px 0;
}
.card > p, .chapter-body > p { margin: 0 0 12px; }
.muted, .fineprint { color: var(--muted); font-size: 14px; }
.lead { font-size: 17px; color: var(--soft); }
.lead strong, .recap strong { color: #fff; }

/* "In short": the part a 7-year-old can read alone */
.easy { border-left: 4px solid var(--amber); }
.easy p { font-size: 19px; line-height: 1.5; margin: 0 0 6px; }
.easy .easy-label { color: var(--amber); font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }

.link-card {
  display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-top: 10px; color: var(--text); font-weight: 700; text-decoration: none;
}
.link-card:hover { border-color: var(--orange); }

.footer {
  text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 1px;
  text-transform: uppercase; margin-top: 28px;
}

/* Buttons and inputs */
button, input { font: inherit; }
button {
  min-height: 44px; padding: 10px 18px; border-radius: 9999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font-weight: 700;
}
button:disabled { opacity: 0.45; cursor: default; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.primary { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.primary:hover:not(:disabled) { background: var(--amber-soft); }
.ghost:hover:not(:disabled) { border-color: var(--orange); }

/* Sentence picker: cards with an amber edge, like the site's part cards */
.chip {
  text-align: left; background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: 12px; font-weight: 700;
}
.chip:hover { background: var(--card-hover); border-color: var(--amber); }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.presets { display: grid; gap: 10px; margin: 16px 0; }
.own label { display: block; color: var(--muted); margin: 8px 0 6px; font-size: 14px; }
.own input {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 14px; border-radius: 9999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.notice {
  border-left: 3px solid var(--orange); background: rgba(217, 119, 6, 0.08);
  padding: 10px 14px; border-radius: 8px; margin: 16px 0; color: var(--soft); font-size: 15px;
}
.notice p { margin: 6px 0; }
.notice strong { color: #fff; }
progress { width: 100%; height: 10px; accent-color: var(--amber); }

.story-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }

details { margin: 16px 0 0; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
summary { cursor: pointer; font-weight: 700; min-height: 32px; }
details p { color: var(--soft); font-size: 15px; margin: 8px 0 0; }

/* Chapter 1: tokens, in warm brand shades */
.quote { font-size: 20px; font-style: italic; color: #fff; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; min-height: 44px; }
.token {
  padding: 6px 10px; border-radius: 8px; font: 700 18px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre; animation: pop 0.35s ease-out both; border: 1px solid;
}
.c0 { background: rgba(251, 191, 36, 0.16); border-color: rgba(251, 191, 36, 0.5); color: #fde68a; }
.c1 { background: rgba(251, 146, 60, 0.16); border-color: rgba(251, 146, 60, 0.5); color: #fed7aa; }
.c2 { background: rgba(214, 211, 209, 0.10); border-color: rgba(214, 211, 209, 0.4); color: #f5f5f4; }
.c3 { background: rgba(245, 158, 11, 0.22); border-color: rgba(245, 158, 11, 0.6); color: #fcd34d; }
.c4 { background: rgba(234, 88, 12, 0.18); border-color: rgba(234, 88, 12, 0.55); color: #fdba74; }
.c5 { background: rgba(253, 230, 138, 0.12); border-color: rgba(253, 230, 138, 0.45); color: #fef3c7; }
.big-number { color: var(--muted); }
.big-number strong { font-size: 28px; font-weight: 900; color: var(--amber); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* Chapter 2: galaxy */
.galaxy {
  display: block; width: 100%; height: min(70vh, 420px); touch-action: none;
  background: radial-gradient(circle at center, #292524, #0b0a09 75%); border: 1px solid var(--line); border-radius: 12px;
}
.caption { color: var(--muted); font-size: 14px; text-align: center; min-height: 1.5em; margin: 8px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; font-size: 13px; color: var(--soft); justify-content: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.neighbours { padding-left: 20px; margin: 0; }
.neighbours li { margin: 8px 0; }
.n-text { display: block; font-weight: 700; }
.meter { display: inline-block; width: 60%; height: 8px; background: var(--line); border-radius: 4px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.meter span { display: block; height: 100%; }
.n-pct { font-size: 13px; color: var(--muted); }

/* Chapter 3: guessing */
.bubble { padding: 10px 14px; border-radius: 12px; margin: 10px 0; white-space: pre-wrap; }
.bubble.you { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); margin-left: 15%; }
.bubble.ai { background: var(--bg); border: 1px solid var(--line); margin-right: 15%; min-height: 3em; color: var(--soft); }
.bubble .new { background: rgba(251, 191, 36, 0.3); color: #fff; border-radius: 4px; }
.cursor { animation: blink 1s steps(1) infinite; color: var(--amber); }
@keyframes blink { 50% { opacity: 0; } }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.bar {
  position: relative; width: 100%; display: flex; justify-content: space-between; overflow: hidden;
  border-radius: 10px; background: var(--bg); padding: 8px 12px; text-align: left; font-weight: 700;
}
.bar:disabled { opacity: 1; }
.bar:hover:not(:disabled) { border-color: var(--amber); }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--orange), var(--amber)); opacity: 0.7; transition: width 0.25s; }
.bar-text, .bar-pct { position: relative; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.empty { color: var(--muted); }
.temp { margin: 16px 0; }
.temp label { color: var(--soft); font-size: 15px; font-weight: 700; }
.slider-row { flex-wrap: nowrap; font-size: 14px; color: var(--muted); }
.slider-row input { flex: 1; min-width: 0; accent-color: var(--amber); min-height: 44px; }
.controls { margin: 12px 0; }

/* Bonus: Teach a Model */
.sort-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sort-card { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.sort-card .row { flex-wrap: nowrap; gap: 6px; }
.toggle { min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 20px; }
.toggle[aria-pressed="true"] { background: rgba(251, 191, 36, 0.2); border-color: var(--amber); color: #fff; }
.teach-own { display: grid; gap: 8px; }
.teach-own input, .teach-own textarea {
  min-height: 44px; padding: 10px 14px; border-radius: 12px; font: inherit;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.teach-own textarea { resize: vertical; }

/* Bonus: Pull the Plug */
.net { display: inline-block; padding: 6px 14px; border-radius: 9999px; font-weight: 800; border: 1px solid var(--line); }
.net.on { color: #86efac; }
.net.off { color: #fda4af; border-color: #fda4af; }
.notice.warn { border-left-color: var(--amber); }
.steps { padding-left: 22px; color: var(--soft); }
.steps li { margin: 8px 0; }
.win { font-size: 18px; font-weight: 800; color: #fff; }

/* Museum */
.exhibits { display: grid; gap: 10px; margin: 16px 0; }
.exhibit { display: flex; align-items: center; gap: 14px; text-align: left; border-radius: 16px; padding: 14px 16px; background: var(--card); }
.exhibit:hover { border-color: var(--amber); }
.exhibit strong { display: block; }
.exhibit .muted { display: block; font-weight: 400; font-size: 14px; }
.exhibit-icon { font-size: 28px; }
.teaser-row { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.teaser-row li {
  display: grid; justify-items: center; gap: 4px; padding: 10px 2px; border-radius: 12px; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); background: var(--bg); animation: glow 3s ease-in-out infinite;
}
.teaser-row li span { font-size: 22px; filter: grayscale(0.6); }
.teaser-row li:nth-child(2) { animation-delay: 0.6s; }
.teaser-row li:nth-child(3) { animation-delay: 1.2s; }
.teaser-row li:nth-child(4) { animation-delay: 1.8s; }
.teaser-row li:nth-child(5) { animation-delay: 2.4s; }
@keyframes glow { 50% { border-color: rgba(251, 191, 36, 0.6); box-shadow: 0 0 12px rgba(251, 191, 36, 0.25); } }
@media (min-width: 640px) { .exhibits { grid-template-columns: 1fr 1fr; } }

/* Finale */
.recap { padding-left: 22px; margin: 0 0 12px; }
.recap li { margin: 10px 0; color: var(--soft); }

@media (min-width: 640px) {
  .presets { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Share card on the finish screen */
.share-preview { display: block; width: 100%; max-width: 360px; height: auto; margin: 12px auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.share .row { justify-content: center; }
