/* ==========================================================================
   Hairy Fairy's Happy Halloween — Family Audio Trail
   Shared stylesheet for every page (homepage + 5 audio stop pages).

   Design brief: crisp white background, as little text/decoration as
   possible, and the big play button is the first thing visible when a
   page opens — everything else here is in service of that.
   ========================================================================== */

:root {
  /* ---- Palette ---- */
  --bg: #ffffff;
  --hairline: #ececec;
  --surface-subtle: #f7f7f7;
  --green-deep: #1f4a35;
  --purple: #5c2d82;
  --purple-deep: #43205f;
  --orange: #e8792e;
  --orange-deep: #c9601c;
  --red-leaf: #b63a2e;
  --ink: #221c14;
  --ink-soft: #6b6459;

  /* ---- Layout ---- */
  --page-max: 480px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow-button: 0 8px 0 var(--orange-deep), 0 14px 22px rgba(201, 96, 28, 0.25);
  --shadow-button-playing: 0 8px 0 var(--purple-deep), 0 14px 22px rgba(67, 32, 95, 0.25);

  /* ---- Type ---- */
  --font-display: "Baloo 2", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

/* ---------------------------------------------------------------------- */
/* Reset / base                                                            */
/* ---------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0 0 0.8em;
}

a {
  color: var(--purple);
}

button {
  font-family: inherit;
}

/* Visible, high-contrast focus for keyboard users everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--orange-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--green-deep);
  color: #fff;
  padding: 0.6em 1em;
  border-radius: var(--radius-md);
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------- */
/* Page shell                                                              */
/* ---------------------------------------------------------------------- */

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0.9rem 1.1rem 3rem;
}

/* The 5 audio-stop pages: just a label, a title and the play button,
   so give them a bit more top breathing room than a dense page would. */
.page--minimal {
  padding-top: clamp(1.5rem, 8vh, 4rem);
}

/* ---------------------------------------------------------------------- */
/* "Audio N" label + the stop's one-line title                            */
/* ---------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
}

.stop-title {
  font-size: clamp(1.6rem, 8.5vw, 2.1rem);
  color: var(--green-deep);
  margin-bottom: 1.6rem;
}

/* ---------------------------------------------------------------------- */
/* The play button — the hero of the page, first thing visible            */
/* ---------------------------------------------------------------------- */

.player {
  text-align: center;
}

.play-button {
  appearance: none;
  border: none;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 5.5vw, 1.35rem);
  letter-spacing: 0.01em;
  padding: 1.25rem 1.3rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-button);
  cursor: pointer;
  min-height: 72px;
  touch-action: manipulation;
}

.play-button:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--orange-deep), 0 6px 12px rgba(201, 96, 28, 0.25);
}

.play-button__icon {
  font-size: 1.3em;
  line-height: 1;
}

.play-button.is-playing {
  background: var(--purple);
  box-shadow: var(--shadow-button-playing);
}

.play-button.is-playing:active {
  box-shadow: 0 2px 0 var(--purple-deep), 0 6px 12px rgba(67, 32, 95, 0.25);
}

/* gentle pulse while playing — purely decorative, skipped for reduced motion */
.play-button.is-playing .play-button__icon {
  display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

.player__progress-wrap {
  margin-top: 1rem;
}

.player__scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--hairline);
  outline-offset: 4px;
  accent-color: var(--purple);
}

.player__scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--purple);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  margin-top: -6px;
  cursor: pointer;
}

.player__scrubber::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--purple);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.player__times {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------- */
/* Closing message — final stop only                                       */
/* ---------------------------------------------------------------------- */

.closing {
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--hairline);
  text-align: center;
}

.closing__title {
  font-family: var(--font-display);
  color: var(--green-deep);
  font-size: 1.5rem;
  margin-bottom: 0.4em;
}

.closing__text {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------- */
/* Homepage specifics                                                      */
/* ---------------------------------------------------------------------- */

.hero {
  text-align: center;
  padding-top: 0.4rem;
}

.hero__title {
  font-size: clamp(1.7rem, 8vw, 2.1rem);
  color: var(--green-deep);
  margin-bottom: 0.5rem;
}

.hero__place {
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  margin-bottom: 1.3rem;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-decoration: none;
  background: var(--purple);
  color: #fff !important;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 5.5vw, 1.4rem);
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 0 var(--purple-deep), 0 14px 22px rgba(67, 32, 95, 0.25);
  min-height: 72px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.cta:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 var(--purple-deep), 0 6px 12px rgba(67, 32, 95, 0.25);
}

.how {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--hairline);
}

.how-steps {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.how-steps li {
  counter-increment: step;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.how-steps li::before {
  content: counter(step);
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-subtle);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meta-line {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 1rem;
}
