/* =========================================================
   Fever XXV — Part 1: The Photoshoot
   Desktop: 1920×1080 artboard scaled to the viewport (--u = 1 artboard px)
   Mobile:  1080×1350 artboard (from the Instagram comps), copy pulled into flow
   ========================================================= */

:root {
  --blue: #1e65f9;
  --ink: #000;
  --paper: #f3f2ef;
  --night: #161616;
  /* ITC Avant Garde Gothic Pro from the Adobe Fonts kit (see <head>) */
  --font: 'itc-avant-garde-gothic-pro', 'ITC Avant Garde Gothic', 'Century Gothic', 'Avenir Next', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; width: 100%; height: auto; }
p, h1, h2, blockquote { margin: 0; font-weight: 300; }        /* Book */
.display, .quote { font-weight: 300; }                          /* Book, matching the original artwork */

/* ---------- sections ---------- */
.sec {
  position: relative;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}
.sec--white { background-color: var(--paper); background-image: url(https://kylie-server.b-cdn.net/fever-pt1/img/bg-white.webp); color: var(--ink); }
.sec--black { background-color: var(--night); background-image: url(https://kylie-server.b-cdn.net/fever-pt1/img/bg-black.webp); color: #fff; }
.sec--photo { background-color: #ddd; }

.sec-bg { position: absolute; inset: 0; z-index: 0; }
.sec-bg img, .sec-bg video { width: 100%; height: 100%; object-fit: cover; }

.stage { position: relative; z-index: 1; }
.art   { position: relative; }

/* every positioned element */
.el { position: absolute; will-change: transform; }
.ln { display: block; overflow: hidden; padding-bottom: .04em; }
.ln > span { display: inline-block; }

/* marker circles "draw" on: a conic mask sweeps round as --a goes 0 → 360deg */
/* the pen bracket: sweeps anticlockwise from its top-left end, down and round to the right
   (the stroke only spans ~200deg of the circle, so the sweep is scaled to finish as --a hits 360deg) */
[data-draw-dir="ccw"] {
  -webkit-mask-image: conic-gradient(from 320deg, transparent calc(360deg - var(--a, 360deg) * .56), #000 0);
          mask-image: conic-gradient(from 320deg, transparent calc(360deg - var(--a, 360deg) * .56), #000 0);
}
[data-draw]:not([data-draw-dir]) {
  -webkit-mask-image: conic-gradient(from 200deg, #000 var(--a, 360deg), transparent 0);
          mask-image: conic-gradient(from 200deg, #000 var(--a, 360deg), transparent 0);
}

/* pen-circle layers sitting on top of an image (positioned in % of that image) */
.ink { position: absolute; left: var(--ix); top: var(--iy); width: var(--iw); height: auto; pointer-events: none; }

/* red marker dots: sit exactly over the dots printed in the artwork (static) */
.dot {
  position: absolute; left: var(--dx); top: var(--dy); width: var(--ds); aspect-ratio: 1;
  translate: -50% -50%; border-radius: 50%; background: #d93938; pointer-events: none;
}

.film-strip video { rotate: -3.5deg; }

/* ---------- typography ---------- */
.eyebrow { letter-spacing: .01em; }
.eyebrow--blue, .title { color: var(--blue); }
.sec--black .eyebrow { color: #fff; }
.display, .quote { line-height: 1; letter-spacing: -.005em; }
.body p + p { margin-top: 1.45em; }
.body--quote { font-style: italic; }
.body--quote footer { font-style: normal; text-align: right; margin-top: .5em; padding-right: 2em; font-size: .85em; letter-spacing: .02em; }
.copy--card { background: rgba(255,255,255,.94); color: var(--ink); }

/* "SCROLL ↓" under the cover title, left-aligned with it */
.scroll-cue {
  display: flex; align-items: center; gap: calc(var(--u) * 14);
  margin-top: calc(var(--u) * 26);
  font-size: calc(var(--u) * 24); letter-spacing: .3em; text-transform: uppercase; color: var(--blue);
}
.scroll-cue i {                                 /* down arrow: stem + chevron, bouncing */
  position: relative; display: block;
  width: 2px; height: calc(var(--u) * 22); background: currentColor;
  animation: cue 1.6s ease-in-out infinite;
}
.scroll-cue i::after {
  content: ''; position: absolute; left: 50%; bottom: 0;
  width: calc(var(--u) * 8); height: calc(var(--u) * 8);
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  translate: -50% 0; rotate: 45deg; transform-origin: center;
}
@keyframes cue { 0%, 100% { translate: 0 -15%; } 50% { translate: 0 15%; } }

/* ---------- loader ---------- */
body.is-loading { overflow: hidden; }
#loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink);
}
#loader .ld-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
#loader .ld-art { position: relative; width: min(96px, 24vw); }
#loader .ld-mark { display: block; width: 100%; height: auto; overflow: visible; opacity: 0; }   /* main.js fades it */
/* full logo, scaled and placed so its XX lands exactly on the mark's XX
   (logo XX = 99x65px at 102,166 in the 310x305 file; mark XX = 18.1..121.9 x 5..71 in the 114x142 viewBox) */
#loader .ld-logo {
  position: absolute; left: -89.3%; top: -120.4%; width: 285%; max-width: none; height: auto;
  visibility: hidden; opacity: 0; pointer-events: none;
}
#loader .ld-mark path {
  fill: none; stroke: currentColor; stroke-width: 4.2; stroke-linecap: butt; stroke-linejoin: miter;   /* same weight as the artwork */

}
#loader .ld-foot { display: grid; place-items: center; min-height: 48px; }
#loader .ld-foot > * { grid-area: 1 / 1; }               /* number and button share one spot */
#loader .ld-bar { width: min(140px, 36vw); height: 2px; background: rgba(0, 0, 0, .12); overflow: hidden; }
#loader .ld-bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; scale: var(--p, 0) 1; }
#loader .ld-begin {
  visibility: hidden; opacity: 0;                         /* main.js shows it once loaded */
  font: inherit; font-weight: 300; font-size: 12px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 2px solid var(--ink);
  padding: 14px 34px 13px 38px; cursor: pointer; transition: background-color .25s, color .25s;
}
#loader .ld-begin:focus-visible { outline: none; background: rgba(0, 0, 0, .06); }   /* keyboard focus: a faint tint, no second line */
#loader .ld-begin:hover { background: var(--ink); color: #fff; }                    /* after focus, so hover always reads black/white */

/* ---------- music on/off ---------- */
.sound-toggle {
  position: fixed; right: 22px; bottom: 22px; z-index: 55;     /* bottom right on every layout */
  width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  background: rgba(243, 242, 239, .88); color: var(--ink); box-shadow: 0 1px 6px rgba(0,0,0,.12);
  visibility: hidden; opacity: 0;                         /* revealed with the site */
}
.sound-toggle span {
  width: 2px; height: 14px; background: currentColor; transform-origin: 50% 100%;
  scale: 1 .22; transition: scale .3s;
}
.sound-toggle[aria-pressed="true"] span { animation: eq 1.1s ease-in-out infinite alternate; }
.sound-toggle[aria-pressed="true"] span:nth-child(2) { animation-delay: -.4s; }
.sound-toggle[aria-pressed="true"] span:nth-child(3) { animation-delay: -.8s; }
.sound-toggle[aria-pressed="true"] span:nth-child(4) { animation-delay: -.2s; }
@keyframes eq { 0% { scale: 1 .25; } 100% { scale: 1 1; } }
.sound-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
#loader.is-done { pointer-events: none; }

/* ---------- reading progress (mobile only; hidden on desktop by .m-only) ---------- */
.progress {
  position: fixed; left: 0; right: 0; top: 0; height: 5px; z-index: 60;   /* top edge: bottom moves with the browser bars */
  pointer-events: none; background: rgba(30,101,249,.15);
}
.progress i { display: block; height: 100%; background: var(--blue); transform-origin: left; scale: var(--p, 0) 1; }

/* ---------- finale: logo, release date, pre-order ---------- */
.po-date { margin: 0; text-transform: uppercase; letter-spacing: .28em; color: var(--ink); }
.po-btn {
  display: inline-block; background: transparent; color: var(--ink); border: 1.5px solid var(--ink);
  text-decoration: none; text-transform: uppercase; letter-spacing: .3em; font-weight: 500;
  transition: background-color .25s, color .25s;
}
.po-btn:hover, .po-btn:focus-visible { background: var(--ink); color: #fff; }   /* fills black on hover */
.po-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- legal footer (copyright + BMG policy links, as on www.kylie.com) ---------- */
.site-foot {
  position: relative; z-index: 2;
  background: var(--paper); color: var(--ink); border-top: 1px solid #d6d3cd;
  padding: 26px 24px 28px; text-align: center;
  font-size: 12px; letter-spacing: .06em; line-height: 1.9;
}
.sf-copy { margin: 0 0 4px; }
.sf-links span { margin: 0 8px; opacity: .5; }
.sf-links a { color: inherit; text-decoration: none; transition: opacity .2s; white-space: nowrap; }
.sf-links a:hover { opacity: .6; }
.sf-links a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- page key (desktop only) ---------- */
.pager { display: none; }

/* =========================================================
   DESKTOP  (landscape, ≥768px)
   ========================================================= */
@media (min-width: 768px) and (orientation: landscape) {
  .m-only { display: none !important; }

  /* dots joined by a line, fixed on the left; black on the light pages,
     white on the dark ones; the current page dot is always blue
     (main.js sets data-theme from the current page) */
  .pager {
    display: block;
    position: fixed; left: 28px; top: 50%; translate: 0 -50%;
    z-index: 50;
    color: #000; transition: color .4s;
  }
  .pager[data-theme="dark"] { color: #fff; }
  .pager ol { list-style: none; margin: 0; padding: 0; }
  .pager li { position: relative; height: 32px; }
  .pager li:last-child { height: 11px; }
  .pager li:not(:last-child)::after {           /* line to the next dot */
    content: ''; position: absolute; left: 5px; top: 14px; bottom: 3px;
    width: 1px; background: currentColor; opacity: .55;
  }
  .pager a {
    display: block; width: 11px; height: 11px; border-radius: 50%;
    border: 1px solid currentColor; color: inherit; text-decoration: none;
    transition: background-color .3s, border-color .3s, scale .3s;
  }
  .pager a:hover, .pager a:focus-visible { scale: 1.25; outline: none; }
  .pager a.is-active { background: var(--blue); border-color: var(--blue); scale: 1.35; }  /* current page: always blue */
  .pager a span {
    position: absolute; left: 24px; top: -3px; white-space: nowrap;
    font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
    opacity: 0; translate: -6px 0; transition: opacity .25s, translate .25s; pointer-events: none;
  }
  .pager a:hover span, .pager a:focus-visible span { opacity: 1; translate: 0 0; }

  .sec { height: 100vh; display: grid; place-items: center; }
  .stage {
    --sw: min(100vw, 177.7778vh);
    --u: calc(var(--sw) / 1920);
    width: var(--sw);
    height: calc(var(--sw) * .5625);
  }
  .art { position: absolute; inset: 0; }
  .art--under { z-index: 0; } .art--top { z-index: 1; }   /* page 3: bottom sheet stays behind the middle one */
  .el, .copy { position: absolute; left: var(--x); top: var(--y); width: var(--w); }
  .el { z-index: var(--dz, auto); }                         /* --dz: desktop-only stacking */
  .copy { z-index: 5; }

  .eyebrow { font-size: calc(var(--u) * 25); }
  .title   { font-size: calc(var(--u) * 44); line-height: 1.1; margin: calc(var(--u) * 8) 0 calc(var(--u) * 26); }
  .body    { font-size: calc(var(--u) * 25); line-height: 1.55; }
  .body--sm { font-size: calc(var(--u) * 23.5); line-height: 1.45; }
  .body--quote { font-size: calc(var(--u) * 22); line-height: 1.6; }
  .display { font-size: calc(var(--u) * 94); margin-top: calc(var(--u) * 46); }
  #cover .eyebrow { font-size: calc(var(--u) * 35); }
  .quote   { font-size: calc(var(--u) * 86); line-height: 1.12; margin-top: calc(var(--u) * 14); }
  #looks .title { margin-bottom: calc(var(--u) * 14); }

  .copy--card { padding: calc(var(--u) * 22) calc(var(--u) * 24) calc(var(--u) * 26); }
  .copy--card .title { margin-bottom: calc(var(--u) * 12); }
  .copy--card .body { font-size: calc(var(--u) * 23.5); line-height: 1.5; }

  /* hard 2px rule where the cropped closing video meets the merch page */
  #merch { border-top: 2px solid #b9b6b0; }   /* soft grey, sits with the paper */
  .preorder {
    position: absolute; left: var(--x); top: var(--y); width: var(--w); z-index: 30;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    visibility: hidden; opacity: 0;                    /* main.js reveals it */
  }
  .preorder .po-logo { width: 66%; height: auto; }
  .preorder .po-date { font-size: calc(var(--u) * 30); margin: calc(var(--u) * 48) 0 calc(var(--u) * 44); }
  .preorder .po-btn  { font-size: calc(var(--u) * 22); padding: calc(var(--u) * 24) calc(var(--u) * 64); }
  #closing { place-items: end center; }      /* sit on the bottom edge so the video always meets the rule */

  .copy--note .sig { width: 58%; margin: calc(var(--u) * 30) 0 0 41%; }
}

/* =========================================================
   MOBILE / PORTRAIT
   ========================================================= */
@media (max-width: 767px), (orientation: portrait) {
  .d-only { display: none !important; }

  .stage { --u: calc(100vw / 1080); display: flex; flex-direction: column; width: 100%; }
  .art { order: 0; width: 100%; aspect-ratio: var(--mar, .8); }
  .art--under { order: 2; }                                /* page 3: third sheet below the text */
  #film .copy { padding-bottom: 8vw; }
  .el { left: var(--mx); top: var(--my); width: var(--mw); z-index: var(--mz, auto); }   /* --mz: mobile-only stacking */

  .copy {
    position: relative; order: var(--mo, 1); z-index: 2;
    padding: 11vw 7vw 2vw;
    max-width: 640px;
  }
  .copy[style*="--mo:1"] { padding: 4vw 7vw 12vw; }

  .eyebrow { font-size: 13px; }
  .title   { font-size: clamp(26px, 7.4vw, 40px); line-height: 1.1; margin: 4px 0 18px; }
  .body    { font-size: clamp(15px, 4vw, 19px); line-height: 1.6; }
  .body--quote { font-size: clamp(14.5px, 3.8vw, 18px); }

  /* art-scaled type that stays on the image (cover title, quote card) */
  .txt .eyebrow { font-size: calc(var(--u) * 26); }
  .display { font-size: calc(var(--u) * 74); margin-top: calc(var(--u) * 38); }
  .quote   { font-size: calc(var(--u) * 84); line-height: 1.1; margin-top: calc(var(--u) * 14); }

  /* full-bleed media sections keep the media behind everything */
  .sec--photo .stage { min-height: 125vw; }
  /* The Focus: full-screen on mobile, quote card centred over the photo */
  #focus { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; }
  #focus .stage { min-height: 0; }
  /* merch: full-screen collage (layout drawn on a 9:16 canvas) */
  #merch { height: 100vh; height: 100svh; }
  #merch .stage, #merch .art { height: 100%; }
  #merch .art { aspect-ratio: auto; }
  /* finale on mobile: column under the centred cover (main.js sets its top) */
  .preorder {
    position: absolute; left: 10%; width: 80%; top: 62%; z-index: 30;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    visibility: hidden; opacity: 0;
  }
  .preorder .po-logo { width: 34vw; max-width: 170px; height: auto; }
  .preorder .po-date { font-size: 14px; margin: 5vw 0 6vw; }
  .preorder .po-btn  { font-size: 13px; padding: 14px 38px; }
  .copy--card { margin: 8vw 5vw 0; padding: 7vw 6vw; width: auto; }

  /* closing note: white card overlapping the bottom of the video */
  #closing .art { z-index: 1; }
  #closing .copy--note { margin: -26vw 4vw 10vw; width: auto; max-width: none; padding: 6vw 5vw 4vw; background: #fff; z-index: 3; }
  .copy--note .sig { width: 52%; margin: 2vw 0 0 42%; }

  .scroll-cue { display: none; }
  .site-foot { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }   /* clears the music button in the corner */
  .sf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }   /* no stray "|" at line ends */
  .sf-links span { display: none; }
  .sound-toggle { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }   /* mobile: a little tighter to the corner */

  /* cover: full-screen on black, framed photo as large as fits (narrower 640×1000 crop) */
  #cover {
    height: 100vh; height: 100svh;
    background: #202026;
    /* logo | photo | scroll: the top and bottom rows share the leftover space equally,
       so the logo and the scroll prompt each sit exactly midway in their gap */
    display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); place-items: center;
  }
  #cover .stage { grid-row: 2; }
  #cover {
    --cw: min(100vw, 100vh * .64);
    --cw: min(100vw, 100svh * .64);
  }
  #cover .stage { --u: calc(var(--cw) / 1080); width: var(--cw); }
  /* larger title on the photo now the logo has moved out */
  #cover .txt .eyebrow { font-size: calc(var(--u) * 40); }
  #cover .display { font-size: calc(var(--u) * 104); margin-top: calc(var(--u) * 30); }
  /* not enough room above the photo (main.js adds .logo-in): put the logo on the photo instead */
  .m-logo-in {
    display: none; position: absolute; z-index: 4;
    right: 12%; top: 6%; width: 21%; height: auto;     /* inside the film border, top right */
    filter: brightness(0) invert(1);
  }
  #cover.logo-in .m-logo-in { display: block; }
  #cover.logo-in .m-logo { visibility: hidden; }

  .m-logo {
    grid-row: 1; z-index: 3;
    height: min(calc((100svh - var(--cw) / .64) / 2 * .72), 96px); width: auto;   /* 72% of the gap, max 96px */
    filter: brightness(0) invert(1);                   /* flat white version of the logo */
  }
  #cover .art { aspect-ratio: .64; }
  #cover { position: relative; }
  .m-cue {
    grid-row: 3; z-index: 3;
    display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #e9e7e3;
    font-size: 12px; letter-spacing: .3em; text-transform: uppercase; text-decoration: none;
  }
  .m-cue i {                                     /* stem + chevron, gentle bounce */
    position: relative; display: block; width: 2px; height: 18px; background: currentColor;
    animation: cue 1.6s ease-in-out infinite;
  }
  .m-cue i::after {
    content: ''; position: absolute; left: 50%; bottom: 0; width: 7px; height: 7px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    translate: -50% 0; rotate: 45deg;
  }
}

/* ---------- reduced motion: no transforms, just the layout ---------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue i { animation: none; }
}
