/* GE Uncut — course-reader shell for the guides section.
   Editorial serif headings (Source Serif 4) over the app's monochrome tokens, so
   a guide reads like a lesson inside GE Uncut, not a separate site. Pairs with
   legal.css (colour tokens + content blocks). Static pages only: the course rail
   is real <a href> links and the current lesson carries .on server-side, so every
   page is crawlable on its own URL. The font is loaded per page in the <head>. */

:root { --shell: rgba(255, 255, 255, 0.92); --radius-sm: 10px; }
:root[data-theme="dark"] { --shell: rgba(12, 12, 13, 0.85); }
/* Pink theme: blush sidebar shell (base colour tokens come from legal.css). */
:root[data-theme="pink"] { --shell: rgba(255, 247, 250, 0.92); }

.serif { font-family: "Source Serif 4", Georgia, "Times New Roman", serif; }

.docs { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.docs-main { min-width: 0; }

/* --- Sidebar: course rail on a lesson, track list on the hub --- */
.docs-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
  padding: 16px 12px;
  background: var(--shell);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-right: 1px solid var(--line);
}
.docs-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px; color: var(--ink);
  font-weight: 800; font-size: 1.0rem; letter-spacing: -0.01em; text-decoration: none;
}
.docs-brand:hover { text-decoration: none; }
.docs-brand .coin {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
}

/* Back-to-hub link above the course rail */
.cback {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 8px; color: var(--muted);
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
}
.cback:hover { color: var(--ink); text-decoration: none; }
.cback svg { width: 15px; height: 15px; }

/* Course rail (a track's lessons) */
.course { display: grid; gap: 0; }
.ctitle { font-family: "Source Serif 4", Georgia, serif; font-size: 1.06rem; font-weight: 600; padding: 4px 8px 0; color: var(--ink); }
.cprog { padding: 2px 8px 8px; font-size: 0.7rem; font-family: ui-monospace, monospace; color: var(--faint); letter-spacing: 0.02em; }
.cbar { height: 4px; border-radius: 3px; background: var(--surface-hover); margin: 0 8px 10px; overflow: hidden; }
.cbar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.clist { display: grid; gap: 2px; }
.citem {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--muted); font-size: 0.86rem; font-weight: 600; line-height: 1.3;
  text-decoration: none;
}
.citem:hover { background: var(--surface-hover); color: var(--ink); text-decoration: none; }
.citem.on { background: var(--surface-hover); color: var(--ink); }
.cn {
  width: 22px; height: 22px; flex: none;
  border-radius: 7px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center;
  font-family: ui-monospace, monospace; font-size: 0.68rem; font-weight: 700; color: var(--faint);
}
.citem.on .cn { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Track list (the hub sidebar) */
.tnav { display: grid; gap: 14px; }
.tnav-grp { display: grid; gap: 1px; }
.tnav-grp b {
  font-size: 0.62rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--faint); font-weight: 800; padding: 0 10px 4px;
}
.tnav-grp a {
  display: flex; align-items: center; gap: 9px; min-height: 34px;
  padding: 0 10px; border-radius: 8px;
  color: var(--muted); font-size: 0.86rem; font-weight: 600; text-decoration: none;
}
.tnav-grp a:hover, .tnav-grp a.on { background: var(--surface-hover); color: var(--ink); text-decoration: none; }
.tnav-grp a::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.5; flex: none;
}
.tnav-grp a.on::before { opacity: 1; }

.docs-foot { display: grid; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.docs-back {
  display: flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 0.88rem; text-decoration: none;
}
.docs-back:hover { opacity: 0.9; text-decoration: none; }
.theme-toggle {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted);
  font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; text-align: left;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.docs-foot .legal { padding: 2px 10px; font-size: 0.72rem; color: var(--faint); line-height: 1.7; }
.docs-foot .legal a { color: var(--faint); text-decoration: none; }
.docs-foot .legal a:hover { color: var(--ink); }

/* --- Content column --- */
.docs-content { width: min(760px, calc(100% - 56px)); margin: 0 auto; padding: 40px 0 84px; }
.docs-content.wide { width: min(900px, calc(100% - 56px)); }
@media (max-width: 560px) { .docs-content { width: calc(100% - 32px); padding-top: 26px; } }

.crumbs { font-size: 0.82rem; color: var(--faint); }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { margin: 0 7px; opacity: 0.55; }

.lessontag {
  font-size: 0.72rem; font-family: ui-monospace, monospace; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--faint); margin-top: 18px;
}

/* --- Hub --- */
.hero-h { font-family: "Source Serif 4", Georgia, serif; font-size: clamp(30px, 5vw, 44px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.06; margin: 8px 0 0; }
.hero-s { color: var(--muted); font-size: 1.05rem; margin: 14px 0 0; max-width: 54ch; line-height: 1.6; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero-cta a { font-size: 0.9rem; font-weight: 600; padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); text-decoration: none; }
.hero-cta a.pri { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.hero-cta a:hover { text-decoration: none; border-color: var(--line-strong); }
.sec-h { font-family: "Source Serif 4", Georgia, serif; font-size: 1.55rem; font-weight: 600; margin: 46px 0 18px; }
.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .tracks { grid-template-columns: 1fr; } }
.track {
  display: block; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease; text-decoration: none; color: inherit;
}
.track:hover { border-color: var(--line-strong); transform: translateY(-3px); text-decoration: none; }
.preview { height: 132px; border-bottom: 1px solid var(--line); background: var(--surface-raised); display: grid; place-items: center; padding: 14px 22px; }
.preview svg { width: 100%; height: 100%; }
.tbody { padding: 17px 20px 19px; }
.tt { font-family: "Source Serif 4", Georgia, serif; font-size: 1.24rem; font-weight: 600; color: var(--ink); }
.td { color: var(--muted); font-size: 0.86rem; margin-top: 6px; line-height: 1.55; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.meta span { font-size: 0.74rem; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px; font-variant-numeric: tabular-nums; }

/* --- Track overview (a track's start page) --- */
.ov h1 { font-family: "Source Serif 4", Georgia, serif; font-size: clamp(28px, 4vw, 38px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 10px 0 0; }
.ov p.lead { color: var(--muted); font-size: 1.05rem; margin: 14px 0 0; line-height: 1.6; }
.learn { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; background: var(--surface-raised); margin-top: 26px; }
.learn h3 { font-family: "Source Serif 4", Georgia, serif; font-size: 1.12rem; margin: 0 0 12px; font-weight: 600; }
.learn ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.learn li { display: flex; gap: 10px; font-size: 0.9rem; color: var(--ink); line-height: 1.5; }
.learn li::before {
  content: ""; width: 18px; height: 18px; flex: none; margin-top: 1px;
  background: var(--up); border-radius: 50%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* --- Hub lesson index: a flat, crawlable list of every lesson so each guide is
   one click from the hub (two from home), not buried behind a track page. --- */
.lesson-index { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 30px; margin: 6px 0 10px; }
@media (max-width: 640px) { .lesson-index { grid-template-columns: 1fr; } }
.li-track h3 { font-family: "Source Serif 4", Georgia, serif; font-size: 1.05rem; font-weight: 600; margin: 0 0 8px; }
.li-track h3 a { color: var(--ink); text-decoration: none; }
.li-track h3 a:hover { text-decoration: underline; }
.li-track ol { margin: 0; padding: 0; list-style: none; counter-reset: li; display: grid; gap: 1px; }
.li-track ol li { counter-increment: li; }
.li-track ol li a { display: flex; align-items: baseline; gap: 10px; padding: 6px 9px; border-radius: 8px; color: var(--muted); font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.li-track ol li a::before { content: counter(li); color: var(--faint); font-family: ui-monospace, monospace; font-size: 0.76rem; min-width: 13px; }
.li-track ol li a:hover { background: var(--surface-hover); color: var(--ink); }

/* --- Article --- */
.article h1 { font-family: "Source Serif 4", Georgia, serif; font-size: clamp(28px, 4vw, 38px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 8px 0 0; }
.metaline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.metaline span { font-size: 0.74rem; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px; }
.metaline .upd { border: 0; padding: 4px 0; color: var(--faint); font-family: ui-monospace, monospace; font-size: 0.7rem; }
.subtitle { font-size: 1.1rem; color: var(--muted); margin: 18px 0 0; line-height: 1.55; }
.article h2 { font-family: "Source Serif 4", Georgia, serif; font-size: 1.4rem; font-weight: 600; margin: 34px 0 10px; padding-top: 24px; border-top: 1px solid var(--line); }
.article h3 { font-family: "Source Serif 4", Georgia, serif; font-size: 1.1rem; font-weight: 600; margin: 26px 0 8px; }
.article p { font-size: 1.02rem; line-height: 1.72; color: var(--ink); margin: 16px 0 0; }
.article ul, .article ol { margin: 14px 0 0; padding-left: 22px; }
.article li { font-size: 1.0rem; line-height: 1.66; color: var(--ink); margin: 6px 0 0; }
.article strong { color: var(--ink); font-weight: 700; }
.article a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); }
.article a:hover { text-decoration-color: var(--ink); }

/* --- Prev / next --- */
.navbtns { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line); }
.navbtns .prev { font-size: 0.84rem; font-weight: 600; color: var(--muted); padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 10px; text-decoration: none; }
.navbtns .prev:hover { color: var(--ink); text-decoration: none; }
.navbtns .next { margin-left: auto; display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; font-weight: 700; padding: 10px 20px; border-radius: 11px; background: var(--accent); color: var(--on-accent); text-decoration: none; }
.navbtns .next:hover { text-decoration: none; opacity: 0.94; }
.navbtns .next .lbl { font-size: 0.68rem; opacity: 0.75; font-weight: 600; }
.navbtns .next .ttl { font-size: 0.88rem; }

.fineprint { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--faint); line-height: 1.7; }
.fineprint a { color: var(--faint); }

/* --- Mobile drawer (reuses guides.js) --- */
.docs-topbar { display: none; }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; }
  .docs-topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 40; padding: 10px 14px;
    background: var(--surface-raised); border-bottom: 1px solid var(--line);
  }
  .docs-topbar .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .docs-side {
    position: fixed; left: 0; top: 0; width: 276px;
    transform: translateX(-100%); transition: transform 180ms ease;
    z-index: 60; box-shadow: var(--shadow);
  }
  .docs.nav-open .docs-side { transform: none; }
  .docs-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); opacity: 0; pointer-events: none; transition: opacity 180ms ease; z-index: 55; }
  .docs.nav-open .docs-scrim { opacity: 1; pointer-events: auto; }
}
