/* ─────────────────────────────────────────────────────────────
   Soul. Heart. Mind.
   Slow, calm, organic. Dark UI, white mark, frosted glass.
   ───────────────────────────────────────────────────────────── */

:root {
  --ink: #0d100f;
  --ink-2: #151a18;
  --bone: #f3efe7;
  --bone-70: rgba(243, 239, 231, 0.72);
  --bone-50: rgba(243, 239, 231, 0.5);
  --bone-30: rgba(243, 239, 231, 0.3);
  --bone-15: rgba(243, 239, 231, 0.15);
  --sage: #a9b5a1;
  --sand: #d9ccb4;

  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-bg-strong: rgba(255, 255, 255, 0.12);
  --glass-line: rgba(255, 255, 255, 0.16);
  --glass-blur: 22px;

  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.2, 1);
  --slow: 1400ms;
  --slower: 2200ms;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px solid var(--bone-70); outline-offset: 4px; border-radius: 999px; }

/* ── Glass ─────────────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ── Backdrop ──────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.backdrop__img {
  position: absolute; inset: -4%;
  background-size: cover; background-position: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity var(--slower) var(--ease-soft), transform 30s linear;
  filter: saturate(0.8);
}
.backdrop__img.is-on { opacity: 1; transform: scale(1.1); }
.backdrop__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 30%, rgba(13, 16, 15, 0.25), rgba(13, 16, 15, 0.75) 80%),
    linear-gradient(180deg, rgba(13, 16, 15, 0.35), rgba(13, 16, 15, 0.7));
  transition: background var(--slower) var(--ease-soft);
}
body[data-screen="intro"] .backdrop__veil { background: rgba(13, 16, 15, 0.92); }

/* ── Screens ───────────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--slow) var(--ease-soft), visibility 0s linear var(--slow);
}
.screen.is-active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity var(--slow) var(--ease-soft) 300ms, visibility 0s;
}

/* ── Type ──────────────────────────────────────────────────── */
.eyebrow {
  margin: 0;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bone-70); font-weight: 400;
}
.display {
  margin: 6px 0 0;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(38px, 10vw, 52px); line-height: 1.02; letter-spacing: -0.01em;
}
.display--md { font-size: clamp(30px, 8vw, 40px); }

/* ── Intro ─────────────────────────────────────────────────── */
.logo { width: min(72vw, 420px); height: auto; color: var(--bone); overflow: visible; }
.logo .word { fill: currentColor; opacity: 0; }
.logo__ring {
  fill: none; stroke: currentColor; stroke-width: 9; stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: 1; stroke-dashoffset: 1; /* set in JS via pathLength */
}
.skip {
  position: absolute; bottom: calc(28px + var(--safe-bottom));
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bone-30); padding: 10px 16px;
  transition: color 600ms var(--ease);
}
.skip:hover { color: var(--bone-70); }

/* ── Welcome pill (from storyboard) ────────────────────────── */
.pill {
  width: min(100%, 340px);
  border-radius: 170px 170px 44px 44px;
  padding: 12px 12px 30px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.pill__window {
  width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--glass-line);
}
.pill__window-img {
  width: 100%; height: 100%; background-size: cover; background-position: center;
  transform: scale(1.08); transition: transform 20s linear, opacity 1.6s var(--ease-soft);
}
.screen--welcome.is-active .pill__window-img { transform: scale(1.18); }
.pill__body { padding: 22px 10px 0; display: flex; flex-direction: column; align-items: center; width: 100%; }
.pill__body.is-entering > * { animation: rise 1200ms var(--ease) both; }
.pill__body.is-entering > *:nth-child(2) { animation-delay: 120ms; }
.pill__body.is-entering > *:nth-child(3) { animation-delay: 240ms; }
.pill__body.is-entering > *:nth-child(4) { animation-delay: 360ms; }
.pill__body.is-entering > *:nth-child(5) { animation-delay: 480ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

.date { margin: 8px 0 0; font-size: 13px; color: var(--bone-70); letter-spacing: 0.04em; }
.weather { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-line);
  font-size: 13px;
}
.chip__icon svg, .wind svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.wind { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bone-70); }
.place { margin: 0; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bone-50); }

.field { width: 100%; margin-top: 22px; }
.field input {
  width: 100%; padding: 14px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-line);
  color: var(--bone); font: 400 17px var(--sans); text-align: center;
  outline: none; transition: border-color 600ms var(--ease), background 600ms var(--ease);
}
.field input::placeholder { color: var(--bone-30); }
.field input:focus { border-color: var(--bone-50); background: rgba(255, 255, 255, 0.1); }
.btn {
  margin-top: 14px; padding: 12px 26px; border-radius: 999px;
  border: 1px solid var(--glass-line); background: var(--glass-bg-strong);
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 400;
  transition: background 600ms var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, 0.18); }
.link { margin-top: 16px; font-size: 11px; color: var(--bone-30); letter-spacing: 0.06em; transition: color 600ms var(--ease); }
.link:hover { color: var(--bone-70); }

.begin {
  position: relative; margin-top: 28px; padding: 16px 30px;
  font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; font-weight: 400;
  animation: rise 1400ms var(--ease) 700ms both;
}
.begin__ring {
  position: absolute; inset: 0; border-radius: 999px; border: 1px solid var(--bone-30);
  animation: breathe 6s var(--ease-soft) infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

/* ── Home: carousel ───────────────────────────────────────── */
.screen--home { justify-content: flex-start; padding-left: 0; padding-right: 0; touch-action: none; }
.topbar { height: 52px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mark { height: 40px; width: auto; color: var(--bone); opacity: 0.9; }
.mark use { fill: currentColor; }

.stage { position: relative; flex: 1; width: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: grab; user-select: none; -webkit-user-select: none; }
.stage.is-dragging { cursor: grabbing; }
.slides { position: relative; width: 100%; height: var(--slide, 280px); }
.slide {
  position: absolute; left: 50%; top: 0;
  width: var(--slide, 280px); height: var(--slide, 280px); margin-left: calc(var(--slide, 280px) / -2);
  border-radius: 50%; overflow: hidden;
  background-size: cover; background-position: center;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  will-change: transform, opacity;
}
.slide::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 120%, rgba(13, 16, 15, 0.5), transparent 60%);
}
.slide__icon {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  display: grid; place-items: center;
  opacity: 0; transform: scale(0.9); transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}
.slide.is-current .slide__icon { opacity: 1; transform: none; }
.slide__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--bone); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

.caption { margin-top: 26px; text-align: center; padding: 0 24px; min-height: 92px; transition: opacity 600ms var(--ease); }
.caption.is-fading { opacity: 0; }
.caption__sub { margin: 6px 0 0; font-size: 14px; color: var(--bone-70); }

/* ── Home: thumb dial ─────────────────────────────────────── */
.dial {
  position: relative; flex-shrink: 0;
  width: 100%; height: calc(var(--dial-h, 210px) + var(--safe-bottom));
  overflow: hidden; touch-action: none; cursor: grab;
}
.dial__track { position: absolute; inset: 0; }
.dial__dot {
  position: absolute; left: 50%; top: 0;
  width: 46px; height: 46px; margin-left: -23px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass-bg); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  will-change: transform, opacity;
  transition: background 600ms var(--ease), border-color 600ms var(--ease);
}
.dial__dot svg { width: 18px; height: 18px; fill: none; stroke: var(--bone-70); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: stroke 600ms; }
.dial__dot.is-current { background: rgba(243, 239, 231, 0.9); border-color: transparent; }
.dial__dot.is-current svg { stroke: var(--ink); }
.dial__hub {
  position: absolute; left: 50%; bottom: calc(-1 * var(--hub, 150px) / 2 + var(--safe-bottom) - 10px);
  width: var(--hub, 150px); height: var(--hub, 150px); margin-left: calc(var(--hub, 150px) / -2);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; padding-top: 26px; gap: 2px;
}
.dial__count { font-family: var(--serif); font-size: 20px; letter-spacing: 0.04em; }
.dial__hint { font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--bone-50); }

/* ── Session (timer + player) ─────────────────────────────── */
.back {
  position: absolute; z-index: 3; top: calc(18px + var(--safe-top)); left: 16px;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
}
.back svg { width: 20px; height: 20px; fill: none; stroke: var(--bone); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.session { width: min(100%, 380px); position: relative; }
.session.is-entering > * { animation: rise 1400ms var(--ease) both; }
.session.is-entering > *:nth-child(2) { animation-delay: 150ms; }
.session.is-entering > *:nth-child(3) { animation-delay: 300ms; }
.session.is-entering > *:nth-child(4) { animation-delay: 450ms; }

.tag {
  display: inline-block; padding: 7px 14px; border-radius: 999px;
  font-size: 11px; letter-spacing: 0.08em;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.session__title { margin: 14px 0 0; font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 9vw, 44px); line-height: 1.04; }
.session__sub { margin: 6px 0 0; color: var(--bone-70); font-size: 14px; }

/* Player (from storyboard) */
.player { display: grid; grid-template-columns: 1fr 34px; gap: 0 18px; }
.player__main { min-width: 0; }
.slider {
  position: relative; margin-top: 22px; height: 54px; border-radius: 999px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  font-size: 14px; overflow: hidden; touch-action: none; cursor: pointer;
}
.slider__fill { position: absolute; inset: 0 auto 0 0; background: rgba(255, 255, 255, 0.08); border-right: 1.5px solid var(--bone); pointer-events: none; transition: width 120ms linear; }
.slider__dots { position: absolute; left: 96px; right: 60px; top: 50%; height: 4px; margin-top: -2px; display: flex; justify-content: space-between; pointer-events: none; }
.slider__dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--bone-30); }
.slider span { position: relative; pointer-events: none; }
.slider__value { font-variant-numeric: tabular-nums; }
.notice { margin: 16px 0 0; font-size: 13px; color: var(--bone-50); font-style: italic; font-family: var(--serif); font-size: 17px; }

.controls { margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 18px; }
.ctl { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; transition: background 600ms var(--ease), opacity 600ms; }
.ctl svg { width: 22px; height: 22px; fill: none; stroke: var(--bone); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.ctl .icon-text { font: 500 6.5px var(--sans); fill: var(--bone); stroke: none; }
.ctl--main { width: 76px; height: 76px; background: var(--bone); box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.6); }
.ctl--main svg { width: 24px; height: 24px; stroke: var(--ink); stroke-width: 1.8; }
.ctl--main svg .fill { fill: var(--ink); stroke: none; }
.ctl:disabled { opacity: 0.35; cursor: default; }

.rail { display: flex; flex-direction: column; align-items: center; justify-content: space-between; font-size: 11px; color: var(--bone-70); font-variant-numeric: tabular-nums; padding: 4px 0; }
.rail__line { position: relative; flex: 1; width: 1.5px; margin: 10px 0; background: var(--bone-15); border-radius: 2px; cursor: pointer; }
.rail__line::before { content: ""; position: absolute; inset: 0 -14px; } /* bigger hit area */
.rail__fill { position: absolute; top: 0; left: 0; right: 0; background: var(--bone); border-radius: 2px; height: 0; }

/* Timer */
.timer { text-align: center; display: flex; flex-direction: column; align-items: center; }
.durations { margin-top: 22px; display: flex; gap: 8px; padding: 6px; border-radius: 999px; }
.dur {
  width: 54px; height: 40px; border-radius: 999px; font-size: 14px; font-variant-numeric: tabular-nums;
  color: var(--bone-70); transition: background 700ms var(--ease), color 700ms var(--ease);
}
.dur small { font-size: 10px; margin-left: 1px; opacity: 0.7; }
.dur[aria-pressed="true"] { background: var(--bone); color: var(--ink); }
.durations.is-locked .dur:not([aria-pressed="true"]) { opacity: 0.35; pointer-events: none; }

.ring { position: relative; margin-top: 26px; width: min(64vw, 250px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 1.5; }
.ring__bg { stroke: var(--bone-15); }
.ring__fg { stroke: var(--bone); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring__time { font-family: var(--serif); font-weight: 300; font-size: clamp(48px, 15vw, 64px); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; transition: opacity 1.2s var(--ease); }
.ring__state { margin-top: 2px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--bone-50); min-height: 14px; }
.ring.is-done .ring__fg { transition: stroke-dashoffset 5s var(--ease-soft); }
.ring.is-breathing { animation: ringBreathe 8s var(--ease-soft) infinite; }
@keyframes ringBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 22px; }

/* ── Larger screens ───────────────────────────────────────── */
@media (min-width: 720px) {
  .mark { height: 52px; }
  .topbar { height: 72px; }
  .caption { margin-top: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .backdrop__img, .pill__window-img { transition-duration: 600ms !important; transform: none !important; }
}
