/* ==========================================================================
   Home — Now Playing #now-playing (§4.3, 24:04, H2: the octave).
   The room behind the featured string: warm noon parchment mixed with the
   cover's own tone, one vermilion node line at the half, the cover hung with
   its right edge on that node, and the head and copy in the right half.
   Signature: A DROP AND ONE RING (now-playing.js adds .is-struck/.is-ringing).
   ========================================================================== */

html[data-page="home"] .now {
  --cover: min(44vw, 640px, calc(100svh - var(--bar-h) - 120px));
  --np-node: var(--vermilion);
  --ring-end: 120vw;
  /* The ring spreads to --ring-end and stays inside the room, except for half a
     band below it: the node line runs on through Label's boundary band until it
     meets the string there (the room paints above Label for that). */
  z-index: 1;
  overflow: clip;
  overflow-clip-margin: 60px; /* ½ --band (120px); Chrome takes no calc() here */
  padding-bottom: calc(var(--section) * 1.05);
}

@media (max-width: 900px) {
  html[data-page="home"] .now {
    overflow-clip-margin: 36px; /* ½ --band (72px) */
  }
}

/* One vermilion node line at ½, hanging from the ribbon down to the next string. */
html[data-page="home"] .now .nodes {
  inset: 0 0 calc(var(--band) / -2);
  background-image: linear-gradient(var(--np-node), var(--np-node));
  background-size: 1px 100%;
  background-position: 50% 0;
  background-repeat: no-repeat;
  clip-path: none;
  opacity: 1;
}

html[data-page="home"] .now .nodes__cap {
  top: calc(var(--band) + 10px);
  left: calc(50% + 12px);
  color: var(--fg-3);
}

/* --- Grid: the cover spans the left half; head and copy share columns 8–12 --- */
html[data-page="home"] .now .wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: var(--col-gap);
}

/* The slot and the article only group markup; their children sit on the grid. */
html[data-page="home"] .now :is(.now__slot, .np) {
  display: contents;
}

html[data-page="home"] .now .section-head {
  grid-column: 8 / -1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  margin-bottom: clamp(36px, 4vw, 64px);
}

html[data-page="home"] .now .section-head__rule {
  margin-bottom: 4px;
}

html[data-page="home"] .now .section-head__index {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}

html[data-page="home"] .now .section-head__title {
  margin: 6px 0 0;
}

html[data-page="home"] .now .section-head__aside {
  max-width: 24em;
  margin: 0;
  font-size: var(--t-body);
  line-height: 1.7;
}

html[data-page="home"]:is([lang="zh-Hans"], [lang="ja-JP"]) .now .section-head__aside {
  line-height: 1.85;
}

/* --- The cover ----------------------------------------------------------------------- */
html[data-page="home"] .now .np__visual {
  grid-column: 1 / 7;
  grid-row: 1 / span 2;
  justify-self: end;
  align-self: start;
  position: sticky;
  top: max(calc(var(--bar-h) + 20px), calc(50svh - var(--cover) / 2));
  z-index: 0;
  display: flex;
  flex-direction: column;
  width: var(--cover);
  /* right edge exactly on the node (the centre of the wrap) */
  margin-right: calc(var(--col-gap) / -2);
  color: inherit;
  text-decoration: none;
}

html[data-page="home"] .now .np__frame {
  position: relative;
  z-index: 1;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 2px;
  background: rgb(var(--art) / 0.16);
  box-shadow:
    0 1px 0 rgb(var(--ink-rgb) / 0.08),
    0 48px 90px -46px rgb(var(--ink-rgb) / 0.55),
    0 30px 120px -30px rgb(var(--art) / 0.75);
  transform: scale(1.02);
  transform-origin: 50% 60%;
  transition: transform 1400ms var(--ease-settle);
}

html[data-page="home"] .now .np.is-struck .np__frame {
  transform: none;
}

/* Reduced motion only: a veil of the room's ground that now-playing.js fades. */
html[data-page="home"] .now .np__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
}

html[data-page="home"] .now .np__frame.is-veiled::after {
  opacity: 1;
}

html[data-page="home"] .now .np__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The sill: the cover rests on a ruled ledge with its timecode and date. */
html[data-page="home"] .now .np__tc {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgb(var(--ink-rgb) / 0.3);
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}

html[data-page="home"] .now .np__tc b {
  font-weight: 500;
  color: var(--signal-ink);
}

/* One ring: drawn around the cover's centre, behind the cover and the text. */
html[data-page="home"] .now .np__ring {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1;
  pointer-events: none;
}

/* The strike probe: from just above the cover's centre down (now-playing.js
   watches it), so a cover held at the centre by sticky still counts. */
html[data-page="home"] .now .np__ring > i {
  position: absolute;
  left: 50%;
  top: calc(50% - 32px);
  width: 1px;
  height: calc(50% + 32px);
  visibility: hidden;
}

html[data-page="home"] .now .np__ring::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border: 1.5px solid var(--vermilion);
  border-radius: 50%;
  translate: -50% -50%;
  opacity: 0;
}

/* Size and fade run on separate curves: the ring travels on --ease-settle but
   stays bright through its first half, so the sweep behind the text is seen. */
html[data-page="home"] .now .np.is-ringing .np__ring::before {
  animation:
    np-ring 1400ms var(--ease-settle) both,
    np-ring-fade 1400ms linear both;
}

@keyframes np-ring {
  from {
    width: 0;
    height: 0;
  }
  to {
    width: var(--ring-end);
    height: var(--ring-end);
  }
}

@keyframes np-ring-fade {
  0% {
    opacity: 0.9;
  }
  45% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}

/* The horizontal node (narrow layouts only). */
html[data-page="home"] .now .np__node {
  display: none;
}

/* --- The copy ------------------------------------------------------------------------- */
html[data-page="home"] .now .np__copy {
  grid-column: 8 / -1;
  grid-row: 2;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  min-width: 0;
}

html[data-page="home"] .now .np__kicker {
  color: var(--fg);
}

html[data-page="home"] .now .np__kicker::before {
  background: var(--vermilion);
  opacity: 1;
}

html[data-page="home"] .now .np__title {
  margin: -4px 0 0;
  max-width: 100%;
  font-family: "Noto Serif SC", "Songti SC", "STSong", "Newsreader", serif;
  font-size: clamp(2.25rem, 4.4vw, 4.75rem);
  font-weight: 500;
  font-stretch: normal;
  font-variation-settings: normal;
  line-height: 1.16;
  letter-spacing: 0.01em;
  color: var(--fg);
  overflow-wrap: anywhere;
}

html[data-page="home"] .now .np__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.5;
  color: var(--fg-2);
}

html[data-page="home"] .now .np__meta span:not(:last-child)::after {
  content: "/";
  content: "/" / "";
  margin: 0 0.85em;
  color: var(--fg-4);
}

/* A waveform glyph of the release on its own string (decorative, not audio). */
html[data-page="home"] .now .np__glyph {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  max-width: 30rem;
  height: 44px;
  background: linear-gradient(rgb(var(--ink-rgb) / 0.3), rgb(var(--ink-rgb) / 0.3)) 0 50% / 100% 1px no-repeat;
}

html[data-page="home"] .now .np__glyph i {
  flex: 1;
  height: calc(var(--h) * 100%);
  min-height: 2px;
  border-radius: 1px;
  background: rgb(var(--ink-rgb) / 0.62);
  transform: scaleY(0.04);
  transition: transform 900ms var(--ease-settle) calc(240ms + var(--gi) * 14ms);
}

html[data-page="home"] .now .np__glyph i:nth-child(7n + 3) {
  background: var(--vermilion);
}

html[data-page="home"] .now .np.is-struck .np__glyph.is-in i {
  transform: none;
}

html[data-page="home"] .now .np__text {
  max-width: 30em;
  margin: 0;
  font-family: var(--f-serif);
  font-size: clamp(1.0625rem, 1.25vw, 1.25rem);
  line-height: 1.85;
  white-space: pre-line;
  color: var(--fg);
}

html[data-page="home"][lang="en"] .now .np__text:not([lang]),
html[data-page="home"] .now .np__text[lang="en"] {
  line-height: 1.6;
}

html[data-page="home"] .now .np__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-2);
}

html[data-page="home"] .now .np__stats strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--f-latin);
  font-size: 1.75rem;
  font-weight: 800;
  font-stretch: 112%;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.01em;
  color: var(--fg);
}

html[data-page="home"] .now .np__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

/* Listen links: perforated ticket stubs (notched left edge, torn line). */
html[data-page="home"] .now .np__listen {
  display: grid;
  /* two stubs a row while each can hold a whole platform name, else one */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(9.5rem, calc(50% - 5px))), 1fr));
  gap: 10px;
  width: 100%;
  max-width: 34rem;
}

html[data-page="home"] .now .np__listen .listen {
  --stub: 22px;
  position: relative;
  min-width: 0;
  min-height: 44px;
  gap: 10px;
  padding: 0 14px 0 calc(var(--stub) + 10px);
  border: 0;
  border-radius: 0 6px 6px 0;
  background:
    linear-gradient(rgb(var(--ink-rgb) / 0.32) 50%, transparent 0) var(--stub) 0 / 1px 6px repeat-y,
    rgb(255 255 255 / 0.58);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  -webkit-mask:
    radial-gradient(circle at 0 50%, transparent 3.5px, #000 4px) 0 0 / 100% 11px repeat-y;
  mask:
    radial-gradient(circle at 0 50%, transparent 3.5px, #000 4px) 0 0 / 100% 11px repeat-y;
  transition: background-color var(--d-1), color var(--d-1);
}

html[data-page="home"] .now .np__listen .listen > span:not(.listen__arrow) {
  min-width: 0;
  padding-block: 6px;
  line-height: 1.25;
  overflow-wrap: break-word;
}

html[data-page="home"] .now .np__listen .listen:is(:hover, :focus-visible) {
  padding-left: calc(var(--stub) + 10px);
  background:
    linear-gradient(rgb(var(--ink-rgb) / 0.32) 50%, transparent 0) var(--stub) 0 / 1px 6px repeat-y,
    rgb(255 255 255 / 0.9);
}

html[data-page="home"] .now .np__listen .listen:focus-visible {
  -webkit-mask: none;
  mask: none;
}

html[data-page="home"] .now .np__listen .listen:hover .listen__arrow {
  color: var(--fg);
}

/* Apple's badge is the white edition, so its stub is printed in ink. */
html[data-page="home"] .now .np__listen .listen--apple {
  padding-block: 6px;
  background:
    linear-gradient(rgb(var(--bone-rgb) / 0.4) 50%, transparent 0) var(--stub) 0 / 1px 6px repeat-y,
    var(--ink);
}

html[data-page="home"] .now .np__listen .listen--apple:is(:hover, :focus-visible) {
  background:
    linear-gradient(rgb(var(--bone-rgb) / 0.55) 50%, transparent 0) var(--stub) 0 / 1px 6px repeat-y,
    #1f2a5c;
}

html[data-page="home"] .now .np__listen .listen--apple img {
  height: 30px;
  width: auto;
}

/* Douyin ships a black mark: it already reads on the light stub. */
html[data-page="home"] .now .np__listen .listen img[src*="tiktok"] {
  filter: none;
}

/* --- Narrow portrait: one column; the cover goes full-bleed and the node turns
       into a horizontal vermilion line between the cover and the copy. ----------- */
@media (max-width: 900px) and (orientation: portrait) {
  html[data-page="home"] .now {
    --cover: 100%;
    /* The cover is the full width here, so the ring has to spread well past it
       (and its corners, 141vw) to be seen; it settles about where the viewport
       ends, so it slows down while crossing the head above and the copy below. */
    --ring-end: clamp(180vw, 100svh, 240vw);
  }

  html[data-page="home"] .now .wrap {
    display: block;
  }

  html[data-page="home"] .now .nodes {
    background: none;
  }

  html[data-page="home"] .now .nodes__cap {
    display: none;
  }

  html[data-page="home"] .now .section-head {
    margin-bottom: 36px;
  }

  html[data-page="home"] .now .np__visual {
    position: relative;
    top: auto;
    width: auto;
    margin: 0 calc(var(--gutter) * -1);
  }

  /* Edge to edge, a drop shadow reads as a smudge under the sill: a hairline only. */
  html[data-page="home"] .now .np__frame {
    border-radius: 0;
    box-shadow: 0 1px 0 rgb(var(--ink-rgb) / 0.12);
  }

  html[data-page="home"] .now .np__tc {
    margin-top: 14px;
    padding: 0 var(--gutter);
    border-top: 0;
  }

  html[data-page="home"] .now .np__node {
    position: relative;
    display: block;
    height: 1px;
    margin: 18px calc(var(--gutter) * -1) 36px;
    background: var(--np-node);
  }

  html[data-page="home"] .now .np__node > span {
    position: absolute;
    top: 10px;
    left: calc(50% + 10px);
    font-family: var(--f-mono);
    font-size: 0.625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--fg-3);
  }

  html[data-page="home"] .now .np__node::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--np-node);
    translate: -50% 0;
  }

  html[data-page="home"] .now .np__title {
    font-size: clamp(2rem, 9vw, 3.25rem);
  }

  html[data-page="home"] .now .np__glyph {
    max-width: none;
  }
}

@media (max-width: 380px) {
  html[data-page="home"] .now .np__listen .listen {
    --stub: 18px;
    padding-right: 10px;
    font-size: 0.8125rem;
  }
}

/* --- Reduced motion and the low tier: no ring, no settle, bars at full height. --- */
@media (prefers-reduced-motion: reduce) {
  html[data-page="home"] .now .np__ring::before {
    display: none;
  }

  html[data-page="home"] .now :is(.np__frame, .np__glyph i) {
    transform: none;
    transition: none;
  }
}

html[data-page="home"][data-tier="low"] .now .np__ring::before {
  display: none;
}

html[data-page="home"][data-tier="low"] .now .np__frame {
  transform: none;
}

html[data-page="home"][data-tier="low"] .now .np__glyph i {
  transform: none;
  transition: none;
}
