/* ELI Ladder — one stylesheet, light by default, dark via prefers-color-scheme. */
:root {
  --bg: #f7f5f0; --surface: #ffffff; --ink: #1d1f2b; --muted: #61667a; --line: #e4e0d6; --accent: #3b5bdb;
  /* rung colours: warm at the bottom, deep at the top */
  --r1: #f59f00; --r2: #f76707; --r3: #e64980; --r4: #ae3ec9; --r5: #4263eb; --r6: #0c8599;
  --radius: 12px; --maxw: 760px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12131a; --surface: #1b1d27; --ink: #e9e9f0; --muted: #a3a7ba; --line: #2b2e3b; --accent: #91a7ff;
          --r1: #ffc94d; --r2: #ff922b; --r3: #f783ac; --r4: #da77f2; --r5: #91a7ff; --r6: #3bc9db; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 17px/1.65 ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: .9em; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 6px; }

.top, .foot, main { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
main { max-width: 960px; }
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; max-width: 960px; }
.brand { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.1rem; }
.top nav a { margin-left: 18px; color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.foot { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 16px; padding-bottom: 32px; font-size: .9rem; }

h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); line-height: 1.15; margin: .4em 0 .3em; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; line-height: 1.3; }
.lede { font-size: 1.15rem; color: var(--muted); }
.btn { display: inline-block; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
       text-decoration: none; font-weight: 600; border: 2px solid var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.badge { display: inline-block; font-size: .8rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.badge.draft { color: var(--r2); border-color: var(--r2); }

/* home */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.hero-ladder { width: 100%; max-width: 260px; justify-self: center; }
.climber { animation: climb 6s ease-in-out infinite; }
@keyframes climb { 0%, 10% { transform: translateY(0); } 85%, 100% { transform: translateY(-160px); } }
@media (prefers-reduced-motion: reduce) { .climber { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; } .hero-ladder { max-width: 180px; } }
.cluster { margin-top: 28px; }
.cluster h3 { margin-bottom: 0; font-size: 1.15rem; }
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card a { display: block; padding: 14px 16px 18px; text-decoration: none; color: var(--ink); }
.card a span { display: block; color: var(--muted); font-size: .92rem; }
.card:hover { border-color: var(--ink); }
.card .progress { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; border-radius: 0 0 0 var(--radius);
                  background: linear-gradient(90deg, var(--r1), var(--r2), var(--r3), var(--r4), var(--r5), var(--r6)); }

/* concept page */
.concept { max-width: var(--maxw); margin: 0 auto; }
.crumbs { font-size: .9rem; color: var(--muted); margin-top: 8px; }
.crumbs a { color: var(--muted); }
.visual { margin: 18px 0; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.visual svg { display: block; margin: 0 auto; }
.ladder { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
          padding: 10px 0; background: var(--bg); }
.step { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted);
        padding: 6px 2px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); font-size: .78rem; text-align: center; }
.step .n { font-weight: 800; font-size: 1rem; }
.step:nth-child(1) { --c: var(--r1); } .step:nth-child(2) { --c: var(--r2); } .step:nth-child(3) { --c: var(--r3); }
.step:nth-child(4) { --c: var(--r4); } .step:nth-child(5) { --c: var(--r5); } .step:nth-child(6) { --c: var(--r6); }
.step.done { border-color: var(--c); color: var(--ink); }
.step.done .n::after { content: " ✓"; color: var(--c); }
.step[aria-selected="true"] { border-color: var(--c); box-shadow: inset 0 -5px 0 var(--c); color: var(--ink); font-weight: 700; }
@media (max-width: 480px) { .step .l { font-size: .68rem; } }
.rung { padding: 6px 0 18px; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.rung h2 .rn { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.js .rung { display: none; border-bottom: 0; }
.js .rung.active { display: block; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.nav-rung { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.nav-rung .btn:only-child { margin-left: auto; }
.done { font-weight: 600; color: var(--r6); }
.check { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 14px 0; }
.check summary { cursor: pointer; font-weight: 600; }
.check summary span { color: var(--muted); font-weight: 500; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: .88rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
table { border-collapse: collapse; display: block; overflow-x: auto; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.cite a { text-decoration: none; font-size: .75em; }
.related ul { padding-left: 1.2em; }
.sources ol { font-size: .92rem; }
.prose { max-width: var(--maxw); margin: 0 auto; }

.rung-visual { margin: 6px 0 16px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rung-visual img, .rung-visual svg { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 8px; }
.rung-visual figcaption { font-size: .88rem; color: var(--muted); margin-top: 6px; }
img.lqip { background-size: cover; background-repeat: no-repeat; }

.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; max-width: 720px; margin: 0 auto;
           background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
           box-shadow: 0 6px 24px rgba(0,0,0,.15); font-size: .92rem; }
.consent p { margin: 0 0 10px; }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.consent .btn { padding: 8px 16px; cursor: pointer; font: inherit; font-weight: 600; }
