  html { scroll-behavior: smooth; }
  body { font-family: 'Plus Jakarta Sans', sans-serif; }

  /* ---------- Player state icons (driven by body classes) ---------- */
  .ico-pause, .ico-load { display: none; }
  body.is-playing .ico-play { display: none; }
  body.is-playing .ico-pause { display: block; }
  body.is-loading .ico-play, body.is-loading .ico-pause { display: none; }
  body.is-loading .ico-load { display: block; }
  .ico-load { animation: spin 0.9s linear infinite; }

  /* ---------- Floating abstracts ---------- */
  @keyframes floaty {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50%      { transform: translateY(-24px) rotate(calc(var(--r, 0deg) + 10deg)); }
  }
  .floaty { animation: floaty var(--d, 6s) ease-in-out infinite; animation-delay: var(--delay, 0s); }
  body.is-playing .floaty { animation-duration: calc(var(--d, 6s) / 2); }

  @keyframes spin { to { transform: rotate(360deg); } }
  .vinyl { animation: spin 22s linear infinite; }
  body.is-playing .vinyl { animation-duration: 3s; }

  .tonearm { transform-origin: 85% 12%; transform: rotate(-28deg); transition: transform .8s cubic-bezier(.5,1.6,.4,1); }
  body.is-playing .tonearm, body.is-loading .tonearm { transform: rotate(0deg); }

  /* Ripple rings around the hero play button */
  .ring { position: absolute; inset: 0; border-radius: 9999px; border: 2px solid rgba(255,255,255,.55); opacity: 0; }
  @keyframes ripple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
  body.is-playing .ring { animation: ripple 2.4s ease-out infinite; }
  body.is-playing .ring:nth-child(2) { animation-delay: .8s; }
  body.is-playing .ring:nth-child(3) { animation-delay: 1.6s; }

  /* Idle "tap me" breathing on the play button */
  @keyframes breathe { 0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,.55), 0 20px 50px -10px rgba(0,0,0,.6); } 50% { box-shadow: 0 0 0 18px rgba(255,255,255,0), 0 20px 50px -10px rgba(0,0,0,.6); } }
  .breathe { animation: breathe 2.2s ease-in-out infinite; }
  body.is-playing .breathe { animation: none; box-shadow: 0 20px 50px -10px rgba(0,0,0,.6); }

  /* ---------- Equalizer bars ---------- */
  .eq { display: flex; align-items: flex-end; gap: var(--g, 3px); height: var(--h, 22px); }
  .eq span { width: var(--w, 4px); height: 20%; background: currentColor; border-radius: 99px; transition: height .4s; }
  @keyframes eq { 0%,100% { height: 18%; } 50% { height: 100%; } }
  body.is-playing .eq span { animation: eq .9s ease-in-out infinite; }
  body.is-playing .eq span:nth-child(2) { animation-duration: .7s;  animation-delay: -.3s; }
  body.is-playing .eq span:nth-child(3) { animation-duration: 1.1s; animation-delay: -.5s; }
  body.is-playing .eq span:nth-child(4) { animation-duration: .8s;  animation-delay: -.1s; }
  body.is-playing .eq span:nth-child(5) { animation-duration: 1s;   animation-delay: -.7s; }

  /* Big hero visualizer strip */
  .viz span { flex: 1; min-width: 3px; background: linear-gradient(to top, rgba(255,255,255,.9), rgba(255,255,255,.25)); border-radius: 99px 99px 0 0; height: var(--idle, 12%); transition: height .6s; }
  @keyframes vizbar { 0%,100% { height: 10%; } 50% { height: var(--peak, 80%); } }
  body.is-playing .viz span { animation: vizbar var(--dur, 1s) ease-in-out infinite; animation-delay: var(--delay, 0s); }

  /* Live dot */
  @keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
  .blink { animation: blink 1.2s ease-in-out infinite; }

  /* ---------- Marquees ---------- */
  .marquee { display: flex; width: max-content; animation: marquee var(--speed, 45s) linear infinite; }
  .marquee.reverse { animation-direction: reverse; }
  .marquee-wrap:hover .marquee, .marquee-wrap:focus-within .marquee { animation-play-state: paused; }
  @keyframes marquee { to { transform: translateX(-50%); } }
  .fade-x { mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); }

  /* ---------- Magazine covers (placeholder art — swap for <img> when real covers are ready) ---------- */
  .cover { position: relative; aspect-ratio: 3 / 4; width: clamp(170px, 20vw, 235px); border-radius: 14px; overflow: hidden; color: #fff; padding: 14px; display: flex; flex-direction: column; background: linear-gradient(160deg, var(--a), var(--b)); box-shadow: 0 25px 45px -18px rgba(0,0,0,.55); transition: transform .4s cubic-bezier(.2,.9,.3,1.3), box-shadow .4s; }
  .cover::before { content: ''; position: absolute; width: 75%; aspect-ratio: 1; border-radius: 9999px; right: -22%; top: 32%; background: var(--c); opacity: .85; }
  .cover::after  { content: ''; position: absolute; width: 45%; aspect-ratio: 1; left: -12%; bottom: 8%; border: 10px solid rgba(255,255,255,.18); border-radius: 9999px; }
  .cover > * { position: relative; z-index: 1; }
  .cover > .cover-img, .cover > .cover-shade { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
  .cover > .cover-img { object-fit: cover; transition: transform .6s ease; }
  .cover > .cover-shade { background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, transparent 32%, transparent 50%, rgba(214,18,41,.35) 72%, rgba(0,0,0,.85) 100%); }
  .cover.has-img { color: #fff !important; }
  .cover.has-img::before, .cover.has-img::after { display: none; }
  .cover.has-img .masthead { text-shadow: 0 2px 14px rgba(0,0,0,.45); }
  .cover-link:hover .cover-img { transform: scale(1.07); }
  .cover-link:hover .cover, .cover-link:focus-visible .cover { transform: translateY(-10px) rotate(-2deg) scale(1.03); box-shadow: 0 35px 55px -18px rgba(214,18,41,.6); }

  /* Podcast tiles */
  .pod { transition: transform .35s cubic-bezier(.2,.9,.3,1.3); }
  .pod-link:hover .pod, .pod-link:focus-visible .pod { transform: translateY(-8px) rotate(1.5deg); }
  .pod-link .pod-play { transform: scale(.6); opacity: 0; transition: all .3s; }
  .pod-link:hover .pod-play, .pod-link:focus-visible .pod-play { transform: scale(1); opacity: 1; }

  /* Feature cards */
  .feature { transition: transform .35s cubic-bezier(.2,.9,.3,1.3); }
  .feature:hover { transform: translateY(-8px) rotate(-1deg); }

  /* Mini player */
  #miniPlayer { transform: translateY(140%); transition: transform .5s cubic-bezier(.2,.9,.3,1.2); }
  #miniPlayer.show { transform: translateY(0); }

  /* Scroll reveal */
  .reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.9,.3,1); }
  .reveal.in { opacity: 1; transform: none; }

  /* Range slider */
  input[type=range].vol { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 99px; background: rgba(255,255,255,.3); outline: none; }
  input[type=range].vol::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 99px; background: #fff; cursor: pointer; }
  input[type=range].vol::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 99px; background: #fff; cursor: pointer; }

  .grain { background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; }

  /* ---------- Auth modals ---------- */
  .auth-in { display: none !important; }
  body.is-authed .auth-in { display: flex !important; }
  body.is-authed .auth-out { display: none !important; }
  body.is-authed .lock-chip { display: none !important; }
  body.modal-open { overflow: hidden; }

  .modal { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-end; justify-content: center; }
  .modal.open { display: flex; }
  @media (min-width: 640px) { .modal { align-items: center; padding: 24px; } }
  .modal-backdrop { position: absolute; inset: 0; background: rgba(11,11,12,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .3s ease; }
  .modal-panel { position: relative; animation: popIn .45s cubic-bezier(.2,.9,.3,1.2); }
  @keyframes popIn { from { opacity: 0; transform: translateY(40px) scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes fadeIn { from { opacity: 0; } }

  .lbl { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #525252; margin-bottom: 6px; }
  .field { width: 100%; border: 2px solid #e7e5e4; border-radius: 14px; padding: 11px 14px; font-weight: 500; font-size: 15px; background: #fff; color: #0b0b0c; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
  .field::placeholder { color: #a3a3a3; }
  .field:focus { border-color: #d61229; box-shadow: 0 0 0 4px rgba(214,18,41,.12); }
  .field.invalid { border-color: #d61229; background: #fff4f4; }
  .field[readonly] { background: #f5f5f4; color: #525252; }
  select.field { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d61229' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
  .err { display: none; font-size: 12px; font-weight: 600; color: #d61229; margin-top: 5px; }
  .err.show { display: block; }
  .otp { letter-spacing: .6em; text-align: center; font-family: 'Space Mono', monospace; font-size: 26px; font-weight: 700; padding-left: calc(14px + .6em); }
  .btn-busy { pointer-events: none; opacity: .75; }
  @keyframes pop { 0% { transform: scale(0) rotate(-20deg); } 70% { transform: scale(1.15) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
  .pop { animation: pop .6s cubic-bezier(.2,.9,.3,1.4) both; }
  @keyframes confetti { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--rot)); opacity: 0; } }
  .confetti { position: absolute; left: 50%; top: 40%; width: 8px; height: 14px; border-radius: 2px; animation: confetti 1.2s ease-out forwards; pointer-events: none; }

  /* ---------- Listing pages ---------- */
  .cover.cover-fluid { width: 100%; }
  .chip { border: 2px solid var(--chip-b, #e7e5e4); color: var(--chip-t, #0b0b0c); padding: 8px 16px; border-radius: 9999px; font-weight: 700; font-size: 14px; white-space: nowrap; transition: all .2s; }
  .chip:hover { border-color: #d61229; }
  .chip.chip-on { background: #d61229; border-color: #d61229; color: #fff; }
  .li-anim { animation: listIn .5s cubic-bezier(.2,.9,.3,1) both; }
  @keyframes listIn { from { opacity: 0; transform: translateY(16px); } }

  /* ---------- Player modes: live radio vs podcast episode ---------- */
  body:not(.mode-ep) .ep-only { display: none !important; }
  body.mode-ep .live-only { display: none !important; }
  input[type=range].seek { -webkit-appearance: none; appearance: none; height: 14px; background: transparent; cursor: pointer; }
  input[type=range].seek::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(to right, #d61229 var(--pct, 0%), rgba(255,255,255,.2) var(--pct, 0%)); }
  input[type=range].seek::-moz-range-track { height: 4px; border-radius: 99px; background: linear-gradient(to right, #d61229 var(--pct, 0%), rgba(255,255,255,.2) var(--pct, 0%)); }
  input[type=range].seek::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 99px; background: #fff; }
  input[type=range].seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 99px; background: #fff; }

  /* Episode rows (podcast page) */
  .ep-row .r-pause, .ep-row .r-load { display: none; }
  .ep-row[data-state=playing] .r-play, .ep-row[data-state=loading] .r-play { display: none; }
  .ep-row[data-state=playing] .r-pause { display: block; }
  .ep-row[data-state=loading] .r-load { display: block; animation: spin .9s linear infinite; }
  .ep-row[data-state=playing], .ep-row[data-state=loading], .ep-row[data-state=paused] { border-color: #d61229; background: rgba(214,18,41,.08); }
  .ep-row .r-eq { display: none; }
  .ep-row[data-state=playing] .r-eq { display: flex; }
  .ep-row[data-state=playing] .r-eq span { animation: eq .9s ease-in-out infinite; }
  .ep-row[data-state=playing] .r-eq span:nth-child(2) { animation-duration: .7s; animation-delay: -.3s; }
  .ep-row[data-state=playing] .r-eq span:nth-child(3) { animation-duration: 1.1s; animation-delay: -.5s; }
  .ep-progress { height: 3px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
  .ep-progress > span { display: block; height: 100%; background: #d61229; width: 0; }

  /* Magazine reader: all-pages grid */
  .thumb { transition: transform .2s, outline-color .2s; outline: 3px solid transparent; outline-offset: 2px; }
  .thumb.on { outline-color: #d61229; }
  .thumb:hover { transform: translateY(-3px); }

  /* Hero play buttons follow the LIVE stream only (an episode may be playing in the floating player) */
  body [data-play-toggle] .ico-play { display: block !important; }
  body [data-play-toggle] .ico-pause, body [data-play-toggle] .ico-load { display: none !important; }
  body.live-playing [data-play-toggle] .ico-play, body.live-loading [data-play-toggle] .ico-play { display: none !important; }
  body.live-playing [data-play-toggle] .ico-pause { display: block !important; }
  body.live-loading [data-play-toggle] .ico-load { display: block !important; }
  main:focus { outline: none; }

  /* Magazine covers are image-only; the placeholder text shows only when there is no image */
  .cover.has-img .cover-fallback { display: none; }

  /* ---------- Flip-book magazine reader ---------- */
  .book-viewport { overflow: hidden; touch-action: pan-y; cursor: pointer; }
  .book-viewport.zoomed { touch-action: none; cursor: grab; }
  .book-viewport.zoomed.panning { cursor: grabbing; }
  .book { position: relative; display: flex; transform-origin: center center; perspective: 2600px; }
  .book.smooth { transition: transform .22s ease; }
  .book-page { position: relative; height: 100%; flex: none; background: #f5f2ee; overflow: hidden; box-shadow: 0 30px 60px -25px rgba(0,0,0,.9); }
  .book-page img, .leaf-face img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
  .book-page.blank { background: transparent; box-shadow: none; }
  .book-page.blank img { visibility: hidden; }
  .book.single .book-left { display: none; }
  .book.single .book-right { border-radius: 6px; }
  .book.two .book-left  { border-radius: 6px 0 0 6px; }
  .book.two .book-right { border-radius: 0 6px 6px 0; }
  /* soft shadow along the spine */
  .book.two .book-page:not(.blank)::after { content: ''; position: absolute; top: 0; bottom: 0; width: 9%; pointer-events: none; }
  .book.two .book-left:not(.blank)::after  { right: 0; background: linear-gradient(to left, rgba(0,0,0,.22), transparent); }
  .book.two .book-right:not(.blank)::after { left: 0;  background: linear-gradient(to right, rgba(0,0,0,.22), transparent); }
  /* page that failed to load */
  .book-page.err { background: #1d1d20; }
  .book-page.err img { visibility: hidden; }
  .book-page.err::before { content: ''; position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; opacity: .35;
    background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.6'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E"); }
  /* the turning page */
  .leaf { position: absolute; top: 0; height: 100%; z-index: 5; transform-style: preserve-3d; pointer-events: none; }
  .leaf-face { position: absolute; inset: 0; overflow: hidden; background: #f5f2ee; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 10px 40px -10px rgba(0,0,0,.7); }
  .leaf-face.blank { background: transparent; box-shadow: none; }
  .leaf-back { transform: rotateY(180deg); }
  .leaf-shade { position: absolute; inset: 0; opacity: 0; pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.05) 40%, rgba(255,255,255,.18) 60%, rgba(0,0,0,.3) 100%); }
  #reader:fullscreen { background: #0b0b0c; padding: 20px; overflow: auto; }

  /* Home: magazine section fills the screen height — bigger covers sized to the viewport */
  .mag-full { min-height: 100vh; min-height: 100svh; }
  .mag-full .cover { width: clamp(180px, min(30vw, calc((100svh - 340px) * .75)), 420px); }
  @media (max-width: 639px) { .mag-full .cover { width: clamp(170px, min(62vw, calc((100svh - 340px) * .75)), 320px); } }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .reveal { opacity: 1; transform: none; }
  }
