/* Noise Calm — light, airy daytime palette. Mobile-first. */
:root {
  --bg: #eef6f6;
  --bg2: #fdf6ef;
  --card: rgba(255, 255, 255, 0.82);
  --ink: #1f3a3d;
  --muted: #5b7476;
  --line: #d6e6e5;
  --accent: #2f8f83;
  --accent-ink: #ffffff;
  --accent-soft: #d5efea;
  --peach: #f4c7a5;
  --sky: #bfe3ee;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(47, 100, 110, 0.10);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 10% -10%, #d9f0f4 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 10%, #fde9da 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  line-height: 1.5;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
button, select, input { font: inherit; color: inherit; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nojs { padding: 1rem; text-align: center; }
:focus-visible { outline: 3px solid #f0a46b; outline-offset: 2px; }

.top, .app, .foot { max-width: 560px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 6px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
.brand-mark { width: 34px; height: 34px; color: var(--accent); }
.lang-wrap select {
  appearance: none; background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: .9rem; cursor: pointer; max-width: 9.5rem;
}

.hero { padding: 18px 2px 8px; }
.hero h1 { font-size: clamp(1.7rem, 7vw, 2.3rem); line-height: 1.15; margin: 0 0 8px; font-weight: 800; letter-spacing: -0.01em; }
.hero p { margin: 0; color: var(--muted); }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 999px; padding: 5px; margin: 16px 0 14px; }
.tabs button { border: 0; background: transparent; border-radius: 999px; padding: 10px 6px; font-weight: 600; font-size: .92rem; cursor: pointer; color: var(--muted); min-height: 44px; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgba(47,100,110,.12); }

.card { background: var(--card); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; backdrop-filter: blur(8px); }
.card h2 { font-size: 1.15rem; margin: 0 0 4px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }

.patterns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pattern {
  text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 16px; padding: 12px; cursor: pointer;
  font-weight: 700; min-height: 56px; transition: border-color .2s, background .2s;
}
.pattern[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pattern-desc { color: var(--muted); margin: 10px 2px 14px; min-height: 3em; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-label { font-weight: 600; }
.seg { display: inline-flex; background: #f1f7f7; border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 8px 12px; cursor: pointer; font-weight: 600; min-height: 40px; min-width: 52px; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }

.opts { display: grid; gap: 10px; margin: 14px 0 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 36px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { flex: none; width: 44px; height: 26px; border-radius: 999px; background: #d3e0df; position: relative; transition: background .2s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 3px solid #f0a46b; outline-offset: 2px; }
.sound-kind { display: flex; align-items: center; gap: 10px; padding-left: 56px; color: var(--muted); }
.sound-kind select { border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; background: #fff; }

.btn { border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; cursor: pointer; min-height: 46px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(47,143,131,.28); }
.btn.primary:active { transform: translateY(1px); }
.btn.ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn.big { width: 100%; font-size: 1.1rem; padding: 15px; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* Session */
.session { text-align: center; }
.stage { position: relative; width: min(78vw, 300px); aspect-ratio: 1; margin: 6px auto 8px; display: grid; place-items: center; }
.halo { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(191,227,238,.7) 0%, rgba(191,227,238,0) 70%); }
.circle {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #c9ece6 35%, #8fd0c6 70%, #5fb3a8 100%);
  box-shadow: 0 20px 50px rgba(47,143,131,.25), inset 0 -10px 30px rgba(47,143,131,.18);
  transform: scale(.55); will-change: transform;
}
.cue { font-size: 1.6rem; font-weight: 800; margin: 6px 0 4px; min-height: 2.3rem; }
.meta { color: var(--muted); margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.sess-bar, .rm-bar { height: 8px; border-radius: 999px; background: #e3eeee; overflow: hidden; margin: 0 auto 16px; max-width: 320px; }
.sess-fill, .rm-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--sky), var(--accent)); border-radius: inherit; }
.rm-bar { display: none; height: 18px; }
.rm-fill { background: linear-gradient(90deg, var(--peach), var(--accent)); }

/* Reduced motion: no animated circle, show a progress bar + text instead. */
@media (prefers-reduced-motion: reduce) {
  .stage { display: none; }
  .rm-bar { display: block; margin-top: 14px; }
  .cue { font-size: 1.9rem; margin-top: 18px; }
  * { transition: none !important; animation: none !important; }
}
.reduced .stage { display: none; }
.reduced .rm-bar { display: block; margin-top: 14px; }

.done { text-align: center; }
.done-dot { width: 72px; height: 72px; border-radius: 50%; margin: 10px auto 12px; background: radial-gradient(circle at 35% 30%, #fff, var(--peach)); box-shadow: 0 10px 30px rgba(244,199,165,.6); }
.done-text { font-size: 1.2rem; font-weight: 700; margin: 0 0 16px; outline: none; }

/* Grounding */
.ground-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 250px; margin: 14px 0 12px; padding: 22px; border: 0; border-radius: 20px; cursor: pointer;
  background: linear-gradient(160deg, #ffffff 0%, #e6f5f3 100%); box-shadow: inset 0 0 0 1.5px var(--line);
  text-align: center;
}
.ground-n { font-size: 3.4rem; font-weight: 800; color: var(--accent); line-height: 1; }
.ground-text { font-size: 1.2rem; font-weight: 600; max-width: 28ch; }
.ground-hint { color: var(--muted); font-size: .85rem; }
.ground-card.finished .ground-n { color: #e39a66; }
.dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 4px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: #d3e0df; }
.dots span.on { background: var(--accent); }
#groundRestart { display: block; margin: 8px auto 0; }

/* Arriving alone */
.arrive-card { margin: 14px 0; padding: 22px 20px; border-radius: 20px; background: linear-gradient(160deg, #fff 0%, #fdf0e5 100%); box-shadow: inset 0 0 0 1.5px #f2e1d3; min-height: 170px; }
.arrive-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--peach); font-weight: 800; color: #6b3e1e; }
.arrive-card p { font-size: 1.15rem; font-weight: 600; margin: 12px 0 0; }
.arrive-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Stats */
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 6px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; }
.stat-n { font-size: 1.8rem; font-weight: 800; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: .88rem; }

.disclaimer { font-size: .82rem; color: var(--muted); text-align: center; margin: 6px 8px 18px; }

.foot { text-align: center; padding-bottom: 32px; color: var(--muted); }
.foot-city a { display: inline-block; background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; text-decoration: none; color: var(--ink); font-size: .92rem; }
.foot-line { margin: 8px 0; font-size: .9rem; }

@media (min-width: 520px) {
  .patterns { grid-template-columns: repeat(4, 1fr); }
  .pattern { font-size: .92rem; }
}
