/* Palette and type are taken from the book's cover: flat navy, dusty rose, cream. */
:root {
  --navy: #14213F; --deep: #0D162C; --cream: #F4EBDD; --paper: #EFE6D6; --ink: #17213A;
  --rose: #D4716A; --rose-dark: #A94B52; --teal: #6FB0B0; --muted: #A9B4CC; --line: #2A3A62;
  --display: "Chakra Petch", "Trebuchet MS", sans-serif;
  --body: "Literata", Georgia, serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--deep); color: var(--cream); font-family: var(--body); font-size: 18px; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 8vw, 5rem); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
h3 { font-size: 1.15rem; letter-spacing: .03em; font-weight: 600; }
p { margin: 0; }
.eyebrow { font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 22px; }
section { padding-block: clamp(56px, 9vw, 104px); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.lede { font-size: 1.25rem; max-width: 34ch; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

/* hero */
.hero { background: var(--navy); padding-block: clamp(40px, 7vw, 88px); overflow: hidden; position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
/* the cover, very faintly, behind the whole hero */
.hero::before { content: ""; position: absolute; inset: 0; background: url(img/cover-front.jpg) center 35% / cover no-repeat; opacity: .05; pointer-events: none; }
.hero .wrap { position: relative; width: 100%; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 6vw, 72px); align-items: center; }
.hero .stack { gap: 22px; }
/* the book, with three inside pages tucked behind it that slide out on hover */
.book-wrap { justify-self: center; width: min(100%, 380px); position: relative; transform: rotate(2deg); }
.peek { position: absolute; left: 3%; top: 3%; width: 94%; height: 94%; object-fit: cover; background: #fff; border-radius: 2px; box-shadow: 0 6px 18px #0006; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.book-wrap:hover .p1 { transform: translate(-17%, -2%) rotate(-9deg); }
.book-wrap:hover .p2 { transform: translate(15%, -4%) rotate(7deg); transition-delay: .05s; }
.book-wrap:hover .p3 { transform: translate(3%, -9%) rotate(-2deg); transition-delay: .1s; }
@media (prefers-reduced-motion: reduce) { .peek { transition: none; } }
.book { position: relative; width: 100%; aspect-ratio: 148 / 210; border-radius: 3px 8px 8px 3px; background: url(img/cover-front.jpg) center / cover; position: relative;
  box-shadow: -1px 0 0 #0006 inset, 6px 0 0 -2px #e9dfcd, 8px 0 0 -2px #cfc4b0, 22px 28px 60px #0009; }
.book span { position: absolute; left: 8.5%; top: 6.5%; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; line-height: 1.02; font-size: clamp(1.4rem, 4.2vw, 2.25rem); color: var(--cream); }
.buy-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: baseline; gap: 10px; font-family: var(--display); font-weight: 600; letter-spacing: .04em; font-size: 1.02rem; text-decoration: none; padding: 13px 20px; border-radius: 3px; border: 1.5px solid var(--cream); cursor: pointer; transition: transform .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--rose); border-color: var(--rose); color: #1A1022; }
.btn .price { font-family: var(--mono); font-weight: 500; font-size: .9rem; opacity: .85; }
.btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.btn[aria-disabled="true"]::after { content: "· soon"; font-family: var(--mono); font-size: .75rem; }
.fine { font-size: .92rem; color: var(--muted); }

/* facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.fact { border-top: 1.5px solid var(--rose); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.fact b { font-family: var(--display); font-size: 1.9rem; font-weight: 600; }
.fact p { color: var(--muted); font-size: 1rem; }

/* how it plays */
.how { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: stretch; }
/* the panel matches the height of the steps column; its three cards spread to fill it */
#deal-out { display: flex; flex-direction: column; gap: 14px; flex: 1; justify-content: space-around; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 54px 1fr; border-top: 1px solid var(--line); padding-top: 14px; }
.steps li::before { content: "0" counter(s); font-family: var(--mono); color: var(--rose); font-size: .85rem; letter-spacing: .1em; padding-top: 4px; }
.steps p { color: var(--muted); font-size: 1rem; }
.deal { background: var(--navy); border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 16px; border-radius: 4px; }
.dealt { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; border-top: 1px solid var(--line); padding-top: 14px; }
.dealt p { font-size: 1.02rem; }
.pc { width: 52px; height: 72px; background: var(--cream); color: var(--ink); border-radius: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 1.2rem; line-height: 1.1; }
.pc.red { color: var(--rose-dark); }
@media (prefers-reduced-motion: no-preference) { .dealt { animation: in .3s ease-out both; } @keyframes in { from { transform: translateY(6px); opacity: .3; } to { transform: none; opacity: 1; } } }

/* paper sections */
.paper { background: var(--paper); color: var(--ink); }
.paper .eyebrow { color: #5A6480; }
.entry { border-left: 3px solid var(--ink); padding-left: 22px; display: flex; flex-direction: column; gap: 12px; font-style: italic; max-width: 62ch; }
/* the cockpit drawing, large, as the section's background on the right */
.entry-sec { position: relative; overflow: hidden; }
.entry-sec::after { content: ""; position: absolute; inset: 0 0 0 46%; background: url(img/art-ref-s.jpg) left center / cover no-repeat; mix-blend-mode: multiply; opacity: .75; pointer-events: none; }
.entry-sec .wrap { position: relative; z-index: 1; }
.entry-sec .stack { max-width: 44%; }
@media (max-width: 780px) { .entry-sec::after { inset: 0; opacity: .14; background-position: center; } .entry-sec .stack { max-width: none; } }
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.split img { mix-blend-mode: multiply; }
.pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }
.pages img { background: #fff; box-shadow: 0 10px 30px #17213a2e, 0 0 0 1px #17213a14; }
/* the canteen drawing runs wide and its lower edge is cut off by the section below */
.inside-sec { padding-bottom: 0; }
.strip { width: min(100%, 940px); margin-inline: auto; aspect-ratio: 16 / 6.8; overflow: hidden; }
.strip img { width: 100%; }
.strip img { mix-blend-mode: multiply; }

/* editions */
.editions { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 24px; }
.edition { background: var(--navy); border: 1px solid var(--line); border-radius: 4px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.edition ul { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 1rem; flex: 1; }
.edition .btn { align-self: flex-start; }

/* faq, footer */
.faq { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 28px 44px; }
.faq div { border-top: 1px solid #17213a33; padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.faq p { font-size: 1rem; }
footer { background: url(img/cover-back.jpg) center 30% / cover; padding-block: 90px 44px; }
footer .wrap { display: flex; flex-direction: column; gap: 14px; }
footer p { max-width: 40ch; font-size: 1.15rem; }

@media (max-width: 780px) {
  .hero .wrap, .how, .split { grid-template-columns: minmax(0, 1fr); }
  .book-wrap { order: -1; width: min(70%, 300px); }
}

/* legal links, cookie banner, legal pages */
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 26px; }
#cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 760px; margin-inline: auto; background: var(--cream); color: var(--ink); border-radius: 4px; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; box-shadow: 0 14px 44px #000a; font-size: .95rem; line-height: 1.5; }
#cookie-banner p { flex: 1 1 320px; }
.cookie-actions { display: flex; gap: 10px; }
#cookie-banner .btn { border-color: var(--ink); color: var(--ink); background: none; padding: 9px 16px; font-size: .92rem; }
#cookie-banner .btn.primary { background: var(--ink); color: var(--cream); }
.legal-head { background: var(--navy); padding-block: 34px; }
.legal-head a { text-decoration: none; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 1.15rem; }
.legal { max-width: 70ch; display: flex; flex-direction: column; gap: 16px; }
.legal h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
.legal h2 { font-size: 1.2rem; margin-top: 18px; }
.legal ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.legal table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-top: 1px solid #17213a33; }
.legal .fill-in { background: #D4716A66; padding: 0 4px; border-radius: 2px; }
.legal-foot { background: var(--navy); padding-block: 30px; }
.legal-foot .legal-links { margin-top: 0; }

/* phones: the sample pages become a row you swipe through, with the next page peeking in */
@media (max-width: 780px) {
  .pages { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-inline: -22px; padding: 4px 22px 34px; scroll-padding-inline: 22px; }
  .pages::-webkit-scrollbar { display: none; }
  .pages img { flex: 0 0 76%; width: 76%; scroll-snap-align: start; }
}
