/* The page's ground: the ELLE fonts, colours and the stages a buyer passes through before the magazine opens (the
   masthead gate with its one-time code, the flicker, the scene with the closed issue), and the edition switch. */
@font-face { font-family: 'Silver Editorial'; src: url('../fonts/TheSilverEditorial-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: 'Silver Editorial'; src: url('../fonts/TheSilverEditorial-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: 'ELLE Nova C'; src: url('../fonts/ElleNovaC-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: block; }
@font-face { font-family: 'ELLE Nova C'; src: url('../fonts/ElleNovaC-Book.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: block; }

:root {
  --canvas: #0B0B0B;
  --ink: #FFFFFF;
  --ink-sub: rgba(255,255,255,0.82);
  --ink-faint: rgba(255,255,255,0.55);
  --relief: #EAE2D4;
  --frame: clamp(6px, 1.3vmin, 14px);
  --accent-1: #D8B897;
  --accent-2: #A9876A;
  --espresso: #3E2617;
  --vh100: 100vh;
}
@supports (height: 100dvh) { :root { --vh100: 100dvh; } }
:root { --svh100: 100vh; }
@supports (height: 100svh) { :root { --svh100: 100svh; } }
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; background: var(--canvas); color: var(--ink); overflow: hidden;
  font-family: 'ELLE Nova C', Futura, 'Avenir Next', sans-serif; -webkit-font-smoothing: antialiased; }

/* the QA hooks (?scene, ?reader on a local preview) still every transition and animation */
html.qa-still *, html.qa-still *::before, html.qa-still *::after { transition: none !important; animation: none !important; }

.stage { position: fixed; inset: 0; opacity: 0; pointer-events: none; transition: opacity .9s ease; }
.stage.on { opacity: 1; pointer-events: auto; }

/* ---- 1 · The gate ---- */
#gate { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 44px; background: var(--canvas); cursor: pointer; z-index: 30; transition: opacity .6s ease; }
#gate img { width: min(42vw, 340px); display: block; }
#gate .greet { font-family: 'Silver Editorial', Didot, serif; font-style: italic; font-size: clamp(19px, 2.3vw, 27px);
  line-height: 1.55; color: var(--ink-sub); text-align: center; max-width: min(86vw, 36ch); }
#gate .pill { margin-top: 14px; -webkit-appearance: none; appearance: none; cursor: pointer; }
#gate .pill {
  font-family: 'Silver Editorial', Didot, serif; font-size: 14px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink); border: 1px solid rgba(255,255,255,0.85); border-radius: 999px; padding: 15px 42px 13px 46px;
  background: transparent; animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
#gate .pill { text-align: center; max-width: 86vw; }
@media (max-width: 480px) { #gate .pill { font-size: 11px; letter-spacing: .2em; padding: 12px 24px 10px 28px; } }
@media (max-width: 480px) { .layout .coverwrap { gap: 16px; } .coverwrap .tapcue { white-space: nowrap; font-size: 12px; letter-spacing: .2em; padding: 13px 26px 11px 29px; } }

/* ---- 2 · The flicker ---- */
#flick { background: #000; z-index: 20; }
#flick video { width: 100%; height: 100%; object-fit: cover; }

/* ---- 3 · The scene ---- */
#scene { z-index: 10; }
#scene .bg, #scene .bg video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#scene .scrim { position: absolute; inset: 0;
  background: linear-gradient(rgba(11,11,11,.30), rgba(11,11,11,.06) 30%, rgba(11,11,11,.10) 70%, rgba(11,11,11,.55)); }
.layout { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 58%);
  align-items: center; padding: 0 4.5vw; gap: 2.5vw; }

.welcome { max-width: 540px; }
.welcome .eyebrow { font-size: 13px; font-weight: 500; letter-spacing: .3em; color: var(--accent-1); text-transform: uppercase; margin-bottom: 26px; }
.welcome h1 { font-family: 'Silver Editorial', Didot, serif; font-weight: 400; font-size: clamp(30px, 4vw, 64px);
  line-height: 1.04; letter-spacing: .02em; text-shadow: 0 2px 28px rgba(11,11,11,.65), 0 1px 4px rgba(11,11,11,.4); }
.welcome h1 em { font-style: italic; }
.welcome p { margin-top: 26px; font-size: clamp(15px, 1.25vw, 20px); font-weight: 400; line-height: 1.55; color: var(--ink-sub); max-width: 44ch;
  text-shadow: 0 1px 18px rgba(11,11,11,.7), 0 1px 3px rgba(11,11,11,.5); }

/* ---- The closed issue (scene hero) ---- */
.coverwrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(26px, 4vh, 40px); min-width: 0; }
/* the call to open, centred under the issue */
.tapcue { -webkit-appearance: none; appearance: none; cursor: pointer; background: transparent;
  font-family: 'Silver Editorial', Didot, serif; font-size: 15px; font-weight: 400; letter-spacing: .3em; text-transform: uppercase; color: var(--ink);
  border: 1px solid rgba(255,255,255,.9); border-radius: 999px; padding: 15px 42px 13px 46px; max-width: 86vw;
  box-shadow: 0 0 0 1px rgba(216,184,151,.28), 0 0 24px rgba(216,184,151,.22);
  text-shadow: 0 1px 3px rgba(11,11,11,.85), 0 0 14px rgba(11,11,11,.6); animation: cue 3.2s ease-in-out infinite; }
.tapcue:hover { border-color: var(--accent-1); }
@keyframes cue { 0%,100% { opacity: .78; } 50% { opacity: 1; } }
#hero {
  position: relative; height: min(76vh, 76 * var(--vh100) / 100); aspect-ratio: 0.72; max-width: 100%;
  cursor: pointer; animation: float 5.5s ease-in-out infinite; perspective: 1600px;
}
/* the closed issue as an object: cover face, spine and page block in 3D */
#hero .mag { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(24deg) rotateX(4deg); }
#hero .mag { --t: clamp(14px, 4vw, 28px); }
#hero .mag > .cover-face { position: absolute; inset: 0;
  box-shadow: 0 0 0 1px rgba(216,184,151,.30), 0 0 26px rgba(216,184,151,.20), 0 40px 70px rgba(0,0,0,.78); }
#hero .spine { position: absolute; top: 0; left: 0; width: var(--t); height: 100%; transform-origin: left center; transform: rotateY(90deg);
  background: linear-gradient(90deg, rgba(0,0,0,.30), rgba(255,255,255,.08) 45%, rgba(0,0,0,.22)),
    linear-gradient(180deg, #0b110d 0 29.3%, #ddd3bd 29.3% 100%); }
#hero .foot { position: absolute; left: 0; bottom: 0; width: 100%; height: var(--t); transform-origin: center bottom; transform: rotateX(90deg);
  background: repeating-linear-gradient(180deg, #efe8de 0 1px, #d9cfc2 1px 2px), #e9e1d6; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ---- The cover face (shared: hero + book page 1) ---- */
.cover-face { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--canvas); }
.cover-face .art { position: absolute; inset: 0; background: url('../media/cover-welcome-15.jpg') center/cover no-repeat; }
/* coverlines on the wall, left */
.cover-face .cl { position: absolute; left: 2%; top: 33.5%; width: 27%; text-align: center; color: #1a1512; font-family: 'Silver Editorial', Didot, serif; }
.cover-face .cl .big { font-size: clamp(13px, 4.3cqh, 37px); line-height: 1.12; }
.cover-face .cl .sep { width: 34px; height: 1px; background: currentColor; opacity: .55; margin: 5.5% auto; }
.cover-face .cl .small { font-size: clamp(9px, 2.1cqh, 18px); line-height: 1.3; letter-spacing: .04em; }
/* caption on the wall, right */
.cover-face .cap { position: absolute; left: 70.5%; top: 37%; width: 26%; text-align: center; color: #1a1512; font-family: 'Silver Editorial', Didot, serif;
  font-size: clamp(9px, 2.1cqh, 18px); line-height: 1.35; letter-spacing: .06em; }
.cover-face .cap .sym { font-family: Georgia, serif; }
/* barcode, bottom left */
.cover-face .bar { position: absolute; left: 3%; top: 84.5%; width: 11.5%; height: 13.5%; background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(11,11,11,.18); }
.cover-face .bar .lines { width: 62%; height: 78%;
  background: repeating-linear-gradient(90deg, #111 0 2px, #fff 2px 4px, #111 4px 5px, #fff 5px 8px, #111 8px 11px, #fff 11px 13px); }
.cover-face { container-type: size; }
/* the hinge score of a perfect-bound issue, just in from the spine */
.cover-face::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 5%; z-index: 6; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.42), rgba(0,0,0,.10) 30%, rgba(0,0,0,0) 40%, rgba(0,0,0,.30) 52%, rgba(255,255,255,.16) 60%, rgba(255,255,255,0) 78%); }
/* artist impression, on every render */
.ai-cap { position: absolute; z-index: 5; right: 4%; bottom: 2.6%; font-size: 9.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.92); text-shadow: 0 0 1px rgba(11,11,11,1), 0 0 4px rgba(11,11,11,.95), 0 0 10px rgba(11,11,11,.7); pointer-events: none; }
#scene .ai-cap.scene-cap { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); z-index: 2; }
/* ---- phones + portrait tablets: reflow, never shrink ---- */
@media (max-width: 860px), (orientation: portrait) and (max-width: 1024px) {
  html, body { overflow: auto; }
  #scene { position: fixed; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #scene .bg, #scene .scrim { position: fixed; }
  .layout { grid-template-columns: minmax(0, 1fr); align-content: start; padding: 11vh 7vw 9vh; gap: 40px; height: auto; min-height: 100%; }
  .welcome { max-width: none; }
  .welcome h1 { font-size: clamp(27px, 7.4vw, 40px); }
  .welcome p { margin-top: 18px; }
  .coverwrap { padding-bottom: 7vh; }
  #hero { height: auto; width: min(88vw, 480px); aspect-ratio: 0.72; }
}
/* phone browsers with their own dark mode (Samsung Internet) would brown the ivory pages */
:root { color-scheme: only light; }
@media (prefers-color-scheme: dark) { :root { color-scheme: only light; } }
/* ---- phones + portrait tablets, upright: the welcome, the issue and the cue fit one screen ---- */
@media (orientation: portrait) and (max-width: 1024px) {
  .layout { display: flex; flex-direction: column; align-items: stretch; height: var(--svh100); min-height: 0;
    padding: max(5.5svh, calc(env(safe-area-inset-top) + 16px)) 7vw max(3.5svh, calc(env(safe-area-inset-bottom) + 12px)); gap: 3svh; }
  .welcome { flex: none; }
  .coverwrap { flex: 1 1 0; min-height: 0; padding-bottom: 0; container-type: size; --cue-room: 96px; }
  #hero { width: auto; max-width: 88vw; aspect-ratio: 0.72;
    height: min(max(250px, calc(100cqh - var(--cue-room))), calc(min(88vw, 480px) / 0.72)); }
}
@media (orientation: portrait) and (max-width: 480px) { .coverwrap { --cue-room: 60px; } }

/* ---- the edition: the Welcome Edition, then the Investment Confirmed Edition once the register says paid ---- */
[data-edition="confirmed"] { display: none; }
body.edition-confirmed [data-edition="welcome"] { display: none; }
body.edition-confirmed [data-edition="confirmed"] { display: revert; }

/* ---- the one-time code, on the masthead gate ---- */
#gate.locked { cursor: default; }
#gate .codegate { display: none; flex-direction: column; align-items: center; gap: 22px; max-width: min(88vw, 440px); text-align: center; }
#gate.locked .codegate { display: flex; }
#gate.locked .greet, #gate.locked .pill { display: none; }
.codegate .eyebrow { font-size: 12.5px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--accent-1); }
.codegate .say { font-family: 'Silver Editorial', Didot, serif; font-style: italic; font-size: clamp(18px, 2.2vw, 24px); line-height: 1.5; color: var(--ink-sub); }
.codegate form { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; }
.codegate [hidden] { display: none !important; }
.codegate input { width: min(280px, 80vw); background: transparent; border: 0; border-bottom: 1px solid rgba(216,184,151,.7); color: var(--ink);
  font-family: 'ELLE Nova C', sans-serif; font-size: 26px; letter-spacing: .35em; text-align: center; padding: 8px 0 10px; outline: none; }
.codegate input::placeholder { color: rgba(255,255,255,.35); letter-spacing: .2em; font-size: 15px; }
.codegate input:focus { border-bottom-color: var(--ink); }
.codebtn { -webkit-appearance: none; appearance: none; cursor: pointer; background: transparent; font-family: 'Silver Editorial', Didot, serif; font-size: 14px;
  letter-spacing: .3em; text-transform: uppercase; color: var(--ink); border: 1px solid rgba(255,255,255,.85); border-radius: 999px; padding: 15px 38px 13px 42px; }
.codebtn:disabled { opacity: .45; cursor: default; }
.codegate .quiet { -webkit-appearance: none; appearance: none; background: none; border: 0; cursor: pointer; color: var(--ink-faint);
  font-family: 'ELLE Nova C', sans-serif; font-size: 11px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; padding: 6px; }
.codegate .msg { min-height: 1.4em; font-size: 14px; line-height: 1.45; color: #F1D9C0; }
@media (max-width: 480px) { .codebtn { font-size: 11.5px; letter-spacing: .2em; padding: 13px 26px 11px 30px; } }
