/* ESET 489 course site. Same tokens and fonts as sabit-ekin.github.io (assets/site.css there). */
:root {
  --maroon: #500000;
  --accent: #6d0f0f;
  --gold: #b07d1e;
  --teal: #276d66;
  --sage: #5f8a4c;
  --bg: #fbfaf8;
  --band: #f3eee7;
  --surface: #ffffff;
  --text: #1e1b18;
  --muted: #625a53;
  --line: #e6e1db;
  --chip: #f4eeea;
  --radius: 14px;
  --serif: "EB Garamond", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --maroon: #e7a3a3; --accent: #f0b9b9; --gold: #ecc062; --teal: #6cc3ba; --sage: #9cc487;
    --bg: #151312; --band: #1c1917; --surface: #1e1b19; --text: #ece7e2; --muted: #a89f97; --line: #322d29; --chip: #2a2421;
  }
}
:root[data-theme="dark"] {
  --maroon: #e7a3a3; --accent: #f0b9b9; --gold: #ecc062; --teal: #6cc3ba; --sage: #9cc487;
  --bg: #151312; --band: #1c1917; --surface: #1e1b19; --text: #ece7e2; --muted: #a89f97; --line: #322d29; --chip: #2a2421;
}
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--maroon); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--maroon); }
h2 { font-size: 2rem; line-height: 1.2; margin: 0 0 14px; }
h3 { font-size: 1.3rem; line-height: 1.25; margin: 0 0 8px; }

/* Header */
header.nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--maroon); text-decoration: none; white-space: nowrap; }
.ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--chip); color: var(--maroon); flex: none; }
.ic svg, .oi svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav nav { display: flex; gap: 4px; margin-left: auto; }
.nav nav a { padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 500; }
.nav nav a:hover { background: var(--chip); color: var(--maroon); }
@media (max-width: 760px) { .nav nav { display: none; } }

/* Light/dark switch (same as the personal site) */
.theme { position: relative; flex: none; }
.theme-toggle { position: relative; display: block; width: 56px; height: 30px; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); color: var(--muted); cursor: pointer; }
.theme-toggle:hover { border-color: var(--maroon); }
.theme svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-ic { position: absolute; inset: 0 8px; display: flex; align-items: center; justify-content: space-between; opacity: .7; }
.tt-knob { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--maroon); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.tt-knob .i-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt-knob { transform: translateX(26px); } :root:not([data-theme="light"]) .tt-knob .i-light { display: none; } :root:not([data-theme="light"]) .tt-knob .i-dark { display: block; } }
:root[data-theme="dark"] .tt-knob { transform: translateX(26px); } :root[data-theme="dark"] .tt-knob .i-light { display: none; } :root[data-theme="dark"] .tt-knob .i-dark { display: block; }
@media (prefers-reduced-motion: reduce) { .tt-knob { transition: none; } }

/* Hero */
.hero { background: var(--band); border-bottom: 1px solid var(--line); padding: 56px 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center; }
.kicker { margin: 0 0 12px; font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.kicker .new { display: inline-block; margin-right: 8px; padding: 2px 10px; border-radius: 999px; background: var(--maroon); color: var(--bg); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
h1 { font-size: clamp(2.3rem, 5vw, 3.3rem); line-height: 1.08; margin: 0 0 16px; }
.lede { font-size: 1.12rem; color: var(--muted); margin: 0 0 24px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.btn { display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--maroon); font-weight: 600; font-size: .95rem; text-decoration: none; transition: transform .15s, border-color .15s; }
.btn:hover { border-color: var(--maroon); transform: translateY(-1px); }
.btn.primary { background: var(--maroon); border-color: var(--maroon); color: var(--bg); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.facts b { color: var(--maroon); }

/* Animated lab */
.lab { position: relative; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(60, 20, 10, .08); overflow: hidden; }
.lab canvas { display: block; width: 100%; aspect-ratio: 4 / 3; }
.lab figcaption { padding: 4px 16px 14px; font-size: .88rem; color: var(--muted); min-height: 46px; }
.lab-wk { display: inline-block; margin-right: 6px; padding: 1px 9px; border-radius: 999px; background: var(--chip); color: var(--maroon); font-weight: 600; font-size: .78rem; }
.lab-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; padding: 6px 10px 0; border-top: 1px solid var(--line); }
.lab-dots button { width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.lab-dots button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.lab-dots button[aria-pressed="true"]::before { background: var(--maroon); transform: scale(1.3); }
.lab-dots button:hover::before { background: var(--gold); }
.lab-name, #lab-name { font-weight: 600; color: var(--text); }
.lab-step { display: block; margin-top: 6px; color: var(--muted); font-size: .9rem; line-height: 1.5; min-height: 3em; }
.lab-n { display: inline-block; margin-right: 4px; padding: 0 7px; border-radius: 6px; background: var(--maroon); color: var(--bg); font-size: .74rem; font-weight: 600; vertical-align: 1px; }
.lab-n:empty { display: none; }
.lab-dots .lab-pause { margin-right: 6px; border-radius: 8px; width: 30px; }
.lab-dots .lab-pause::before { width: 10px; height: 11px; border-radius: 0; background: none; border-left: 3px solid var(--maroon); border-right: 3px solid var(--maroon); transform: none; }
.lab-dots .lab-pause[aria-pressed="true"]::before { width: 0; height: 0; border-left: 11px solid var(--maroon); border-right: 0; border-top: 6.5px solid transparent; border-bottom: 6.5px solid transparent; }
.lab-dots .lab-pause:hover::before { background: none; }
@media (max-width: 600px) { .lab-step { min-height: 4.5em; } .lab-dots button[data-s] { width: 22px; } }

/* Numbers */
.numbers { padding: 44px 0 8px; }
.numbers ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.numbers li { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.numbers b { display: block; font-family: var(--serif); font-size: 2.6rem; line-height: 1; font-weight: 600; color: var(--maroon); margin-bottom: 6px; }
.numbers span { color: var(--muted); font-size: .9rem; }

/* Sections: alternate plain and band, as on the personal site */
main > .wrap > section { padding: 56px 0; }
main > .wrap > section:nth-of-type(odd):not(.numbers) { border-image: conic-gradient(var(--band) 0 0) fill 0 // 0 100vmax; }
.sublede { color: var(--muted); margin: -4px 0 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.two p { margin: 0 0 14px; }
.prereq h3 { font-size: 1.2rem; }
.prereq h3 + ul { margin-bottom: 18px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .94rem; }
.checks li { position: relative; padding-left: 26px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 7px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg); }
.tools { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tools li { padding: 4px 12px; border-radius: 999px; background: var(--chip); font-size: .85rem; font-weight: 600; color: var(--maroon); }

/* Outcomes and project ideas */
.outcomes, .ideas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.outcomes li { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.outcomes p { margin: 0; font-size: .95rem; color: var(--muted); }
.outcomes b { color: var(--text); }
.oi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--chip); color: var(--maroon); flex: none; }
.oi svg { width: 22px; height: 22px; }
.ideas li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; }
.ideas li:hover .oi { background: var(--maroon); color: var(--bg); }
.ideas .oi { transition: background .2s, color .2s; }

/* Roadmap: modules on a line that fills as you scroll */
.road { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; display: grid; gap: 16px; --p: 0; }
.road::before, .road::after { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--line); }
.road::after { background: linear-gradient(var(--maroon), var(--gold)); bottom: auto; height: calc((100% - 12px) * var(--p)); }
.mod { position: relative; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mod::before { content: ""; position: absolute; left: -27px; top: 22px; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 3px solid var(--maroon); z-index: 1; }
.mod h3 { margin: 0 0 8px; }
.mod .tag { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--maroon); }
.mod ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mod ol li { display: grid; grid-template-columns: 76px 1fr; gap: 10px; font-size: .96rem; }
.wk { font-weight: 600; color: var(--muted); font-size: .85rem; padding-top: 1px; white-space: nowrap; }
.mile { display: inline-flex; align-items: center; gap: 8px; margin: 10px 8px 0 0; padding: 3px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.mile::before { content: ""; width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: currentColor; }
.mile.exam { background: var(--chip); color: var(--maroon); }
.mile.proj { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal); }

/* Deliverables */
.steps-h { margin-top: 30px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: s; }
.steps li { position: relative; counter-increment: s; padding: 16px 16px 14px 56px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--maroon); color: var(--bg); font-weight: 600; font-size: .9rem; }
.steps span { color: var(--muted); font-size: .85rem; }

/* Grading */
.grade { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: center; }
.donut { position: relative; margin: 0; width: 240px; }
.donut svg { display: block; width: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 6; }
.donut .ring { stroke: var(--line); }
.donut .seg { stroke-dasharray: var(--len) calc(100 - var(--len)); stroke-dashoffset: calc(-1 * var(--off)); transition: stroke-dasharray 1.1s ease, stroke-dashoffset 1.1s ease; }
.io .donut:not(.in) .seg { stroke-dasharray: 0 100; stroke-dashoffset: 0; }
.donut .s1, .k1 { stroke: var(--maroon); background: var(--maroon); }
.donut .s2, .k2 { stroke: var(--gold); background: var(--gold); }
.donut .s3, .k3 { stroke: var(--teal); background: var(--teal); }
.donut .s4, .k4 { stroke: var(--sage); background: var(--sage); }
.donut figcaption { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); font-size: .85rem; }
.donut figcaption b { font-family: var(--serif); font-size: 2.4rem; color: var(--maroon); line-height: 1; }
.weights { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.weights li { display: grid; grid-template-columns: 14px 1fr; column-gap: 12px; }
.weights i { width: 14px; height: 14px; border-radius: 4px; margin-top: 5px; grid-row: span 2; }
.weights span { color: var(--muted); font-size: .92rem; }
.scale { margin: 24px 0 0; font-size: .9rem; color: var(--muted); }

/* Reading */
.books { margin: 0 0 18px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.books li { padding: 14px 16px 14px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--maroon); border-radius: 10px; font-size: .92rem; color: var(--muted); }
.books cite { font-style: normal; font-weight: 600; color: var(--text); }

/* Instructor */
.person { display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: start; }
.person img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.person h3 { font-size: 1.6rem; margin-bottom: 4px; }
.role { margin: 0 0 12px; color: var(--muted); }
.contact { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; font-size: .95rem; }
.contact span { display: inline-block; width: 110px; color: var(--muted); font-size: .85rem; }
.links { margin: 0; font-size: .95rem; }

/* Call to action */
.join { text-align: center; }
.join p { max-width: 38em; margin: 0 auto 20px; color: var(--muted); }

footer { border-top: 1px solid var(--line); padding: 24px 0 36px; font-size: .88rem; color: var(--muted); }
footer p { margin: 4px 0; }

/* Scroll-in effect (only when IntersectionObserver works; off under reduced motion) */
.io .rv { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.io .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .io .rv { opacity: 1; transform: none; transition: none; }
  .donut .seg, .lab-dots button::before, .ideas .oi { transition: none; }
}

/* Narrow screens */
@media (max-width: 900px) {
  .hero-grid, .two, .grade { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 44px; }
  .outcomes, .ideas { grid-template-columns: repeat(2, 1fr); }
  .numbers ul, .steps { grid-template-columns: repeat(2, 1fr); }
  .donut { margin: 0 auto; width: 210px; }
}
@media (max-width: 600px) {
  h2 { font-size: 1.7rem; }
  .outcomes, .ideas, .books { grid-template-columns: 1fr; }
  .mod ol li { grid-template-columns: 1fr; gap: 0; }
  .person { grid-template-columns: 1fr; }
  .person img { width: 96px; height: 96px; }
  .contact span { width: 96px; }
  main > .wrap > section { padding: 44px 0; }
}
.mod.on::before { background: var(--maroon); }
@media (prefers-reduced-motion: no-preference) { .mod::before { transition: background .3s; } }
