:root {
  color-scheme: dark;
  --ink: #07110f;
  --surface: #0b1714;
  --surface-2: #10201c;
  --line: rgba(218, 235, 227, 0.16);
  --line-strong: rgba(218, 235, 227, 0.32);
  --text: #e4eee9;
  --muted: #91a49c;
  --signal: #8cddbd;
  --signal-dim: #4d8f78;
  --danger: #efb6a9;
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  background: var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--text);
  overscroll-behavior: none;
}

body {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.app {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 480px);
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(var(--line), var(--line)) 24px 0 / 1px 100% no-repeat,
    linear-gradient(var(--line), var(--line)) calc(100% - 24px) 0 / 1px 100% no-repeat,
    var(--ink);
}

.desktop-note { display: none; }

.topbar {
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(52px + var(--safe-top));
  padding: var(--safe-top) 24px 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-decoration: none;
}

.wordmark-mark {
  display: inline-block;
  width: 16px;
  height: 10px;
  border-top: 1px solid var(--signal);
  border-bottom: 1px solid var(--signal);
  transform: skewY(-22deg);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.language-control select {
  min-width: 64px;
  height: 36px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
}

.language-control option { background: var(--surface); color: var(--text); }

.panel {
  position: relative;
  z-index: 2;
  grid-row: 2;
  display: flex;
  min-height: 0;
  padding: 28px 24px 22px;
}

.hidden { display: none !important; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--signal);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .19em;
  line-height: 1.4;
}

h1, h2, p { margin-top: 0; }

h1, h2 {
  margin-bottom: 18px;
  font-weight: 520;
  letter-spacing: -.055em;
  line-height: .98;
}

h1 { font-size: clamp(52px, 15.5vw, 72px); }
h2 { font-size: clamp(39px, 11.5vw, 54px); }

.lede {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.start-panel {
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  overflow-y: auto;
}

.placement {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  min-height: 116px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.placement strong, .placement span {
  display: block;
}

.placement strong {
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 650;
}

.placement div > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.placement-graphic {
  position: relative;
  height: 86px;
}

.causal-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.causal-steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.causal-steps b {
  color: var(--signal);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.causal-steps strong {
  margin-right: 5px;
  color: var(--text);
  font-weight: 650;
}

.body-line {
  position: absolute;
  left: 5px;
  top: 54px;
  width: 75px;
  height: 1px;
  background: var(--line-strong);
}

.body-line::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-bottom: 0;
  border-radius: 70% 0 0 0;
}

.phone-shape {
  position: absolute;
  left: 37px;
  top: 27px;
  width: 35px;
  height: 24px;
  border: 1px solid var(--signal-dim);
  border-radius: 4px;
  transform: rotate(-5deg);
}

.phone-shape i {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 3px;
  height: 3px;
  border: 1px solid var(--signal-dim);
  border-radius: 50%;
}

.signal-line {
  position: absolute;
  left: 51px;
  width: 1px;
  background: var(--signal-dim);
  opacity: .75;
}

.signal-line-a { top: 13px; height: 10px; }
.signal-line-b { top: 4px; height: 5px; opacity: .4; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--signal);
  border-radius: 0;
  background: var(--signal);
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button:active { background: #afe9d3; }

.primary-button:focus-visible,
.text-button:focus-visible,
.wordmark:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.start-actions p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.text-button {
  min-width: 48px;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.session-panel {
  flex-direction: column;
  padding-top: 18px;
}

.session-copy h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 9vw, 42px);
}

.session-copy > p:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.phase-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 1px 0 0;
  padding: 6px 9px;
  border: 1px solid rgba(140, 221, 189, .28);
  color: var(--text) !important;
  font-size: 11px !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.35 !important;
}

.instrument {
  position: relative;
  flex: 1;
  min-height: 230px;
  margin: 10px -24px 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

#breath-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pitch-axis {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 156px;
  transform: translate(-50%, -50%);
}

.pitch-axis > i {
  position: absolute;
  left: 50%;
  top: 19px;
  bottom: 19px;
  width: 1px;
  background: var(--line-strong);
}

#pitch-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 14px rgba(140, 221, 189, .5);
  transform: translate(-50%, -50%);
  transition: top 90ms linear;
}

.pitch-high,
.pitch-low {
  position: absolute;
  left: 50%;
  color: #50675e;
  font-size: 8px;
  letter-spacing: .14em;
  transform: translateX(-50%);
}

.pitch-high { top: 0; }
.pitch-low { bottom: 0; }

.measurements {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 15px 0 13px;
}

.measurements > div { border-right: 1px solid var(--line); padding-left: 12px; }
.measurements > div:first-child { padding-left: 0; }
.measurements > div:last-child { border-right: 0; }
.measurements span, .measurements small { color: var(--muted); font-size: 9px; }
.measurements span { display: block; margin-bottom: 4px; letter-spacing: .12em; }
.measurements strong { margin-right: 3px; font-size: 20px; font-weight: 560; font-variant-numeric: tabular-nums; }
.measurements > div:last-child strong { font-size: 13px; }

.message-panel, .result-panel {
  flex-direction: column;
  justify-content: center;
}

.message-panel p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.message-panel .primary-button, .result-panel .primary-button { margin-top: 36px; }
.result-rule { height: 1px; margin: 16px 0 26px; background: var(--line-strong); }
.result-summary { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.result-grid > div {
  min-height: 90px;
  padding: 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-grid dt { color: var(--muted); font-size: 10px; }
.result-grid dd { margin: 12px 0 0; font-size: 19px; font-variant-numeric: tabular-nums; }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: calc(38px + var(--safe-bottom));
  padding: 0 24px var(--safe-bottom);
  color: #597067;
  font-size: 9px;
  letter-spacing: .06em;
}

@media (min-width: 720px) {
  body { background: #030706; }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .desktop-note {
    position: fixed;
    left: 24px;
    bottom: 22px;
    display: block;
    color: #50625b;
    font-size: 10px;
    letter-spacing: .08em;
  }
}

@media (max-height: 690px) {
  .panel { padding-top: 12px; padding-bottom: 12px; }
  h1 { font-size: 48px; }
  .start-panel { gap: 10px; }
  .lede { font-size: 13px; line-height: 1.5; }
  .placement { min-height: 80px; }
  .placement-graphic { height: 72px; }
  .causal-steps li { min-height: 31px; }
  .instrument { min-height: 190px; }
  .footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  #pitch-dot { transition: none; }
}
