/* The front of the homepage (founder, 17 Nov 2026): the newest Music diary entries and stories, one to a screen, and
   a glass bar at the foot of the screen to move between them. scripts/front.py writes the markup from the published
   entries, so a new entry from HQ becomes the first thing a reader sees. front.js runs the bar; without it the track
   still swipes and the bar's links still go to each one.
   The ground behind each one is its own artwork, blurred and held still (grounds come from the photographs). With two
   or more, the front turns to the next one every seven seconds while nobody is touching it (founder, 17 Nov 2026),
   with a pause button in the bar and a line under the current name filling toward the turn. Readers who have asked
   for less motion are never moved and see no line. The glass bar is the founder's own request; it is the one place
   on the site that uses it. */

.front { --top: 77px; --bar-room: 112px; position: relative; background: var(--hold); color: var(--paper); }
.front :focus-visible { outline-color: var(--paper); }
.front:not(:has(.front-bar)) { --bar-room: clamp(32px, 4vw, 64px); } /* one piece: no bar, so no room kept for it */
.front-track { display: flex; height: max(600px, calc(100svh - var(--top))); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.front-track::-webkit-scrollbar { display: none; }
.front-track:focus-visible { outline: 2px solid var(--paper); outline-offset: -6px; }

.front-slide { position: relative; isolation: isolate; flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto minmax(0, 1fr); column-gap: var(--g);
  padding: 0 max(var(--m), env(safe-area-inset-right)) var(--bar-room) max(var(--m), env(safe-area-inset-left)); }

/* The artwork, blurred and darkened into the field the words sit on. Still: it never drifts or zooms. */
.front-ground { position: absolute; inset: -8%; z-index: -2; }
.front-ground img { filter: blur(56px) saturate(1.35) brightness(0.52); }
.front-slide::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgb(10 10 10 / 0.22); pointer-events: none; }

.front-folio { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; padding: 14px 0 13px; border-bottom: var(--rule-lit); font: 700 0.75rem/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
/* The section name and the entry number are links (founder, 17 Nov 2026); the tap area is the folio's full height. */
.front-folio a { display: inline-block; padding-block: 14px; margin-block: -14px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
@media (hover: hover) and (pointer: fine) { .front-folio a:hover { text-decoration-thickness: 2px; } }

/* The artwork itself, whole, at 4:5, as tall as the screen allows. */
.front-art { grid-column: 8 / span 5; grid-row: 2; align-self: center; justify-self: end; display: block; width: min(100%, (max(600px, 100svh - var(--top)) - var(--bar-room) - 80px) * 0.8); aspect-ratio: 4 / 5; overflow: hidden; background: var(--hold); }
.front-type { display: flex; flex-direction: column; justify-content: space-between; padding: 7%; font: 700 0.75rem/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.front-type b { font: 400 clamp(6rem, 14vw, 14rem)/0.8 var(--cond); letter-spacing: 0; }

/* The words: the song (or the story's title) as large as its column allows, then who made it, then his headline.
   --n is the longer line's length in characters (front.py), so a short title runs big and a long one still fits in
   two lines. Bebas capitals average under 0.44em wide. */
.front-words { grid-column: 1 / span 7; grid-row: 2; align-self: end; container-type: inline-size; padding-bottom: 4px; }
.front-big { font: 400 min(calc(100cqi / (var(--n) * 0.44)), 26svh, 15rem)/0.84 var(--cond); text-transform: uppercase; text-wrap: balance; margin: 0 0 0.06em -0.02em; overflow-wrap: anywhere; }
.front-by { margin-top: 14px; font: 700 0.75rem/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.86; }
.front-line { margin-top: clamp(18px, 2vw, 28px); max-width: 19em; font: 400 clamp(1.5rem, 2.3vw, 2.25rem)/1.14 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.front-go { display: flex; flex-wrap: wrap; align-items: center; column-gap: 26px; row-gap: 4px; margin-top: clamp(22px, 2.6vw, 36px); }
.front-read, .front-listen { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; font: 700 0.75rem/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.front-read { padding: 0 24px; background: var(--paper); color: var(--ink); }
.front-listen { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; }
@media (hover: hover) and (pointer: fine) {
  .front-big a:hover { text-decoration: underline; text-decoration-thickness: 0.04em; text-underline-offset: 0.08em; }
  .front-read:hover { background: rgb(251 252 254 / 0.84); }
  .front-listen:hover { text-decoration-thickness: 2px; }
}
.front-read:active, .front-step:active, .front-thumbs a:active { scale: 0.97; }

/* ───── The glass bar ───── */
.front-bar { position: absolute; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 3; translate: -50% 0; display: flex; align-items: center; gap: 2px; max-width: calc(100% - 2 * var(--m)); padding: 6px;
  border-radius: 999px; background: rgb(251 252 254 / 0.14); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8); /* taste-skill-ignore: the founder asked for a glass bar */
  box-shadow: inset 0 0 0 1px rgb(251 252 254 / 0.24), inset 0 1px 0 rgb(251 252 254 / 0.34); } /* taste-skill-ignore: the glass bar is the founder's request (17 Nov 2026); the inset light is its edge */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .front-bar { background: rgb(23 24 26 / 0.86); } } /* taste-skill-ignore: the solid bar for browsers without glass */
.front-thumbs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; list-style: none; }
.front-thumbs::-webkit-scrollbar { display: none; }
.front-thumbs a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px; border-radius: 999px; }
.front-thumb { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--hold); color: var(--paper); }
.front-thumb b { font: 400 0.9375rem/1 var(--cond); }
.front-name { display: none; padding-right: 12px; max-width: 13em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 0.75rem/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; }
.front-thumbs a[aria-current] { background: var(--paper); color: var(--ink); }
.front-thumbs a[aria-current] .front-name { display: block; }
.front-step { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; }
.front-step svg { width: 20px; height: 20px; stroke-width: 1.8; }
.front-step:disabled { opacity: 0.32; cursor: default; }
.front-play .front-resume { display: none; }
.front-play[aria-pressed="true"] .front-pause { display: none; }
.front-play[aria-pressed="true"] .front-resume { display: block; fill: currentColor; stroke: none; }
@media (hover: hover) and (pointer: fine) {
  .front-thumbs a:not([aria-current]):hover, .front-step:not(:disabled):hover { background: rgb(251 252 254 / 0.14); }
}

/* ───── Phones: the artwork fills the screen and the words sit at its foot ───── */
@media (max-width: 820px) {
  .front { --top: 97px; --bar-room: 92px; }
  .front-track { height: max(540px, calc(100svh - var(--top))); }
  .front-slide { display: flex; flex-direction: column; }
  .front-ground { display: none; }
  .front-art { position: absolute; inset: 0; z-index: -2; width: auto; aspect-ratio: auto; align-self: stretch; justify-self: stretch; }
  .front-slide::after { background: linear-gradient(to top, rgb(10 10 10 / 0.9), rgb(10 10 10 / 0.72) 34%, rgb(10 10 10 / 0.08) 66%, rgb(10 10 10 / 0.3)); } /* taste-skill-ignore: a neutral scrim so the words read on any artwork */
  .front-folio { padding: 12px 0 11px; font-size: 0.6875rem; letter-spacing: 0.1em; }
  .front-type { padding: 120px var(--m) 0; }
  .front-type span { display: none; }
  .front-type b { display: none; }
  .front-words { margin-top: auto; align-self: stretch; }
  .front-big { font-size: min(calc(100cqi / (var(--n) * 0.44)), 17svh); }
  .front-by { margin-top: 10px; font-size: 0.6875rem; letter-spacing: 0.1em; }
  .front-line { margin-top: 12px; font-size: 1.4375rem; line-height: 1.16; }
  .front-go { margin-top: 18px; column-gap: 20px; }
  .front-read { padding: 0 20px; }
  .front-bar { left: var(--m); right: var(--m); translate: none; bottom: max(16px, env(safe-area-inset-bottom)); justify-content: space-between; max-width: none; }
  .front-thumbs a { padding: 4px; gap: 8px; }
  .front-thumb { width: 36px; height: 36px; }
  .front-name { max-width: 9.5em; padding-right: 10px; font-size: 0.6875rem; }
}

/* The line under the current name fills over the seven seconds before the turn (front.js sets data-playing). */
@media (prefers-reduced-motion: no-preference) {
  .front-bar[data-playing] .front-thumbs a[aria-current]::after { content: ""; position: absolute; left: 54px; right: 16px; bottom: 9px; height: 2px; background: var(--ink); opacity: 0.55; transform-origin: 0 50%; animation: front-fill var(--every, 7s) linear both; }
  @keyframes front-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 820px) {
  .front-bar[data-playing] .front-thumbs a[aria-current]::after { left: 48px; right: 14px; bottom: 8px; }
}
@media print { .front-bar, .front-ground { display: none; } .front { background: none; color: var(--ink); } }
