/* ============================================================
   PLATFORM · ENGINE STRUCTURE
   ------------------------------------------------------------
   Layout and components for the landing and the course player.
   Reads ONLY theme variables (see platform/theme.css for the
   full list). No brand colors or fonts are hardcoded here, so a
   fork restyles the whole platform by swapping the theme, never
   by editing this file.
   ============================================================ */

*, *::before, *::after { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font-family:var(--sans);
  font-size:17px; line-height:1.65; -webkit-font-smoothing:antialiased; text-wrap:pretty; }
h1,h2,h3 { font-family:var(--serif); text-wrap:balance; line-height:1.14; }
p { margin:0 0 1em; } em { font-style:italic; } strong { font-weight:700; }
a { color:var(--primary); }
:focus-visible { outline:3px solid var(--accent-fill); outline-offset:3px; border-radius:3px; }
button { font-family:inherit; cursor:pointer; }
img { max-width:100%; }
.label { font-family:var(--sans); font-weight:600; font-size:12.5px; letter-spacing:0.14em;
  text-transform:uppercase; color:var(--text-soft); }
.hidden { display:none; }
.skip-link { position:absolute; left:-9999px; top:0; z-index:100; background:var(--primary);
  color:var(--bg); padding:10px 16px; border-radius:0 0 8px 0; font-weight:600; font-size:14px; }
.skip-link:focus { left:0; }

/* ---- top bar (shared) ---- */
.top { position:sticky; top:0; z-index:20; background:color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter:saturate(140%) blur(8px); border-bottom:1px solid var(--border); }
.top-inner { max-width:960px; margin:0 auto; padding:12px 22px; display:flex;
  align-items:center; justify-content:space-between; gap:16px; }
.brand { display:flex; align-items:center; gap:10px; min-width:0; text-decoration:none; }
.brand .hex { font-family:var(--serif); font-weight:700; color:var(--bg); background:var(--primary);
  width:30px; height:30px; flex:none; display:grid; place-items:center; font-size:16px;
  clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%); }
.brand-name { font-family:var(--sans); font-weight:600; font-size:12.5px; letter-spacing:0.16em;
  text-transform:uppercase; color:var(--text); white-space:nowrap; }
.brand-name span { color:var(--muted); }
.crumb { font-size:12.5px; color:var(--muted); white-space:nowrap; }
.crumb-link { text-decoration:none; } .crumb-link:hover { color:var(--primary); }
.crumb-link:hover .crumb-lead { text-decoration:underline; }
.top-actions { display:flex; align-items:center; gap:10px; }
.top-link { font-size:12.5px; font-weight:600; color:var(--text-soft); text-decoration:none;
  white-space:nowrap; }
.top-link:hover { color:var(--primary); }
.theme-btn { background:transparent; border:1px solid var(--border); color:var(--text-soft);
  border-radius:999px; padding:6px 12px; font-size:12px; font-weight:600; }
.theme-btn:hover { border-color:var(--primary); }
/* On mobile keep the tappable course-overview link, but drop the module
   detail and the plain (non-link) crumb, which are just context. */
@media (max-width:720px){ .crumb:not(.crumb-link), .crumb-detail, .top-link.optional { display:none; } }

/* ---- buttons (shared) ---- */
.btn { border-radius:8px; padding:12px 22px; font-weight:600; font-size:15.5px;
  border:1px solid transparent; text-decoration:none; display:inline-block; }
.btn-primary { background:var(--accent); color:var(--bg); } .btn-primary:hover { filter:brightness(0.94); }
.btn-ghost { background:transparent; color:var(--text-soft); border-color:var(--border); }
.btn-ghost:hover { border-color:var(--primary); } .btn:disabled { opacity:.4; cursor:not-allowed; }
/* de-emphasized secondary actions: smaller and quieter than the primary */
.btn-sm { padding:8px 12px; font-size:13.5px; }
.btn-quiet { background:transparent; border-color:transparent; color:var(--muted); }
.btn-quiet:hover { color:var(--primary); }

/* ============================================================
   LANDING
   ============================================================ */
.hero { max-width:960px; margin:0 auto; padding:64px 22px 34px; }
.hero .stage-in { max-width:40ch; }
.hero .eyebrow { display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.hero h1 { font-size:clamp(34px, 6vw, 56px); font-weight:700; margin:0 0 18px; color:var(--text); }
.hero .lede { font-size:clamp(18px,2.3vw,21px); color:var(--text-soft); max-width:56ch; margin:0 0 26px; }
.hero .cta-row { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.hero .cta-note { font-size:13.5px; color:var(--muted); margin:14px 0 0; }
.rule { width:52px; height:3px; background:var(--accent-fill); border:0; margin:0 0 22px; }

section.band { border-top:1px solid var(--line); }
.wrap { max-width:960px; margin:0 auto; padding:44px 22px; }
.sec-head { margin-bottom:26px; }
.sec-head .label { display:block; margin-bottom:8px; }
.sec-head h2 { font-size:clamp(24px,3.5vw,32px); margin:0; color:var(--text); }

/* course cards */
.course-grid { display:grid; gap:20px; }
.course-card { border:1px solid var(--border); background:var(--surface); border-radius:14px;
  padding:26px 26px 22px; box-shadow:var(--shadow); }
.course-card .kicker { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.course-card .badge { font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--text-soft); }
.course-card h3 { font-size:clamp(24px,3.4vw,30px); margin:0 0 10px; color:var(--text); }
.course-card .desc { color:var(--text-soft); max-width:60ch; margin:0 0 18px; }
.course-card .card-cta { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-top:4px; }
.course-card .card-cta .meta { font-size:13.5px; color:var(--muted); }

/* a course still being built: quieter, no link, no shadow */
.course-card.soon { background:var(--bg); border-style:dashed; box-shadow:none; }
.course-card.soon h3 { color:var(--text-soft); }
.course-card.soon .desc { margin-bottom:0; }
.course-card .soon-tag { font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  color:var(--muted); border:1px solid var(--border); border-radius:999px; padding:2px 10px; }

/* module track */
.track { list-style:none; margin:0 0 20px; padding:0; display:grid; gap:10px; }
.track li { display:flex; align-items:flex-start; gap:14px; padding:12px 14px; border:1px solid var(--line);
  border-radius:10px; background:var(--bg); }
.track .mnum { flex:none; width:30px; height:30px; border-radius:999px; display:grid; place-items:center;
  font-weight:700; font-size:13px; border:2px solid var(--border); color:var(--muted); background:var(--bg); }
.track li.ready .mnum { background:var(--accent); border-color:var(--accent); color:var(--bg); }
.track .mbody { min-width:0; display:flex; flex-direction:column; gap:2px; }
.track .mtitle { font-weight:600; color:var(--text); }
.track .mstate { font-size:12px; color:var(--muted); font-weight:600; letter-spacing:.04em; text-transform:uppercase; }
.track li.done .mstate { color:var(--good); }

/* interactive module list on the course page: each ready module is a link */
.track-nav li { padding:0; align-items:stretch; }
.track-nav li a { display:flex; align-items:center; gap:14px; width:100%; padding:12px 14px;
  text-decoration:none; color:inherit; border-radius:10px; }
.track-nav li a:hover { background:var(--surface); }
.track-nav li a:hover .mtitle { color:var(--primary); }
.track-nav li.done .mnum { background:var(--accent); border-color:var(--accent); color:var(--bg); }
.track-nav .mgo { margin-left:auto; color:var(--muted); font-weight:700; font-size:18px; }
.track-nav li a:hover .mgo { color:var(--primary); transform:translateX(2px); }
.track-nav li.coming { opacity:.55; }

.navbar .nav-secondary { display:flex; flex-wrap:wrap; gap:4px 8px; align-items:center; }

/* philosophy strip */
.pillars { display:grid; grid-template-columns:1fr; gap:22px 30px; align-items:start; }
@media (min-width:640px) { .pillars { grid-template-columns:1fr 1fr; } }
.pillar h4 { font-family:var(--sans); font-size:12.5px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--text-soft); margin:0 0 8px; font-weight:700; }
.pillar p { color:var(--text-soft); margin:0; }

/* footer */
.site-footer { border-top:1px solid var(--border); background:var(--surface); }
.footer-inner { max-width:960px; margin:0 auto; padding:32px 22px; display:flex; flex-wrap:wrap;
  gap:20px; justify-content:space-between; align-items:baseline; }
.footer-inner .fbrand { font-family:var(--serif); font-weight:700; color:var(--text); }
.footer-inner .fnote { font-size:13.5px; color:var(--muted); max-width:44ch; }
.footer-inner a { color:var(--text-soft); font-weight:600; text-decoration:none; }
.footer-inner a:hover { color:var(--primary); }
.footer-links { display:flex; flex-wrap:wrap; gap:16px; }

/* prose page (privacy, terms, and the like) */
.prose { max-width:var(--maxread); }
.prose h3 { font-size:19px; font-weight:700; color:var(--text); margin:1.6em 0 .5em; }
.prose h3:first-child { margin-top:0; }
.prose p { margin:0 0 1em; }
.prose a { color:var(--primary); font-weight:600; }
.prose-meta { font-size:13.5px; color:var(--muted); margin-top:1.6em; }

/* ============================================================
   COURSE PLAYER
   ============================================================ */
.path-wrap { border-bottom:1px solid var(--line); background:var(--surface); }
.path { max-width:940px; margin:0 auto; padding:18px 22px 14px; display:flex;
  align-items:flex-start; overflow-x:auto; }
.node { display:flex; flex-direction:column; align-items:center; gap:7px; flex:1 1 0;
  min-width:76px; position:relative; }
.node .connector { position:absolute; top:15px; left:-50%; width:100%; height:2px;
  background:var(--border); z-index:0; }
.node:first-child .connector { display:none; }
.node.done .connector, .node.current .connector { background:var(--accent-fill); }
.dot { position:relative; z-index:1; width:32px; height:32px; border-radius:999px;
  background:var(--bg); border:2px solid var(--muted); color:var(--muted); display:grid;
  place-items:center; font-size:13px; font-weight:700;
  transition:transform 140ms ease, background 160ms ease, border-color 160ms ease; }
.node button.dot:hover { border-color:var(--primary); transform:translateY(-1px); }
.node.done .dot { background:var(--accent); border-color:var(--accent); color:var(--bg); }
.node.current .dot { border-color:var(--primary); color:var(--primary);
  box-shadow:0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.node .kind { font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--muted);
  font-weight:600; text-align:center; line-height:1.25; }
.node.current .kind { color:var(--text-soft); }

main.player { max-width:940px; margin:0 auto; padding:30px 22px 40px; }
.stage { max-width:var(--maxread); margin:0 auto; }
.eyebrow { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.eyebrow .n { font-size:12.5px; color:var(--muted); font-weight:600; }
.stage h1 { font-size:clamp(30px, 5vw, 42px); font-weight:700; margin:0 0 4px; color:var(--text); }
.stage .rule { margin:16px 0 22px; }
.body :is(p,ul,ol) { color:var(--text); }
.body ul { margin:0 0 1em; padding-left:1.1em; } .body li { margin-bottom:.4em; }
.body .aside { border-left:3px solid var(--accent-fill); background:var(--surface);
  padding:14px 18px; border-radius:0 8px 8px 0; margin:0 0 1.1em; color:var(--text-soft); }
.notebook-note { border:1px solid var(--border); background:var(--surface); border-radius:10px;
  padding:14px 16px; margin:0 0 22px; color:var(--text-soft); font-size:15.5px; }
.notebook-note b { color:var(--text); }
.journal { position:relative; border:1px solid var(--accent-fill); background:var(--accent-soft);
  border-radius:10px; padding:15px 18px 15px 46px; margin:6px 0 20px; color:var(--text); }
.journal::before { content:"\270E"; position:absolute; left:17px; top:13px; font-size:19px; color:var(--accent); }
.journal .jlabel { display:block; font-weight:700; font-size:11.5px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--accent); margin-bottom:5px; }
.journal p { margin:0 0 .4em; } .journal ul { margin:.2em 0 0; padding-left:1.05em; }
.journal li { margin-bottom:.35em; } .journal .hint { color:var(--muted); font-weight:400; }
@media (prefers-reduced-motion: no-preference) {
  .fade { animation:fade 260ms ease both; }
  @keyframes fade { from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }
}
.options { display:grid; gap:12px; margin:6px 0 4px; }
.opt { border:1px solid var(--border); background:var(--surface); border-radius:10px; padding:14px 16px; }
.opt .tag { font-weight:700; color:var(--primary); font-family:var(--serif); font-size:19px; margin-right:6px; }
.prompt-line { font-weight:600; color:var(--text-soft); }
.take { background:var(--surface); border:1px solid var(--border); border-radius:10px;
  padding:16px 18px; margin:6px 0 4px; box-shadow:var(--shadow); }
.take h4 { margin:0 0 8px; font-family:var(--sans); font-size:12.5px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--accent); font-weight:700; }
.take ul { margin:0; padding-left:1.05em; } .take li { margin-bottom:.5em; }
.reveal-btn { background:transparent; border:1px dashed var(--primary); color:var(--primary);
  border-radius:8px; padding:11px 18px; font-weight:600; font-size:15px; width:100%; margin-bottom:6px; }
.reveal-btn:hover { background:color-mix(in srgb, var(--primary) 8%, transparent); }
.navbar { max-width:var(--maxread); margin:26px auto 0; display:flex; align-items:center;
  justify-content:space-between; gap:12px 16px; flex-wrap:wrap; padding-top:20px; border-top:1px solid var(--line); }
.saved { text-align:center; font-size:12.5px; color:var(--muted); margin:20px 0 0; }
.saved b { color:var(--good); font-weight:700; }

/* signup dot */
.signup { max-width:var(--maxread); margin:10px 0 0; display:grid; gap:16px; }
.signup .hp { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
.signup .fld { display:grid; gap:6px; }
.signup .fld > span, .signup legend { font-weight:600; font-size:14px; color:var(--text); }
.signup input[type="email"], .signup textarea { font-family:inherit; font-size:16px; color:var(--text);
  background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:11px 13px; width:100%; }
.signup textarea { resize:vertical; }
.signup input[type="email"]:focus-visible, .signup textarea:focus-visible { border-color:var(--primary); }
.signup fieldset { border:0; padding:0; margin:0; display:grid; gap:9px; }
.signup fieldset legend { margin-bottom:3px; }
.signup .chk { display:flex; align-items:flex-start; gap:9px; font-size:15px; color:var(--text-soft); font-weight:400; }
.signup .chk input { margin-top:3px; flex:none; }
.signup .optin { color:var(--text); }
.signup-privacy { font-size:13px; color:var(--muted); margin:-4px 0 0; line-height:1.5; }
.signup-privacy a { color:var(--text-soft); font-weight:600; }
.signup-status { font-size:13.5px; color:var(--muted); margin:0; min-height:1.2em; }
.signup-done { border:1px solid var(--accent-fill); background:var(--accent-soft); border-radius:10px; padding:16px 18px; }
.signup-done b { color:var(--accent); font-size:16px; }
.signup-done p { margin:.4em 0 0; color:var(--text); }
@media (max-width:620px) { .brand-name { display:none; } .node { min-width:54px; }
  .node .kind { display:none; } .node.current .kind { display:block; } .stage h1 { font-size:27px; }
  /* Stack the nav: quiet secondary actions on top, the prominent forward
     button full-width beneath, so moving on is the obvious tap. */
  .navbar { flex-direction:column; align-items:stretch; gap:14px; }
  .navbar .nav-secondary { justify-content:center; order:1; }
  .navbar .btn-primary { order:2; width:100%; text-align:center; } }
