/* ============ ad-free sleep — a lamp-lit room while it rains ============ */

:root {
  --font-ui: "Gabarito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-num: "Outfit", "Gabarito", sans-serif;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);

  /* the Lullen palette — no navy, no stars, and no black text */
  --ink: #6E4B34;
  --muted: #A3755A;
  --apricot: #CE9257;
  --clay: #9B6A3F;
  --glass: rgba(255, 246, 236, 0.42);
  --glass-edge: rgba(255, 252, 244, 0.6);
  --shadow: 0 16px 32px -18px rgba(130, 60, 15, 0.4);

  /* night screen */
  --night-bg: #0A0603;
  --night-ink: rgba(214, 160, 120, 0.4);
  --night-ink-dim: rgba(214, 160, 120, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  font-family: var(--font-ui);
  font-weight: 450;
  line-height: 1.55;
  color: var(--ink);
  background: linear-gradient(160deg, #F7DCCC 0%, #F0C5AB 38%, #E9B295 72%, #E2A98C 100%) fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
svg { display: block; }

/* ---------- ambient glow ---------- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.orb.a { width: 520px; height: 520px; top: -160px; left: -120px; background: rgba(255, 240, 216, 0.9); opacity: .7; }
.orb.b { width: 460px; height: 460px; top: 30%; right: -180px; background: rgba(216, 122, 82, 0.3); }
.orb.c { width: 420px; height: 420px; bottom: -140px; left: 22%; background: rgba(255, 210, 160, 0.45); }

/* ---------- shared glass ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow);
}

/* light numeral face used for every timer readout */
.num {
  font-family: var(--font-num);
  font-weight: 240;
  letter-spacing: -0.01em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- layout ---------- */
.topbar {
  position: relative; z-index: 10;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 24px 22px 0;
  max-width: 460px;
  margin: 0 auto;
}
.brand {
  font-family: var(--font-num);
  font-size: 32px;
  font-weight: 560;
  letter-spacing: -0.01em;
  line-height: 1;
  background: linear-gradient(115deg, #E08A4C 10%, #C96438 55%, #B0714A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  margin-top: 6px;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--clay);
  transition: color 0.25s, transform 0.25s var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:hover { color: var(--ink); }

.col {
  position: relative; z-index: 10;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 18px calc(30px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  gap: 16px;
}

/* ---------- the ball ---------- */
.puller {
  position: relative;
  height: 380px;
  margin: 0 -18px;      /* room to swing the ball around */
}

/* faint indicator from home to the ball while it's held */
.pull-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.pull-track line {
  stroke: rgba(255, 252, 244, 0.55);
  stroke-width: 2;
  stroke-linecap: round;
}

.ball {
  position: absolute;
  left: 50%;
  top: 96px;
  margin-left: -24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 9px solid rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    0 12px 24px -10px rgba(130, 60, 15, 0.45),
    inset 0 1px 2px rgba(255, 255, 255, 0.8);
  outline: none;
  z-index: 2;
  touch-action: none;
  cursor: grab;
  will-change: transform;
}
.ball.dragging { cursor: grabbing; }
.ball:focus-visible { border-color: var(--apricot); }

.pull-readout {
  position: absolute;
  left: 24px;
  top: 200px;
  z-index: 1;
}
.pull-readout .big { font-size: 54px; color: var(--ink); }
.pull-readout .unit {
  font-size: 19px;
  font-weight: 420;
  margin-left: 7px;
  color: var(--muted);
}
.pull-readout .sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 8px;
}

.pullhint {
  position: absolute;
  left: 0; right: 0;
  top: 306px;
  text-align: center;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--muted);
  z-index: 1;
}

/* the two screens hand over softly */
.puller, .dialwrap { transition: opacity 0.55s var(--ease); }
.puller.gone, .dialwrap.gone { opacity: 0; pointer-events: none; }

/* ---------- the dial (playing) ---------- */
.dialwrap {
  position: relative;
  height: 380px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.dialring {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}
#dialProgress { transition: stroke-dashoffset 1s linear; }
.dial {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 196px;
  height: 196px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.25s var(--ease);
}
.dial:active { transform: translateX(-50%) scale(0.97); }
.dial .big { font-size: 52px; color: var(--ink); }
.dial .sub {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
  margin-top: 6px;
}
.fadelabel {
  position: absolute;
  top: 292px;
  left: 0; right: 0;
  text-align: center;
  z-index: 1;
}
.fadelabel b {
  display: block;
  font-size: 16px;
  font-weight: 650;
}
.fadelabel span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- sound chips ---------- */
.chipbox { display: flex; justify-content: center; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chip {
  font-size: 13px;
  font-weight: 650;
  padding: 9px 16px;
  border-radius: 999px;
  color: #96684A;
  background: rgba(255, 248, 240, 0.38);
  border: 1px solid rgba(255, 252, 244, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.chip.on {
  background: rgba(110, 75, 52, 0.92);
  border-color: rgba(110, 75, 52, 0.92);
  color: #FBEBD8;
  box-shadow: 0 10px 20px -10px rgba(90, 50, 25, 0.55);
}

/* ---------- pressed sounds: their sliders, as a list above the chips ---------- */
.mixlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mixlist:empty { display: none; }
.mix-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 4px;
  animation: row-in 0.3s var(--ease);
}
@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.mix-row .intensity {
  flex: none;
  width: 24px; height: 16px;
  overflow: visible;
}
.mix-row .intensity path {
  fill: none;
  stroke: var(--apricot);
  stroke-width: 2.2;
  stroke-linecap: round;
  transition: d 0.25s var(--ease);
}
.mix-row .s-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  min-width: 92px;
}

.vol {
  flex: 1;
  appearance: none; -webkit-appearance: none;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.55);
  outline: none;
}
.vol::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--apricot);
  border: 2.5px solid #FFF6EC;
  box-shadow: 0 2px 8px rgba(130, 60, 15, 0.4);
  cursor: pointer;
}
.vol::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--apricot);
  border: 2.5px solid #FFF6EC;
  cursor: pointer;
}

.fadenote {
  font-size: 13px;
  line-height: 1.6;
  font-weight: 550;
  color: var(--muted);
  text-align: center;
}

/* ---------- about / seo copy ---------- */
.about {
  display: flex; flex-direction: column; gap: 14px;
  margin-top: 26px;
}
.panel {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 26px;
  padding: 24px 24px 22px;
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  box-shadow: 0 24px 48px -28px rgba(130, 60, 15, 0.35);
}
.panel h2 {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  text-wrap: balance;
}
.panel p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
}
.panel strong { color: var(--ink); font-weight: 650; }
.panel em { color: var(--apricot); font-style: italic; }

.faq details {
  border-top: 1px solid rgba(255, 252, 244, 0.6);
  padding: 12px 2px;
}
.faq details:first-of-type { border-top: none; padding-top: 4px; }
.faq summary {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; gap: 9px;
}
.faq summary::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  border-right: 2px solid var(--apricot);
  border-bottom: 2px solid var(--apricot);
  transform: rotate(-45deg);
  transition: transform 0.25s var(--ease);
}
.faq details[open] summary::before { transform: rotate(45deg); }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin-top: 8px; padding-left: 16px; }

.foot {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.foot a { color: var(--clay); font-weight: 650; text-decoration: none; }

/* ---------- night screen ---------- */
.night-screen {
  position: fixed; inset: 0; z-index: 100;
  background: var(--night-bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  animation: night-in 1.6s ease;
  cursor: pointer;
}
@keyframes night-in { from { opacity: 0; } }

.night-moon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset -10px -7px 0 0 var(--night-ink);
  transform: rotate(-18deg);
  margin-bottom: 8px;
}

.night-remaining {
  font-family: var(--font-num);
  font-weight: 240;
  font-size: 19px;
  color: var(--night-ink);
  letter-spacing: 0.04em;
}
.night-clock {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--night-ink-dim);
}
.night-hint {
  position: absolute;
  bottom: calc(26px + env(safe-area-inset-bottom));
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--night-ink-dim);
  opacity: 0.7;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 200;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(58, 42, 32, 0.92);
  color: #F8E2CC;
  font-size: 13.5px;
  font-weight: 650;
  padding: 11px 20px;
  border-radius: 999px;
  white-space: nowrap;
  animation: toast-in 0.4s var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .mix-row { animation: none; }
}
