:root {
  color-scheme: dark;
  --ink: #100b0b;
  --ink-soft: #1b1111;
  --blood: #741d1c;
  --blood-bright: #b83c32;
  --gold: #c9a765;
  --gold-pale: #ead7a5;
  --ivory: #eee5d3;
  --parchment: #d7c39e;
  --muted: #9e9181;
  --line: rgba(201, 167, 101, .28);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --companion-preview-bg: #17100f;
  --companion-preview-border: rgba(234, 215, 165, .35);
  --companion-preview-text: #f4ead7;
  --companion-preview-muted: #bdad94;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); }
body { margin: 0; background: var(--ink); color: var(--ivory); font-family: var(--sans); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.nav { position: absolute; z-index: 2; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding-block: 24px; }
.nav__brand { display: inline-flex; gap: 10px; align-items: center; color: #fff8e8; font-family: var(--serif); font-weight: 700; letter-spacing: .04em; }
.nav__brand span { color: var(--gold); }
.nav__links { display: flex; gap: 26px; align-items: center; color: rgba(255, 248, 232, .78); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.nav__links a { padding-block: 8px; border-bottom: 1px solid transparent; }
.nav__links a:hover, .nav__links a:focus-visible { color: #fff; border-color: var(--gold); }

.hero { background: var(--ink); }
.hero__visual { position: relative; overflow: hidden; background: #050505; border-bottom: 1px solid var(--line); }
.hero__visual::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.6), transparent 23%, transparent 75%, rgba(8,5,5,.58)); }
.hero__visual img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero__brief { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); gap: 68px; align-items: end; padding-block: 54px 64px; }
.hero__copy h2, .section-heading h2, .lab-copy h2, .boundary-layout h2, .deck-intro h2 { margin: 8px 0 18px; font: 500 clamp(2.35rem, 5vw, 5.6rem)/.97 var(--serif); letter-spacing: -.035em; }
.hero__copy h2 em { color: var(--gold); font-weight: 400; }
.hero__copy > p:not(.eyebrow) { max-width: 700px; color: #bfb09b; font-size: 1.05rem; }
.eyebrow { margin: 0; color: var(--gold-pale); font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow--dark { color: var(--blood); }
.eyebrow--red { color: #e26957; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: .82rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(226, 105, 87, .5); outline-offset: 3px; }
.button--gold { background: var(--gold); color: #211307; }
.button--glass { background: rgba(255,255,255,.04); color: var(--ivory); border-color: rgba(255,255,255,.2); }
.button--ink { background: var(--ink); color: var(--ivory); }
.hero__facts { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.hero__facts div { min-height: 126px; padding: 23px; border: solid var(--line); border-width: 0 1px 1px 0; }
.hero__facts div:nth-child(2n) { border-right: 0; }
.hero__facts div:nth-last-child(-n + 2) { border-bottom: 0; }
.hero__facts strong { display: block; color: var(--gold-pale); font: 500 2.8rem/1 var(--serif); }
.hero__facts span { display: block; margin-top: 9px; color: var(--muted); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }

.ivory-section, .parchment-section, .obsidian-section, .blood-section, .deck-section { padding-block: 104px; }
.ivory-section { color: #251a16; background: var(--ivory); }
.parchment-section { color: #24170f; background: var(--parchment); }
.obsidian-section { background: radial-gradient(circle at 85% 15%, rgba(116, 29, 28, .19), transparent 35%), var(--ink); }
.blood-section { background: linear-gradient(135deg, #571311, #230d0d 70%); }
.deck-section { background: #090706; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .55fr); gap: 60px; align-items: end; margin-bottom: 48px; }
.section-heading h2 { max-width: 820px; font-size: clamp(2.4rem, 5vw, 4.9rem); }
.section-heading--light h2 { color: #fff4dc; }
.section-lede { margin: 0 0 8px; color: #736355; font-size: 1.02rem; }
.section-heading--light .section-lede { color: #c7a99a; }

.strategy-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid rgba(43,24,16,.2); }
.strategy-grid article { min-height: 300px; padding: 28px; border-right: 1px solid rgba(43,24,16,.2); }
.strategy-grid article:last-child { border: 0; }
.strategy-grid article > span { color: var(--blood); font-size: .7rem; font-weight: 900; letter-spacing: .15em; }
.strategy-grid h3 { margin: 45px 0 14px; font: 600 1.5rem/1.05 var(--serif); }
.strategy-grid p { color: #645448; font-size: .92rem; }
.strategy-grid small { display: block; margin-top: 28px; color: var(--blood); font-weight: 800; }

.lab-layout { display: grid; grid-template-columns: .78fr 1.22fr; gap: 80px; align-items: start; }
.lab-copy { position: sticky; top: 28px; }
.lab-copy h2 { max-width: 480px; color: #fff4dd; font-size: clamp(3rem, 6vw, 5.5rem); }
.lab-copy > p { color: #b6a591; }
.rule-note { margin-top: 38px; padding: 24px; border-left: 3px solid var(--blood-bright); background: rgba(255,255,255,.035); }
.rule-note strong { color: var(--gold-pale); font-family: var(--serif); font-size: 1.2rem; }
.rule-note p { margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.trigger-console { padding: 38px; border: 1px solid var(--line); background: #17100f; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.trigger-console > label { display: flex; justify-content: space-between; gap: 20px; color: var(--gold-pale); font-weight: 800; }
.trigger-console output { font: 600 1.8rem/1 var(--serif); }
.trigger-console input[type="range"] { width: 100%; margin: 22px 0 36px; accent-color: var(--blood-bright); }
.trigger-console fieldset { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.trigger-console legend { margin-bottom: 14px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.trigger-console fieldset label { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.025); cursor: pointer; }
.trigger-console input[type="checkbox"] { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--blood-bright); }
.trigger-console fieldset span { color: #c3b4a1; font-size: .9rem; }
.trigger-console b { color: #f4e6ca; }
.trigger-result { display: flex; gap: 18px; align-items: center; margin-top: 26px; padding: 24px; background: var(--blood); }
.trigger-result strong { font: 500 4.4rem/1 var(--serif); color: #fff1d7; }
.trigger-result span { max-width: 280px; color: #f4cbc3; }
.console-footnote { margin: 18px 0 0; color: #857a70; font-size: .8rem; }

.line-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.line-tab { padding: 13px 18px; border: 1px solid rgba(255,255,255,.19); border-radius: 999px; background: transparent; color: #e2c6ba; cursor: pointer; }
.line-tab.is-active { color: #24120c; border-color: var(--gold); background: var(--gold-pale); }
.line-stage { display: grid; grid-template-columns: .72fr 1.28fr; gap: 54px; min-height: 450px; padding: 44px; border: 1px solid rgba(255,255,255,.13); background: rgba(0,0,0,.22); }
.line-stage__intro span { color: var(--gold); font-size: .7rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.line-stage__intro h3 { margin: 14px 0; color: #fff1d7; font: 500 clamp(2.5rem, 5vw, 4.6rem)/.95 var(--serif); }
.line-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.line-card { padding: 9px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 4px; background: rgba(255,255,255,.045); color: #f4dccf; cursor: pointer; font-size: .78rem; }
.line-steps { display: grid; align-content: center; gap: 14px; counter-reset: line-step; }
.line-steps li { display: grid; grid-template-columns: 44px 1fr; gap: 18px; align-items: start; padding: 21px; background: rgba(255,255,255,.045); color: #d8c0b4; list-style: none; }
.line-steps li::before { counter-increment: line-step; content: "0" counter(line-step); color: var(--gold); font: 700 1rem var(--serif); }

.keep-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(43,24,16,.2); border-bottom: 1px solid rgba(43,24,16,.2); }
.keep-grid article { padding: 28px 26px; border-right: 1px solid rgba(43,24,16,.2); }
.keep-grid article:last-child { border: 0; }
.keep-grid strong { font: 600 1.35rem var(--serif); }
.keep-grid p { margin-bottom: 0; color: #6b5a4c; font-size: .88rem; }
.hand-panel { margin-top: 38px; padding: 30px; border: 1px solid rgba(43,24,16,.22); background: #e3d8c2; }
.hand-panel__head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 22px; }
.hand-panel h3 { margin: 4px 0 0; font: 600 2rem var(--serif); }
.mini-cards { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.mini-card { min-height: 185px; padding: 10px; border: 0; border-radius: 5px; background: #2a1b16 center / cover; box-shadow: inset 0 -80px 55px rgba(0,0,0,.78); color: #fff3df; cursor: pointer; display: flex; align-items: end; text-align: left; font-size: .74rem; font-weight: 800; }
#hand-verdict { margin: 20px 0 0; color: #58463a; }

.pass-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 36px; }
.pass-grid article { min-height: 200px; padding: 26px; border: 1px solid rgba(43,24,16,.22); background: rgba(255,255,255,.14); }
.pass-grid .is-selected { color: #f4e6cd; border-color: var(--blood); background: var(--blood); }
.pass-grid span { display: block; margin-bottom: 35px; font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.pass-grid strong { font: 600 1.5rem var(--serif); }
.pass-grid p { color: #6d5947; }
.pass-grid .is-selected p { color: #e1bdb2; }
.swap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.swap-card { padding: 20px; border: 1px solid rgba(43,24,16,.19); background: rgba(255,255,255,.12); }
.swap-card span { color: var(--blood); font-size: .68rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.swap-card h3 { margin: 12px 0 8px; font: 600 1.06rem var(--serif); }
.swap-card h3 s { color: #7b6858; font-weight: 400; }
.swap-card p { margin: 0; color: #665343; font-size: .82rem; }

.boundary-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 78px; align-items: center; }
.boundary-layout h2 { color: #fff2d7; font-size: clamp(2.7rem, 5vw, 5rem); }
.boundary-layout > div:first-child > p:last-child { color: #ad9c8a; }
.boundary-card { border: 1px solid var(--line); }
.boundary-card > div { padding: 27px; border-bottom: 1px solid var(--line); }
.boundary-card span { color: var(--gold); font-size: .7rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.boundary-card p { color: #b6a796; }
.boundary-card blockquote { margin: 0; padding: 28px; color: #f0ddbd; font: italic 1.4rem/1.4 var(--serif); background: rgba(116,29,28,.18); }

.atlas-layout { display: grid; grid-template-columns: 260px 1fr; gap: 34px; align-items: start; }
.curve-panel { position: sticky; top: 24px; padding: 25px; border: 1px solid rgba(43,24,16,.18); }
.curve-panel h3 { margin-top: 0; font: 600 1.45rem var(--serif); }
.curve-panel > p { color: #6a584a; font-size: .82rem; }
.curve-panel > p strong { color: var(--blood); }
.curve-row { display: grid; grid-template-columns: 28px 1fr 24px; gap: 8px; align-items: center; margin: 9px 0; font-size: .75rem; }
.curve-row i { display: block; height: 8px; width: var(--bar); background: linear-gradient(90deg, var(--blood), var(--gold)); }
.controls { display: grid; grid-template-columns: 1.5fr .8fr; gap: 12px; margin-bottom: 18px; }
.controls label { color: #6a584b; font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.controls input, .controls select { width: 100%; margin-top: 7px; padding: 12px 14px; color: #271b15; border: 1px solid rgba(43,24,16,.25); border-radius: 0; background: rgba(255,255,255,.42); }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card-tile { min-width: 0; padding: 0; border: 1px solid rgba(43,24,16,.16); background: rgba(255,255,255,.2); color: #261913; cursor: pointer; text-align: left; }
.card-tile__art { display: block; aspect-ratio: 1.55 / 1; background: #241714 center / cover; filter: saturate(.85); transition: filter .2s ease, transform .2s ease; }
.card-tile:hover .card-tile__art { filter: saturate(1.1); transform: scale(1.015); }
.card-tile__body { display: block; padding: 13px; }
.card-tile__role, .card-tile__tags { display: block; color: var(--blood); font-size: .62rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.card-tile__name { display: block; margin: 6px 0 8px; font: 600 1rem/1.1 var(--serif); }
.card-tile__tags { color: #7f6c5d; font-size: .56rem; }
.empty-state { color: #6f5c4d; text-align: center; }

.deck-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: end; margin-bottom: 48px; }
.deck-intro h2 { color: #fff0d3; font-size: clamp(3rem, 6vw, 5.8rem); }
.deck-intro > div:last-child { max-width: 480px; justify-self: end; color: #a49686; }
.deck-intro .button { margin: 16px 0; }
.deck-intro small { display: block; }
.deck-columns { columns: 4; column-gap: 34px; }
.deck-role { break-inside: avoid; margin: 0 0 26px; }
.deck-role h3 { margin: 0 0 8px; padding-bottom: 8px; color: var(--gold); border-bottom: 1px solid var(--line); font: 600 .92rem var(--serif); }
.deck-card { display: block; width: 100%; padding: 4px 0; border: 0; background: transparent; color: #b3a593; cursor: pointer; text-align: left; font-size: .73rem; }
.deck-card:hover { color: #fff0d3; }

footer { border-top: 1px solid var(--line); background: #050403; }
footer .shell { display: flex; justify-content: space-between; gap: 30px; padding-block: 30px; color: #81766b; font-size: .78rem; }
footer strong { color: var(--gold-pale); font-family: var(--serif); }
footer a { color: var(--gold); }

.card-dialog { width: min(880px, calc(100% - 28px)); padding: 0; border: 1px solid rgba(234,215,165,.32); background: #17100f; color: var(--ivory); box-shadow: 0 40px 120px rgba(0,0,0,.65); }
.card-dialog::backdrop { background: rgba(3,2,2,.82); backdrop-filter: blur(7px); }
.dialog-close { position: absolute; z-index: 2; top: 10px; right: 10px; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: #17100f; color: #fff; cursor: pointer; }
.dialog-card { display: grid; grid-template-columns: minmax(260px, 43%) 1fr; }
.dialog-card img { width: 100%; height: 100%; min-height: 520px; object-fit: contain; background: #080505; }
.dialog-copy { padding: 48px 38px 38px; }
.dialog-copy .tag { color: var(--gold); font-size: .65rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.dialog-copy h2 { margin: 12px 0; color: #fff0d3; font: 500 2.6rem/1 var(--serif); }
.dialog-copy p { color: #b9aa98; }
.dialog-copy .oracle { white-space: pre-line; }
.dialog-copy a { color: var(--gold); font-weight: 800; }

@media (max-width: 980px) {
  .nav__links a:not(:last-child) { display: none; }
  .hero__brief, .section-heading, .lab-layout, .boundary-layout, .deck-intro { grid-template-columns: 1fr; gap: 34px; }
  .lab-copy, .curve-panel { position: static; }
  .strategy-grid, .keep-grid { grid-template-columns: repeat(2, 1fr); }
  .strategy-grid article:nth-child(2) { border-right: 0; }
  .strategy-grid article:nth-child(-n + 2) { border-bottom: 1px solid rgba(43,24,16,.2); }
  .keep-grid article:nth-child(2) { border-right: 0; }
  .keep-grid article:nth-child(-n + 2) { border-bottom: 1px solid rgba(43,24,16,.2); }
  .line-stage { grid-template-columns: 1fr; }
  .swap-grid { grid-template-columns: repeat(2, 1fr); }
  .atlas-layout { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .deck-columns { columns: 3; }
  .deck-intro > div:last-child { justify-self: start; }
}

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 1180px); }
  .nav { padding-block: 14px; }
  .nav__brand { font-size: .86rem; }
  .nav__links { font-size: .68rem; }
  .hero__visual img { margin-top: 50px; }
  .hero__visual::after { top: 50px; }
  .hero__brief { padding-block: 36px 46px; }
  .hero__facts div { min-height: 100px; padding: 17px; }
  .hero__facts strong { font-size: 2.15rem; }
  .ivory-section, .parchment-section, .obsidian-section, .blood-section, .deck-section { padding-block: 72px; }
  .strategy-grid, .keep-grid, .pass-grid, .swap-grid, .controls { grid-template-columns: 1fr; }
  .strategy-grid article, .keep-grid article { min-height: auto; border-right: 0; border-bottom: 1px solid rgba(43,24,16,.2); }
  .strategy-grid article:last-child, .keep-grid article:last-child { border-bottom: 0; }
  .trigger-console, .line-stage { padding: 24px; }
  .mini-cards { display: flex; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
  .mini-card { flex: 0 0 145px; scroll-snap-align: start; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .deck-columns { columns: 2; }
  .dialog-card { grid-template-columns: 1fr; }
  .dialog-card img { max-height: 430px; min-height: 0; }
  .dialog-copy { padding: 30px 22px; }
  footer .shell { flex-direction: column; gap: 8px; }
}

@media (max-width: 430px) {
  .hero__facts, .card-grid { grid-template-columns: 1fr 1fr; }
  .hero__facts div { min-height: 88px; }
  .trigger-result strong { font-size: 3.2rem; }
  .line-tabs { display: grid; }
  .deck-columns { columns: 1; }
}

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