/* The Reportcards visual system. Geometry stays in styles.css; all themeable
   surfaces and the editorial treatment live here. No external assets. */
:root {
  color-scheme: light;
  --ink: #12233d;
  --text: #26364b;
  --muted: #59677a;
  --navy: #18365d;
  --navy-700: #244971;
  --gold: #edc36a;
  --gold-deep: #805b19;
  --page: #f9f7f2;
  --paper: #f1eee6;
  --surface: #ffffff;
  --tint: #eceff4;
  --line: #d9d8d0;
  --correct: #197254;
  --success-tint: #edf6f0;
  --fix-tint: #faf1dc;
  --fix-line: #cba45b;
  --warning-ink: #694b19;
  --weak-ink: #98424e;
  --action-bg: #173457;
  --action-ink: #ffffff;
  --focus-ring: #896018;
  --shadow: 0 5px 20px #14273f05, 0 1px 3px #14273f05;
  --shadow-hover: 0 18px 36px #14273f14;
  --content: 1200px;
  --editorial: Georgia, 'Times New Roman', serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f3ed;
  --text: #d3dce8;
  --muted: #a2b2c8;
  --navy: #b7cdf0;
  --navy-700: #d6e4fa;
  --gold: #edc36a;
  --gold-deep: #edc778;
  --page: #0b1423;
  --paper: #17253a;
  --surface: #111e31;
  --tint: #203047;
  --line: #33445b;
  --correct: #7ce0b8;
  --success-tint: #142e2a;
  --fix-tint: #302a1d;
  --fix-line: #9d8149;
  --warning-ink: #f1cf86;
  --weak-ink: #f3a7b0;
  --action-bg: #edc36a;
  --action-ink: #13233a;
  --focus-ring: #f3cd80;
  --shadow: 0 6px 20px #00000018;
  --shadow-hover: 0 18px 40px #00000040;
}
/* theme.js applies system preference before first paint. This fallback keeps
   the page readable if scripts are disabled or fail to load. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #f5f3ed; --text: #d3dce8; --muted: #a2b2c8;
    --page: #0b1423; --surface: #111e31; --paper: #17253a;
    --tint: #203047; --line: #33445b; --navy: #b7cdf0;
    --gold-deep: #edc778; --action-bg: #edc36a; --action-ink: #13233a;
    --focus-ring: #f3cd80;
  }
}
body { background: var(--page); }
::selection { background: #edc36a; color: #12233d; }
header {
  background: var(--surface);
  border-color: var(--line);
  flex-wrap: nowrap;
  padding-top: 20px;
  padding-bottom: 20px;
}
.brand { color: var(--ink); font-size: 21px; letter-spacing: -.04em; }
.brand small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.logo { background: #ffffff; border-radius: 50%; }
nav { margin-left: auto; gap: 22px; }
nav a { color: var(--text); font-size: 13px; white-space: nowrap; }
nav a:hover, nav a[aria-current="page"] { color: var(--gold-deep); }
.theme-control {
  display: flex; align-items: center; gap: 5px;
  padding: 0 8px 0 10px; margin: 0; border: 1px solid var(--line);
  border-radius: 999px; background: var(--page); flex: none;
}
.theme-control svg { stroke: var(--gold-deep); stroke-width: 1.6; fill: none; flex: none; }
.theme-control select {
  font: 600 12px/1.4 Inter, system-ui, sans-serif;
  width: auto; padding: 10px 3px; min-height: 42px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text);
}
.theme-control select option { background: var(--surface); color: var(--ink); }
:is(button,a,input,select,textarea,summary,[tabindex]):not(main):focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 4px;
}
/* The landmark receives focus after routing; interactive controls retain rings. */
main:focus { outline: none; }
.skip:focus { background: var(--surface); color: var(--ink); }
main { padding-top: 36px; }
footer { padding: 32px var(--gutter); line-height: 1.9; }
h1 { font-size: clamp(2rem, 1.3rem + 2.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1vw, 2rem); }
.eyebrow { font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.card, .text-card, .workspace > section:last-child {
  background: var(--surface); border-color: var(--line); box-shadow: var(--shadow);
  border-radius: 18px;
}
.card p { line-height: 1.75; }
button, .button { background: var(--action-bg); color: var(--action-ink); gap: 14px; }
button:hover, .button:hover { background: var(--navy-700); color: var(--action-ink); }
:root[data-theme="dark"] :is(button,.button):hover { background: #f5d796; color: #13233a; }
.secondary { background: var(--tint); color: var(--ink); }
.secondary:hover { background: var(--line); color: var(--ink); }
.gold { background: var(--gold); color: #14253d; }
.gold:hover { background: #f4d692; color: #14253d; }
.chip { color: var(--text); background: var(--tint); }
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  color: var(--ink); background: var(--surface); border-color: #7e8999;
}
:root[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select) { border-color: #71829a; }
::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold-deep); }
.tabs, .passage, .own-guide { background: var(--paper); border-color: var(--line); }
.tabs button { color: var(--text); background: transparent; }
.tabs button[aria-pressed="true"], [role="tab"][aria-selected="true"] { background: var(--action-bg); color: var(--action-ink); }
.status-pill.online { color: var(--correct); }
.error, .notice { background: var(--fix-tint); color: var(--warning-ink); border-color: var(--fix-line); }
.question:hover { border-color: var(--gold-deep); }
details { background: var(--surface); }
.hero {
  padding: 52px 54px; min-height: 480px; border-radius: 26px;
  background: radial-gradient(ellipse at 83% 38%, #a5813a28, transparent 48%), linear-gradient(115deg, #122e50, #0a1b32 82%);
  border: 1px solid #2a4361; margin-bottom: 0;
  box-shadow: 0 20px 40px #0a1a3310;
}
.hero-copy { max-width: 58%; }
.hero .chip {
  padding: 0; border-radius: 0; background: transparent;
  color: #f1cc80; font: 500 11px/1.5 Inter, system-ui, sans-serif;
  letter-spacing: .06em;
}
.hero h1 { font-size: 14px; line-height: 1.5; font-weight: 600; letter-spacing: .02em; margin: 22px 0 12px; }
.hero .hero-statement {
  font: 500 clamp(2.7rem, 1.5rem + 3.2vw, 4.5rem)/1.06 var(--editorial);
  letter-spacing: -.045em; color: #fffaf0; margin: 0 0 26px;
}
.hero-statement em { color: #edc87d; font-weight: 400; }
.hero-copy > p:not(.hero-statement) { max-width: 415px; font-size: 15px; line-height: 1.8; color: #cfdaea; }
.hero .button { margin-top: 8px; font-size: 13px; padding: 13px 18px; }
.hero :focus-visible { outline-color: #f3cd80; }
.hero-note { display: block; color: #b7c6da; margin-top: 12px; font-size: 11px; }
.literary-scene { inset: 0 0 0 55%; }
.stage-curtain { display: none; }
.stage-light { width: 540px; height: 540px; left: -40px; top: -40px; }
.scene-orbit {
  position: absolute; width: 380px; height: 380px; border: 1px solid #e3c9891c;
  border-radius: 50%; left: 48%; top: 50%; transform: translate(-50%, -50%) rotateX(55deg) rotateZ(-25deg);
}
.orbit-two { width: 460px; height: 460px; border-style: dashed; opacity: .5; transform: translate(-50%, -50%) rotateX(35deg) rotateZ(18deg); }
.book-drift { width: 294px; height: 207px; margin: -104px 0 0 -147px; left: 45%; top: 50%; }
.book-cover { box-shadow: 0 8px 0 #07152c, 0 10px 1px #ad8940, 0 14px 25px #02091250; }
.book-leaf { border-radius: 3px 15px 12px 3px; }
.book-leaf::after { opacity: .3; inset: 30px 20px 22px; background: repeating-linear-gradient(transparent 0 8px, #756548 8px 9px); }
.book-leaf.left::before { content: ''; position: absolute; top: 20px; left: 22px; width: 25px; height: 4px; background: #b28a43; opacity: .7; }
.book-shadow { top: 76%; left: 45%; width: 245px; opacity: .75; }
.practice-journey {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 26px;
  list-style: none; padding: 28px 10px 32px; margin: 0 0 44px; border-bottom: 1px solid var(--line);
}
.practice-journey li { display: flex; gap: 14px; align-items: flex-start; font-size: 12px; }
.practice-journey li > span { font: italic 24px/1.2 var(--editorial); color: var(--gold-deep); }
.practice-journey strong { color: var(--ink); font-size: 12px; }
.practice-journey p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.section-intro { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 24px; }
.section-intro h2 { margin: 8px 0 0; }
.section-intro p { margin: 0; font-size: 12px; color: var(--muted); }
.section-intro .eyebrow { color: var(--gold-deep); font-size: 10px; }
.boards { gap: 20px; margin-bottom: 28px; }
.board-card { padding: 30px; gap: 12px; position: relative; }
.board-heading { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 16px; margin-bottom: 12px; }
.board-number { font: 500 24px/1 var(--editorial); color: var(--gold-deep); }
.board-heading .eyebrow { color: var(--muted); font-size: 9px; }
.board-card h3 { font-size: 23px; line-height: 1.25; margin: 0; max-width: 380px; }
.board-card > p { font-size: 12px; color: var(--muted); }
.course-preview { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; padding: 0; }
.course-preview li { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 10px; color: var(--text); }
.course-preview span { color: var(--muted); }
.board-card .button { background: transparent; color: var(--navy); border-top: 1px solid var(--line); padding: 16px 0 0; border-radius: 0; font-size: 12px; justify-content: space-between; width: 100%; text-align: left; }
.board-card .button > span { color: var(--gold-deep); font-size: 21px; margin-left: auto; }
.board-card .button:hover { color: var(--gold-deep); background: transparent; }
.own-path { background: var(--paper); border-color: var(--line); padding: 32px; }
.own-path > p { font-size: 14px; max-width: 650px; }
.own-path h2 { font: 500 32px/1.15 var(--editorial); }
.own-path .button { font-size: 13px; }
.result-question { font-size: clamp(1.6rem,1.15rem + 1.8vw,2.5rem); max-width: 960px; margin-bottom: 28px; }
.result-context { text-transform: none; letter-spacing: .035em; }
.score {
  background: radial-gradient(ellipse at 95% 0%, #e7b53c19, transparent 55%), linear-gradient(115deg, #132f51, #0b1c34);
  border: 1px solid #34506e; border-radius: 24px; padding: 36px 40px; gap: 44px;
  box-shadow: 0 12px 32px #0a1a3312;
}
.score > div:first-child { text-align: center; }
.score .score-caption { margin: 0 0 14px; font: 500 25px/1.25 var(--editorial); color: #fff3d9; }
.score .chip { background: #edc36a; color: #14253d; font-size: 11px; }
.score .eyebrow { color: #bfcee0; font-size: 10px; }
.score p { color: #e0e7f1; font-size: 15px; }
.score small { display: block; color: #bcccdf; font-size: 12px; margin-top: 12px; }
.mark-orbit { width: 166px; height: 166px; }
.mark-orbit circle { stroke-width: 4px; }
.ring-track { stroke: #ffffff20; }
.ring-value { stroke: #edc36a; }
.table-heading, .feedback-heading { margin-top: 36px; }
.marking-tables { margin-bottom: 36px; }
.table-score { position: relative; }
.table-score h3 { font-size: 16px; }
.table-score .table-value { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.table-value strong { font: 600 36px/1.1 Jakarta, system-ui, sans-serif; color: var(--ink); letter-spacing: -.04em; }
.table-score meter { display: block; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--tint); }
.table-score meter::-webkit-meter-bar { background: var(--tint); border: 0; border-radius: 99px; }
.table-score meter::-webkit-meter-optimum-value { background: #ab7a24; border-radius: 99px; }
:root[data-theme="dark"] .table-score meter::-webkit-meter-optimum-value { background: #edc36a; }
.table-score .table-band { font-size: 11px; font-weight: 700; margin: 16px 0 6px; color: var(--gold-deep); }
.table-score .muted { font-size: 12px; }
.aos { gap: 16px; }
.ao { border-top-width: 3px; padding: 24px; }
.ao.secure { border-top-color: var(--navy); }
.ao.strong .rating { color: var(--correct); }
.ao.developing .rating { color: var(--gold-deep); }
.ao.weak .rating { color: var(--weak-ink); }
.ao p { font-size: 13px; }
.ao .rating { font-size: 10px; }
.fix { background: var(--fix-tint); border-color: var(--fix-line); border-left: 4px solid var(--gold-deep); padding: 30px; }
.fix h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.fix p { max-width: 780px; }
.targeted-drill { border-left-color: var(--gold-deep); }
.upgrade { background: var(--surface); border-color: var(--line); border-top: 3px solid var(--correct); }
.upgrade-text { background: var(--success-tint); padding: 26px; border-radius: 12px; font: 400 20px/1.9 var(--editorial); margin: 22px 0 32px; }
.change { margin-top: 22px; padding-top: 22px; }
.after { color: var(--correct); }
.attempt-title { font-size: 20px; }
.task-guide-title { font-size: 20px; }
.phrase-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.phrase-comparison p { padding: 18px; margin: 0; border-radius: 10px; font-size: 14px; }
.phrase-comparison .before { color: var(--text); background: var(--paper); }
.phrase-comparison .after { color: var(--text); background: var(--success-tint); font-weight: 500; }
.comparison-label { display: block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.after .comparison-label { color: var(--correct); }
.after mark { color: inherit; background: transparent; text-decoration: underline; text-decoration-color: var(--correct); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.change-reason { padding: 16px 4px 0; font-size: 13px; }
.change-reason .eyebrow { display: block; margin-bottom: 4px; font-size: 9px; }
.writing-comparison mark { background: var(--fix-tint); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.empty, .progress, .own-wait, .opening-state { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; }
.empty { padding: 48px 28px; }
.empty::before { content: '✧'; display: block; color: var(--gold-deep); font-size: 32px; margin-bottom: 14px; }
.progress, .own-wait { background: radial-gradient(ellipse at top, var(--tint), transparent 70%), var(--surface); }
.progress h2, .own-wait h2 { font-family: var(--editorial); font-weight: 500; font-size: 28px; }
.opening-state { display: grid; align-content: center; justify-items: center; min-height: 480px; color: var(--muted); font-size: 14px; }
.opening-state .book-loader { display: none; }
.opening-state::before { content: '✧'; color: var(--gold-deep); font-size: 36px; margin-bottom: 12px; }
main:has(> .opening-state) + footer { visibility: hidden; }
.table-scroll:focus-visible { outline-offset: 3px; }
@media (hover:hover) and (pointer:fine) {
  .motion-enabled :is(.text-card,.pathway,.quote):hover { box-shadow: var(--shadow-hover); }
  .board-card:focus-within { border-color: var(--gold-deep); }
}
@media (max-width: 1000px) {
  header { flex-wrap: wrap; gap: 14px; }
  nav { order: 3; width: 100%; margin-left: 0; border-top: 1px solid var(--line); padding-top: 8px; }
  .theme-control { margin-left: auto; }
  .hero { padding: 40px; }
  .book-drift { width: 230px; height: 170px; margin: -85px 0 0 -115px; }
}
@media (max-width: 699px) {
  main { padding-top: 20px; }
  header { padding-top: 14px; padding-bottom: 10px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand small { font-size: 9px; }
  .logo { width: 44px; height: 44px; }
  nav { justify-content: space-between; gap: 7px; padding-top: 6px; }
  nav a { font-size: 11px; padding: 8px 0; }
  .theme-control { gap: 3px; padding: 0 4px 0 7px; }
  .theme-control svg { width: 15px; height: 15px; }
  .theme-control select { font-size: 11px; min-height: 40px; }
  .hero { padding: 28px 26px 210px; border-radius: 20px; min-height: 0; }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: 12px; margin-top: 24px; }
  .hero .hero-statement { font-size: clamp(2.5rem,1.5rem + 5vw,3.5rem); }
  .hero-copy > p:not(.hero-statement) { font-size: 13px; }
  .hero .chip { font-size: 10px; }
  .literary-scene { inset: auto 0 0; height: 195px; overflow: hidden; }
  .book-drift { width: 210px; height: 140px; margin: -70px 0 0 -105px; left: 50%; top: 48%; }
  .book-shadow { left: 50%; top: 84%; width: 180px; }
  .stage-light { top: -190px; left: calc(50% - 270px); }
  .scene-orbit { width: 285px; height: 285px; left: 50%; top: 48%; }
  .orbit-two { width: 340px; height: 340px; }
  .practice-journey { grid-template-columns: minmax(0,1fr); padding: 26px 6px; gap: 20px; margin-bottom: 30px; }
  .practice-journey li { gap: 18px; }
  .practice-journey strong { font-size: 13px; }
  .practice-journey p { font-size: 11px; }
  .section-intro { display: block; margin-bottom: 20px; }
  .section-intro > p { margin-top: 12px; }
  .board-card { padding: 24px; }
  .board-card h3 { font-size: 22px; }
  .own-path { padding: 26px; }
  .score { padding: 26px; gap: 24px; }
  .score > div:first-child { display: flex; flex-direction: column; align-items: center; }
  .score .score-caption { font-size: 25px; }
  .score > div:last-child { border-top: 1px solid #ffffff26; padding-top: 24px; }
  .score .mark-orbit { width: 156px; height: 156px; }
  .phrase-comparison { grid-template-columns: minmax(0,1fr); }
  .upgrade-text { padding: 18px; font-size: 18px; }
  .fix { padding: 24px; }
  .progress-filters { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .motion-reveal { opacity: 1 !important; transform: none !important; }
}
