/* The Rest Reset Bundle | Return to Calm
   Colours: R2C Colour Guide + Hierarchy. Type: R2C Typography Guide. */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Raleway"; src: url("fonts/raleway-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Raleway"; src: url("fonts/raleway-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inria Serif"; src: url("fonts/inria-serif-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Open Sauce Sans"; src: url("fonts/open-sauce-sans-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sauce Sans"; src: url("fonts/open-sauce-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* ---------- Brand tokens ---------- */
:root {
  /* Foundation */
  --stone: #EDEAE4;        /* Soft Stone: main background */
  --warm-grey: #F2F2F2;    /* Warm Grey: cards */
  --charcoal: #4B4B4B;     /* Charcoal: all text */
  /* Primary brand */
  --dusty-blue: #AAB9C8;   /* Dusty Blue: brand blocks, decorative rules */
  /* Supporting */
  --lavender: #CBC7E4;     /* Lavender: Yoga Nidra labels */
  /* Accent */
  --purple: #8963D4;       /* Purple: actions only */

  --font-heading: "Raleway", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Open Sauce Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Inria Serif", Georgia, "Times New Roman", serif;

  --radius-lg: 1.5rem;
  --radius-md: 1rem;
  --shadow: 0 1px 2px rgba(75, 75, 75, 0.05), 0 12px 32px -14px rgba(75, 75, 75, 0.18);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--stone);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
  line-height: 1.7;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--lavender); color: var(--charcoal); }

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

/* ---------- Masthead ---------- */
.masthead__text {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 10vw, 6rem) 1.25rem 0;
  text-align: center;
}

h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.subheading {
  margin: 0.9rem 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1.1rem + 0.75vw, 1.625rem);
  line-height: 1.4;
  text-wrap: balance;
}

.masthead__text::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin: clamp(2rem, 5vw, 2.75rem) auto 0;
  border-radius: 3px;
  background: var(--dusty-blue);
}

/* ---------- Introduction ---------- */
.intro {
  max-width: 38rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 2.75rem) 1.25rem 0;
}

.intro__greeting {
  margin-bottom: 1.25rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.3125rem, 1.15rem + 0.6vw, 1.5rem);
  line-height: 1.4;
}

.intro__reflection {
  margin: 2.25rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

.note {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--dusty-blue);
  border-radius: 0 0.75rem 0.75rem 0;
  background: var(--warm-grey);
  font-size: 1rem;
  line-height: 1.6;
}

.note + .note { margin-top: 1rem; }
.note strong { font-weight: 500; }

/* ---------- Practices ---------- */
.practices {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.25rem);
  max-width: 46rem;
  margin: clamp(3rem, 8vw, 4.5rem) auto 0;
  padding: 0 1rem;
}

.practice {
  padding: clamp(1.5rem, 5vw, 2.75rem);
  border-radius: var(--radius-lg);
  background: var(--warm-grey);
  box-shadow: var(--shadow);
}

.practice__chip {
  display: inline-block;
  margin: 0;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--lavender);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.practice__title {
  margin: 1rem 0 0.5rem;
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem);
  line-height: 1.25;
}

.practice__duration {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.practice__duration svg { flex: none; width: 1.1rem; height: 1.1rem; }

/* ---------- Audio player ---------- */
.player {
  margin-top: clamp(1.75rem, 4vw, 2.25rem);
  padding: 1rem clamp(1rem, 3vw, 1.5rem);
  border-radius: var(--radius-md);
  background: var(--stone);
}

.player audio { display: block; width: 100%; }
.player.is-enhanced audio { display: none; }

.player__ui {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.25rem;
}

.player__toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.player__toggle:hover { box-shadow: 0 0 0 6px rgba(137, 99, 212, 0.18); }
.player__toggle:active { transform: scale(0.96); }

.player__icon { display: grid; place-items: center; }
.player__toggle svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
.player__icon--play svg { margin-left: 3px; }

.player__icon--pause,
.is-playing .player__icon--play { display: none; }
.is-playing .player__icon--pause { display: grid; }

.is-loading .player__toggle::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid transparent;
  border-top-color: var(--purple);
  border-right-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.player__timeline { min-width: 0; }

.player__times {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: -0.25rem;
  font-size: 0.875rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.player__extras {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;   /* volume drops to its own line on very narrow screens */
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Text buttons: Start again, Save, Cancel, Remove */
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0 0.9rem 0 0.6rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--charcoal);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.text-button:hover { background: var(--warm-grey); }
.text-button svg { flex: none; width: 1.125rem; height: 1.125rem; }

.player__restart { margin-left: -0.35rem; white-space: nowrap; }

.player__volume {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.player__mute {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--charcoal);
  cursor: pointer;
}

.player__mute:hover { background: var(--warm-grey); }
.player__mute svg { width: 1.375rem; height: 1.375rem; }

.player__icon--muted,
.is-muted .player__icon--volume { display: none; }
.is-muted .player__icon--muted { display: grid; }

.player__volume .player__level { flex: none; width: clamp(4rem, 20vw, 7rem); }

.player__error {
  grid-column: 1 / -1;
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

/* Save for offline listening */
.offline {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(145, 148, 146, 0.35);   /* Soft Charcoal divider */
}

.offline__save { margin-left: -0.35rem; }
.offline__save svg,
.offline__saved-label svg { color: var(--purple); }

.offline__progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
}

.offline__progress progress {
  flex: 1;
  min-width: 0;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--dusty-blue);
  color: var(--purple);
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

.offline__progress progress::-webkit-progress-bar { background: var(--dusty-blue); }
.offline__progress progress::-webkit-progress-value { background: var(--purple); border-radius: 999px; }
.offline__progress progress::-moz-progress-bar { background: var(--purple); border-radius: 999px; }

.offline__percent {
  min-width: 2.75rem;
  font-size: 0.875rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.offline__saved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  min-height: 2.75rem;
}

.offline__saved-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.offline__saved-label svg { flex: none; width: 1.125rem; height: 1.125rem; }

.offline__status { margin: 0.25rem 0 0; font-size: 0.9375rem; }

/* Range sliders: progress + volume */
.range {
  --fill: 0%;
  display: block;
  width: 100%;
  height: 2.75rem;          /* 44px touch target */
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Focus is shown as a ring around the thumb so it never overlaps the time labels */
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--stone), 0 0 0 6px var(--purple); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--stone), 0 0 0 6px var(--purple); }

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--purple) var(--fill), var(--dusty-blue) var(--fill));
}

.range::-webkit-slider-thumb {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: calc((6px - 1.25rem) / 2);
  border: 3px solid var(--warm-grey);
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 1px 3px rgba(75, 75, 75, 0.3);
  -webkit-appearance: none;
  appearance: none;
}

.range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--dusty-blue); }
.range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--purple); }

.range::-moz-range-thumb {
  box-sizing: border-box;
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid var(--warm-grey);
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 1px 3px rgba(75, 75, 75, 0.3);
}

/* ---------- Closing + waitlist ---------- */
.closing {
  margin-top: clamp(4rem, 10vw, 6rem);
  padding: clamp(3rem, 9vw, 5.5rem) 1rem;
  background: var(--dusty-blue);
}

.closing__card {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1.75rem, 6vw, 3.25rem);
  border-radius: var(--radius-lg);
  background: var(--stone);
  box-shadow: var(--shadow);
}

.closing__title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.625rem, 1.3rem + 1.5vw, 2.25rem);
}

.closing__action { margin: 2rem 0 0; text-align: center; }

/* White on Purple: 19px Bold qualifies as WCAG large text */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.button:hover { box-shadow: 0 0 0 6px rgba(137, 99, 212, 0.2); }
.button:active { transform: translateY(1px); }
.button:focus-visible { outline-offset: 4px; }

@media (min-width: 40rem) {
  .button { width: auto; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .is-loading .player__toggle::after { animation-duration: 2.5s; }
}
