:root {
  --ink: #24172b;
  --muted: #675b6d;
  --plum: #45245b;
  --plum-dark: #2a1337;
  --mint: #dff6e9;
  --teal: #17685d;
  --coral: #c84f42;
  --amber: #f4c95d;
  --cream: #fffaf0;
  --line: #d8ccdc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; }
button, input { font: inherit; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 14px; background: var(--amber); }
.skip-link:focus { top: 12px; }
.lab-header { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 12px clamp(18px, 5vw, 72px); border-bottom: 1px solid var(--line); background: white; }
.wordmark { color: var(--plum-dark); font-weight: 950; text-decoration: none; letter-spacing: -.04em; }
.wordmark span:first-child { color: var(--teal); }
.wordmark span:last-child { margin-left: 4px; color: var(--coral); }
.back-link { color: var(--plum); font-weight: 800; }
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); align-items: center; gap: clamp(36px, 8vw, 110px); max-width: 1240px; min-height: 68vh; margin: auto; padding: clamp(64px, 10vw, 120px) clamp(18px, 5vw, 72px); }
.overline { margin: 0 0 10px; color: var(--teal); font: 900 .75rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { color: var(--plum-dark); line-height: 1.08; letter-spacing: -.045em; }
h1 { margin: 0; font-size: clamp(4rem, 9vw, 8.5rem); }
.hero-copy { max-width: 650px; margin: 20px 0 28px; color: var(--muted); font-size: clamp(1.08rem, 1.7vw, 1.3rem); }
.primary-link { display: inline-flex; min-height: 46px; align-items: center; gap: 10px; border-radius: 8px; padding: 11px 16px; background: var(--plum); color: white; font-weight: 900; text-decoration: none; }
.primary-link:hover { background: var(--plum-dark); }
.primary-link:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.proof-layers { margin: 0; padding: 0; border-top: 2px solid var(--plum); list-style: none; }
.proof-layers li { display: flex; gap: 18px; padding: 18px 4px; border-bottom: 1px solid var(--line); }
.proof-layers li > span { color: var(--coral); font: 900 .8rem ui-monospace, monospace; }
.proof-layers strong { color: var(--plum-dark); font-size: 1.08rem; }
.proof-layers p { margin: 2px 0 0; color: var(--muted); }
.command-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid #553c63; background: var(--plum-dark); color: white; }
.command-strip div { min-width: 0; padding: 18px clamp(16px, 3vw, 34px); border-right: 1px solid #553c63; }
.command-strip span { display: block; margin-bottom: 7px; color: #b8dcca; font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.command-strip code { display: block; overflow-x: auto; color: white; font-size: .8rem; white-space: nowrap; }
.lab-section { max-width: 1120px; margin: auto; padding: clamp(70px, 10vw, 120px) clamp(18px, 5vw, 50px); scroll-margin-top: 20px; }
.lab-intro { max-width: 720px; margin-bottom: 34px; }
.lab-intro h2, .next-step h2 { margin: 4px 0 12px; font-size: clamp(2.6rem, 6vw, 5rem); }
.lab-intro > p:last-child, .next-step > p { color: var(--muted); }
.lab-shell { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr); overflow: hidden; border: 2px solid var(--plum); border-radius: 18px; background: white; box-shadow: 14px 14px 0 var(--mint); }
.lab-form, .library-output { min-width: 0; padding: clamp(24px, 5vw, 48px); }
.library-output { border-left: 1px solid var(--line); background: #f7f3f8; }
.field { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; color: var(--plum-dark); font-weight: 900; }
input { width: 100%; min-height: 48px; border: 1px solid #8d7e98; border-radius: 8px; padding: 10px 12px; background: white; color: var(--ink); }
.lab-form button { width: 100%; min-height: 48px; border: 0; border-radius: 8px; background: var(--teal); color: white; font-weight: 900; cursor: pointer; }
.lab-form button:hover { background: #0d5048; }
.feedback { min-height: 28px; margin: 14px 0 0; font-weight: 800; }
.feedback.success { color: var(--teal); }
.feedback.error { color: var(--coral); }
.output-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--line); }
.output-head h2 { margin: 0 0 14px; font-size: 1.4rem; }
#book-count { color: var(--teal); font: 800 .78rem ui-monospace, monospace; white-space: nowrap; }
#book-list { margin: 0; padding: 0; list-style: none; }
#empty-state { color: var(--muted); }
.book-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.book-card h3, .book-card p { margin: 0; }
.book-card p { color: var(--muted); }
.book-card button { flex: 0 0 auto; min-height: 40px; border: 1px solid var(--coral); border-radius: 7px; padding: 7px 10px; background: white; color: var(--coral); font-weight: 800; cursor: pointer; }
.next-step { max-width: 900px; margin: 0 auto; padding: 30px 24px 110px; text-align: center; }
.next-step p { max-width: 680px; margin: 0 auto 24px; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px clamp(18px, 5vw, 72px); background: var(--plum-dark); color: white; }

@media (max-width: 900px) {
  .command-strip { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; min-height: auto; }
}

@media (max-width: 760px) {
  .back-link { font-size: .82rem; }
  .command-strip, .lab-shell { grid-template-columns: 1fr; }
  .command-strip div { border-right: 0; border-bottom: 1px solid #553c63; }
  .library-output { border-top: 1px solid var(--line); border-left: 0; }
  .lab-shell { box-shadow: 8px 8px 0 var(--mint); }
  .output-head { align-items: flex-start; flex-direction: column; gap: 0; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
