/* Jonathon Perez resource system v1. Source of truth: DESIGN.md
   Six rules: light page, one ink, one accent (purple) · two fonts that load everywhere ·
   one motion piece per page · show the product before the email box ·
   a short "who is this" note, no selling · readable for a 55-year-old on a phone. */

:root {
  color-scheme: light;
  /* colour */
  --bg: #faf9fc;          /* page, faint purple bias */
  --surface: #ffffff;
  --ink: #16131f;         /* 17:1 on bg */
  --muted: #4a4558;       /* 8.7:1 on bg, safe for small text */
  --line: #e7e3ef;
  --purple: #5b2dbf;      /* the one accent, 8:1 with white text */
  --purple-deep: #4c2a9e;
  --purple-soft: #f1ecfc;
  --night: #160f26;       /* dark panels + motion stage */
  --night-2: #221838;
  --night-text: #b9b1cc;  /* 9:1 on night */
  --lilac: #c4b5fd;
  --done: #6ee7b7;        /* semantic: finished */
  /* type */
  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Figtree", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  /* shape */
  --radius: 14px;
  --radius-lg: 22px;
  --col: 1120px;
  --read: 680px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.65 var(--body); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.08; text-wrap: balance; letter-spacing: -0.025em; }
p { margin: 0; }
a { color: var(--purple); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; border-radius: 6px; }

.shell { max-width: var(--col); margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; background: var(--purple); color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.label { font: 500 0.8rem/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--purple); }
.muted { color: var(--muted); }

/* top bar */
.bar { border-bottom: 1px solid var(--line); background: var(--bg); }
.bar .shell { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.mark { display: flex; align-items: center; font: 700 1.1rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
/* brand emblem: a purple cursor after the name, blinking continuously (holds solid for reduced motion) */
.cur { display: inline-block; width: 0.5em; height: 1.1em; margin-left: 4px; border-radius: 1px; background: var(--purple); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.bar nav { display: flex; gap: 20px; align-items: center; font-size: 1rem; }
.bar nav a { color: var(--ink); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; min-height: 44px; }
.bar nav a:hover { color: var(--purple); }

/* buttons + form */
.btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 26px; border-radius: 12px; border: 0; background: var(--purple); color: #fff; font: 600 1.05rem/1 var(--body); text-decoration: none; cursor: pointer; transition: background .2s; }
.btn:hover { background: var(--purple-deep); }
.btn.ghost { background: transparent; color: var(--purple); border: 1.5px solid var(--purple); min-height: 46px; padding: 0 18px; font-size: 0.98rem; }
.btn.ghost:hover { background: var(--purple-soft); }
.optin { position: relative; display: flex; flex-wrap: wrap; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 8px; max-width: 520px; box-shadow: 0 1px 0 rgba(22,19,31,.03), 0 12px 32px -18px rgba(91,45,191,.35); }
.optin .hp { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; pointer-events: none; }
.optin .hp input { flex: none; width: 1px; height: 1px; min-height: 0; padding: 0; }
.optin label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.optin input { flex: 1 1 220px; min-width: 0; min-height: 54px; border: 0; background: transparent; font: 400 1.05rem var(--body); color: var(--ink); padding: 0 14px; }
.optin input::placeholder { color: #6b6480; }
.optin input:focus { outline: none; }
.optin:focus-within { border-color: var(--purple); }
.optin:has(input:focus-visible) { outline: 3px solid var(--purple); outline-offset: 3px; }
.optin .btn { flex: 1 0 auto; }
.fine { font-size: 0.95rem; color: var(--muted); margin-top: 12px; }
.fine b { color: var(--ink); }

/* proof line */
.proof { display: flex; align-items: center; gap: 12px; font-size: 0.98rem; color: var(--muted); }
.proof img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.proof b { color: var(--ink); font-weight: 600; }

/* cover (generated from settings, no design work per guide) */
.cover { aspect-ratio: 17 / 22; width: 100%; max-width: 300px; border-radius: 10px; background: radial-gradient(120% 80% at 85% 0%, #3a2470 0%, var(--night) 60%); color: #fff; padding: 26px 24px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 30px 60px -30px rgba(22,15,38,.55), 0 2px 6px rgba(22,15,38,.18); position: relative; overflow: hidden; }
.cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.cover .label { color: var(--lilac); font-size: 0.7rem; }
.cover h3 { font-size: 1.75rem; line-height: 1.05; letter-spacing: -0.02em; }
.cover .rule { width: 36px; height: 4px; background: var(--lilac); border-radius: 2px; margin-block: 14px; }
.cover p { font-size: 0.85rem; color: var(--night-text); line-height: 1.45; }
.cover .by { display: flex; justify-content: space-between; align-items: end; font: 500 0.7rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--night-text); }

/* about: short "who is this" note, evergreen */
.about .shell { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; padding-block: 56px; border-top: 1px solid var(--line); }
.about img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.about .txt { display: grid; gap: 6px; flex: 1 1 320px; min-width: 0; }
.about h2 { font-size: 1.45rem; letter-spacing: -0.015em; }
.about p { color: var(--muted); max-width: 58ch; }
.about .links { display: flex; flex-wrap: wrap; gap: 8px; }
.about .links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.98rem; }
.about .links a:hover { border-color: var(--purple); color: var(--purple); }

/* footer */
.foot { border-top: 1px solid var(--line); }
.foot .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 28px; font-size: 0.95rem; color: var(--muted); }
.foot a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.foot .shell { padding-bottom: max(28px, env(safe-area-inset-bottom, 0px)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- v0.2: subtle details (subtle "advanced" layer) ---------- */

/* film grain on dark panels */
.grain { position: relative; isolation: isolate; }
.grain::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .09; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
/* cursor spotlight on dark panels (set --mx/--my from script) */
.spot { --mx: 70%; --my: 20%; }
.spot::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(139, 92, 246, .22), transparent 60%); }


/* clock chip in the top bar */
.clock { display: inline-flex; align-items: center; gap: 8px; font: 500 0.82rem/1 var(--mono); letter-spacing: .04em; color: var(--muted); font-variant-numeric: tabular-nums; }


/* spec sheet: label / value rows in mono */
.spec { display: grid; grid-template-columns: max-content 1fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; font-size: 0.98rem; }
.spec dt, .spec dd { margin: 0; padding: 11px 16px; border-top: 1px solid var(--line); }
.spec dt:first-of-type, .spec dd:first-of-type { border-top: 0; }
.spec dt { font: 500 0.75rem/1.9 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #fcfbfe; border-right: 1px solid var(--line); }
.spec dd { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* keycap */
.kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; border: 1px solid currentColor; font: 500 0.75rem/1 var(--mono); opacity: .7; }

/* button arrow + unlocking state */
.btn .arr { transition: transform .25s; }
.btn:hover .arr { transform: translateX(4px); }
.btn.loading { position: relative; overflow: hidden; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255,255,255,.85); transform-origin: left; animation: load .7s ease forwards; }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* reading progress */
.progress { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 3px; z-index: 20; background: transparent; }
.progress i { display: block; height: 100%; width: 100%; background: var(--purple); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* ---------- opt-in page ---------- */
/* Opt-in template: hero (promise + form | motion stage) · what's inside (cover + list) · about · repeat form */
.hero .shell { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; padding-block: 64px 72px; }
.hero .copy { display: grid; gap: 22px; min-width: 0; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--purple); background: linear-gradient(100deg, var(--purple) 0%, var(--purple) 38%, #8b5cf6 50%, var(--purple) 62%, var(--purple) 100%); background-size: 260% 100%; background-position: 0% 0; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: sheen 2.6s ease .5s 1 both; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0% 0; } }
.stage { transition: transform .35s ease; transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.hero .promise { font-size: 1.25rem; color: var(--muted); max-width: 32ch; }
.stage { background: radial-gradient(90% 70% at 50% 0%, #2c1b55 0%, var(--night) 65%); border-radius: var(--radius-lg); padding: 18px; box-shadow: 0 40px 80px -40px rgba(22,15,38,.6); min-width: 0; }
.stage svg { width: 100%; height: auto; display: block; }
.stage figcaption { color: var(--night-text); font-size: 0.95rem; text-align: center; padding: 4px 8px 6px; }
.inside .shell { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: center; padding-block: 72px; border-top: 1px solid var(--line); }
.inside .covercol { display: flex; justify-content: center; }
.inside h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); margin-top: 10px; }
.list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; }
.list li { display: grid; grid-template-columns: 44px 1fr; gap: 6px; padding-block: 16px; border-top: 1px solid var(--line); }
.list li:last-child { border-bottom: 1px solid var(--line); }
.list .n { font: 500 0.85rem/1.9 var(--mono); color: var(--purple); }
.list b { font-family: var(--display); font-size: 1.12rem; display: block; }
.list span { color: var(--muted); font-size: 1rem; }
.extra { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--purple-soft); color: var(--purple-deep); border-radius: 999px; padding: 8px 14px; font-size: 0.95rem; font-weight: 500; }
.chip svg { width: 16px; height: 16px; }
.closer .shell { padding-block: 80px; display: grid; justify-items: center; text-align: center; gap: 18px; }
.closer h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.closer .optin { width: 100%; }
@media (max-width: 560px) { .bar nav { display: none; } .inside .cover { max-width: 220px; } }
@media (max-width: 860px) {
  .hero .shell, .inside .shell { grid-template-columns: 1fr; gap: 40px; }
  .hero .shell { padding-block: 40px 56px; }
}

/* ---------- guide page ---------- */
/* Resource template: title · video · contents rail + reading column · personal note · next steps */
.head .shell { padding-block: 48px 28px; display: grid; gap: 16px; max-width: 920px; }
.head h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); font-weight: 800; }
.head .sub { font-size: 1.2rem; color: var(--muted); max-width: 46ch; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; font-size: 0.98rem; color: var(--muted); }
.meta .unlocked { display: inline-flex; align-items: center; gap: 8px; color: #0f5132; background: #e3f7ee; border-radius: 999px; padding: 5px 12px; font-weight: 600; }
.video .shell { max-width: 920px; }
.player { isolation: isolate; position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: radial-gradient(80% 90% at 70% 10%, #33206a 0%, var(--night) 62%); display: grid; place-items: center; color: #fff; box-shadow: 0 40px 80px -45px rgba(22,15,38,.65); }
.player .play { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: grid; place-items: center; border: 0; cursor: pointer; box-shadow: 0 0 0 10px rgba(255,255,255,.12); }
.player .play svg { width: 30px; height: 30px; margin-left: 5px; }
.player .cap { position: absolute; left: 24px; bottom: 20px; right: 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.98rem; color: var(--night-text); }
.player .cap b { color: #fff; font-family: var(--display); font-size: 1.1rem; }
.player .poster { position: absolute; left: 24px; top: 52px; max-width: 46%; display: grid; gap: 10px; }
.player .poster b { font: 800 clamp(1.4rem, 3.4vw, 2.3rem)/1.05 var(--display); letter-spacing: -0.02em; color: #fff; }
.player .poster b em { font-style: normal; color: var(--lilac); }
.player .slot { position: absolute; top: 18px; left: 24px; font: 500 0.75rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lilac); }
.body .shell { display: grid; grid-template-columns: 220px minmax(0, var(--read)); gap: 64px; justify-content: center; padding-block: 56px 72px; }
.rail { position: sticky; top: 24px; align-self: start; display: grid; gap: 14px; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 2px solid var(--line); }
.rail a { display: block; padding: 7px 14px; color: var(--muted); text-decoration: none; font-size: 1rem; margin-left: -2px; border-left: 2px solid transparent; }
.rail a:hover { color: var(--purple); border-left-color: var(--purple); }
.rail a.btn { width: 100%; display: flex; padding: 0 18px; margin-left: 0; border-left: 1.5px solid var(--purple); color: var(--purple); }
article { display: grid; gap: 48px; min-width: 0; }
article section { display: grid; gap: 18px; scroll-margin-top: 24px; }
article h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
article p { max-width: 64ch; }
.intro { font-size: 1.15rem; }
.prompt { position: relative; isolation: isolate; background: var(--night); border-radius: var(--radius); overflow: hidden; }
.prompt .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid #2e2448; }
.prompt .top > span { font: 500 0.78rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lilac); }
.copy-btn { white-space: nowrap; flex: none; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: #fff; color: var(--night); font: 600 0.98rem var(--body); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.copy-btn:hover { background: var(--purple-soft); }
.copy-btn.done { background: var(--done); }
.copy-btn .kbd { margin-left: 4px; }
@media (max-width: 520px) { .copy-btn .kbd { display: none; } }
.prompt pre { margin: 0; padding: 22px 20px 24px; color: #f2eefe; font: 500 1rem/1.75 var(--mono); white-space: pre-wrap; word-break: break-word; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.steps li::before { content: counter(s); width: 34px; height: 34px; border-radius: 10px; background: var(--purple-soft); color: var(--purple-deep); font: 700 1.05rem/34px var(--display); text-align: center; }
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.why li { padding-left: 20px; border-left: 3px solid var(--purple); }
.why b { display: block; font-family: var(--display); font-size: 1.1rem; margin-bottom: 4px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: start; }
.note img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.note .sig { font: 700 1.15rem var(--display); margin-top: 10px; }
.more { border-top: 1px solid var(--line); }
.more .shell { padding-block: 64px; display: grid; gap: 24px; }
.more h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); transition: border-color .2s; min-width: 0; }
.card:hover { border-color: var(--purple); }
.card .cover { max-width: 96px; padding: 10px; border-radius: 6px; }
.card .cover h3 { font-size: 0.72rem; }
.card .cover .rule { width: 16px; height: 2px; margin-block: 6px; }
.card b { font-family: var(--display); font-size: 1.12rem; display: block; line-height: 1.2; }
.card span { color: var(--muted); font-size: 0.98rem; }
@media (max-width: 900px) {
  .body .shell { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .rail { position: static; }
  .rail ol, .rail .label { display: none; }
}
@media (max-width: 520px) { .player .poster { display: none; } .note { grid-template-columns: 1fr; } .player .play { width: 68px; height: 68px; } }

/* ---------- motion stage fallback (no custom motion yet): the cover floats in the stage ---------- */
.stage .floatcover { display: grid; place-items: center; padding: 34px 20px 18px; }
.stage .floatcover .cover { max-width: 250px; animation: float 6s ease-in-out 5; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(-0.5deg); } }
.stage video { width: auto; max-width: 100%; max-height: min(560px, 70vh); height: auto; display: block; margin: 0 auto; border-radius: 14px; }

/* ---------- guide body: rendered from the guide's markdown ---------- */
.prose { display: grid; gap: 18px; min-width: 0; }
.prose > section { display: grid; gap: 18px; scroll-margin-top: 24px; }
.prose > section + section { margin-top: 30px; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
.prose h3 { font-size: 1.22rem; margin-top: 8px; letter-spacing: -0.01em; }
.prose p, .prose li { max-width: 64ch; }
.prose ul, .prose ol { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.prose ul > li { position: relative; padding-left: 22px; }
.prose ul > li::before { content: ""; position: absolute; left: 4px; top: 0.72em; width: 7px; height: 7px; border-radius: 2px; background: var(--purple); }
.prose ol { counter-reset: s; }
.prose ol > li { counter-increment: s; position: relative; padding-left: 46px; min-height: 32px; }
.prose ol > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 9px; background: var(--purple-soft); color: var(--purple-deep); font: 700 0.98rem/32px var(--display); text-align: center; }
.prose blockquote { margin: 0; background: var(--purple-soft); border: 1px solid #e2d9fa; border-radius: var(--radius); padding: 16px 20px; color: var(--ink); }
.prose blockquote p { max-width: none; }
.prose code { font: 500 0.92em var(--mono); background: var(--purple-soft); color: var(--purple-deep); padding: 1px 6px; border-radius: 6px; }
.prose a { font-weight: 500; }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose table { border-collapse: collapse; width: 100%; font-size: 1rem; }
.prose .tw { overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 500 0.75rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.prose .prompt pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* ---------- library ---------- */
.lib-hero .shell { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; padding-block: 64px 56px; }
.lib-hero .copy { display: grid; gap: 20px; min-width: 0; }
.lib-hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.2rem); font-weight: 800; }
.lib-hero h1 em { font-style: normal; color: var(--purple); }
.lib-hero .promise { font-size: 1.2rem; color: var(--muted); max-width: 40ch; }
.stack { position: relative; aspect-ratio: 1 / 0.9; }
.stack .cover { position: absolute; width: 46%; max-width: 230px; top: 50%; left: 50%; }
.stack .cover:nth-child(1) { transform: translate(-105%, -46%) rotate(-9deg); animation: drift1 9s ease-in-out 3; }
.stack .cover:nth-child(2) { transform: translate(-50%, -54%) rotate(0deg); z-index: 2; animation: drift2 9s ease-in-out 3; }
.stack .cover:nth-child(3) { transform: translate(5%, -46%) rotate(9deg); animation: drift3 9s ease-in-out 3; }
@keyframes drift1 { 50% { transform: translate(-108%, -50%) rotate(-11deg); } }
@keyframes drift2 { 50% { transform: translate(-50%, -59%) rotate(0deg); } }
@keyframes drift3 { 50% { transform: translate(8%, -50%) rotate(11deg); } }
.unlocked-note[hidden] { display: none; }
.unlocked-note { display: inline-flex; align-items: center; gap: 10px; background: #e3f7ee; color: #0f5132; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 1rem; }
.optin.is-prompted { animation: nudge .5s ease; border-color: var(--purple); }
@keyframes nudge { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.grid { padding-block: 16px 80px; }
.grid .shell { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 24px; }
.res { display: grid; grid-template-columns: 190px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; color: var(--ink); text-decoration: none; transition: border-color .2s, transform .25s, box-shadow .25s; min-width: 0; }
@media (hover: hover) { .res:hover { border-color: var(--purple); transform: translateY(-3px); box-shadow: 0 24px 48px -32px rgba(91,45,191,.45); } }
.res .art { min-height: 220px; background: radial-gradient(90% 80% at 70% 0%, #2c1b55 0%, var(--night) 70%); display: grid; place-items: center; padding: 28px 20px; }
.res .art .cover { max-width: 150px; padding: 16px 14px; }
.res .art .cover h3 { font-size: 1.05rem; }
.res .art .cover p { display: none; }
.res .art .cover .rule { margin-block: 8px; width: 24px; height: 3px; }
.res .body { display: grid; gap: 8px; padding: 20px 22px 22px; align-content: start; }
.res .num { font: 500 0.75rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.res h2 { font-size: 1.35rem; letter-spacing: -0.015em; }
.res p { color: var(--muted); font-size: 1rem; }
.res .go { margin-top: 6px; font-weight: 600; color: var(--purple); display: inline-flex; gap: 8px; align-items: center; }
.res .go .lock { width: 14px; height: 14px; }
body.library-unlocked .res .lock { display: none; }
@media (max-width: 520px) { .res { grid-template-columns: 1fr; } .res .art { min-height: 0; } }
@media (max-width: 860px) { .lib-hero .shell { grid-template-columns: 1fr; gap: 32px; padding-block: 40px; } .stack { max-width: 420px; width: 100%; justify-self: center; } }

/* form messages sit right under the form; errors get colour and an icon */
.status-msg { font-size: 0.98rem; color: var(--muted); margin-top: 10px; min-height: 0; }
.status-msg:empty { display: none; }
.status-msg.is-error { color: #a3242a; font-weight: 500; }
.status-msg.is-error::before { content: "! "; font-weight: 700; }
.optin:has(input[aria-invalid="true"]) { border-color: #a3242a; }

/* long prompts start collapsed; Copy still copies everything */
.prompt.long:not(.open) pre { max-height: 360px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.prompt .expand { display: block; width: calc(100% - 40px); margin: 0 20px 20px; min-height: 48px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; font: 600 1rem var(--body); cursor: pointer; touch-action: manipulation; }
.prompt .expand:hover { background: rgba(255,255,255,.12); }
