/* InterThread Software: tokens first, then layout, then sections. */

:root {
  --paper: #f3f8fd;
  --surface: #ffffff;
  --surface-2: #e6f0fb;
  --ink: #0e2246;
  --ink-soft: #40557a;
  --line: #c9daee;
  --blue: #2479de;
  --blue-deep: #1552ad;
  --beak: #ffab2e;
  --beak-deep: #b75a00;
  --orb-orange: #f07c1e;
  --orb-blue: #2f7fe0;
  --orb-green: #2fa866;
  --bubble-chirpo: #e3effc;
  --bubble-student: #1552ad;
  --bubble-student-ink: #ffffff;
  --on-blue: #ffffff;
  --highlight-bg: #0e2246;
  --highlight-ink: #f3f8fd;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;

  --wrap: 1120px;
  --gutter: 16px;
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-pill: 999px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1a36;
    --surface: #13284d;
    --surface-2: #102244;
    --ink: #eaf3ff;
    --ink-soft: #a9bddb;
    --line: #27426e;
    --blue: #6cb8ff;
    --blue-deep: #4eaaf6;
    --beak: #ffb84d;
    --beak-deep: #ffb84d;
    --bubble-chirpo: #1c3663;
    --bubble-student: #2f86e6;
    --on-blue: #0b1a36;
    --highlight-bg: #1d4b94;
    --highlight-ink: #ffffff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0b1a36;
  --surface: #13284d;
  --surface-2: #102244;
  --ink: #eaf3ff;
  --ink-soft: #a9bddb;
  --line: #27426e;
  --blue: #6cb8ff;
  --blue-deep: #4eaaf6;
  --beak: #ffb84d;
  --beak-deep: #ffb84d;
  --bubble-chirpo: #1c3663;
  --bubble-student: #2f86e6;
  --on-blue: #0b1a36;
  --highlight-bg: #1d4b94;
  --highlight-ink: #ffffff;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 1.3rem; font-weight: 700; }
h4 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 1em; }

a { color: var(--blue-deep); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
:focus-visible { outline: 3px solid var(--beak); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 62ch; }
.narrow { max-width: 56ch; }

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

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 8px; }

/* Buttons */
.button {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  padding: 0.8em 1.4em;
  border-radius: var(--radius-pill);
  background: var(--blue-deep);
  color: var(--on-blue);
  border: 2px solid transparent;
}
.button:hover { background: var(--ink); color: var(--paper); }
.button-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.button-quiet:hover { background: var(--surface); color: var(--ink); border-color: var(--blue); }
.button-small { padding: 0.5em 1em; font-size: 0.95rem; }
.button-accent { background: var(--beak); color: #0e2246; }
.button-accent:hover { background: #fff; color: #0e2246; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a:not(.button) { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.98rem; }
.site-nav a:not(.button):hover { color: var(--blue); }
.site-nav .button { color: var(--on-blue); }
.nav-toggle {
  display: none;
  font: inherit; font-weight: 700; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 6px 16px; cursor: pointer;
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 20px;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.button) { padding: 10px 0; font-size: 1.1rem; }
  .site-nav .button { margin-top: 8px; }
}

/* Hero */
.hero { padding: 56px 0 72px; overflow: hidden; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) {
  .hero { padding: 88px 0 104px; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 56px; }
}
.hero-copy .lede { margin-bottom: 0.8em; }
.hero-copy strong { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* The hero demo: a conversation thread that feeds a goal report. The thread
   line between them is the page's one visual flourish. */
.thread-demo { margin: 0; position: relative; display: grid; gap: 20px; }
.thread-demo::before {
  content: "";
  position: absolute; left: 34px; top: 40px; bottom: 40px; width: 4px;
  background: linear-gradient(var(--blue), var(--beak));
  border-radius: 4px; z-index: 0;
}
.chat, .report {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.chat-head img { width: 40px; height: 40px; }
.chat-title { font-family: var(--font-display); font-weight: 700; margin: 0; }
.chat-sub { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.messages { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 0.98rem; line-height: 1.45; }
.msg-chirpo { background: var(--bubble-chirpo); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg-student { background: var(--bubble-student); color: var(--bubble-student-ink); border-bottom-right-radius: 6px; align-self: flex-end; }

.report { margin-left: 24px; }
@media (min-width: 960px) { .report { margin-left: 56px; } }
.report-title { font-family: var(--font-display); font-weight: 700; margin-bottom: 10px; }
.goals { list-style: none; margin: 0; padding: 0; }
.goals li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.98rem; line-height: 1.35;
}
.goals li:first-child { border-top: 0; }
.orb-label { font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }
.report-note { margin: 10px 0 0; font-size: 0.9rem; color: var(--ink-soft); }

.orb {
  display: inline-block; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  box-shadow: inset -3px -4px 6px rgb(0 0 0 / 0.22), inset 3px 3px 5px rgb(255 255 255 / 0.45);
  vertical-align: middle;
}
.orb-orange { background: var(--orb-orange); }
.orb-blue { background: var(--orb-blue); }
.orb-green { background: var(--orb-green); }

@media (prefers-reduced-motion: no-preference) {
  .messages .msg { animation: pop 0.45s ease-out both; }
  .messages .msg:nth-child(1) { animation-delay: 0.2s; }
  .messages .msg:nth-child(2) { animation-delay: 0.9s; }
  .messages .msg:nth-child(3) { animation-delay: 1.6s; }
  .messages .msg:nth-child(4) { animation-delay: 2.3s; }
  .report { animation: pop 0.5s ease-out 3s both; }
  @keyframes pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
  }
}

/* Sections */
.section { padding: 80px 0; }
@media (min-width: 960px) { .section { padding: 112px 0; } }
.sub-h { margin-top: 64px; margin-bottom: 24px; font-size: 1.5rem; }

/* Chirpo */
.chirpo { background: var(--surface); border-block: 1px solid var(--line); }
.chirpo-intro { display: grid; gap: 24px; align-items: center; }
.chirpo-mascot { width: 160px; }
@media (min-width: 720px) {
  .chirpo-intro { grid-template-columns: 220px 1fr; gap: 48px; }
  .chirpo-mascot { width: 220px; }
}

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 28px; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 36px; } }
.steps li { counter-increment: step; border-top: 4px solid var(--blue); padding-top: 16px; }
.steps li::before {
  content: counter(step);
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; margin-bottom: 12px; border-radius: 50%;
  background: var(--blue-deep); color: var(--on-blue);
  font-family: var(--font-display); font-weight: 800;
}
.steps p { color: var(--ink-soft); margin: 0; }

.types { display: grid; gap: 16px; }
@media (min-width: 820px) { .types { grid-template-columns: repeat(3, 1fr); } }
.type { background: var(--paper); border-radius: var(--radius-md); padding: 24px; border: 1px solid var(--line); }
.type h4 { font-size: 1.4rem; color: var(--blue-deep); }
.type p { margin: 0; color: var(--ink-soft); }

.orb-key { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 28px; }
.orb-key p { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; }

/* Use cases */
.features { display: grid; gap: 20px; margin-top: 40px; }
@media (min-width: 900px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.feature:nth-child(3) { background: var(--highlight-bg); color: var(--highlight-ink); border-color: var(--highlight-bg); }
.feature:nth-child(3) h3 { color: var(--beak); }
.feature h3 { font-size: 1.5rem; }
.feature p { color: inherit; }
.feature-eg {
  margin: auto 0 0; padding-top: 16px;
  font-style: italic; color: var(--ink-soft);
}
.feature:nth-child(3) .feature-eg { color: color-mix(in srgb, var(--highlight-ink) 78%, transparent); }

.more-uses { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 48px; }
@media (min-width: 720px) { .more-uses { grid-template-columns: repeat(2, 1fr); } }
.more-uses li { padding: 20px 0; border-top: 1px solid var(--line); }
.more-uses p { margin: 0; color: var(--ink-soft); }
.tag {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 700;
  padding: 2px 10px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--beak-deep); border: 1px solid var(--line);
}

/* Audiences */
.audiences { background: var(--surface-2); }
.aud-grid { display: grid; gap: 32px; margin-top: 32px; }
@media (min-width: 720px) { .aud-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .aud-grid { grid-template-columns: repeat(4, 1fr); } }
.aud-grid h3 { color: var(--blue-deep); }
.aud-grid p { margin: 0; color: var(--ink-soft); }

/* Safety */
.principles { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 36px 48px; }
@media (min-width: 720px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .principles { grid-template-columns: repeat(3, 1fr); } }
.principles li { padding-left: 20px; border-left: 4px solid var(--orb-green); }
.principles p { margin: 0; color: var(--ink-soft); }

/* Roadmap: a genuine sequence, so it gets an ordered line */
.roadmap { background: var(--surface); border-block: 1px solid var(--line); }
.timeline { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 28px; }
@media (min-width: 820px) { .timeline { grid-template-columns: repeat(3, 1fr); gap: 36px; } }
.timeline li { position: relative; padding-top: 28px; border-top: 3px dashed var(--line); }
.timeline li::before {
  content: ""; position: absolute; top: -10px; left: 0;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--line);
}
.timeline li.now { border-top-style: solid; border-top-color: var(--blue); }
.timeline li.now::before { background: var(--blue); border-color: var(--blue); }
.timeline p { margin: 0; color: var(--ink-soft); }

/* Pilot CTA */
.pilot { background: var(--blue-deep); color: #fff; padding: 72px 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pilot { background: #1a3f80; }
}
:root[data-theme="dark"] .pilot { background: #1a3f80; }
.pilot-inner { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .pilot-inner { grid-template-columns: 1fr auto; gap: 56px; } }
.pilot h2 { color: #fff; }
.pilot p { margin: 0; max-width: 58ch; font-size: 1.15rem; color: #e3effc; }

/* About */
.about-grid { display: grid; gap: 16px; }
@media (min-width: 860px) { .about-grid { grid-template-columns: 1fr 1.6fr; gap: 56px; } }
.about-grid p { max-width: 62ch; font-size: 1.1rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-soft); font-size: 0.95rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.footer-row p { margin: 0; }
.footer-note { flex-basis: 100%; font-size: 0.85rem; }

.section-more { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 40px 0 0; font-weight: 700; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--ink-soft); }
.site-nav a[aria-current="page"] { color: var(--blue); }

/* Long-form pages: privacy, terms, safety */
.doc { padding: 48px 0 96px; }
.doc-wrap { max-width: 760px; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.25rem); margin-bottom: 0.3em; }
.doc h2 { font-size: 1.6rem; margin-top: 2.2em; }
.doc h3 { font-size: 1.15rem; margin-top: 1.6em; }
.doc p, .doc li { max-width: 68ch; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1em; }
.doc li { margin-bottom: 0.45em; }
.doc code { font-size: 0.9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.doc-meta { color: var(--ink-soft); }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 0.98rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.doc th { font-family: var(--font-display); }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px 24px; margin: 28px 0; }
.toc h2 { font-size: 1.15rem; margin: 0 0 0.5em; }
.toc ol { margin: 0; padding-left: 2em; columns: 2 220px; column-gap: 40px; }
.toc li { margin-bottom: 0.3em; break-inside: avoid; }

.callout { background: var(--surface); border-left: 4px solid var(--orb-orange); border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: 16px 20px; }

/* Visible markers for unfinished drafts; remove from the HTML before publishing */
.draft-note { background: #fff4dc; color: #5a3600; border: 1px solid #f0c674; border-radius: var(--radius-md); padding: 12px 16px; font-size: 0.95rem; }
mark.todo { background: #ffe08a; color: #3b2a00; padding: 0 4px; border-radius: 4px; }
