:root {
  color-scheme: light;
  --ink: #182724;
  --muted: #66736f;
  --line: #d9ddd7;
  --teal: #0072b2;
  --focus: #0072b2;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--ink); }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.site-header { min-height: 62px; padding: 8px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(24, 39, 36, 0.1); }
.course-title { display: flex; flex-direction: column; color: var(--ink); font-size: 1.05rem; font-weight: 750; line-height: 1.05; text-decoration: none; }
.course-title small { margin-top: 4px; color: var(--muted); font-size: 0.68rem; font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-link { padding: 8px 12px; color: var(--ink); background: #e5e7eb; border-radius: 7px; font-size: 0.8rem; font-weight: 700; line-height: 1; text-decoration: none; }
.top-link:hover, .top-link[aria-current="page"] { background: #d1d5db; }
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

main { width: min(1050px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 22px; }
h1 { margin: 0; font: 500 clamp(2.8rem, 6vw, 5rem)/0.98 Georgia, "Times New Roman", serif; letter-spacing: -0.045em; }
.demo-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.demo-card { min-height: 350px; padding: 22px; display: flex; flex-direction: column; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; transition: border-color 150ms ease, transform 150ms ease; }
.demo-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.demo-number { color: var(--teal); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; }
.demo-mark { width: 100%; height: 116px; margin: 8px 0 6px; overflow: visible; }
.demo-mark path, .demo-mark circle, .demo-mark rect { vector-effect: non-scaling-stroke; }
.mark-main { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mark-secondary { fill: none; stroke: #e47d2d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mark-faint { fill: none; stroke: #b9c5c1; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.mark-fill { fill: var(--teal); stroke: none; }
.mark-secondary-fill { fill: #e47d2d; stroke: none; }
.mark-faint-fill { fill: #e9eeeb; stroke: none; }
.pixel-mark rect { shape-rendering: crispEdges; }
.waterfall-mark { padding: 8px 12px; display: grid; grid-template-rows: 34px 1fr; gap: 7px; }
.waterfall-spectrum-mark { background: var(--teal); clip-path: polygon(0 82%, 8% 78%, 13% 28%, 18% 75%, 29% 68%, 35% 12%, 40% 72%, 52% 61%, 58% 35%, 64% 69%, 74% 55%, 80% 18%, 86% 66%, 100% 72%, 100% 78%, 86% 72%, 80% 24%, 74% 61%, 64% 75%, 58% 41%, 52% 67%, 40% 78%, 35% 18%, 29% 74%, 18% 81%, 13% 34%, 8% 84%, 0 88%); }
.waterfall-color-mark { background: repeating-linear-gradient(0deg, rgba(255,255,255,0.17) 0 2px, transparent 2px 7px), linear-gradient(90deg, #0d0887 0%, #4c02a1 13%, #7e03a8 25%, #aa2395 38%, #cc4778 50%, #e66c5c 63%, #f89540 75%, #fdc527 88%, #f0f921 100%); border-radius: 2px; }
.demo-card h2 { margin: 8px 0 12px; font: 500 clamp(1.6rem, 3vw, 2.2rem) Georgia, "Times New Roman", serif; letter-spacing: -0.025em; }
.formula { color: var(--muted); }
.keywords { margin: 18px 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.keywords li { padding: 4px 7px; color: var(--teal); background: #eef7fb; border-radius: 999px; font-size: 0.67rem; font-weight: 700; line-height: 1.2; }
.open-label { margin-top: auto; align-self: flex-end; color: var(--teal); font-size: 0.8rem; font-weight: 750; }
.site-footer { padding: 0 20px 14px; color: var(--muted); font-size: 0.72rem; text-align: center; }

@media (max-width: 650px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .top-actions { width: 100%; }
  .top-link { flex: 1; text-align: center; }
  main { width: calc(100% - 16px); padding-top: 20px; }
  .demo-grid { margin-top: 30px; grid-template-columns: 1fr; }
  .demo-card { min-height: 340px; }
}
@media (max-width: 1050px) and (min-width: 651px) { .demo-grid { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .demo-card { transition: none; } }
