:root {
  --bg: #eef7f8;
  --surface: #ffffff;
  --ink: #152a2f;
  --muted: #607982;
  --line: rgba(78, 129, 143, 0.16);
  --primary: #2aa889;
  --primary-dark: #176f67;
  --blue: #497fa3;
  --blue-soft: #e4f1f6;
  --mint: #d8f4ec;
  --danger: #7c2d32;
  --shadow: 0 18px 44px rgba(34, 83, 94, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(73, 127, 163, 0.18), transparent 34rem),
    radial-gradient(circle at 86% 8%, rgba(42, 168, 137, 0.18), transparent 30rem),
    linear-gradient(180deg, #f9fdfd 0%, var(--bg) 48%, #e8f7f2 100%);
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  color: inherit;
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(42, 168, 137, 0.3);
  outline-offset: 3px;
}

.hero {
  max-width: 1220px;
  min-height: 560px;
  margin: 0 auto;
  padding: 78px 20px 42px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 32px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.5rem, 5.8vw, 5.35rem);
  line-height: 0.98;
}

.hero p,
.state-panel p,
.tool-card p,
.footer p {
  color: var(--muted);
}

.hero > div > p:not(.eyebrow) {
  max-width: 680px;
  font-size: 1.1rem;
}

.state-panel,
.tool-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.state-panel {
  padding: 26px;
}

.state-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.mode-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.mode-button:hover,
.button:hover {
  transform: translateY(-2px);
}

.mode-button.active {
  background: var(--primary);
  color: #fff;
}

.tool-board {
  max-width: 1220px;
  margin: 0 auto;
  padding: 34px 20px 76px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  min-height: 360px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.tool-card.dimmed {
  opacity: 0.58;
}

.tool-card:not(.dimmed) {
  border-color: rgba(42, 168, 137, 0.28);
}

.tool-card:hover {
  transform: translateY(-2px);
}

.tool-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.tool-heading span {
  color: var(--blue);
  font-weight: 900;
}

.tool-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: auto;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.secondary {
  background: var(--blue-soft);
  color: var(--blue);
}

.light {
  background: #fff;
  color: var(--primary-dark);
}

.orb-stage,
.focus-stage {
  flex: 1;
  display: grid;
  place-items: center;
}

.breath-orb,
.focus-ring {
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.94) 0 35%, rgba(216, 244, 236, 0.9) 36% 62%, rgba(73, 127, 163, 0.18) 63% 100%);
  color: var(--primary-dark);
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 18px 44px rgba(34, 83, 94, 0.16);
  transition: transform 3s ease, background 300ms ease;
}

.breath-orb.expand {
  transform: scale(1.14);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue-soft);
}

.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  transition: width 220ms ease;
}

.color-wash {
  min-height: 160px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d8f4ec, #e4f1f6);
  border: 1px solid var(--line);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.focus-ring {
  background:
    conic-gradient(var(--primary) var(--focus-progress, 0%), var(--blue-soft) 0),
    #fff;
}

.focus-ring span {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-size: 2.5rem;
}

.tap-pad {
  min-height: 190px;
  margin-top: auto;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at center, rgba(42, 168, 137, 0.22), transparent 44%),
    linear-gradient(135deg, var(--mint), var(--blue-soft));
  color: var(--primary-dark);
  cursor: pointer;
}

.tap-pad span {
  font-size: 3.8rem;
  font-weight: 900;
}

.tap-pad small {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.key-hints {
  display: flex;
  gap: 8px;
}

.key-hints kbd {
  min-width: 38px;
  padding: 6px 10px;
  border: 1px solid rgba(73, 127, 163, 0.2);
  border-bottom-width: 3px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}

.key-hints kbd.active {
  transform: translateY(2px);
  background: var(--primary);
  color: #fff;
}

.tap-pad.pulse {
  animation: tapPulse 260ms ease;
}

@keyframes tapPulse {
  50% {
    transform: scale(0.97);
  }
}

.safety-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 70px max(20px, calc((100vw - 1220px) / 2 + 20px));
  background: var(--primary-dark);
  color: #fff;
}

.safety-note > div {
  max-width: 760px;
}

.safety-note .eyebrow,
.safety-note p {
  color: #d9f2ec;
}

.safety-note h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
}

.footer {
  padding: 28px 20px;
  text-align: center;
  background: #e7f4f6;
}

@media (max-width: 940px) {
  .hero,
  .tool-board {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 58px;
  }

  .safety-note {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: 2.35rem;
  }

  .mode-tabs {
    grid-template-columns: 1fr;
  }

  .breath-orb,
  .focus-ring {
    width: 160px;
    height: 160px;
  }
}
