/* Roman · Guided meditation (private page, not linked from the site)
   Same palette and type as assets/site.css, but self-contained on purpose:
   the main page can change without touching this one.

   Motion: every layer of the artwork only turns, breathes or fades (transform / opacity),
   so the browser moves finished pictures instead of repainting them. Slow on purpose. */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond.woff2') format('woff2');
  font-weight: 300 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope.woff2') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('/assets/fonts/dm-mono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --abyss: #04080a;
  --night: #071311;
  --deep: #0a1b18;
  --emerald-900: #0e3530;
  --aqua: #8fd9cc;
  --aqua-soft: #bfe9e1;
  --ivory: #f6f1e7;
  --sand: #d9c6a5;
  --gold: #c39a52;
  --text-light: #f3ede2;
  --muted-light: #aebbb5;
  --line-light: rgba(243, 237, 226, 0.12);

  --serif: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gutter: clamp(16px, 5vw, 48px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --glide: cubic-bezier(0.45, 0.05, 0.2, 1);

  /* Size of the artwork. Phones: as wide as the screen allows, title and text below. */
  --S: max(240px, min(100vw - 2 * var(--gutter), 100vh - 290px, 620px));
  --S: max(240px, min(100vw - 2 * var(--gutter), 100svh - 290px, 620px));
}
/* Landscape screens: text on the left, the artwork large on the right */
@media (min-aspect-ratio: 5/4) and (min-width: 700px) {
  :root {
    /* 244px = top and bottom space of the stage plus time line and controls under the artwork */
    --S: max(240px, min(100vh - 244px, 54vw, 860px));
    --S: max(240px, min(100svh - 244px, 54vw, 860px));
  }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }

html { background: var(--abyss); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7;
  color: var(--text-light); background: var(--abyss);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; border-radius: 4px; }
/* Older browsers (e.g. iOS 15) know no overflow: clip */
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }

/* ---- Night sky ---- */
.sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(90% 70% at 50% 42%, rgba(18, 64, 58, 0.34) 0%, rgba(7, 19, 17, 0) 70%),
    linear-gradient(180deg, var(--abyss) 0%, var(--night) 48%, var(--abyss) 100%);
}
.sky__stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.tw {
  position: absolute; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; border-radius: 50%;
  background: #f6f1e7; box-shadow: 0 0 7px 1px rgba(246, 241, 231, 0.42);
  opacity: 0.15; animation: twinkle var(--t, 7s) ease-in-out var(--b, 0s) infinite alternate;
}
.tw--aqua { background: var(--aqua-soft); box-shadow: 0 0 7px 1px rgba(143, 217, 204, 0.45); }
@keyframes twinkle { from { opacity: 0.1; } to { opacity: 0.85; } }

/* ---- Top line ---- */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--gutter);
  transition: opacity 1.4s var(--ease);
}
.brand { display: flex; align-items: center; padding-block: 0.6rem; text-decoration: none; min-width: 0; }
/* "Consciousness Alchemist" as on the start page; on phones on two lines, as there next to its button */
.brand__name { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; letter-spacing: 0.01em; line-height: 1.04; text-wrap: balance; }
@media (max-width: 480px) {
  .top { padding-block: 14px; }
  .brand { padding-block: 0.15rem; }
  .brand__name { max-width: 7.5em; }
}
@media (max-width: 359px) { .brand__name { font-size: 1.3rem; } }

/* ---- Stage: phones first (artwork on top, text below) ---- */
.stage {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  min-height: 100vh; min-height: 100svh;
  padding: 70px var(--gutter) 26px;
  /* the turning layers are squares: at 45° their corners would widen the page on phones */
  overflow-x: clip;
}
.player-home { order: -1; width: var(--S); flex: none; }
.player { position: relative; width: var(--S); transition: transform 2.4s var(--glide); }

.panel { width: 100%; max-width: 34rem; text-align: center; transition: opacity 1.4s var(--ease) 0.3s, visibility 0s linear 0s; }
/* a column: the booking link sits under the text on every screen (centred on phones, left on wide screens) */
.panel__intro { display: flex; flex-direction: column; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--aqua-soft); }
.panel__title {
  margin-top: 0.9rem;
  font-family: var(--serif); font-weight: 300; font-size: clamp(2rem, 2.6vw + 1.1rem, 3.6rem);
  line-height: 1.06; letter-spacing: -0.01em; text-wrap: balance;
}
.panel__title:focus { outline: none; }
.panel__lead { margin-top: 1.1rem; font-size: clamp(1rem, 0.35vw + 0.92rem, 1.14rem); color: var(--muted-light); text-wrap: pretty; }
.hint {
  display: inline-flex; align-items: center; gap: 0.65rem; margin-top: 1.4rem;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-light);
}
.hint svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--aqua); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Small booking link: opens the booking pop-up of the start page (/#book) */
.assess {
  display: inline-flex; align-items: center; gap: 0.6em;
  min-height: 42px; margin-top: 1.5rem; padding: 0.55em 1.05em 0.55em 1.2em;
  border-radius: 999px; border: 1px solid rgba(243, 237, 226, 0.24);
  background: rgba(10, 27, 24, 0.55);
  font-family: var(--sans); font-size: 0.84rem; font-weight: 600; letter-spacing: 0.01em; line-height: 1.25;
  color: var(--text-light); text-decoration: none; text-align: left;
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.assess::after {
  content: ''; flex: none; width: 1em; height: 1em; background: var(--aqua-soft);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.35s var(--ease);
}
.assess:hover { border-color: rgba(143, 217, 204, 0.55); background: rgba(14, 53, 48, 0.75); transform: translateY(-1px); }
.assess:hover::after { transform: translateX(3px); }

.fine {
  position: relative; z-index: 1;
  padding: 0 var(--gutter) 22px; text-align: center;
  font-size: 0.76rem; line-height: 1.6; color: #8e9a95;
  transition: opacity 1.2s var(--ease) 0.3s, visibility 0s linear 0s;
}

@media (min-aspect-ratio: 5/4) and (min-width: 700px) {
  .stage {
    flex-direction: row; justify-content: space-between; gap: clamp(28px, 5vw, 96px);
    padding: 64px var(--gutter) 64px;
  }
  .player-home { order: 0; }
  .panel { flex: 1 1 0; max-width: 33rem; text-align: left; }
  .panel__intro { align-items: flex-start; }
  .fine { position: absolute; left: var(--gutter); right: calc(var(--S) + 2 * var(--gutter)); bottom: 0; padding: 0 0 18px; text-align: left; }
}
@media (max-height: 520px) and (min-aspect-ratio: 5/4) {
  .stage { padding-block: 52px 40px; }
  .panel__title { font-size: 1.9rem; }
  .panel__lead { font-size: 0.95rem; margin-top: 0.7rem; }
  .hint { margin-top: 0.8rem; }
}

/* ---- The artwork ---- */
/* decoration only: its turning layers reach past the square and must not catch taps meant for the controls */
.art { position: relative; width: var(--S); height: var(--S); pointer-events: none; }
.art > * { position: absolute; }
.art__defs { width: 0; height: 0; overflow: hidden; }
.lay, .lotus { inset: 0; width: 100%; height: 100%; }
.lay { display: block; overflow: visible; }

/* --k = SVG units per screen pixel (set by meditation.js), so lines stay hair-fine at any size */
.art .ln {
  fill: none; stroke: var(--gold);
  stroke-width: calc(var(--k, 1.6) * var(--w, 1.05));
  stroke-linecap: round; stroke-linejoin: round; stroke-opacity: var(--o, 0.92);
}
.art .ln.f { --o: 0.52; }
.art .ln.ff { --o: 0.28; }
.art .ln.b { --w: 1.4; --o: 1; }
.art .dt { fill: var(--gold); }
.art .dt.l { fill: #e8cc93; }
.art .pf { stroke: none; }
.art .pr { fill: none; stroke: #d8b878; stroke-width: calc(var(--k, 1.6) * 1.8); }

.aura { inset: -6%; }
.aura__react, .core__react { position: absolute; inset: 0; }
.aura i { position: absolute; border-radius: 50%; }
.aura__deep { inset: -8%; background: radial-gradient(closest-side, rgba(18, 64, 58, 0.5), rgba(14, 53, 48, 0.18) 55%, rgba(14, 53, 48, 0) 100%); }
.aura__a, .aura__b { inset: 12%; }
.aura__a { background: radial-gradient(closest-side, rgba(142, 167, 187, 0.3), rgba(157, 180, 198, 0.12) 50%, rgba(185, 202, 214, 0) 100%); }
.aura__b { background: radial-gradient(closest-side, rgba(127, 196, 184, 0.32), rgba(159, 211, 201, 0.12) 50%, rgba(191, 233, 225, 0) 100%); opacity: 0; }

.pulses { inset: 24%; }
.pulse { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; }
.core { inset: 34%; }
.core__glow { position: absolute; inset: 0; }
.core__svg { display: block; width: 100%; height: 100%; overflow: visible; }

.sparks, .orb, .rise { left: 50%; top: 50%; width: 0; height: 0; }
.orb, .rise { position: absolute; }
.orb i, .rise i {
  position: absolute; left: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle, #fffaf0 0 15%, rgba(242, 212, 143, 0.62) 30%, rgba(242, 212, 143, 0) 70%);
  opacity: 0;
}
.orb i { top: calc(var(--S) * var(--r) * -1 - 9px); }
.rise i { top: -9px; }

/* ---- Continuous movement: slow, independent, never in step ---- */
.lay--out { animation: turn 720s linear infinite; }
.lay--mid { animation: turn 480s linear infinite reverse; }
.lay--seed { animation: turn 300s linear infinite, shimmer 9s ease-in-out infinite alternate; }
.lotus { animation: sway 41s ease-in-out infinite alternate; }
.lay--lotus { animation: breathe 12s ease-in-out infinite; }
.aura__a { animation: breathe-wide 12s ease-in-out infinite; }
.aura__b { animation: breathe-wide 12s ease-in-out infinite, tint 23s ease-in-out infinite alternate; }
.aura__deep { animation: shimmer 17s ease-in-out infinite alternate; }
.core__glow { animation: pulse 6s ease-in-out infinite; }
.pulse { animation: ring 12s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
.pulse--2 { animation-delay: -6s; }
.orb { animation: turn var(--t, 60s) linear infinite; }
.orb--ccw { animation-direction: reverse; }
.orb i { animation: spark var(--f, 19s) ease-in-out var(--fb, 0s) infinite; }
.rise i { animation: rise 17s ease-in-out -5s infinite; }

@keyframes turn { to { transform: rotate(360deg); } }
@keyframes sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes breathe { 0%, 100% { transform: scale(0.985); } 50% { transform: scale(1.02); } }
@keyframes breathe-wide { 0%, 100% { transform: scale(0.94); } 50% { transform: scale(1.05); } }
@keyframes shimmer { from { opacity: 0.62; } to { opacity: 1; } }
@keyframes tint { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.84; } }
@keyframes ring { 0% { transform: scale(0.2); opacity: 0; } 14% { opacity: 0.42; } 100% { transform: scale(1); opacity: 0; } }
@keyframes spark { 0% { opacity: 0; } 18%, 50% { opacity: 1; } 68%, 100% { opacity: 0; } }
@keyframes rise {
  0% { transform: translate3d(0, calc(var(--S) * 0.47), 0); opacity: 0; }
  16%, 84% { opacity: 0.9; }
  100% { transform: translate3d(0, calc(var(--S) * -0.47), 0); opacity: 0; }
}

/* ---- Opening: the lines draw themselves from the light outwards (once) ---- */
.js .art .ln { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 3.4s var(--glide) var(--d, 0s); }
.js .art.is-drawn .ln { stroke-dashoffset: 0; }
.js .art :is(.dt, .pf, .fl) { opacity: 0; transition: opacity 2.2s var(--ease) calc(var(--d, 0s) + 0.5s); }
.js .art.is-drawn :is(.dt, .pf, .fl) { opacity: 1; }
.js .art :is(.aura, .pulses, .sparks) { opacity: 0; transition: opacity 3.2s var(--ease) 0.2s; }
.js .art .sparks { transition-delay: 3.4s; }
.js .art .core { opacity: 0; transform: scale(0.5); transition: opacity 2.4s var(--ease), transform 3s var(--ease); }
.js .art.is-drawn :is(.aura, .pulses, .sparks, .core) { opacity: 1; transform: none; }

/* ---- Play / pause: one large button in the light ---- */
.play {
  position: absolute; left: 50%; top: calc(var(--S) / 2); z-index: 4;
  display: grid; place-items: center;
  width: clamp(74px, calc(var(--S) * 0.16), 104px); aspect-ratio: 1; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--ivory); color: var(--abyss);
  box-shadow: 0 0 0 1px rgba(246, 241, 231, 0.4), 0 0 46px 8px rgba(243, 211, 143, 0.26), 0 22px 50px -18px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%);
  transition: opacity 1.2s var(--ease), background-color 0.4s var(--ease), transform 0.5s var(--ease);
}
.play:hover { background: #fffdf8; transform: translate(-50%, -50%) scale(1.04); }
.play:focus-visible { outline: 2px solid var(--aqua); outline-offset: 5px; }
/* A soft ring invites the first touch */
.play::before {
  content: ''; position: absolute; inset: -11px; border-radius: 50%;
  border: 1px solid rgba(246, 241, 231, 0.42); opacity: 0;
  animation: invite 3.8s var(--ease) 2.6s infinite;
}
.play__icon { grid-area: 1 / 1; width: 40%; height: 40%; fill: currentColor; }
.play__icon--again { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.play__icon--pause, .play__icon--again { display: none; }
.is-playing .play__icon--play { display: none; }
.is-playing .play__icon--pause { display: block; }
.is-ended .play__icon--play { display: none; }
.is-ended .play__icon--again { display: block; }
.is-started .play::before, .is-ended .play::before { animation: none; }
.is-waiting .play::before { opacity: 1; border-color: rgba(246, 241, 231, 0.2); border-top-color: var(--ivory); animation: wait 1.4s linear infinite; }
@keyframes invite { 0% { transform: scale(0.94); opacity: 0; } 30% { opacity: 0.9; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes wait { to { transform: rotate(360deg); } }

/* ---- Time line ---- */
.bar {
  display: flex; align-items: center; gap: 14px; margin-top: 16px;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted-light);
  transition: opacity 1.4s var(--ease);
}
.bar__time { min-width: 3.4em; font-variant-numeric: tabular-nums; }
.bar__time--total { text-align: right; }
.bar__seek {
  flex: 1; min-width: 0; height: 44px; margin: 0; padding: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.bar__seek::-webkit-slider-runnable-track {
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--sand) 0 var(--p, 0%), rgba(243, 237, 226, 0.18) var(--p, 0%) 100%);
}
.bar__seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -6px;
  border: 0; border-radius: 50%; background: var(--ivory); box-shadow: 0 0 0 5px rgba(246, 241, 231, 0.1);
}
.bar__seek::-moz-range-track { height: 2px; border-radius: 2px; background: rgba(243, 237, 226, 0.18); }
.bar__seek::-moz-range-progress { height: 2px; border-radius: 2px; background: var(--sand); }
.bar__seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ivory); }
.bar__seek:focus-visible { outline: none; }
.bar__seek:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--aqua); }
.bar__seek:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--aqua); }

/* ---- Controls under the time line: background music, full view ---- */
.ctrl {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px;
  /* on phones the row may use the gutters, so both buttons fit side by side */
  margin: 2px calc(-1 * var(--gutter)) 0;
  transition: opacity 1.4s var(--ease);
}
.chip {
  display: inline-flex; align-items: center; gap: 0.75em;
  min-height: 40px; padding: 0 1.05em; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(243, 237, 226, 0.16); background: rgba(4, 8, 10, 0.4);
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1;
  color: var(--muted-light);
  transition: border-color 0.35s var(--ease), color 0.35s var(--ease), background-color 0.35s var(--ease);
}
.chip:hover { border-color: rgba(143, 217, 204, 0.42); color: var(--text-light); }
.chip[hidden] { display: none; }
/* the music switch: a small track with a knob, aqua when the music is on */
.chip--music::before {
  content: ''; flex: none; width: 27px; height: 15px; border-radius: 999px;
  background: rgba(243, 237, 226, 0.14) radial-gradient(circle, var(--muted-light) 0 4.6px, transparent 5.2px) no-repeat 0 50% / 15px 15px;
  box-shadow: inset 0 0 0 1px rgba(243, 237, 226, 0.22);
  transition: background-color 0.35s var(--ease), background-position 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.chip--music[aria-checked="true"] { color: var(--text-light); border-color: rgba(143, 217, 204, 0.32); }
.chip--music[aria-checked="true"]::before {
  background-color: rgba(143, 217, 204, 0.5); background-position: 12px 50%;
  background-image: radial-gradient(circle, #fffaf0 0 4.6px, transparent 5.2px);
  box-shadow: inset 0 0 0 1px rgba(191, 233, 225, 0.6), 0 0 12px rgba(143, 217, 204, 0.35);
}
.chip--enter::before, .chip--exit::before {
  content: ''; flex: none; width: 13px; height: 13px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
/* four corners outwards: into the full view */
.chip--enter { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'/%3E%3C/svg%3E"); }
/* four corners inwards: back to the page */
.chip--exit { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5'/%3E%3C/svg%3E"); }
.chip--exit { color: var(--text-light); border-color: rgba(243, 237, 226, 0.3); }
@media (hover: hover) and (pointer: fine) {
  /* keyboards: Esc leaves the full view too */
  .chip--exit::after {
    content: 'Esc'; margin-left: 0.15em; padding: 3px 5px 2px; border-radius: 4px;
    border: 1px solid rgba(243, 237, 226, 0.25); font-size: 0.56rem; letter-spacing: 0.08em; text-transform: none; opacity: 0.75;
  }
}

.audio { display: block; width: 100%; margin-top: 18px; }
.player__msg { margin-top: 14px; text-align: center; font-size: 0.92rem; color: var(--muted-light); }

/* Without JavaScript the browser's own player is shown instead */
html:not(.js) .play, html:not(.js) .bar, html:not(.js) .ctrl { display: none; }
.js .audio { display: none; }
.is-missing .play, .is-missing .bar { display: none; }

/* ---- Full view while listening: the text steps back, the artwork moves to the centre ---- */
.is-focus .player { transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0); }
.is-focus .stage { height: 100vh; height: 100svh; overflow: hidden; overflow: clip; }
.is-focus .panel, .is-focus .fine { opacity: 0; visibility: hidden; transition: opacity 1s var(--ease), visibility 0s linear 1s; }
.is-focus .top { opacity: 0.3; }
.is-focus.is-idle .top { opacity: 0; }
.is-focus.is-playing.is-idle .play { opacity: 0; }
.is-focus.is-playing.is-idle .bar, .is-focus.is-playing.is-idle .ctrl { opacity: 0.38; }

/* ---- The end ---- */
.js .panel__end { display: none; }
.js.is-ended .panel__end { display: block; }
.js.is-ended .panel__intro { display: none; }
.panel__end { margin-top: 2.6rem; }
.js .panel__end { margin-top: 0; }
.panel__title--end { margin-top: 0; font-size: clamp(1.9rem, 2.2vw + 1rem, 3.1rem); }
.is-ended .panel__end { animation: arrive 1.6s var(--ease) both; }
@keyframes arrive { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

.bonus {
  display: grid; gap: 0.3rem; margin-top: 1.8rem; padding: 1.2rem 1.4rem;
  border-radius: 22px; border: 1px solid rgba(143, 217, 204, 0.22);
  background: linear-gradient(160deg, rgba(143, 217, 204, 0.09), rgba(143, 217, 204, 0.02) 60%);
  text-decoration: none; text-align: left;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.bonus[hidden] { display: none; }
.bonus:hover { border-color: rgba(143, 217, 204, 0.45); transform: translateY(-2px); }
.bonus__title { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; line-height: 1.2; }
.bonus__text { font-size: 0.92rem; line-height: 1.55; color: var(--muted-light); }

.next { margin-top: 2rem; padding-top: 1.6rem; border-top: 1px solid var(--line-light); }
.next__text { font-size: 0.98rem; color: var(--muted-light); }
.next__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.8rem 1.5rem; margin-top: 1.1rem; }
@media (min-aspect-ratio: 5/4) and (min-width: 700px) { .next__row { justify-content: flex-start; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.75em;
  padding: 1.05em 1.55em 1.05em 1.7em;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em; line-height: 1.2;
  text-decoration: none; text-align: center;
  transition: background-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.btn::after {
  content: ''; flex: none; width: 1.05em; height: 1.05em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.35s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:hover::after { transform: translateX(3px); }
.btn--light { background: var(--ivory); color: var(--abyss); box-shadow: 0 18px 40px -22px rgba(143, 217, 204, 0.55); }
.btn--light:hover { background: var(--aqua-soft); }
.again {
  min-height: 44px; padding: 0.4rem 0.2rem; border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--aqua-soft);
  text-decoration: underline; text-underline-offset: 6px; text-decoration-color: rgba(191, 233, 225, 0.4);
}
.again:hover { text-decoration-color: currentColor; }
.again[hidden] { display: none; }

/* ---- Film grain on pointer devices, as on the main page ---- */
@media (hover: hover) and (pointer: fine) {
  body::after {
    content: ''; position: fixed; inset: 0; z-index: 6; pointer-events: none; opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

/* ---- Reduced motion: a calm still image, the player works as usual ---- */
@media (prefers-reduced-motion: reduce) {
  .art *, .tw, .play::before { animation: none !important; }
  .js .art .ln { stroke-dashoffset: 0; transition: none; }
  /* no transform reset on the petals: it would override their rotate() attribute */
  .js .art :is(.dt, .pf, .fl) { opacity: 1; transition: none; }
  .js .art :is(.aura, .core) { opacity: 1; transform: none; transition: none; }
  .aura__b { opacity: 0.5; }
  .pulses, .sparks { display: none; }
  .player, .panel, .fine, .top, .play, .bar, .ctrl { transition: none !important; }
  .is-ended .panel__end { animation: none; }
}
