/* ============================================================
   EduNova — Design Tokens
   Palette: cool paper ground, deep indigo ink, dusty-teal
   secondary, single marigold accent reserved for progress /
   correctness / streaks. Display serif (Fraunces) for editorial
   headlines, Plex Sans for UI/body, Plex Mono reserved for data
   labels (durations, scores, timers) — a nod to the CS subject
   matter without turning the whole UI into a terminal.
   ============================================================ */

:root{
  /* -- core palette -- */
  --ink:            #161B2E;
  --ink-soft:       #3B4368;
  --indigo:         #202A52;
  --indigo-strong:  #141A34;
  --teal:           #3E6E82;
  --teal-soft:      #E9F0F1;
  --amber:          #E2A73B;
  --amber-strong:   #B9821F;
  --good:           #2F8F5B;
  --good-soft:      #E5F3EA;
  --bad:            #C1443C;
  --bad-soft:       #FBEAE8;

  --paper:          #F6F6F2;
  --paper-raised:   #FFFFFF;
  --paper-sunken:   #EDEDE6;
  --line:           #DDDCD2;
  --line-strong:    #C7C6B9;

  --text:           var(--ink);
  --text-soft:      var(--ink-soft);
  --text-on-dark:   #F3F3EE;
  --surface:        var(--paper);
  --surface-raised: var(--paper-raised);
  --surface-sunken: var(--paper-sunken);
  --border:         var(--line);
  --border-strong:  var(--line-strong);
  --brand:          var(--indigo);
  --brand-strong:   var(--indigo-strong);

  --focus:          #1857C6;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-s: 3px;
  --radius-m: 6px;
  --radius-l: 10px;

  --shadow-s: 0 1px 2px rgba(22,27,46,0.06);
  --shadow-m: 0 6px 20px rgba(22,27,46,0.08);
  --shadow-l: 0 16px 40px rgba(22,27,46,0.14);

  --maxw: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  color-scheme: light;
}

:root[data-theme="dark"]{
  --ink:            #EDEEF5;
  --ink-soft:       #B7BAD1;
  --text:           var(--ink);
  --text-soft:      var(--ink-soft);
  --surface:        #12162A;
  --surface-raised: #191E37;
  --surface-sunken: #0D1023;
  --border:         #2B3153;
  --border-strong:  #3B4270;
  --brand:          #7C93E8;
  --brand-strong:   #A8B8F2;
  --teal-soft:      #16262A;
  --good-soft:      #10261A;
  --bad-soft:       #2A1414;
  --focus:          #8FB2FF;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]):not([data-theme="dark"]){
    --ink:            #EDEEF5;
    --ink-soft:       #B7BAD1;
    --text:           var(--ink);
    --text-soft:      var(--ink-soft);
    --surface:        #12162A;
    --surface-raised: #191E37;
    --surface-sunken: #0D1023;
    --border:         #2B3153;
    --border-strong:  #3B4270;
    --brand:          #7C93E8;
    --brand-strong:   #A8B8F2;
    --teal-soft:      #16262A;
    --good-soft:      #10261A;
    --bad-soft:       #2A1414;
    --focus:          #8FB2FF;
    color-scheme: dark;
  }
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *,*::before,*::after{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

h1,h2,h3,h4{
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.12;
  font-weight: 600;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1{ font-size: clamp(2.1rem, 4vw, 3.4rem); font-weight: 560; }
h2{ font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
h3{ font-size: 1.3rem; }
h4{ font-size: 1.08rem; }

p{ margin: 0 0 1em; max-width: 62ch; color: var(--text); }
p.lede{ color: var(--text-soft); font-size: 1.1rem; max-width: 54ch; }

a{ color: inherit; }
img{ max-width: 100%; display: block; }

.mono{ font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.container{
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section{ padding-block: clamp(2.5rem, 6vw, 5rem); }
.section-tight{ padding-block: clamp(1.5rem, 3vw, 2.5rem); }

.rule{ border: 0; border-top: 1px solid var(--border); margin: 0; }
.vrule{ width: 1px; background: var(--border); align-self: stretch; }

/* skip link */
.skip-link{
  position: absolute; left: -999px; top: 0; z-index: 2000;
  background: var(--brand); color: #fff; padding: .75rem 1.25rem;
  border-radius: 0 0 var(--radius-m) 0; text-decoration: none; font-weight: 600;
}
.skip-link:focus{ left: 0; }

:focus-visible{ outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.visually-hidden{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

::selection{ background: var(--amber); color: var(--indigo-strong); }
