/* Fonts are served from this site, not a font CDN. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/fraunces-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fraunces-latin-600-normal.woff2') format('woff2'); }

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1f2430;
  --muted: #5e6472;
  --line: #e4ded3;
  --accent: #3d5a80;
  --accent-ink: #ffffff;
  --warm: #c2703d;
  --hub: #1f2430;
  --hub-ink: #faf7f2;
  --focus: #c2703d;
  --shadow: 0 1px 2px rgba(31, 36, 48, .06), 0 8px 24px rgba(31, 36, 48, .06);
  /* perspective hues */
  --h1: #3d5a80; --h2: #2a7f62; --h3: #b5523b; --h4: #7a5195;
  --h5: #8a6914; --h6: #2f7f9e; --h7: #9c3d68; --h8: #5b6b2f;
  /* question levels */
  --l1: #2a7f62; --l2: #2f7f9e; --l3: #7a5195; --l4: #b5523b;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161c; --surface: #1c1f27; --ink: #ece8e1; --muted: #a3a8b4; --line: #2e323d;
    --accent: #8fb0d9; --accent-ink: #14161c; --warm: #e0955f; --hub: #ece8e1; --hub-ink: #14161c;
    --focus: #e0955f; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --h1: #8fb0d9; --h2: #6cc3a0; --h3: #e38d75; --h4: #b896d4;
    --h5: #d6b25a; --h6: #72bcd8; --h7: #d987ad; --h8: #a7b96a;
    --l1: #6cc3a0; --l2: #72bcd8; --l3: #b896d4; --l4: #e38d75;
  }
}
:root[data-theme="dark"] {
  --bg: #14161c; --surface: #1c1f27; --ink: #ece8e1; --muted: #a3a8b4; --line: #2e323d;
  --accent: #8fb0d9; --accent-ink: #14161c; --warm: #e0955f; --hub: #ece8e1; --hub-ink: #14161c;
  --focus: #e0955f; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --h1: #8fb0d9; --h2: #6cc3a0; --h3: #e38d75; --h4: #b896d4;
  --h5: #d6b25a; --h6: #72bcd8; --h7: #d987ad; --h8: #a7b96a;
  --l1: #6cc3a0; --l2: #72bcd8; --l3: #b896d4; --l4: #e38d75;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--sans);
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.bar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 18px 16px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font: 600 20px var(--serif); color: var(--ink); text-decoration: none; }
.brand svg { width: 24px; height: 24px; }
.brand svg circle:first-child { fill: var(--warm); }
.brand svg circle:last-child { stroke: var(--accent); stroke-width: 3; }
.by { color: var(--muted); font-size: 14px; }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 64px; }

/* home */
.hero { max-width: 680px; margin: 48px auto 0; text-align: center; }
.hero h1 { font-size: clamp(32px, 6vw, 48px); margin: 0 0 12px; }
.sub { color: var(--muted); font-size: 18px; margin: 0 auto 28px; max-width: 560px; }
#ask { text-align: left; }
#ask input {
  width: 100%; padding: 16px 18px; font: 500 18px var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
#ask input::placeholder { color: var(--muted); opacity: .8; }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; }
.models { border: 0; margin: 0; padding: 0; display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.models label { position: relative; cursor: pointer; }
.models input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.models span { display: block; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.models input:checked + span { background: var(--ink); color: var(--bg); }
.models input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.models input:disabled + span { opacity: .4; cursor: not-allowed; }
button {
  font: 600 16px var(--sans); padding: 12px 22px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
}
button:disabled { opacity: .6; cursor: progress; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); padding: 8px 14px; font-size: 14px; }
.form-msg { min-height: 1.5em; color: var(--muted); font-size: 15px; margin: 10px 0 0; }
.form-msg.error { color: var(--h3); }

.recent { max-width: 680px; margin: 56px auto 0; }
.recent h2 { font-size: 20px; margin: 0 0 12px; }
.recent ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.recent a {
  display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 15px;
}
.recent a:hover { border-color: var(--accent); }

/* working */
#working { max-width: 560px; margin: 56px auto 0; text-align: center; }
#working h1 { font-size: 32px; margin: 20px 0 24px; }
.spinner-wheel {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
  background: conic-gradient(var(--h1) 0 12.5%, var(--h2) 0 25%, var(--h3) 0 37.5%, var(--h4) 0 50%, var(--h5) 0 62.5%, var(--h6) 0 75%, var(--h7) 0 87.5%, var(--h8) 0);
  -webkit-mask: radial-gradient(circle, transparent 18px, #000 19px); mask: radial-gradient(circle, transparent 18px, #000 19px);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner-wheel { animation: none; } }
.steps { text-align: left; list-style: none; padding: 0; margin: 0 auto; max-width: 460px; }
.steps li { padding: 10px 0 10px 32px; position: relative; color: var(--muted); border-bottom: 1px solid var(--line); }
.steps li::before { content: ''; position: absolute; left: 6px; top: 17px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); }
.steps li.active { color: var(--ink); font-weight: 500; }
.steps li.active::before { border-color: var(--warm); background: var(--warm); }
.steps li.done::before { border-color: var(--h2); background: var(--h2); }
.hint { color: var(--muted); font-size: 14px; margin-top: 20px; }

/* primer */
.primer-head { max-width: 760px; margin: 24px auto 8px; text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--warm); margin: 0; }
.primer-head h1 { font-size: clamp(32px, 6vw, 52px); margin: 8px 0 12px; }
.intro { color: var(--muted); font-size: 18px; margin: 0; }

.layout { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 40px; align-items: start; margin-top: 32px; }
.wheel-wrap { margin: 0; position: sticky; top: 16px; }
.wheel-wrap figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 4px; }
#wheel { width: 100%; height: auto; display: block; overflow: visible; }
#wheel .seg { cursor: pointer; }
#wheel .seg path { stroke: var(--bg); stroke-width: 3; transition: filter .2s, transform .2s; transform-origin: 200px 200px; }
#wheel .seg:hover path { filter: brightness(1.08); }
#wheel .seg.on path { transform: scale(1.04); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25)); }
#wheel .seg.on text { font-size: 14px; }
#wheel .seg:focus { outline: none; }
#wheel .seg:focus-visible path { stroke: var(--focus); }
#wheel .seg text { fill: #fff; font: 600 13px var(--sans); pointer-events: none; }
:root[data-theme="dark"] #wheel .seg text { fill: #14161c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #wheel .seg text { fill: #14161c; } }
#wheel .hub circle { fill: var(--hub); }
#wheel .hub text { fill: var(--hub-ink); text-anchor: middle; }
#wheel .hub .top { font: 500 15px var(--sans); opacity: .8; }
#wheel .hub .bottom { font: 600 26px var(--serif); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); border-top: 6px solid var(--hue, var(--accent)); }
.panel h2 { font-size: 28px; margin: 0 0 6px; }
.panel .lead { color: var(--muted); margin: 0 0 20px; font-size: 17px; }
.level { margin-top: 20px; }
.level h3 {
  font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px;
  color: var(--lc); display: flex; align-items: center; gap: 8px;
}
.level h3 .dots { display: inline-flex; gap: 3px; }
.level h3 .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--lc); }
.level h3 .dots i.off { background: var(--line); }
.level ol { margin: 0; padding-left: 22px; }
.level li { margin: 6px 0; }
.level li::marker { color: var(--lc); font-weight: 600; }
.l-basics { --lc: var(--l1); } .l-intermediate { --lc: var(--l2); } .l-advanced { --lc: var(--l3); } .l-research { --lc: var(--l4); }

.all { margin-top: 64px; border-top: 1px solid var(--line); padding-top: 24px; }
.all-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.all-head h2 { margin: 0; font-size: 24px; }
.all details { border-bottom: 1px solid var(--line); }
.all summary { cursor: pointer; padding: 14px 0; font: 600 18px var(--serif); list-style: none; display: flex; align-items: center; gap: 10px; }
.all summary::-webkit-details-marker { display: none; }
.all summary::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--hue); flex: none; }
.all summary::after { content: '+'; margin-left: auto; color: var(--muted); font-family: var(--sans); }
.all details[open] summary::after { content: '–'; }
.all .body { padding: 0 0 18px 22px; }
.all .body .lead { color: var(--muted); margin: 0; }

.primer-foot { max-width: 760px; margin: 48px auto 0; color: var(--muted); font-size: 15px; text-align: center; }
.primer-foot details { text-align: left; margin: 16px auto; max-width: 620px; }
.primer-foot summary { cursor: pointer; text-align: center; }
.primer-foot ul { font-size: 14px; padding-left: 20px; }
.primer-foot li { margin: 4px 0; overflow-wrap: anywhere; }
.made { font-size: 13px; }

#missing { text-align: center; margin-top: 80px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 20px; }
  .wheel-wrap { position: static; max-width: 400px; margin: 0 auto; width: 100%; }
  .panel { padding: 20px; }
  .panel h2 { font-size: 24px; }
}
@media (max-width: 480px) {
  .row { flex-direction: column; align-items: stretch; }
  .models { justify-content: center; }
  .hero { margin-top: 24px; }
}

@media print {
  .bar, .wheel-wrap, .panel, .all-head button, .primer-foot a, #p-sources { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .layout { display: block; margin: 0; }
  .all { margin-top: 12px; border: 0; }
  .all details { break-inside: avoid; }
  .all summary::after { content: none; }
  .all .body { display: block !important; }
}

/* ---------- accounts, answers and plans ---------- */
.nav { display: flex; align-items: center; gap: 16px; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--accent); }
button.small { padding: 6px 14px; font-size: 14px; }
button.link { background: none; color: var(--accent); padding: 4px 0; font-weight: 500; }
.row.end { justify-content: flex-end; }
.muted { color: var(--muted); }

.unlock {
  max-width: 1120px; margin: 28px auto 0; padding: 18px 22px; display: flex; align-items: center; gap: 18px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--warm); border-radius: 14px; box-shadow: var(--shadow);
}
.unlock strong { font: 600 18px var(--serif); }
.unlock p { margin: 2px 0 0; color: var(--muted); }
.unlock.busy { justify-content: flex-start; }
.spinner-wheel.small { width: 40px; height: 40px; flex: none; -webkit-mask: radial-gradient(circle, transparent 10px, #000 11px); mask: radial-gradient(circle, transparent 10px, #000 11px); margin: 0; }
@media (max-width: 600px) { .unlock { flex-direction: column; align-items: stretch; } }

.level li .q { margin: 0; font-weight: 500; }
.level li .a { margin: 4px 0 14px; color: var(--ink); opacity: .85; font-size: 15px; line-height: 1.65; border-left: 2px solid var(--line); padding-left: 12px; }

.dlg { border: 1px solid var(--line); border-radius: 16px; padding: 28px; max-width: 420px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.dlg.wide { max-width: 920px; }
.dlg::backdrop { background: rgba(20, 22, 28, .45); }
.dlg h2 { margin: 0 0 6px; font-size: 26px; }
.dlg .sub { font-size: 15px; margin: 0 0 18px; text-align: left; }
.dlg form:not(.dlg-close) { display: grid; gap: 10px; }
.dlg label { font-size: 14px; font-weight: 500; }
.dlg input { padding: 12px 14px; font: 500 17px var(--sans); border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.dlg-close { position: absolute; right: 12px; top: 8px; }
.dlg-close button { background: none; color: var(--muted); font-size: 26px; padding: 4px 10px; }
.dlg { position: fixed; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 24px auto 0; max-width: 960px; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.plan.featured { border: 2px solid var(--accent); }
.plan .tag { position: absolute; top: -11px; left: 18px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.plan h3 { margin: 0; font-size: 20px; }
.plan .price { font: 600 30px var(--serif); margin: 4px 0; }
.plan .price span { font: 400 14px var(--sans); color: var(--muted); }
.plan .desc { color: var(--muted); font-size: 15px; margin: 0 0 12px; flex: 1; }
#pricing .fine { text-align: center; color: var(--muted); font-size: 14px; margin-top: 20px; }

#account { max-width: 960px; margin: 32px auto 0; }
#account h1 { font-size: 36px; margin: 0; }
#account .sub { text-align: left; margin: 4px 0 24px; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.card.wide { grid-column: 1 / -1; }
.card h2 { font-size: 18px; margin: 0 0 10px; }
.billing { display: grid; gap: 8px; max-width: 520px; }
.billing label { font-size: 14px; font-weight: 500; }
.billing input, .billing textarea { font: 400 15px var(--sans); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.billing button { padding: 8px 18px; font-size: 14px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 500; }
@media (max-width: 700px) { .acct-grid { grid-template-columns: 1fr; } .tbl { display: block; overflow-x: auto; } }
a.button { display: inline-block; font: 600 16px var(--sans); padding: 12px 22px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
a.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); padding: 8px 14px; font-size: 14px; }

/* Browser printing follows the same breaks as the PDF. */
@media print {
  .unlock, #pdf { display: none !important; }
  .all details { break-before: page; break-inside: auto; }
  .all details:first-child { break-before: auto; }
  .level h3 { break-after: avoid; }
  .level li { break-inside: avoid; }
  .level li .a { border-left-color: #ccc; }
}
.topic-label { display: block; font-weight: 600; margin-bottom: 8px; }
#home .hero { margin-top: 72px; }

/* ---------- footer and legal pages ---------- */
.fine-print { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.site-foot { max-width: 1120px; margin: 40px auto 0; padding: 24px 16px 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.site-foot nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--accent); }
.legal { max-width: 720px; margin: 24px auto 0; padding: 0 16px; }
.legal h1 { font-size: clamp(30px, 5vw, 40px); margin: 0 0 4px; }
.legal .updated { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.legal .lead-in { font-size: 17px; }
.legal h2 { font-size: 20px; margin: 28px 0 8px; }
.legal li { margin: 6px 0; }
.legal dl.contact { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 20px 0; }
.legal dl.contact dt { color: var(--muted); }
.legal dl.contact dd { margin: 0; }
@media print { .site-foot { display: none; } }
