/* Learn Statistics Fast — "highlighter on graph paper".
   See /brand for the guidelines behind these tokens. */
:root {
  --ink: #101935;
  --ink-2: #3a4366;
  --muted: #6b6f86;
  --paper: #fbf8f0;
  --paper-2: #f4efe1;
  --card: #fffdf8;
  --grid: #e7e1cf;
  --line: #e2dccb;
  --hl: #eeff41;          /* highlighter */
  --hl-soft: #f6ffa3;
  --pen: #ff5533;         /* red pen (decorative / large text) */
  --pen-text: #d93a1a;    /* red pen at AA contrast for small text */
  --ok: #1e8e5a;
  --warn: #a86b00;
  --danger: #c4321f;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(16, 25, 53, .06), 0 10px 30px -12px rgba(16, 25, 53, .18);
  --shadow-hard: 4px 4px 0 var(--ink);
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --grid-bg:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--paper); line-height: 1.6; font-size: 17px; }
img { max-width: 100%; display: block; }
a { color: var(--pen-text); text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: transparent; transition: text-decoration-color .15s; }
a:hover { text-decoration: underline; text-decoration-color: currentColor; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin-top: 1.3em; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
h4 { font-weight: 700; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
::selection { background: var(--hl); color: var(--ink); }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.left { text-align: left; }
.mx-auto { margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.lead { font-size: 1.18rem; color: var(--ink-2); max-width: 62ch; }
.inline { display: inline; margin: 0; }
.push { margin-left: auto; }
.plain { list-style: none; padding: 0; margin: 0; }
.grid-paper { background: var(--card); background-image: var(--grid-bg); }

/* ---------- brand motifs */
.swipe { background: linear-gradient(100deg, transparent 0 1%, var(--hl) 2% 97%, transparent 98%) 0 62% / 100% 72% no-repeat; padding: 0 .12em; margin: 0 -.06em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.redpen { position: relative; white-space: nowrap; }
.redpen::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: -.22em; height: .38em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9c40-6 90-8 130-5 22 2 40 3 64 1' fill='none' stroke='%23FF5533' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.sticky-inline { background: var(--hl-soft); padding: 0 .3em; border-radius: 3px; box-shadow: 2px 2px 0 rgba(16,25,53,.12); }
.eyebrow { display: inline-block; font-family: var(--font-mono); font-weight: 700; color: var(--pen-text); text-transform: uppercase; font-size: .76rem; letter-spacing: .12em; margin-bottom: 14px; }
.eyebrow::before { content: "→ "; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; background: var(--ink); color: #fff;
  border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: .62em 1.15em; font: inherit; font-family: var(--font-display); font-weight: 700; letter-spacing: -.005em;
  cursor: pointer; transition: transform .08s, box-shadow .08s, background .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--pen); }
.btn:active { transform: none; box-shadow: none; }
.btn-hl { background: var(--hl); color: var(--ink); }
.btn-hl:hover { box-shadow: var(--shadow-hard); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--card); box-shadow: var(--shadow-hard); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-sm { padding: .38em .8em; font-size: .88rem; }
.btn-lg { padding: .8em 1.4em; font-size: 1.08rem; }
.btn-block { display: flex; width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.link-button:hover { text-decoration: underline; }

/* ---------- header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(251, 248, 240, .94); backdrop-filter: blur(8px); border-bottom: 2px solid var(--ink); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.22rem; letter-spacing: -.03em; line-height: 1; }
.wordmark .fast { color: var(--pen); font-style: italic; background: linear-gradient(var(--hl), var(--hl)) 0 70% / 100% 60% no-repeat; padding: 0 .14em 0 .08em; }
.brand-xl .brand-mark { width: 56px; height: 56px; }
.brand-xl .wordmark { font-size: 1.6rem; }
.nav-links { display: flex; align-items: center; gap: 1.3em; font-weight: 700; font-size: .95rem; }
.nav-links a, .nav-links .link-button { color: var(--ink); }
.nav-links a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--pen); }
.nav-links a.btn { color: var(--ink); background: var(--hl); }
.cart-link { position: relative; display: inline-flex; }
.badge { position: absolute; top: -9px; right: -11px; background: var(--pen); color: #fff; font-family: var(--font-mono); font-size: .68rem; font-weight: 700; border-radius: 99px; padding: 1px 6px; }
.nav-toggle, .nav-burger { display: none; }
@media (max-width: 880px) {
  .nav-burger { display: block; width: 28px; height: 20px; position: relative; cursor: pointer; }
  .nav-burger span, .nav-burger::before, .nav-burger::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--ink); border-radius: 2px; }
  .nav-burger::before { top: 0; } .nav-burger span { top: 8.5px; } .nav-burger::after { bottom: 0; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--paper); flex-direction: column; align-items: flex-start; padding: 16px; border-bottom: 2px solid var(--ink); gap: 1em; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .wordmark { font-size: 1.08rem; }
}

/* ---------- flashes */
.flashes { margin-top: 16px; }
.flash { padding: .75em 1em; border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--card); border: 2px solid var(--ink); font-weight: 700; box-shadow: 3px 3px 0 var(--ink); }
.flash-success { background: #e4f5ea; }
.flash-error { background: #ffe5df; }
.flash-info { background: var(--hl-soft); }

/* ---------- hero */
.hero { background: var(--paper); background-image: var(--grid-bg); padding: 76px 0 64px; border-bottom: 2px solid var(--ink); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); }
.hero .lead { font-size: 1.22rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 22px; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4em 1.4em; color: var(--ink-2); }
.checks li::before { content: "✓"; color: var(--pen); font-weight: 700; margin-right: .45em; }
.buy-box .checks { flex-direction: column; margin-top: 14px; }

.hero-art { position: relative; min-height: 440px; }
.index-card { position: absolute; top: 0; left: 4%; width: 76%; background: var(--card); border: 2px solid var(--ink); border-radius: 6px; padding: 22px 24px 20px; box-shadow: var(--shadow-hard);
  background-image: linear-gradient(transparent 46px, var(--pen) 46px 48px, transparent 48px), repeating-linear-gradient(transparent 0 27px, #cfe0f2 27px 28px); background-position: 0 0, 0 20px; transform: rotate(-2deg); display: grid; gap: 6px; z-index: 2; }
.card-label { font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--pen-text); font-weight: 700; }
.countdown { font-family: var(--font-display); font-size: 3.2rem; line-height: 1; margin-top: 12px; }
.countdown small { font-size: 1.1rem; font-weight: 700; color: var(--ink-2); }
.formula-card { position: absolute; right: 0; top: 200px; width: 70%; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 30px 24px 18px; transform: rotate(2deg); display: grid; gap: 8px; font-family: var(--font-mono); font-size: 1rem; z-index: 1; box-shadow: var(--shadow); }
.formula-card span { color: var(--hl); }
.formula-card .bell { width: 100%; height: 50px; color: var(--pen); margin-top: 6px; }
.sticky { position: absolute; left: 0; bottom: 0; width: 200px; background: var(--hl); color: var(--ink); padding: 16px; font-family: var(--font-display); font-weight: 700; line-height: 1.25; transform: rotate(-4deg); box-shadow: 3px 6px 14px -4px rgba(16,25,53,.35); z-index: 3; }
.sticky em { display: block; font-family: var(--font-body); font-weight: 400; font-size: .82rem; margin-top: 6px; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { min-height: 440px; max-width: 520px; } }
@media (max-width: 480px) { .formula-card { width: 86%; font-size: .9rem; } .index-card { width: 88%; left: 0; } }

/* ---------- sections & grids */
.section { padding: 56px 0; }
.section.alt { background: var(--paper-2); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h1, .section-head h2, .section-head h3 { margin: 0; }
.section-head > a { font-weight: 700; }
.page-head { background: var(--paper); background-image: var(--grid-bg); padding: 48px 0 36px; border-bottom: 2px solid var(--ink); }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.step-list { list-style: none; padding: 0; counter-reset: step; }
.step-list li { counter-increment: step; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 24px; display: grid; gap: 6px; box-shadow: var(--shadow-hard); }
.step-list li:nth-child(2) { background: var(--hl-soft); }
.step-list li::before { content: "0" counter(step); font-family: var(--font-mono); font-weight: 700; color: var(--pen-text); font-size: .9rem; }
.step-list strong { font-family: var(--font-display); font-size: 1.25rem; }
.step-list span { color: var(--ink-2); }

/* ---------- cards */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.product-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; transition: transform .1s, box-shadow .1s; }
.product-card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.product-card .card-body { padding: 16px 18px 0; flex: 1; }
.product-card h3 a { color: var(--ink); }
.card-foot { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-top: 2px dashed var(--line); margin-top: 14px; }
.card-foot form { margin: 0; }
.product-cover { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; aspect-ratio: 16 / 9; padding: 18px; position: relative; overflow: hidden; border-bottom: 2px solid var(--ink); }
.product-cover:hover { text-decoration: none; }
.product-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Course covers: ink "chalkboard" with a bell curve. Guides: index card with a red margin line. */
.cover-course { background: var(--ink); color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 76C60 76 72 8 100 8S140 76 200 76' fill='none' stroke='%23EEFF41' stroke-opacity='.55' stroke-width='2.5'/%3E%3Cpath d='M100 8V76' stroke='%23FF5533' stroke-width='2' stroke-dasharray='4 4'/%3E%3C/svg%3E"),
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 76% 46%, 20px 20px, 20px 20px; background-position: 85% 14%, 0 0, 0 0; background-repeat: no-repeat, repeat, repeat; }
.cover-guide { background: var(--card); color: var(--ink);
  background-image: linear-gradient(90deg, transparent 34px, var(--pen) 34px 36px, transparent 36px), repeating-linear-gradient(transparent 0 23px, #cfe0f2 23px 24px); padding-left: 52px; }
.product-cover.big { aspect-ratio: 4 / 3; border-radius: var(--radius); max-width: 420px; border: 2px solid var(--ink); box-shadow: var(--shadow-hard); }
.cover-kind { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; opacity: .85; }
.cover-course .cover-kind { color: var(--hl); }
.cover-guide .cover-kind { color: var(--pen-text); }
.cover-title { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; line-height: 1.1; letter-spacing: -.02em; max-width: 90%; position: relative; }
.cover-guide .cover-title span { background: linear-gradient(var(--hl), var(--hl)) 0 88% / 100% 42% no-repeat; box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: 0 .1em; }
.meta { display: flex; flex-wrap: wrap; gap: .3em 1em; color: var(--muted); font-size: .88rem; font-family: var(--font-mono); }
.meta span + span::before { content: "·"; margin-right: 1em; }
.price { font-family: var(--font-mono); font-weight: 700; font-size: 1.2rem; }
.price-lg { font-family: var(--font-mono); font-weight: 700; font-size: 2.4rem; line-height: 1; }
.tag { display: inline-block; font-family: var(--font-mono); font-size: .7rem; font-weight: 700; color: var(--ink); background: var(--hl); border-radius: 4px; padding: .2em .55em; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.tag-free { background: #d9f2e3; color: #0f5c39; margin: 0; }
.tag-warn { background: #ffe5b8; color: #6e4600; margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { border: 2px solid var(--ink); background: var(--card); border-radius: 99px; padding: .3em .95em; color: var(--ink); font-size: .9rem; font-weight: 700; }
.chip.active, .chip:hover { background: var(--ink); color: var(--hl); text-decoration: none; }

/* ---------- detail */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 44px; align-items: start; }
.buy-box { position: sticky; top: 90px; display: grid; gap: 10px; box-shadow: var(--shadow-hard); }
.buy-box form { margin: 0; }
.buy-box .btn-lg { background: var(--hl); color: var(--ink); }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } .buy-box { position: static; order: -1; } }
.curriculum details { border: 2px solid var(--ink); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--card); }
.curriculum details[open] summary { border-bottom: 2px dashed var(--line); }
.curriculum summary { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; font-family: var(--font-display); font-weight: 700; list-style: none; }
.curriculum summary::before { content: "+"; font-family: var(--font-mono); color: var(--pen-text); margin-right: .2em; }
.curriculum details[open] summary::before { content: "−"; }
.curriculum summary > span:first-child { flex: 1; }
.curriculum summary::-webkit-details-marker { display: none; }
.curriculum ul { list-style: none; margin: 0; padding: 4px 16px 10px; }
.curriculum li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.curriculum li:first-child { border-top: 0; }
.curriculum .muted.small { font-family: var(--font-mono); }
.lesson-icon { color: var(--pen); font-size: .7rem; }
.guide-cover { margin-bottom: 28px; }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.callout { background: var(--hl-soft); border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: .8em 1em; margin: 16px 0; }

/* ---------- forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: .93rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=url], input:not([type]), textarea, select {
  width: 100%; font: inherit; padding: .62em .8em; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; box-shadow: 0 0 0 4px var(--hl); }
input[type=file] { font: inherit; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); }
.check { display: flex !important; align-items: center; gap: .55em; font-weight: 400 !important; }
.has-error input, .has-error textarea { border-color: var(--danger); }
.error { color: var(--danger); font-weight: 700; }
.auth-wrap { display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 450px; padding: 32px; box-shadow: var(--shadow-hard); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.inline-form { display: flex; gap: 12px; }
.inline-form input { flex: 1; }

/* ---------- cart */
.cart { padding: 0; box-shadow: var(--shadow-hard); }
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 2px dashed var(--line); flex-wrap: wrap; }
.cart-row:last-child { border-bottom: 0; }
.cart-row .tag { display: block; width: fit-content; }
.cart-right { display: flex; align-items: center; gap: 16px; }
.cart-right form { margin: 0; }
.cart-row.total { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; background: var(--hl-soft); border-radius: 0 0 var(--radius) var(--radius); }
.checkout-form { margin-top: 22px; }
.checkout-form .btn { background: var(--hl); color: var(--ink); }
.success-mark { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; background: var(--hl); border: 2px solid var(--ink); color: var(--ink); font-size: 2.4rem; font-weight: 800; margin: 0 auto 16px; box-shadow: var(--shadow-hard); }

/* ---------- dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 36px; align-items: start; }
.dash-grid h2:first-child { margin-top: 0; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-grid aside { order: -1; } }
.course-progress, .guide-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.course-progress > div { flex: 1; }
.guide-row h3 { margin: 0; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.progress { height: 12px; border-radius: 99px; background: var(--paper-2); border: 2px solid var(--ink); overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: var(--hl); border-right: 2px solid var(--ink); transition: width .4s; }
.progress span[style*="width: 0%"] { border-right: 0; }
.plan-card { position: sticky; top: 90px; background: var(--card); box-shadow: var(--shadow-hard);
  background-image: linear-gradient(transparent 58px, var(--pen) 58px 60px, transparent 60px); }
.plan-card h3 { font-family: var(--font-mono); text-transform: uppercase; font-size: .8rem; letter-spacing: .1em; color: var(--pen-text); margin-bottom: 30px; }
.big-number { font-family: var(--font-display); font-size: 3.4rem; font-weight: 800; line-height: 1; margin: 6px 0 12px; }
.big-number span { font-size: 1rem; font-weight: 700; color: var(--ink-2); margin-left: .4em; }

/* ---------- player */
.player-page .site-footer { display: none; }
.player { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.player-sidebar { border-right: 2px solid var(--ink); background: var(--paper-2); overflow-y: auto; max-height: calc(100vh - 68px); position: sticky; top: 68px; }
.sidebar-head { padding: 20px; border-bottom: 2px solid var(--ink); background: var(--card); }
.sidebar-head h2 { font-size: 1.15rem; margin: 8px 0; }
.sidebar-head p { margin: 0; font-family: var(--font-mono); }
.sidebar-module h4 { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--pen-text); padding: 18px 20px 6px; margin: 0; }
.sidebar-module ul { list-style: none; margin: 0; padding: 0; }
.sidebar-module li a, .sidebar-module li .row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 20px; color: var(--ink); font-size: .93rem; line-height: 1.35; }
.sidebar-module li a:hover { background: var(--hl-soft); text-decoration: none; }
.sidebar-module li.current a { background: var(--hl); font-weight: 700; box-shadow: inset 4px 0 0 var(--ink); }
.sidebar-module li .title { flex: 1; }
.sidebar-module li .muted { font-family: var(--font-mono); font-size: .78rem; }
.sidebar-module .status { flex: 0 0 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; background: var(--card); }
.sidebar-module li.done .status { background: var(--ok); border-color: var(--ok); }
.sidebar-module li.locked .status { border: 0; background: none; font-size: .8rem; }
.sidebar-module li.locked { opacity: .6; }
.player-main { padding: 26px clamp(16px, 3vw, 44px) 56px; max-width: 1100px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--ink); border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; border: 2px solid var(--ink); box-shadow: var(--shadow-hard); }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.video-placeholder { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #c5c9de;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 24px 24px; }
.video-placeholder span { font-size: 3rem; color: var(--hl); }
.video-placeholder p { font-family: var(--font-mono); }
.lesson-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.lesson-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.lesson-head p { margin: 0 0 4px; font-family: var(--font-mono); }
.lesson-head form { margin: 0; }
.lesson-head .btn:not(.btn-ghost) { background: var(--hl); color: var(--ink); }
.notes { margin-top: 18px; position: relative; padding-left: 28px;
  background-image: linear-gradient(90deg, transparent 12px, var(--pen) 12px 14px, transparent 14px); }
.notes h3 { font-family: var(--font-mono); text-transform: uppercase; font-size: .78rem; letter-spacing: .1em; color: var(--pen-text); }
.notes p { margin: 0 0 .7em; font-family: var(--font-mono); font-size: .96rem; line-height: 1.6; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.lesson-nav .btn { white-space: normal; text-align: left; }
@media (max-width: 900px) {
  .player { grid-template-columns: 1fr; }
  .player-sidebar { position: static; max-height: none; border-right: 0; border-top: 2px solid var(--ink); order: 2; }
}

/* ---------- status pills */
.status-pill { display: inline-block; font-family: var(--font-mono); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 4px; padding: .15em .55em; background: #eee; color: #444; }
.status-paid { background: #d9f2e3; color: #0f5c39; }
.status-pending { background: #ffe5b8; color: #6e4600; }
.status-refunded, .status-expired { background: #ffe0d9; color: #8f2410; }
.order ul { padding: 0 20px 16px; color: var(--ink-2); }
.order .cart-row { border-bottom: 0; }

/* ---------- admin */
.admin { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 34px; padding-top: 34px; padding-bottom: 56px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 90px; align-self: start; }
.admin-nav a { padding: .55em .8em; border-radius: var(--radius-sm); color: var(--ink); font-weight: 700; }
.admin-nav a.active, .admin-nav a:hover { background: var(--hl); text-decoration: none; }
@media (max-width: 800px) { .admin { grid-template-columns: 1fr; } .admin-nav { flex-direction: row; flex-wrap: wrap; position: static; } }
.stat strong { display: block; font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; }
.stats .stat:first-child { background: var(--hl-soft); }
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--paper-2); font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); white-space: nowrap; border-bottom: 2px solid var(--ink); }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.module-admin .section-head { margin-bottom: 8px; }
.admin-lessons li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 2px dashed var(--line); }

/* ---------- brand page */
.brand-page .swatch-card { display: grid; place-items: center; gap: 14px; min-height: 220px; align-content: center; }
.brand-page .on-ink { background: var(--ink); color: #fff; }
.brand-page .on-ink .wordmark { color: #fff; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.swatch { display: grid; gap: 4px; }
.chip-color { height: 84px; border-radius: var(--radius-sm); border: 2px solid var(--ink); margin-bottom: 6px; }
.type-sample { font-size: 1.7rem; margin: 0 0 .4em; line-height: 1.2; }
.type-sample.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; }
.type-sample.mono { font-family: var(--font-mono); font-size: 1.4rem; }
.motifs li { margin-bottom: .7em; }

/* ---------- footer */
.site-footer { background: var(--ink); color: #c5c9de; padding: 52px 0 26px; margin-top: 56px; border-top: 2px solid var(--ink); }
.site-footer .wordmark { color: #fff; }
.tagline { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--hl); margin-top: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { color: var(--hl); font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; }
.footer-grid a:not(.brand) { display: block; color: #e3e5f0; padding: 3px 0; }
.fineprint { margin-top: 34px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: .8rem; color: #9aa0bb; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

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

/* ---------- interactive tools (shared by Lab, lessons and course tool pages) */
.lsf-tool { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-hard); margin: 24px 0; overflow: hidden; }
.lsf-tool-head { padding: 18px 20px 14px; border-bottom: 2px dashed var(--line); background: var(--card); background-image: var(--grid-bg); }
.lsf-tool-head h2, .lsf-tool-head h3 { margin: 4px 0 6px; }
.lsf-tool-kicker { font-family: var(--font-mono); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--pen-text); }
.lsf-tool-kicker::before { content: "◆ "; }
.lsf-tool-intro p { margin: 0 0 .4em; color: var(--ink-2); }
.lsf-tool-body { padding: 18px 20px 20px; }
.tool-controls { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; margin-bottom: 16px; }
.tool-ctl { display: grid; gap: 6px; min-width: 150px; flex: 1 1 160px; }
.tool-ctl[hidden] { display: none; }
.tool-ctl-label { font-weight: 700; font-size: .88rem; }
.tool-ctl output { font-family: var(--font-mono); background: var(--hl); padding: 0 .35em; border-radius: 3px; }
.tool-ctl select, .tool-ctl input[type=number] { padding: .45em .6em; }
.tool-ctl input[type=range] { width: 100%; accent-color: var(--ink); }
.tool-buttons { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.tool-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .tool-grid-2 { grid-template-columns: 1fr; } }
.tool-panel { border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 10px 10px 4px; background: #fff; min-width: 0; }
.tool-panel h5 { font-family: var(--font-display); font-size: .95rem; margin: 2px 4px 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tool-canvas { display: block; max-width: 100%; }
.legend-line::before, .legend-hit::before, .legend-miss::before { content: ""; display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 5px; }
.legend-line, .legend-hit, .legend-miss { font-family: var(--font-mono); font-size: .75rem; font-weight: 500; color: var(--ink-2); }
.legend-line::before, .legend-miss::before { background: var(--pen); }
.legend-hit::before { background: var(--ink); }
.tool-readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 16px 0 0; }
.tool-readout > div { background: var(--paper-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.tool-readout dt { font-size: .78rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tool-readout dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; }
.tool-readout small { font-size: .78rem; font-weight: 500; color: var(--ink-2); }
.tool-hint { margin: 14px 0 0; font-size: .92rem; color: var(--ink-2); }
.tool-hint::before { content: "Try it: "; font-weight: 700; color: var(--pen-text); }
.tool-warning { background: #ffe5df; border: 2px solid var(--pen); border-radius: var(--radius-sm); padding: .6em .9em; font-size: .92rem; font-weight: 700; }
.tool-answer { margin-top: 14px; }
.tool-answer-main { font-family: var(--font-mono); font-size: 1.3rem; margin: 0 0 4px; }
.tool-answer-main strong { background: var(--hl); padding: 0 .3em; }
.tool-answer-detail { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); margin: 0; }
.lesson-tools { margin-top: 8px; }
.tool-dot { color: var(--pen); font-size: .7rem; margin-top: 3px; }
.sidebar-tools-link { display: inline-block; margin-top: 10px; font-weight: 700; font-size: .9rem; }
.resume-btn { margin: -8px 0 18px; }
.narrow-wide { max-width: 980px; }
.tool-source { margin: 28px 0 -16px; }

/* ---------- lab */
.lab-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.lab-price { display: flex; align-items: baseline; gap: 8px; margin: 24px 0 12px; }
.lab-hero form { margin: 0 0 18px; }
.lab-status { display: grid; gap: 8px; max-width: 420px; margin-top: 24px; box-shadow: var(--shadow-hard); }
.lab-status form { margin: 0; }
.lab-art { position: relative; min-height: 300px; }
.lab-art svg { width: 100%; max-width: 460px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-hard); transform: rotate(1.5deg); }
.lab-sticky { left: auto; right: 0; bottom: -10px; transform: rotate(3deg); }
.tool-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.tool-card .card-body { padding: 16px 18px 0; flex: 1; }
.tool-card.is-locked .tool-card-art { filter: grayscale(.6); opacity: .8; }
.tool-card-art { aspect-ratio: 16 / 7; border-bottom: 2px solid var(--ink); background-color: var(--ink); background-repeat: no-repeat; background-position: center; background-size: 80% 80%; }
.tool-art-clt-simulator { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80'%3E%3Cg fill='%23EEFF41'%3E%3Crect x='40' y='66' width='12' height='12'/%3E%3Crect x='54' y='54' width='12' height='24'/%3E%3Crect x='68' y='34' width='12' height='44'/%3E%3Crect x='82' y='14' width='12' height='64'/%3E%3Crect x='96' y='8' width='12' height='70'/%3E%3Crect x='110' y='18' width='12' height='60'/%3E%3Crect x='124' y='38' width='12' height='40'/%3E%3Crect x='138' y='58' width='12' height='20'/%3E%3C/g%3E%3Cpath d='M20 78C70 78 80 6 100 6S130 78 180 78' fill='none' stroke='%23FF5533' stroke-width='3'/%3E%3C/svg%3E"); }
.tool-art-confidence-intervals { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80'%3E%3Cg stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M60 8H130M75 18H150M50 28H120M95 38H170M65 48H135M80 58H145M40 68H105' stroke='%23EEFF41'/%3E%3Cpath d='M112 38H170' stroke='%23FF5533'/%3E%3C/g%3E%3Cpath d='M100 2V78' stroke='%23fff' stroke-width='2' stroke-dasharray='4 4'/%3E%3C/svg%3E"); }
.tool-art-normal-calculator { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80'%3E%3Cpath d='M20 76C70 76 80 6 100 6S118 50 130 64V76Z' fill='%23EEFF41'/%3E%3Cpath d='M20 76C70 76 80 6 100 6S130 76 180 76' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath d='M130 76V58' stroke='%23FF5533' stroke-width='3'/%3E%3C/svg%3E"); }
.lab-plug { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 32px; background: var(--hl-soft); box-shadow: var(--shadow-hard); }
.lab-plug h3 { margin-bottom: 4px; }
.lab-plug p { margin: 0; }
.home-lab { background: var(--ink); color: #fff; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.home-lab .lead { color: #c5c9de; }
.home-lab h2 { color: #fff; }
.home-lab .hero-grid { align-items: center; }
.home-lab .lab-art svg { transform: rotate(-1.5deg); }

/* ---------- admin: tools */
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-5 { grid-template-columns: 1fr 1fr; } }
.attachments { margin-top: 24px; }
.attachments form { margin: 0; }
.tool-help pre { background: var(--paper-2); border-radius: 6px; padding: 8px 10px; overflow-x: auto; font-family: var(--font-mono); }

/* ---------- quizzes & practice tests */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tag-test { background: var(--ink); color: var(--hl); }
.quiz-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.quiz-card-main { flex: 1; min-width: 220px; }
.quiz-card h3 { margin: 4px 0 6px; }
.quiz-card.is-test { box-shadow: var(--shadow-hard); }
.best-score { margin: 8px 0 0; }
.lesson-quizzes { margin-top: 24px; }
.lesson-quizzes .quiz-card { background: var(--hl-soft); box-shadow: var(--shadow-hard); }
.quiz-start { box-shadow: var(--shadow-hard); margin: 20px 0 32px; }
.quiz-start form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.quiz-start .checks { flex-direction: column; margin-bottom: 16px; }

.quiz-page .site-footer { display: none; }
.quiz-bar { position: sticky; top: 68px; z-index: 15; background: var(--card); border-bottom: 2px solid var(--ink); }
.quiz-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.quiz-bar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.quiz-bar-title .tag { margin: 0; }
.quiz-bar-title strong { font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quiz-bar-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-family: var(--font-mono); }
.timer { font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; background: var(--ink); color: var(--hl); border-radius: var(--radius-sm); padding: .25em .7em; min-width: 6.5ch; text-align: center; }
.timer.warn { background: var(--hl); color: var(--ink); border: 2px solid var(--ink); }
.timer.danger { background: var(--pen); color: #fff; animation: pulse 1s steps(2) infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.quiz-layout { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 32px; padding-top: 28px; padding-bottom: 56px; }
.quiz-nav { position: sticky; top: 140px; align-self: start; }
.quiz-nav ol { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quiz-nav a { display: grid; place-items: center; height: 30px; border: 2px solid var(--ink); border-radius: 6px; font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--ink); background: var(--card); position: relative; }
.quiz-nav a:hover { text-decoration: none; background: var(--hl-soft); }
.quiz-nav a.answered { background: var(--ink); color: #fff; }
.quiz-nav a.flagged::after { content: ""; position: absolute; top: -5px; right: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--pen); border: 2px solid var(--card); }
.quiz-nav .legend { line-height: 1.8; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin: 0 2px 0 6px; }
.dot.answered { background: var(--ink); }
.dot.flagged { background: var(--pen); border-radius: 50%; }
@media (max-width: 760px) {
  .quiz-layout { grid-template-columns: 1fr; }
  .quiz-nav { position: static; }
  .quiz-nav ol { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
  .quiz-bar { top: 68px; }
}
.question { scroll-margin-top: 150px; border: 2px solid var(--ink); margin: 0 0 18px; min-width: 0; }
.question-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.q-num { font-family: var(--font-mono); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; color: var(--pen-text); }
.flag-btn { margin-left: auto; background: none; border: 2px solid var(--line); border-radius: 6px; font: inherit; font-size: .8rem; padding: .15em .6em; cursor: pointer; color: var(--muted); }
.flag-btn.on { border-color: var(--pen); color: var(--pen-text); background: #ffe5df; }
.q-prompt { font-size: 1.08rem; margin-bottom: 14px; }
.q-image { max-height: 320px; border: 1px solid var(--line); border-radius: 6px; margin: 0 0 14px; background: #fff; }
.choices { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.choice { display: flex; align-items: flex-start; gap: 10px; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; background: #fff; transition: border-color .1s, background .1s; }
.choice:hover { border-color: var(--ink); }
.choice input { margin-top: 4px; accent-color: var(--ink); width: 18px; height: 18px; flex: none; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--hl-soft); }
.choice-letter { font-family: var(--font-mono); font-weight: 700; flex: none; width: 1.4em; }
.choice-text { flex: 1; }
.numeric-answer { display: grid; gap: 6px; max-width: 260px; font-weight: 700; font-size: .92rem; }
.numeric-answer input { font-family: var(--font-mono); font-size: 1.1rem; }
.submit-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; box-shadow: var(--shadow-hard); }
.submit-card p { margin: 0; }

.score-hero { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-top: 8px; }
.score-hero h1 { margin-bottom: 8px; }
.score-hero .row-actions form { margin: 0; }
.score-ring { --pct: 0; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(var(--card) 58%, transparent 59%), conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--paper-2) 0); border: 2px solid var(--ink); }
.score-ring.passed { --ring: var(--ok); }
.score-ring.failed { --ring: var(--pen); }
.score-ring span { display: grid; text-align: center; }
.score-ring strong { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.score-ring small { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); margin-top: 4px; }
.question.review { border-left-width: 8px; }
.question.review.is-right { border-left-color: var(--ok); }
.question.review.is-wrong { border-left-color: var(--pen); }
.verdict { font-weight: 700; }
.is-right .verdict { color: var(--ok); }
.is-wrong .verdict { color: var(--pen-text); }
.review-choices .choice { cursor: default; align-items: center; }
.review-choices .choice.correct { border-color: var(--ok); background: #e4f5ea; }
.review-choices .choice.wrong { border-color: var(--pen); background: #ffe5df; }
.choice-tags { display: flex; gap: 6px; }
.choice-tags .tag { margin: 0; }
.numeric-review { font-size: 1.02rem; }
.explanation { margin-top: 14px; padding: 12px 14px; background: var(--paper-2); border-radius: var(--radius-sm); border-left: 4px solid var(--hl-deep, #c9db00); }
.pct-low { color: var(--danger); font-weight: 700; }

/* admin question editor */
.choices-editor { margin: 6px 0 18px; }
.choice-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.choice-row textarea { min-height: 44px; flex: 1; }
.choice-row .check { white-space: nowrap; }
[data-for][hidden] { display: none !important; }
