@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Syne:wght@500;600;700&display=swap");

:root {
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #061018;
  color: #e7f2f1;
}

body {
  min-height: 100dvh;
}

#aeris-root {
  --bg: #061018;
  --panel: rgba(10, 26, 34, 0.78);
  --line: rgba(142, 212, 198, 0.22);
  --teal: #3ddec8;
  --teal-ink: #06221e;
  --gold: #e7b15a;
  --gold-ink: #2a1c06;
  --ice: #9ecbff;
  --ink: #e7f2f1;
  --muted: #8ea4ad;
  --soft: #c5d6da;
  --display: "Syne", "Manrope", sans-serif;
  --sans: "Manrope", system-ui, sans-serif;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  text-wrap: pretty;
}

#aeris-root button,
#aeris-root input {
  font: inherit;
  color: inherit;
}

#aeris-root button {
  cursor: pointer;
  touch-action: manipulation;
}

#aeris-root button:focus-visible,
#aeris-root input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

#aeris-root [hidden] { display: none !important; }

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: "Syne", sans-serif;
  letter-spacing: 0.22em;
  color: #3ddec8;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.sky canvas { width: 100%; height: 100%; display: block; }

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 222, 200, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 222, 200, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 72%);
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 18%, transparent 0%, rgba(6, 16, 24, 0.35) 46%, #061018 100%);
}

#view { position: relative; z-index: 1; }

.shell, .page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: env(safe-area-inset-top);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  min-height: 44px;
}

.mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  border: 1.5px solid var(--teal);
  background: radial-gradient(circle at 40% 35%, #f4fffc, #1a8f80 52%, #061018 76%);
  box-shadow: 0 0 16px rgba(61, 222, 200, 0.35);
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.word {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.16em;
  line-height: 1;
}

.top-actions { display: flex; gap: 2px; align-items: center; flex: none; }
.brand { min-width: 0; }

.icon-btn, .lang-btn {
  min-width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--soft);
}

.icon-btn[aria-pressed="true"], .lang-btn {
  border-color: var(--line);
  background: rgba(61, 222, 200, 0.08);
  color: var(--ink);
}

.lang-btn {
  padding: 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.ico {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  display: grid;
  gap: 8px;
  padding: 18px 0 8px;
}

.hero-orb {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  justify-self: start;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.75), transparent 24%),
    radial-gradient(circle at 50% 55%, rgba(61, 222, 200, 0.85), rgba(6, 16, 24, 0.1) 70%);
  box-shadow: 0 0 32px rgba(61, 222, 200, 0.35), inset 0 0 18px rgba(255, 255, 255, 0.18);
  animation: tide 7.5s ease-in-out infinite;
}

h1 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(1.85rem, 8vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lead, .why, .prose p, .fine, .hint, .coach {
  color: var(--soft);
}

.lead { margin: 10px 0 0; max-width: 38rem; }

.quote {
  margin: 14px 0 0;
  color: var(--gold);
  font-family: var(--display);
  font-size: 1.05rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 12px;
}

.chip, .preset {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--soft);
}

.chip.on, .preset.on {
  background: var(--teal);
  color: var(--teal-ink);
  border-color: transparent;
  font-weight: 700;
}

.cards {
  display: grid;
  gap: 10px;
}

.card {
  width: 100%;
  text-align: left;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 3px 0 0 var(--teal);
}

.card[data-tone="intense"] { box-shadow: inset 3px 0 0 var(--gold); }
.card[data-tone="deep"] { box-shadow: inset 3px 0 0 var(--ice); }

.card-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-title {
  font-family: var(--display);
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.card-blurb { color: var(--soft); }
.card-meta { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.92rem; }

.fine {
  font-size: 0.82rem;
  margin: 18px 0 0;
}

.pack {
  margin: 14px 0 0;
}

.pack-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--teal);
  text-decoration: none;
  cursor: pointer;
}

.page-head { padding: 8px 0 4px; }

.page h1, .detail h1, .done h1 {
  font-size: clamp(1.7rem, 6vw, 2.6rem);
}

.back {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.why { margin: 8px 0 0; }

.steps {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  color: var(--soft);
}

.steps li { margin: 4px 0; }

.caution, .hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(231, 177, 90, 0.45);
  color: #f3e2c0;
  background: rgba(231, 177, 90, 0.08);
  font-size: 0.92rem;
}

.presets, .pref-row, .actions, .btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.presets { margin-top: 14px; }

.fields { display: grid; gap: 12px; margin-top: 14px; }

.slider-top, .switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.slider-top strong, .elapsed, .count {
  font-variant-numeric: tabular-nums;
}

.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  background: transparent;
  margin: 2px 0 0;
}

.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(142, 212, 198, 0.28);
  border-radius: 99px;
}

.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--teal);
}

.slider input[type="range"]::-moz-range-track {
  height: 4px;
  background: rgba(142, 212, 198, 0.28);
  border-radius: 99px;
}

.slider input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--teal);
}

.switch {
  width: 100%;
  min-height: 52px;
  padding: 0 12px 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 20, 26, 0.45);
  text-align: left;
}

.knob {
  width: 42px;
  height: 26px;
  border-radius: 99px;
  background: #1c333b;
  position: relative;
  flex: none;
}

.knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease;
}

.switch[aria-checked="true"] .knob,
.switch[aria-pressed="true"] .knob {
  background: rgba(61, 222, 200, 0.35);
}

.switch[aria-checked="true"] .knob::after,
.switch[aria-pressed="true"] .knob::after {
  transform: translateX(16px);
  background: var(--teal);
}

.estimate {
  margin: 14px 0 0;
  color: var(--ice);
  font-variant-numeric: tabular-nums;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  color: var(--soft);
}

.check input {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--gold);
  flex: none;
}

.primary, .release, .ghost {
  min-height: 52px;
  border-radius: 999px;
  padding: 0 18px;
}

.primary, .release { width: 100%; border: 0; font-weight: 700; }

.primary { background: var(--teal); color: var(--teal-ink); margin-top: 12px; }
.primary:disabled { opacity: 0.38; }

.start-dock {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 8px;
  padding: 12px 0 calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(6, 16, 24, 0), #061018 28%);
}

.start-dock .primary { margin-top: 8px; }
.start-dock .check { margin-top: 0; }

.release { background: var(--gold); color: var(--gold-ink); }

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.btn-row { margin-top: 12px; }
.btn-row .ghost, .btn-row .primary { width: auto; flex: 1; margin-top: 0; }

.session {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 1;
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-mid { min-width: 0; text-align: center; flex: 1; }
.session-mid .eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.elapsed {
  margin: 0;
  min-width: 52px;
  text-align: right;
  color: var(--muted);
}

.toggles {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 320px;
}

.orb-wrap {
  position: relative;
  width: min(78vw, 46vh, 420px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: rgba(142, 212, 198, 0.18); stroke-width: 1.2; }
.ring-fg {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.6;
  stroke-linecap: round;
  transform-origin: center;
  transform-box: fill-box;
  transform: rotate(-90deg);
}

.orb {
  width: 72%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.55), transparent 22%),
    radial-gradient(circle at 50% 55%, rgba(61, 222, 200, 0.72), rgba(8, 22, 30, 0.15) 68%);
  box-shadow: 0 0 40px rgba(61, 222, 200, 0.32), inset 0 0 24px rgba(255, 255, 255, 0.12);
}

.orb[data-kind="out"] {
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.35), transparent 22%),
    radial-gradient(circle at 50% 55%, rgba(158, 203, 255, 0.55), rgba(8, 22, 30, 0.2) 70%);
  box-shadow: 0 0 36px rgba(158, 203, 255, 0.28);
}

.orb[data-kind="hold"] {
  box-shadow: 0 0 40px rgba(231, 177, 90, 0.38);
}

.orb[data-kind="keep"] {
  background:
    radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.28), transparent 20%),
    radial-gradient(circle at 50% 60%, rgba(158, 203, 255, 0.35), rgba(6, 16, 24, 0.45) 72%);
  box-shadow: 0 0 46px rgba(158, 203, 255, 0.28);
}

.orb[data-kind="fire"] {
  box-shadow: 0 0 36px rgba(255, 176, 136, 0.45);
}

#phase {
  font-family: var(--display);
  font-size: clamp(1.05rem, 4vw, 1.4rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.count {
  font-family: var(--display);
  font-size: clamp(2.4rem, 10vw, 4rem);
  line-height: 1;
  margin-top: 2px;
}

#sub { margin-top: 4px; color: var(--soft); font-size: 0.92rem; }

.coach {
  margin: 0;
  min-height: 3.2em;
  max-width: 28rem;
  text-align: center;
  font-size: 1.02rem;
}

.actions { display: grid; gap: 8px; }
.action-row { display: flex; gap: 8px; }
.action-row .ghost { flex: 1; }

.track-wrap {
  margin-top: 12px;
  height: 4px;
  border-radius: 99px;
  background: rgba(142, 212, 198, 0.16);
  overflow: hidden;
}

.track {
  height: 100%;
  width: 0%;
  background: var(--teal);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--panel);
}

.stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.stat span { color: var(--muted); font-size: 0.8rem; }

.chart-card, .panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 20, 26, 0.55);
}

.chart-card h2, .panel h2, .atlas h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
}

.chart { width: 100%; height: auto; display: block; }
.chart polyline { fill: none; stroke: var(--teal); stroke-width: 2; }
.chart circle { fill: var(--gold); }
.chart line { stroke: rgba(142, 212, 198, 0.2); stroke-width: 1; }

.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 96px;
}

.bars span {
  flex: 1;
  min-height: 6px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(#8ef0e2, #1a8f80);
}

.timeline {
  display: flex;
  height: 18px;
  width: 100%;
  border-radius: 99px;
  overflow: hidden;
  background: #102028;
}

.timeline span { display: block; height: 100%; min-width: 1px; }
.tl-in { background: #3ddec8; }
.tl-out { background: #7eb6ef; }
.tl-hold { background: #e7b15a; }
.tl-keep { background: #d5e7ff; }
.tl-rest { background: #35515c; }
.tl-fire { background: #ffb088; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin-right: 4px;
}

.holds { margin: 8px 0 0; padding-left: 1.1rem; color: var(--soft); }

.row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.row p { margin: 0; }
.row small { color: var(--muted); }

.linkish {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--ice);
  padding: 0 4px;
}

.atlas-block {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.atlas-block h2 { margin-bottom: 4px; }

dialog.sheet {
  width: min(520px, calc(100% - 24px));
  margin: auto auto 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0c1c24;
  color: var(--ink);
  padding: 16px 16px 18px;
}

dialog.sheet::backdrop { background: rgba(2, 6, 10, 0.66); }

.sheet h2 {
  font-family: var(--display);
  margin: 0 0 10px;
}

.sheet .switch { margin-top: 8px; }
.note { color: var(--muted); font-size: 0.86rem; margin: 10px 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 28px;
    padding-top: 28px;
  }
  .hero-orb { width: 120px; height: 120px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .session { width: min(760px, 100%); margin: 0 auto; }
  dialog.sheet { margin: auto; }
}

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

@media (prefers-reduced-motion: reduce) {
  .hero-orb { animation: none; }
  .knob::after { transition: none; }
}
