/* Ultimatum site v2. Layout: the client's photographic panel grid (dark ground, warm gold light),
   with two interactive pieces of our own: the time-on-page stopwatch and the chapter compass. */
:root {
  --ground: #0c0a08;      /* page ground, warm near-black */
  --panel: #16120e;       /* raised surfaces, form fields */
  --line: #3a2f22;        /* hairlines, rings */
  --sand: #b9a98d;        /* secondary text */
  --paper: #efe6d6;       /* primary text */
  --gold: #d9ab5e;        /* lettering, accents (the cover's gold) */
  --amber: #f0a04b;       /* light, hover, focus */
  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --bar-h: 60px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* --bar-real: the header's rendered height (js/site.js), taller than --bar-h when enlarged text wraps it */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-real, var(--bar-h)) + 8px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ground); color: var(--paper); font: 400 1.0625rem/1.65 var(--font-text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 500; letter-spacing: .06em; text-wrap: balance; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow { display: grid; gap: 12px; justify-items: start; font: 500 .8rem/1 var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.eyebrow::after { content: ""; width: 56px; height: 1px; background: var(--gold); opacity: .8; }
.quote { font: italic 400 clamp(1.5rem, 2.6vw, 2.1rem)/1.3 var(--font-text); color: var(--gold); text-wrap: balance; }

.btn {
  display: inline-flex; align-items: center; gap: .6em; padding: .8em 1.3em; border: 1px solid var(--gold); border-radius: 6px;
  font: 500 .95rem/1 var(--font-text); color: var(--paper); background: rgba(12, 10, 8, .35); text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.btn::after { content: "→"; transition: transform .2s; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn:hover { background: color-mix(in srgb, var(--gold) 16%, transparent); border-color: var(--amber); }
.btn:hover::after { transform: translateX(3px); }
.btn--solid { background: var(--gold); color: var(--ground); font-weight: 600; }
.btn--solid:hover { background: var(--amber); color: var(--ground); }
.btn--plain::after { content: none; }

/* ---------- header ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--ground); }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--ground) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.bar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--bar-h); } /* wraps only with enlarged text */
.brand { position: relative; font: 500 1.35rem/1 var(--font-display); letter-spacing: .08em; color: var(--gold); text-decoration: none; }
.brand::after { content: ""; position: absolute; left: 0; bottom: -10px; width: 70%; height: 1px; background: var(--gold); opacity: .6; }
.bar nav { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px clamp(14px, 3vw, 40px); min-width: 0; }
.bar nav a { font: 500 .78rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--paper); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--gold); }
.bar nav a.order { color: var(--gold); display: inline-flex; align-items: center; gap: 10px; }
.bar nav a.order svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.menu-btn { display: none; align-items: center; gap: 8px; margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--paper); font: 500 .74rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.menu-btn::after { content: "≡"; font: 400 1.1rem/1 var(--font-mono); }
.bar.open .menu-btn::after { content: "×"; }
@media (max-width: 47.5em) { /* em: the menu also switches on when the reader enlarges text */
  .menu-btn { display: inline-flex; }
  .bar nav a:not(.order) { display: none; }
  .bar.open nav { position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100dvh - var(--bar-real, var(--bar-h)) - env(safe-area-inset-top, 0px)); overflow-y: auto; overscroll-behavior: contain; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; align-items: stretch; gap: 0; background: var(--ground); border-bottom: 1px solid var(--line); padding: 4px var(--gutter-r) 14px var(--gutter-l); }
  .bar.open nav a { display: flex; padding: 14px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
  .bar.open nav a.order { border-bottom: 0; }
}
/* the narrowest phones: wordmark smaller so the menu button and the order link keep their spacing */
@media (max-width: 380px) { .brand { font-size: 1.12rem; } }
@media (max-width: 340px) { .bar nav a.order { font-size: 0; gap: 0; } } /* cart icon only; the label stays the link's accessible name */

/* ---------- hero ---------- */
/* Every scene picture has its own calm dark area for text (left on wide screens, top on narrow ones),
   so no overlay or gradient is laid over any picture. Wide pictures (>=1024px) are 16:9 masters shown at 2.4:1,
   tall ones are 9:16 masters shown at 3:4 on tablets and at 9:16 or taller on phones; they are only cropped,
   never scaled out of proportion. */
.hero { position: relative; overflow: hidden; background: var(--ground); }
.hero picture, .hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero picture img { object-fit: cover; object-position: 50% 50%; }
.hero .wrap { position: relative; z-index: 2; min-height: max(560px, calc(100vw / 2.2)); display: grid; align-content: center; padding-block: 56px; }
.hero-copy { display: grid; gap: 22px; justify-items: center; text-align: center; width: min(100%, 31vw, 540px); }
.hero h1 { font-size: clamp(2.8rem, 6.4vw, 6rem); line-height: .95; letter-spacing: .07em; background: linear-gradient(180deg, #ffe7b8 0%, var(--gold) 55%, #a3742f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { font: 500 clamp(1.05rem, 1.8vw, 1.5rem)/1.35 var(--font-display); letter-spacing: .14em; color: var(--gold); }
.hero .rule { width: 90px; height: 1px; background: var(--gold); opacity: .8; }
.hero .line { font: 400 clamp(1.1rem, 1.7vw, 1.45rem)/1.4 var(--font-text); color: var(--paper); max-width: 22ch; }
.hero .ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@media (max-width: 1023px) {
  .hero .wrap { min-height: calc(100vw * 4 / 3); align-content: start; padding-block: 5vw 40px; }
  .hero-copy { width: min(100%, 560px); margin: 0 auto; }
}
@media (max-width: 600px) {
  /* the tall master at width-fit, anchored to the bottom: no crop, no upscale; fits a 375x812 phone under the header.
     The bottom 42 % (clock and figure) is reserved, so taller copy (enlarged text) grows the hero upwards onto the
     picture's own sky colour instead of running into the subjects. */
  .hero { background: rgb(12, 14, 20); }
  .hero picture, .hero picture img { top: auto; height: calc(100vw * 16 / 9); }
  .hero .wrap { min-height: calc(100vw * 16 / 9); padding-top: 6vw; padding-bottom: calc(100vw * 16 / 9 * .42); }
  .hero h1 { font-size: min(2.9rem, 13vw); } /* the wordmark never outgrows the screen, even with enlarged text */
  .hero-copy { gap: 12px; }
}

/* ---------- stopwatch band ---------- */
.clockband { border-block: 1px solid var(--line); background: linear-gradient(90deg, var(--ground), var(--panel) 50%, var(--ground)); }
.clockband .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 28px; padding-block: 22px; text-align: center; }
.clockband .lbl { font: 500 .78rem/1.3 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--sand); }
.clock { font: 500 clamp(1.9rem, 4.4vw, 2.8rem)/1 var(--font-mono); color: var(--gold); font-variant-numeric: tabular-nums; }
.clockband .note { font-style: italic; color: var(--paper); }
.clockband .cite { font: 400 .78rem/1.3 var(--font-mono); letter-spacing: .08em; color: var(--sand); }

/* ---------- panel grid ---------- */
/* full-width bands one under another; text sits on the picture's own calm area, no overlay */
.panels { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); }
.panel { position: relative; overflow: hidden; display: grid; align-items: center; background: var(--panel); isolation: isolate; min-height: max(420px, calc(100vw / 2.4)); }
.panel > picture.bg { position: absolute; inset: 0; z-index: -1; }
.panel > picture.bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; transition: transform 1.2s ease; }
.panel:hover > picture.bg img { transform: scale(1.02); }
.panel-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: center; justify-items: start; width: 100%; min-width: 0;
  padding-block: clamp(48px, 6vw, 88px); padding-inline: max(var(--gutter-l), calc((100% - 1240px) / 2 + 16px)) max(var(--gutter-r), calc((100% - 1240px) / 2 + 16px)); }
.panel-body > * { max-width: min(520px, 31vw); }
.panel-body h2 { font: italic 400 clamp(1.6rem, 2.6vw, 2.2rem)/1.2 var(--font-text); letter-spacing: 0; color: var(--gold); }
.panel-body p { color: var(--paper); font-size: 1rem; max-width: 40ch; }
.panel-body .soft { color: var(--sand); }
@media (prefers-reduced-motion: reduce) { .panel > picture.bg img { transition: none; } .panel:hover > picture.bg img { transform: none; } }
/* tablets and phones: the tall picture at width-fit (never upscaled), anchored to the bottom. A panel is only as tall
   as its text plus the picture's subject: the empty sky above the text is cropped off, and so is empty floor below the
   subject (--cut, the share of the picture hidden under the panel's bottom edge). --reserve is the share of the
   picture, from its bottom, that holds the subject; the text ends just above it. Taller (enlarged) text grows the
   panel upwards onto the picture's own flat sky colour (--sky, set per panel) instead of running into the subject. */
@media (max-width: 1023px) {
  /* separate cards: the change of sky colour between two pictures reads as a card edge, not a broken picture */
  .panels { gap: 12px; background: var(--ground); }
  .panel { min-height: 0; align-items: start; background: var(--sky, var(--panel)); }
  /* --ar: the tall master's height / width (9:16 masters 1.7778; reviews-tall is 968x1625) */
  .panel > picture.bg { top: auto; bottom: calc(-100vw * var(--ar, 1.7778) * var(--cut, 0)); height: calc(100vw * var(--ar, 1.7778)); }
  /* centred, like the hero, the compass and the closing panel; the subjects sit in the middle of the tall pictures */
  .panel-body { min-height: 0; align-content: start; justify-items: center; text-align: center;
    padding-block: min(10vw, 64px) calc(100vw * var(--ar, 1.7778) * (var(--reserve, .52) - var(--cut, 0))); }
  .panel-body .eyebrow { justify-items: center; }
  .panel-body > * { max-width: min(560px, 100%); }
  .panel:hover > picture.bg img { transform: none; }
}
@media (max-width: 600px) {
  .panel-body { gap: 16px; }
  .panel-body .soft { display: none; }
}

/* why: the client's four icons (line SVGs drawn by Codex) */
.icons { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.4em, 1fr)); row-gap: 18px; width: 100%; max-width: 460px; }
.icons li { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 4px 8px; border-left: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); list-style: none; }
.icons li:first-child { border-left: 0; }
.icons svg { width: 46px; height: 46px; color: var(--gold); }
.icons span { font-size: .95rem; line-height: 1.25; color: var(--paper); }
.icons-list { margin: 0; padding: 0; }
@media (max-width: 600px) { /* why: all four icons in one row */
  .icons { grid-template-columns: repeat(auto-fit, minmax(4.2em, 1fr)); max-width: 100%; } /* 4 in a row; reflows with enlarged text */
  .icons li { gap: 8px; padding: 2px; }
  .icons svg { width: 34px; height: 34px; }
  .icons span { font-size: .8rem; }
}
/* (kept) chapter theme links */
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; width: 100%; max-width: 460px; }
.themes a { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 6px 8px; text-decoration: none; border-left: 1px solid var(--line); }
.themes a:first-child { border-left: 0; }
.themes b { font: 500 1.2rem/1 var(--font-mono); color: var(--gold); }
.themes span { font-size: .92rem; line-height: 1.25; color: var(--paper); }
.themes a:hover span { color: var(--gold); }
.bignum { font: 500 clamp(2.6rem, 5vw, 3.6rem)/1 var(--font-display); color: var(--gold); }
.bignum small { display: block; margin-top: 6px; font: 400 .78rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sand); }

/* reviews: honest empty slot */
.review-slot { border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent); padding: 18px 20px; max-width: 34ch; color: var(--sand); font-style: italic; }
.stars { color: var(--gold); letter-spacing: .3em; opacity: .4; }

/* end panel: text sits centred in the black space above the horizon */
.panel--end { text-align: center; align-items: start; }
.panel--end .panel-body { justify-items: center; align-content: start; gap: 14px; padding-top: 3.2vw; }
.panel--end .panel-body > * { max-width: none; }
.panel--end .quote { font-size: clamp(1.3rem, 2.2vw, 1.9rem); color: var(--paper); }
.panel--end .panel-body > .quote { max-width: 30em; }
.panel--end .wordmark { font: 500 clamp(1.3rem, 2.2vw, 1.8rem)/1 var(--font-display); letter-spacing: .18em; color: var(--gold); }
/* tablets and phones: horizon in the bottom --reserve, see the tablet and phone panel rule */
@media (max-width: 1023px) { .panel--end .panel-body { padding-top: min(10vw, 64px); } }
/* desktop: the wide picture at width-fit, anchored to the bottom (8 % of empty floor hidden). The panel is only as tall
   as the text plus the earth: the text ends above the horizon glow (it starts at 46 % of the picture), and a longer or
   enlarged quote grows the panel upwards onto the picture's own black sky instead of running into the horizon. */
@media (width > 1023px) {
  .panel--end { min-height: 0; background: var(--sky, #000); }
  .panel--end > picture.bg { top: auto; bottom: calc(-100vw * 941 / 1672 * .08); height: calc(100vw * 941 / 1672); }
  .panel--end .panel-body { padding-block: clamp(40px, 4vw, 64px) calc(100vw * 941 / 1672 * .48); }
}

/* ---------- compass ---------- */
/* The scene picture sits in a fixed-shape stage (16:9 wide, 9:16 tall) with an empty parchment disc; the dial is
   placed on that disc in stage units, so it stays on the map at every width. Text is in normal flow and reserves
   its own space, so enlarged text pushes the layout instead of being covered or clipped. Where text outgrows the
   stage, the section continues in the picture's own wood colour (solid, no gradient). */
.compass-sec { --stage: calc(100vw * 9 / 16); --cx: 30%; --cy: 50%; --cd: calc(var(--stage) * .46);
  position: relative; isolation: isolate; overflow: hidden; background: rgb(22, 12, 6); }
.stage { position: absolute; top: 0; left: 0; right: 0; height: var(--stage); z-index: 0; }
.stage > .bg, .stage > .bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage > .bg img { object-fit: cover; }
.dial-wrap { position: absolute; width: var(--cd); aspect-ratio: 1; left: calc(var(--cx) - var(--cd) / 2); top: calc(var(--cy) - var(--cd) / 2); }
.compass-text { display: grid; gap: 36px; align-content: start; min-height: var(--stage);
  margin-left: 61%; padding: calc(var(--stage) * .17) max(var(--gutter-r), 5%) 48px 0; }
.compass-head { position: relative; z-index: 1; display: grid; gap: 14px; }
.compass-sec .chapter { position: relative; z-index: 1; }
.compass-head h2 { font-size: clamp(1.8rem, 2.6vw, 2.5rem); color: var(--paper); }
.compass-head p { color: var(--sand); max-width: 36ch; }
@media (max-width: 1023px) {
  /* text zone at the top of the tall picture, dial in the middle, chapter details in the bottom wood */
  .compass-sec { --stage: calc(100vw * 16 / 9); --cd: calc(100vw * .74); --zone: calc(var(--stage) * .30);
    display: flex; flex-direction: column; background: rgb(27, 10, 3); }
  .compass-text { display: contents; }
  .compass-head { order: 1; position: relative; z-index: 1; min-height: var(--zone); align-content: start; text-align: center; justify-items: center;
    padding: calc(var(--stage) * .035) var(--gutter-r) 12px var(--gutter-l); }
  .compass-head p { margin-inline: auto; }
  /* the stage overlaps the head's reserved zone; a taller head simply pushes it down */
  .stage { order: 2; position: relative; flex: none; margin-top: calc(-1 * var(--zone)); }
  /* centred on the map (parchment 30.3-79.6 % of the picture height, 4.9-94.6 % of its width), even margin all round */
  .dial-wrap { left: calc(49.73% - var(--cd) / 2); top: calc(var(--stage) * .545 - var(--cd) / 2); }
  /* chapter details start in the bottom wood, below the parchment (which ends at 80 % of the tall picture) */
  .compass-sec .chapter { order: 3; position: relative; z-index: 1; text-align: center; justify-items: center; gap: 8px;
    margin-top: calc(-1 * var(--stage) * .19 + 10px); padding: 0 var(--gutter-r) 28px var(--gutter-l); }
  .compass-sec .ch-meta { justify-content: center; }
  .compass-sec .progress { width: min(100%, 420px); }
}
@media (max-width: 600px) {
  .compass-sec .compass-head { gap: 10px; }
  .compass-sec .compass-head h2 { font-size: 1.7rem; }
  .compass-sec .compass-head p { font-size: .92rem; }
  .compass-sec .ch-num { font-size: 1.9rem; }
  .compass-sec .ch-title { font-size: 1.4rem; }
  .compass-sec .ch-sub { font-size: 1.05rem; }
  .compass-sec .chapter { gap: 6px; }
  .compass-sec .progress { display: none; }
}
.dial { position: relative; z-index: 1; width: 100%; height: 100%; overflow: visible; touch-action: none; cursor: grab; user-select: none; }
.dial:active { cursor: grabbing; }
.dial .dial-art { filter: drop-shadow(0 18px 28px rgba(0,0,0,.6)); }
.dial .glass-art, .dial .needle-art { pointer-events: none; }
.dial .tick { stroke: #e9d9b4; stroke-width: 1; opacity: .45; }
.dial .num { fill: #e9d9b4; font: 500 7.6px var(--font-mono); letter-spacing: -.2px; opacity: .72; cursor: pointer; }
.dial g.ch:hover .num { opacity: 1; }
.dial g.ch.on .num { fill: #ffd68a; opacity: 1; font-weight: 600; }
.dial g.ch.on .tick { stroke: var(--amber); opacity: 1; stroke-width: 2.2; }
.dial .hit { fill: transparent; cursor: pointer; }
.needle .needle-art { filter: drop-shadow(3px 5px 4px rgba(20,10,0,.55)); }
.needle { transition: transform .7s cubic-bezier(.3, 1.5, .5, 1); transform-origin: 0 0; }
.needle.shiver { animation: shiver .9s ease-in-out 1; }
@keyframes shiver { 0%, 100% { translate: 0 0; } 20% { translate: 1.5px 0; } 40% { translate: -1.5px 0; } 60% { translate: 1px 0; } 80% { translate: -1px 0; } }
@media (prefers-reduced-motion: reduce) { .needle { transition: none; } .needle.shiver { animation: none; } }
.chapter { display: grid; gap: 14px; min-width: 0; }
.ch-num { font: 500 clamp(2.2rem, 4.6vw, 3.4rem)/1 var(--font-mono); color: var(--gold); }
.ch-title { font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.1; color: var(--paper); }
.ch-sub { font-style: italic; font-size: clamp(1.15rem, 1.8vw, 1.4rem); color: var(--gold); }
.ch-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; font: 400 .78rem/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sand); }
.progress { position: relative; height: 2px; max-width: 420px; background: var(--line); }
.progress i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--sand), var(--amber)); transition: width .5s; }


/* ---------- 3D book ---------- */
.book3d { --w: 200px; --t: calc(var(--w) * .133); position: relative; width: var(--w); aspect-ratio: 1402 / 2007; transform-style: preserve-3d; transform: rotateY(var(--ry, 24deg)) rotateX(var(--rx, 5deg)); }
.book3d.tilt { transition: transform .3s ease-out; }
.book3d > * { position: absolute; top: 0; height: 100%; backface-visibility: hidden; }
.book3d .front { left: 0; width: 100%; transform: translateZ(calc(var(--t) / 2)); }
.book3d .front img { width: 100%; height: 100%; object-fit: cover; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.book3d .front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.35) 0, rgba(255,255,255,.06) 2.5%, rgba(0,0,0,0) 6%); pointer-events: none; }
.book3d .back { left: 0; width: 100%; transform: rotateY(180deg) translateZ(calc(var(--t) / 2)); background: #120f0b url("../img/back.jpg") center / cover; }
.book3d .spine { left: calc(50% - var(--t) / 2); width: var(--t); transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); background: #120f0b url("../img/spine.jpg") center / 100% 100%; box-shadow: inset -3px 0 6px rgba(0,0,0,.5); }
.book3d .pages { left: calc(50% - var(--t) / 2); width: var(--t); top: 1.2%; height: 97.6%; transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 3px)); background: repeating-linear-gradient(90deg, #efe4cc 0 1px, #d5c8ab 1px 2px); }
.book-shadow { position: absolute; left: 50%; bottom: -8%; width: 120%; height: 14%; translate: -50% 0; background: radial-gradient(closest-side, rgba(0,0,0,.75), transparent); filter: blur(6px); z-index: -1; }
.panel-title { font: 500 clamp(1.4rem, 2.4vw, 1.9rem)/1.2 var(--font-display); letter-spacing: .08em; color: var(--paper); }
.book-stage { position: relative; display: grid; place-items: center; perspective: 1400px; }

/* ---------- author ---------- */
.author { padding-block: clamp(64px, 9vw, 112px); border-top: 1px solid var(--line); }
.author .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.mono { position: relative; width: clamp(120px, 15vw, 170px); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--gold); display: grid; place-items: center; font: 500 clamp(2.2rem, 4vw, 3rem)/1 var(--font-display); color: var(--gold); }
.mono::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--gold) 50%, transparent); }
.author-copy { display: grid; gap: 16px; }
.author-copy h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.author-bio { display: grid; gap: 14px; max-width: 64ch; color: var(--sand); line-height: 1.7; }
.author-bio .author-quote { font-style: italic; font-size: 1.15rem; line-height: 1.5; color: var(--gold); padding-left: 18px; border-left: 2px solid var(--gold); }
.placeholder { border: 1px dashed var(--line); padding: 16px 18px; color: var(--sand); font-style: italic; max-width: 62ch; }
@media (max-width: 640px) { .author .wrap { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding-block: clamp(56px, 8vw, 96px) 36px; text-align: center; background: radial-gradient(60% 80% at 50% 100%, color-mix(in srgb, var(--amber) 14%, transparent), transparent 70%); }
footer .wrap { display: grid; gap: 18px; justify-items: center; }
footer .closing { display: grid; gap: 10px; max-width: 44ch; color: var(--sand); font-size: 1.1rem; }
footer .closing b { display: block; margin-top: 10px; font: 500 2.4rem/1 var(--font-display); color: var(--gold); }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin-top: 16px; }
footer nav a { font: 500 .76rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--paper); text-decoration: none; }
footer nav a:hover { color: var(--gold); }
footer .fine { margin-top: 24px; font: 400 .72rem/1.7 var(--font-mono); letter-spacing: .1em; color: var(--sand); }

/* ---------- order page ---------- */
.order-hero { position: relative; isolation: isolate; overflow: hidden; }
.order-hero picture, .order-hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.order-hero picture img { object-fit: cover; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(32px, 6vw, 80px); align-items: start; padding-block: clamp(40px, 6vw, 72px); }
.viewer { display: grid; gap: 18px; justify-items: center; position: sticky; top: calc(var(--bar-real, var(--bar-h)) + 24px); }
.viewer .book-stage { width: 100%; min-height: clamp(420px, 52vw, 600px); cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.viewer .book-stage:active { cursor: grabbing; }
.viewer .book3d { --w: clamp(220px, 24vw, 320px); }
.viewer .book3d.snap { transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .viewer .book3d.snap, .book3d.tilt { transition: none; } }
.faces { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: rgba(12,10,8,.6); }
.faces button { padding: 10px 16px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--paper); font: 500 .78rem/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.faces button:first-child { border-left: 0; }
.faces button[aria-pressed="true"] { background: var(--gold); color: var(--ground); }
.viewer .hint { font: 400 .74rem/1.3 var(--font-mono); letter-spacing: .08em; color: var(--paper); }

.buy { display: grid; gap: 22px; min-width: 0; background: rgba(22,18,14,.86); border: 1px solid var(--line); border-radius: 10px; padding: clamp(22px, 3vw, 36px); backdrop-filter: blur(6px); }
.buy h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); color: var(--paper); }
.buy .lede { color: var(--sand); }
.summary { display: grid; gap: 10px; padding-block: 16px; border-block: 1px solid var(--line); }
.summary .row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.summary .row span:last-child { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.summary .total { font: 500 1.4rem/1 var(--font-display); color: var(--gold); }
.summary .total span:last-child { font-family: var(--font-mono); }
.summary small { color: var(--sand); font-size: .85rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; color: var(--paper); font: 500 1.1rem/1 var(--font-mono); cursor: pointer; }
.stepper button:hover { color: var(--gold); }
.stepper input { width: 52px; height: 40px; border: 0; border-inline: 1px solid var(--line); background: transparent; color: var(--paper); text-align: center; font: 500 1rem/1 var(--font-mono); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

form.order { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
form.order .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font: 500 .72rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--sand); }
.field input, .field textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--ground); color: var(--paper); font: 400 1rem/1.3 var(--font-text); }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.field .err { min-height: 1em; font-size: .85rem; color: #f08a6a; }
.field.bad input { border-color: #c4623f; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--gold); }
.check a { color: var(--gold); }
.pay { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; }
.pay b { font: 500 .8rem/1.2 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.pay span { color: var(--sand); font-size: .92rem; }
.form-note { font-size: .85rem; color: var(--sand); }
.thanks { display: grid; gap: 16px; }
.thanks h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--gold); }
.thanks dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0; }
.thanks dt { font: 500 .72rem/1.8 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--sand); }
.thanks dd { margin: 0; }
.staging-note { border: 1px dashed var(--amber); padding: 12px 14px; color: var(--amber); font-size: .92rem; }
/* shop: product choice, payment methods, results */
.products { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.product { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: rgba(13,11,9,.35); }
.product:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.product:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.product input, .method input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.product span { display: grid; gap: 2px; min-width: 0; }
.product b { font: 500 .95rem/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--paper); }
.product small { color: var(--sand); font-size: .9rem; }
.product em { font: normal 500 1rem/1 var(--font-mono); color: var(--gold); white-space: nowrap; }
.methods { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.methods legend { font: 500 .72rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--sand); margin-bottom: 10px; }
#methodList { display: grid; gap: 8px; }
.method { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.method:has(input:checked) { border-color: var(--gold); }
.method input { margin-top: 2px; }
.method b { font: 500 .8rem/1.4 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.method span { grid-column: 2; color: var(--sand); font-size: .92rem; }
.buy .err:empty { display: none; }
#methodErr, #consentErr, #termsErr { color: #f08a6a; font-size: .85rem; margin-top: 6px; }
.form-error { border: 1px solid #c4623f; color: #f3b39d; padding: 12px 14px; border-radius: 6px; }
.bankbox { display: grid; gap: 14px; }
.ipsqr { margin: 0; display: grid; gap: 8px; justify-items: start; }
.ipsqr img { background: #fff; padding: 8px; border-radius: 6px; width: 220px; height: 220px; }
.ipsqr figcaption { color: var(--sand); font-size: .88rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 900px) {
    .order-grid { grid-template-columns: 1fr; }
  .viewer { position: static; }
  .viewer .book-stage { min-height: 400px; }
  form.order { grid-template-columns: 1fr; }
  /* the picture covers only the book area; the buttons, hint and form sit on the plain page ground.
     It uses the wide master, sized (never above native) and placed so its pool of light (28 %, 55 %) is behind the book. */
  .order-hero { --pad: clamp(40px, 6vw, 72px); --viewer-h: calc(var(--pad) + 400px); --book-cy: calc(var(--pad) + 200px); --iw: max(180vw, 1000px); }
  .order-hero picture { inset: 0 0 auto 0; height: var(--viewer-h); overflow: hidden; }
  .order-hero picture img { inset: auto; width: var(--iw); max-width: none; height: auto; object-fit: fill;
    left: calc(50% - var(--iw) * .28); top: calc(var(--book-cy) - var(--iw) * .55 * 941 / 1672); }
}

.details { padding-block: clamp(48px, 7vw, 88px); border-top: 1px solid var(--line); }
.details .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(28px, 6vw, 80px); }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; margin: 18px 0 0; }
.specs dt { font: 500 .72rem/1.9 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--sand); }
.specs dd { margin: 0; }
.blurb { display: grid; gap: 14px; color: var(--paper); }
.blurb .ask { border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); padding: 16px 18px; font-style: italic; color: var(--gold); }
@media (max-width: 820px) { .details .wrap { grid-template-columns: 1fr; } }

/* ---------- legal page ---------- */
/* ---------- About: the whole text about the book unfolds below the panel as a page of the book ---------- */
/* About and the fold-out are one grid item of .panels, so a closed fold-out adds no second gap */
.about-group { display: grid; background: var(--ground); }
.bookpage { display: grid; grid-template-rows: 1fr; }
.bookpage-clip { min-height: 0; overflow: hidden; }
/* the text stays open until site.js has wired the buttons (no JS, or site.js failed: it simply reads open) */
html.site-ready .bookpage:not(.open) { grid-template-rows: 0fr; }
html.site-ready .bookpage:not(.open) .bookpage-clip { visibility: hidden; }
/* animate only after the first paint (book-anim), so the initial collapse on load is instant */
html.book-anim .bookpage { transition: grid-template-rows .55s ease; }
html.book-anim .bookpage:not(.open) .bookpage-clip { transition: visibility 0s .55s; }
@media (prefers-reduced-motion: reduce) { html.book-anim .bookpage, html.book-anim .bookpage .bookpage-clip { transition: none; } }
/* the sheet: a dark book page in the site's own warm tones (light text on near-black paper as
   a solid fill, no blend modes: iOS Safari did not blend the paper tile), a thin gold edge and stacked page edges below */
.bookpage-sheet {
  --ink: var(--paper); --leaf: #17110c; --rim: #8a6a35; --gap: clamp(64px, 7vw, 112px);
  width: min(100% - var(--gutter-l) - var(--gutter-r), 1120px); margin: clamp(28px, 4vw, 56px) auto clamp(40px, 5vw, 72px);
  padding: clamp(32px, 5vw, 72px) clamp(22px, 5vw, 80px) clamp(28px, 4vw, 56px);
  background: var(--leaf); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent); border-radius: 2px 2px 3px 3px;
  box-shadow: 0 1px 0 #2a2219, 0 3px 0 #15110c, 0 4px 0 #2a2219, 0 6px 0 #120e0a, 0 7px 0 #261f17, 0 9px 0 #0f0c09,
    0 22px 48px rgba(0, 0, 0, .6);
}
.bookpage-text p { margin: 0; font-size: clamp(1.05rem, 1.2vw, 1.13rem); line-height: 1.75; text-indent: 1.6em; text-wrap: pretty; orphans: 2; widows: 2; }
.bookpage-text p:first-child { text-indent: 0; }
.bookpage-text .pull, .bookpage-text .last { text-indent: 0; text-align: center; font-style: italic; text-wrap: balance; break-inside: avoid; }
.bookpage-text .pull { margin-block: 1em; font-size: clamp(1.2rem, 1.6vw, 1.35rem); line-height: 1.5; color: var(--gold); }
.bookpage-text .last { margin-top: 1.2em; font-size: clamp(1.15rem, 1.5vw, 1.3rem); line-height: 1.5; }
.bookpage-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: clamp(28px, 3vw, 40px); }
/* phones and tablets: one page at a time (site.js adds .paged and sets the page height); the text flows into
   overflow columns to the right, one column = one page; site.js scrolls the view a column per page */
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; }
.pager-btn { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--rim); border-radius: 50%; background: transparent; color: var(--gold); font: 400 1.35rem/1 var(--font-text); cursor: pointer; }
.pager-btn:not(:disabled):hover { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.pager-btn:disabled { opacity: .3; cursor: default; }
.pager-status span { white-space: nowrap; }
.pager-status { min-width: 8em; text-align: center; font: 500 .78rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--sand); font-variant-numeric: tabular-nums; }
@media (width <= 1023px) {
  .bookpage-sheet.paged .bookpage-view { overflow: hidden; touch-action: pan-y; }
  .bookpage-sheet.paged .bookpage-text { column-count: auto; column-gap: 48px; column-fill: auto; }
  .bookpage-sheet.paged .bookpage-text.dragging { user-select: none; }
}
[data-book-toggle]::after, [data-nojs]::after { content: "↓"; }
[data-book-toggle][aria-expanded="true"]::after { content: "↑"; }
/* desktop: an open spread, two pages with the spine shadow drawn only inside the gap between them */
@media (width > 1023px) {
  .bookpage-text { columns: 2; column-gap: var(--gap); }
  .bookpage-sheet { background:
    linear-gradient(90deg, transparent, rgba(0, 0, 0, .45) 50%, transparent) 50% 0 / var(--gap) 100% no-repeat,
    var(--leaf); }
  /* panel paragraphs reflow narrower with enlarged text instead of running onto the picture's subject */
  .panel-body p { max-width: min(40ch, 31vw); }
  /* when enlarged text makes the About panel taller than the picture, keep the dark left part, crop the right */
  #o-knjizi > picture.bg img { object-position: 0% 50%; }
}
/* without site.js the header height is not measured: give anchor targets room for a wrapped header */
html:not(.site-ready) :is(#o-knjizi, #ceo-tekst, #knjiga-tekst) { scroll-margin-top: 2.5em; }

.legal { padding-block: clamp(48px, 7vw, 88px); }
.legal .wrap { max-width: 780px; display: grid; gap: 40px; }
.legal h1 { font-size: clamp(2rem, 4vw, 3rem); color: var(--gold); }
.legal section { display: grid; gap: 12px; }
.legal h2 { font-size: 1.3rem; color: var(--paper); }
