/* Qigong Timer's page. Every colour is a token set on :root by the app's own palette.js (Ink & Jade
   until a visitor picks another), so the whole page re-colours the way the app does. The dial's
   strokes are the app's (www/css/app.css, .dial). */
:root {
  --bg: #0e1412; --surface: #172019; --surface-2: #1d2720; --text: #e6eee8; --muted: #9aa59e; --faint: #6b756f;
  --line: #2a332e; --track: #252e29; --accent: #73c29c; --accent-soft: #24392f; --accent-glow: rgba(115,194,156,.34);
  --on-accent: #0b0b0b; --shadow: rgba(0,0,0,.45); --mist-a: rgba(115,194,156,.16); --mist-b: rgba(230,238,232,.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: var(--serif);
  --ease: cubic-bezier(.22,.8,.24,1);
  --gutter: clamp(16px, 5vw, 56px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color: var(--text); transition: background-color .6s var(--ease); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; margin: 0; }

/* the app's mist backdrop, fixed behind everything */
.mist {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, var(--mist-a), transparent 60%),
    radial-gradient(80% 50% at 110% 100%, var(--mist-b), transparent 70%),
    radial-gradient(70% 40% at -10% 80%, var(--mist-b), transparent 70%);
}

/* a gong's ripple crosses the whole page */
#ripples { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.ripple {
  position: absolute; width: 24px; height: 24px; transform: translate(-50%, -50%); border-radius: 50%;
  border: 1.5px solid var(--accent); opacity: calc(.5 * var(--s, 1));
  animation: ripple 4s cubic-bezier(.1,.6,.3,1) forwards;
}
@keyframes ripple { to { width: 240vmax; height: 240vmax; opacity: 0; } }

/* ---------------------------------------------------------------- top */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px var(--gutter); font-size: 14px; color: var(--muted);
}
.studio { color: var(--text); text-decoration: none; font-family: var(--display); font-size: 17px; }
.soon { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; text-align: right; }

/* ---------------------------------------------------------------- hero */
main { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.hero {
  display: grid; gap: 24px 56px; align-items: center; padding: 3vh 0 10vh;
  grid-template-columns: 1fr; grid-template-areas: "text" "dial" "setup";
}
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-areas: "text dial" "setup dial"; min-height: calc(100vh - 70px); }
  .hero-text { align-self: end; }
  .setup { align-self: start; }
}
.hero-text { grid-area: text; }
.kicker, .eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { font-size: clamp(38px, 6.2vw, 74px); line-height: 1.04; }
.lede { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); max-width: 32em; margin: 20px 0 0; }

.dial-wrap { grid-area: dial; display: grid; place-items: center; width: 100%; padding: 12px; }
.dial { position: relative; width: min(100%, 520px); aspect-ratio: 1; touch-action: none; cursor: grab; outline: none; border-radius: 50%; }
.dial:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.dial.dragging { cursor: grabbing; }
.dial-svg, .dial-svg svg, .mini svg { width: 100%; height: 100%; display: block; overflow: visible; }
.dial .tk { stroke: var(--faint); stroke-width: 1.2; opacity: .55; }
.dial .tk.big { stroke: var(--muted); stroke-width: 2; opacity: .8; }
.dial .track { stroke: var(--track); stroke-width: 16; transition: stroke-width .4s var(--ease); }
.dial .fill-arc { stroke: var(--accent); stroke-width: 16; stroke-linecap: round; filter: drop-shadow(0 0 10px var(--accent-glow)); transition: stroke-width .4s var(--ease); }
:root[data-dial="brush"] .dial .fill-arc { filter: url(#brush); stroke-width: 19; }
:root[data-dial="brush"] .dial .track { filter: url(#brush); }
:root[data-dial="minimal"] .dial .track { stroke-width: 3; }
:root[data-dial="minimal"] .dial .fill-arc { stroke-width: 4; filter: none; }
:root[data-dial="minimal"] .dial .tk:not(.big) { opacity: 0; }
:root[data-dial="orb"] .dial .track { stroke-width: 6; }
:root[data-dial="orb"] .dial .fill-arc { stroke-width: 6; }
.dial .hr { stroke: var(--track); stroke-width: 4; transition: stroke .3s; }
.dial .hr.on { stroke: var(--accent); opacity: .7; }
.dial .knob { fill: var(--surface); stroke: var(--accent); stroke-width: 3; filter: drop-shadow(0 3px 6px var(--shadow)); transition: r .15s; }
.dial .knob-dot { fill: var(--accent); }
.dial.dragging .knob { r: 16; }
.dial .gm { fill: var(--accent); opacity: .5; transition: opacity .3s, r .3s; }
.dial .gm.start, .dial .gm.end { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; opacity: .9; }
.dial .gm.lit { opacity: 1; fill: var(--accent); }
.dial .playhead { fill: var(--text); opacity: 0; transition: opacity .3s; }
.dial.hearing .playhead { opacity: .9; }
.dial.hearing .knob, .dial.hearing .knob-dot { opacity: .25; }
.dial .orb { opacity: 0; transform-origin: 160px 160px; transform-box: view-box; transition: opacity .6s; }
:root[data-dial="orb"] .dial .orb { opacity: 1; animation: breathe 10s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.78); } 50% { transform: scale(1); } }

.strike {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56%; aspect-ratio: 1; border-radius: 50%; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.strike:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.strike .time { font-family: var(--display); font-size: clamp(54px, 11vw, 92px); line-height: 1; font-variant-numeric: tabular-nums; }
.strike .laps { color: var(--muted); font-size: 14px; }
.strike .tap { margin-top: 10px; color: var(--accent); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.strike:hover .tap { text-decoration: underline; text-underline-offset: 4px; }

.setup { grid-area: setup; max-width: 30em; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; cursor: pointer; color: var(--muted); min-height: 40px; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.stepper { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; vertical-align: middle; }
.stepper[hidden] { display: none; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; }
.stepper output { min-width: 7.5em; text-align: center; font-variant-numeric: tabular-nums; }
.timeline { margin: 22px 0 6px; }
.timeline svg { width: 100%; height: 34px; display: block; }
.tl-line { stroke: var(--track); stroke-width: 3; stroke-linecap: round; }
.tl-iv { fill: var(--accent); }
.tl-tick { stroke: var(--accent); stroke-width: 1.4; }
.tl-end { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.tl-labels { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.ivsum { color: var(--muted); margin: 10px 0 18px; }
.hear {
  border: 0; border-radius: 999px; padding: 14px 24px; cursor: pointer; min-height: 48px;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 28px var(--accent-glow);
}
.note { color: var(--faint); font-size: 14px; margin: 12px 0 0; }

/* ---------------------------------------------------------------- bands */
.band { padding: 12vh 0; border-top: 1px solid var(--line); }
.band-head { max-width: 40em; margin-bottom: 40px; }
.band h2 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.08; }
.band-head p:not(.eyebrow) { color: var(--muted); margin: 18px 0 0; }

.voice-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.voice {
  width: 100%; height: 100%; text-align: left; cursor: pointer; padding: 18px 18px 20px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px;
  transition: transform .25s var(--ease), border-color .25s;
}
.voice:hover { border-color: var(--accent); transform: translateY(-2px); }
.voice:active { transform: scale(.98); }
.v-name { font-family: var(--display); font-size: 21px; }
.v-note { color: var(--muted); font-size: 14px; }
.v-state { color: var(--accent); font-size: 13px; min-height: 1em; }
.voice.tuning { border-color: var(--accent-soft); }

.pattern-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.pattern { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.pattern:hover { border-color: var(--accent); }
.p-play { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; font-size: 14px; }
.pattern.tuning .p-play { opacity: .5; }
.p-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.p-name { font-family: var(--display); font-size: 20px; }
.p-who { color: var(--muted); font-size: 13px; }
.p-row { position: relative; height: 26px; margin: 8px 12px 0 8px; border-bottom: 1px solid var(--line); }
.hit {
  position: absolute; left: calc(var(--x) * 100%); bottom: -6px; transform: translateX(-50%);
  width: calc(8px + var(--v) * 10px); height: calc(8px + var(--v) * 10px); border-radius: 50%;
  background: var(--accent); opacity: calc(.25 + var(--v) * .5); transition: transform .3s var(--ease), opacity .3s;
}
.hit.lit { opacity: 1; transform: translateX(-50%) scale(1.5); box-shadow: 0 0 16px var(--accent-glow); }

.swatches { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin-bottom: 28px; }
.swatch {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; cursor: pointer; width: 100%;
  background: var(--sb, var(--surface)); color: var(--st, var(--text)); border: 2px solid transparent; text-align: left;
}
.swatch[aria-checked="true"] { border-color: var(--accent); }
.chip { display: inline-flex; flex: none; width: 46px; height: 30px; border-radius: 9px; overflow: hidden; background: var(--ss); }
.chip i { flex: 1; }
.chip i:nth-child(1) { background: var(--ss); }
.chip i:nth-child(2) { background: var(--st); }
.chip i:nth-child(3) { background: var(--sa); }
.s-name { font-family: var(--display); font-size: 17px; }
.own { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.own-btn { width: auto; background: var(--surface); color: var(--text); border: 2px dashed var(--line); }
.own-chip { background: conic-gradient(from 0deg, #d9a441, #73c29c, #a3bbff, #d892c4, #d9a441); }
.own-chip i { background: transparent !important; }
.own-pick { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.own-pick[hidden] { display: none; }
.own-pick label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.own-pick input { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.own-pick output { color: var(--muted); font-size: 14px; }
.style-row { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.dial.mini { width: 150px; cursor: default; pointer-events: none; }

.fact-grid { display: grid; gap: 28px 40px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin: 0; }
.fact-grid dt { font-family: var(--display); font-size: 22px; margin-bottom: 6px; }
.fact-grid dd { margin: 0; color: var(--muted); }
.privacy { margin: 48px 0 0; color: var(--muted); max-width: 44em; }

.foot { border-top: 1px solid var(--line); padding: 32px var(--gutter) 48px; color: var(--muted); font-size: 14px; text-align: center; }
.foot a { color: var(--muted); }
.fine { color: var(--faint); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .soon { font-size: 12px; }
  .soon .wide { display: none; }
  .stepper { margin: 12px 0 0; display: flex; }
  .stepper[hidden] { display: none; }
  .band { padding: 9vh 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ripple, :root[data-dial="orb"] .dial .orb { animation: none !important; }
  * { transition: none !important; }
}
