/* Sit — guided meditation for people who have been meaning to. */

:root {
  --navy: #1a2332;
  --navy-deep: #131a26;
  --navy-soft: #243049;
  --cream: #f5f0e6;
  --cream-soft: #ece5d4;
  --brass: #b8946a;
  --brass-soft: #c9a583;
  --brass-deep: #8c6e4d;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --r-1: 6px;
  --r-2: 14px;
  --r-3: 28px;

  --t-soft: 600ms cubic-bezier(.22,.61,.36,1);
  --t-quick: 220ms cubic-bezier(.22,.61,.36,1);

  --max: 460px;
  --max-wide: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(184,148,106,0.10), transparent 60%),
    radial-gradient(80% 60% at 50% 110%, rgba(36,48,73,0.55), transparent 60%),
    var(--navy);
  background-attachment: fixed;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  letter-spacing: inherit;
}

button:focus-visible,
input:focus-visible,
[role="radio"]:focus-visible,
a:focus-visible {
  outline: 1px solid var(--brass-soft);
  outline-offset: 4px;
  border-radius: var(--r-1);
}

a { color: inherit; }

/* ---------- Stage / Views ---------- */
.stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(20px, 4vw, 40px);
  padding-top: max(clamp(20px, 4vw, 40px), env(safe-area-inset-top));
  padding-bottom: max(clamp(20px, 4vw, 40px), env(safe-area-inset-bottom));
}

.view {
  display: none;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-soft), transform var(--t-soft);
}

.view--picker { max-width: var(--max-wide); }

body[data-view="landing"] .view--landing,
body[data-view="picker"]  .view--picker,
body[data-view="library"] .view--library,
body[data-view="player"]  .view--player {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Typography ---------- */
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(56px, 12vw, 88px);
  letter-spacing: 0.04em;
  margin: 0 0 .25em;
  color: var(--cream);
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.5;
  color: var(--cream-soft);
  opacity: .82;
  margin: 0 0 2.5em;
  max-width: 28ch;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--brass);
  margin: 0 0 1.6em;
  font-weight: 400;
}

.prompt {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.18;
  margin: 0 0 1.8em;
  color: var(--cream);
}

/* ---------- Landing ---------- */
.view--landing { justify-content: center; align-items: stretch; }
.landing__inner {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.landing__footer {
  margin-top: clamp(32px, 6vw, 56px);
  padding-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

/* ---------- Picker ---------- */
.view--picker { justify-content: center; }
.picker__inner { margin: auto 0; width: 100%; }

.picker__heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 5.5vw, 38px);
  line-height: 1.18;
  color: var(--cream);
  margin: 0 0 2em;
  letter-spacing: 0.005em;
}

.picker__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 4vw, 36px);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .picker__grid { grid-template-columns: 1fr 1fr; }
}

.guide {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform var(--t-quick);
}
.guide:hover { transform: translateY(-2px); }
.guide:active { transform: translateY(0); }

.guide__portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--navy-soft);
  box-shadow:
    0 40px 60px -30px rgba(0,0,0,0.55),
    inset 0 0 0 1px rgba(245,240,230,0.06);
  transition: box-shadow var(--t-quick), transform var(--t-quick);
}
.guide:hover .guide__portrait {
  box-shadow:
    0 50px 70px -30px rgba(0,0,0,0.65),
    inset 0 0 0 1px rgba(184,148,106,0.35);
}
.guide__portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guide__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 3.2vw, 28px);
  color: var(--cream);
  letter-spacing: 0.01em;
}

/* ---------- Library ---------- */
.library__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(20px, 4vw, 36px);
}

.library__heading {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 20px;
  color: var(--cream-soft);
  margin: 0;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

.library__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.library__item {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 6px;
  border-bottom: 1px solid rgba(245,240,230,0.07);
  transition: background var(--t-quick);
  border-radius: var(--r-1);
}
.library__item:hover { background: rgba(245,240,230,0.03); }
.library__item:last-child { border-bottom: none; }

.library__item[data-current="true"] .library__title { color: var(--brass-soft); }

.library__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.25;
}

.library__description {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
  color: var(--cream-soft);
  opacity: 0.65;
  max-width: 56ch;
}

.library__footer {
  margin-top: clamp(32px, 6vw, 48px);
  padding-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

/* ---------- Buttons / Links ---------- */
.btn {
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 16px 38px;
  border-radius: 999px;
  transition: background var(--t-quick), color var(--t-quick), border-color var(--t-quick), transform var(--t-quick);
  font-weight: 400;
}

.btn--primary {
  background: var(--brass);
  color: var(--navy);
  border: 1px solid var(--brass);
}

.btn--primary:hover { background: var(--brass-soft); border-color: var(--brass-soft); }
.btn--primary:active { transform: scale(0.985); }

.btn--ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(245,240,230,0.18);
}
.btn--ghost:hover { border-color: var(--brass-soft); color: var(--brass-soft); }

.link {
  font-family: var(--sans);
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: none;
  display: inline-block;
}

.link--quiet {
  color: var(--cream-soft);
  opacity: 0.55;
  letter-spacing: 0.1em;
  transition: opacity var(--t-quick);
}
.link--quiet:hover { opacity: 0.9; }

.iconbtn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--cream-soft);
  opacity: 0.7;
  transition: opacity var(--t-quick), background var(--t-quick);
}
.iconbtn:hover { opacity: 1; background: rgba(245,240,230,0.05); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn--placeholder { pointer-events: none; opacity: 0; }

/* ---------- Player ---------- */
.view--player {
  position: relative;
  justify-content: flex-start;
}

.player__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(18px, 4vw, 30px);
}

.player__brand {
  font-family: var(--serif);
  letter-spacing: 0.1em;
  color: var(--cream-soft);
  opacity: 0.6;
  font-size: 14px;
}

.player__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.player__guide {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: clamp(8px, 3vw, 16px) auto clamp(20px, 4vw, 28px);
  overflow: hidden;
  background: var(--navy-soft);
  box-shadow:
    0 30px 50px -30px rgba(0,0,0,0.55),
    inset 0 0 0 1px rgba(184,148,106,0.25);
}
.player__guide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 4.8vw, 32px);
  line-height: 1.22;
  margin: 0 0 .55em;
  color: var(--cream);
  max-width: 24ch;
}

.track__description {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--cream-soft);
  opacity: 0.7;
  margin: 0 auto 2em;
  max-width: 36ch;
}

.player__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vw, 28px);
  margin: 0 0 clamp(20px, 4vw, 32px);
}

.play {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--brass);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-quick), transform var(--t-quick), box-shadow var(--t-quick);
  box-shadow: 0 18px 36px -16px rgba(184,148,106,0.55);
  position: relative;
  flex-shrink: 0;
}
.play:hover { background: var(--brass-soft); }
.play:active { transform: scale(0.97); }

.play__icon { width: 30px; height: 30px; }
.play__icon--pause { display: none; }
body[data-playing="true"] .play__icon--play { display: none; }
body[data-playing="true"] .play__icon--pause { display: block; }

.play__label {
  position: absolute;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0);
}

.rewind {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cream-soft);
  background: rgba(245,240,230,0.04);
  border: 1px solid rgba(245,240,230,0.10);
  transition: background var(--t-quick), border-color var(--t-quick), color var(--t-quick), transform var(--t-quick);
  position: relative;
}
.rewind:hover {
  background: rgba(245,240,230,0.08);
  border-color: rgba(184,148,106,0.35);
  color: var(--cream);
}
.rewind:active { transform: scale(0.96); }
.rewind svg { width: 22px; height: 22px; }
.rewind__num {
  position: absolute;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: inherit;
  margin-top: 2px;
}

.player__scrubber {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 clamp(18px, 4vw, 28px);
}

.scrubber {
  width: 100%;
}

.player__times {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--cream-soft);
  opacity: 0.55;
  text-transform: uppercase;
}

.player__meta {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 0 0 clamp(20px, 4vw, 28px);
}

.volume {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(260px, 100%);
  color: var(--cream-soft);
  opacity: 0.7;
}
.volume__icon { width: 18px; height: 18px; flex-shrink: 0; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
  height: 22px;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: rgba(245,240,230,0.25);
  border-radius: 1px;
}
input[type="range"]::-moz-range-track {
  height: 1px;
  background: rgba(245,240,230,0.25);
  border-radius: 1px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  background: var(--brass);
  border-radius: 50%;
  margin-top: -5.5px;
  transition: transform var(--t-quick);
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  background: var(--brass);
  border-radius: 50%;
  border: none;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }

.player__chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(245,240,230,0.12);
  background: rgba(245,240,230,0.02);
  color: var(--cream-soft);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--sans);
  font-weight: 400;
  transition: border-color var(--t-quick), background var(--t-quick), color var(--t-quick);
}
.chip svg { width: 14px; height: 14px; opacity: 0.7; }
.chip:hover { border-color: rgba(184,148,106,0.45); color: var(--cream); }

.chip--ghost {
  opacity: 0.55;
  border-color: rgba(245, 240, 230, 0.06);
}
.chip--ghost:hover {
  opacity: 0.92;
  border-color: rgba(184, 148, 106, 0.32);
}

/* ---------- Complete state ---------- */
.complete {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(19,26,38,0.94) 0%, var(--navy-deep) 80%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-soft);
  padding: clamp(24px, 5vw, 40px);
  text-align: center;
}
.complete[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
}

.complete__line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 4.5vw, 32px);
  color: var(--cream);
  opacity: 0.92;
  margin: 0 0 2em;
  max-width: 24ch;
  line-height: 1.3;
}

.complete__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* ---------- Footer (portfolio + tip) ---------- */
.portfolio {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--cream-soft);
  opacity: 0.55;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: opacity var(--t-quick), color var(--t-quick);
}
.portfolio a {
  color: var(--brass-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(184,148,106,0.3);
}
.portfolio:hover { opacity: 0.9; }
.portfolio a:hover { color: var(--cream); border-bottom-color: var(--cream); }

.tip {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--brass-soft);
  text-decoration: none;
  opacity: 0.7;
  padding: 6px 10px;
  border-radius: var(--r-1);
  transition: opacity var(--t-quick), color var(--t-quick);
}
.tip:hover { opacity: 1; color: var(--cream); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: var(--navy-soft);
  color: var(--cream);
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(184,148,106,0.25);
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-soft), transform var(--t-soft);
  z-index: 60;
  max-width: calc(100% - 40px);
  text-align: center;
  box-shadow: 0 24px 48px -20px rgba(0,0,0,0.5);
}
.toast[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 220ms !important; }
}
