/* The sample Ritual player: /hear-a-ritual/, its embed and the homepage.
 * Self-contained so it reads the same on pages built from product-pages.css and
 * on the homepage, which carries its own inline styles. Brand Identity System:
 * Midnight #000000 field, Dawn Gold #D4A574 for the ritual, Lucid Cyan #00F2FE
 * for the voice and focus only, Moon Silver #F5EFE0 text, Ash #8E8E93 metadata;
 * Playfair Display Italic for the title, Inter for the interface, JetBrains
 * Mono for labels and time. */

.tma-rp {
  --rp-black: #000000;
  --rp-gold: #D4A574;
  --rp-gold-soft: #E0BA91;
  --rp-silver: #F5EFE0;
  --rp-copy: #C9BFA8;
  --rp-ash: #8E8E93;
  --rp-cyan: #00F2FE;
  --rp-hairline: rgba(212, 165, 116, 0.26);
  --rp-track: rgba(245, 239, 224, 0.14);
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px) clamp(16px, 4vw, 34px) clamp(18px, 3.4vw, 28px);
  /* The stage must be pure black: the original mark sits on a #000000 field. */
  background: var(--rp-black);
  border: 1px solid var(--rp-hairline);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  color: var(--rp-copy);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.tma-rp *, .tma-rp *::before, .tma-rp *::after { box-sizing: border-box; }

/* Stage: the mark, with the voice drawn around it. A padding square keeps the
 * shape in webviews that predate aspect-ratio. */
.tma-rp__stage {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  background: var(--rp-black);
}
.tma-rp__stage::before { content: ""; display: block; padding-top: 100%; }
.tma-rp__mark {
  position: absolute;
  left: 24%;
  top: 24%;
  width: 52%;
  height: 52%;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.tma-rp__canvas {
  position: absolute;
  inset: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.tma-rp__kicker {
  margin: 14px 0 8px;
  color: var(--rp-gold);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.tma-rp__title {
  margin: 0 auto 20px;
  max-width: 26ch;
  color: var(--rp-silver);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(22px, 3.6vw, 30px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.tma-rp__line { display: inline-block; }

/* Controls ---------------------------------------------------------------- */
.tma-rp__controls {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 20px);
  text-align: left;
}
.tma-rp__play {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rp-gold);
  color: #000;
  cursor: pointer;
  box-shadow: 0 0 0 6px rgba(212, 165, 116, 0.10), 0 10px 28px rgba(212, 165, 116, 0.22);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  touch-action: manipulation;
}
.tma-rp__play:hover { background: var(--rp-gold-soft); box-shadow: 0 0 0 8px rgba(212, 165, 116, 0.14), 0 12px 34px rgba(212, 165, 116, 0.30); }
.tma-rp__play:active { transform: scale(0.97); }
.tma-rp__play:focus { outline: none; }
.tma-rp__play:focus-visible { outline: 2px solid var(--rp-cyan); outline-offset: 5px; }
.tma-rp__play svg { display: block; width: 24px; height: 24px; fill: currentColor; }
.tma-rp__icon-play { margin-left: 3px; }
.tma-rp__icon-pause,
.tma-rp__spinner { display: none !important; }
.tma-rp[data-state="playing"] .tma-rp__icon-play,
.tma-rp[data-state="loading"] .tma-rp__icon-play { display: none; }
.tma-rp[data-state="playing"] .tma-rp__icon-pause,
.tma-rp[data-state="loading"] .tma-rp__icon-pause { display: block !important; }
.tma-rp__spinner {
  position: absolute;
  inset: -7px;
  width: calc(100% + 14px) !important;
  height: calc(100% + 14px) !important;
  fill: none !important;
  pointer-events: none;
}
.tma-rp__spinner circle { fill: none; stroke: var(--rp-gold-soft); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 52 200; }
.tma-rp[data-state="loading"] .tma-rp__spinner { display: block !important; animation: tma-rp-spin 1.1s linear infinite; }
@keyframes tma-rp-spin { to { transform: rotate(360deg); } }

.tma-rp__timeline { flex: 1 1 auto; min-width: 0; }
.tma-rp__seek {
  --rp-progress: 0%;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: none;
}
.tma-rp__seek:focus { outline: none; }
.tma-rp__seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--rp-gold) 0, var(--rp-gold) var(--rp-progress), var(--rp-track) var(--rp-progress), var(--rp-track) 100%);
}
.tma-rp__seek::-moz-range-track { height: 3px; border-radius: 3px; background: var(--rp-track); }
.tma-rp__seek::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--rp-gold); }
.tma-rp__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6.5px;
  border: 2px solid var(--rp-gold);
  border-radius: 50%;
  background: var(--rp-silver);
  box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.16);
}
.tma-rp__seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--rp-gold);
  border-radius: 50%;
  background: var(--rp-silver);
  box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.16);
}
.tma-rp__seek:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--rp-cyan); }
.tma-rp__seek:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--rp-cyan); }
.tma-rp__times {
  display: flex;
  justify-content: space-between;
  margin-top: -6px;
  color: var(--rp-ash);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.tma-rp__status {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--rp-copy);
  font-size: 13px;
  line-height: 1.4;
}
.tma-rp__status:empty { min-height: 0; margin: 0; }

.tma-rp__note {
  margin: 16px auto 0;
  max-width: 44ch;
  color: var(--rp-ash);
  font-size: 12px;
  line-height: 1.6;
}
.tma-rp__note a { color: var(--rp-gold); text-underline-offset: 3px; }
.tma-rp__note a:focus-visible { outline: 2px solid var(--rp-cyan); outline-offset: 3px; }

/* Without JavaScript the browser's own controls are the player. */
.tma-rp__native { display: block; width: 100%; margin-top: 16px; }
.tma-rp:not(.is-ready) .tma-rp__controls,
.tma-rp:not(.is-ready) .tma-rp__status { display: none; }
.tma-rp.is-ready .tma-rp__native { display: none; }

/* Compact: the homepage. Stage beside the controls on wide screens. ------- */
.tma-rp--compact {
  max-width: 640px;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  grid-template-areas: "stage body";
  align-items: center;
  gap: 8px 24px;
  padding: 22px 26px;
  text-align: left;
}
.tma-rp--compact .tma-rp__stage { grid-area: stage; max-width: none; }
.tma-rp--compact .tma-rp__body { grid-area: body; min-width: 0; }
.tma-rp--compact .tma-rp__kicker { margin-top: 0; }
.tma-rp--compact .tma-rp__title { margin: 0 0 12px; max-width: none; font-size: clamp(20px, 2.6vw, 24px); }
.tma-rp--compact .tma-rp__play { width: 56px; height: 56px; }
.tma-rp--compact .tma-rp__play svg { width: 21px; height: 21px; }
@media (max-width: 560px) {
  .tma-rp--compact {
    grid-template-columns: 1fr;
    grid-template-areas: "stage" "body";
    padding: 18px 16px 20px;
    text-align: center;
  }
  .tma-rp--compact .tma-rp__stage { width: 168px; margin: 0 auto; }
  .tma-rp--compact .tma-rp__title { margin-bottom: 14px; }
}

/* Embed: fills the frame X gives it, at any size. ------------------------- */
.tma-rp--embed {
  max-width: none;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(12px, 4vmin, 28px);
}
.tma-rp--embed .tma-rp__stage { width: min(48vh, 70vw, 340px); max-width: none; }
.tma-rp--embed .tma-rp__kicker { margin-top: clamp(6px, 2vh, 14px); }
.tma-rp--embed .tma-rp__title { margin-bottom: clamp(8px, 2.4vh, 18px); font-size: clamp(17px, 4.4vmin, 26px); }
.tma-rp--embed .tma-rp__controls { width: 100%; max-width: 460px; margin: 0 auto; }
.tma-rp--embed .tma-rp__note { margin-top: clamp(6px, 1.8vh, 14px); }

@media (prefers-reduced-motion: reduce) {
  .tma-rp__play, .tma-rp__play:hover, .tma-rp__play:active { transition: none; transform: none; }
  .tma-rp[data-state="loading"] .tma-rp__spinner { animation: none; stroke-dasharray: none; opacity: 0.6; }
}
@media (forced-colors: active) {
  .tma-rp__play { border: 2px solid ButtonText; }
  .tma-rp__canvas { display: none; }
}
