:root {
  --brand-blue: #1554d1;
  --brand-blue-dark: #0d2d68;
  --aqua: #62e2d4;
  --ink: #122033;
  --muted: #66758a;
  --surface: #ffffff;
  --line: #d9e3ef;
  --warm: #e8a84f;
  --recovery: #2a9d8f;
  --focus: #533f92;
  --breath-scale: 0.72;
  --session-progress: 0%;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #f8fbff 0%, #eef8f5 50%, #f7f3ec 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 4px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  width: clamp(112px, 16vw, 170px);
  height: auto;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 4.4rem);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 2.4rem);
}

.state-pill {
  min-width: 96px;
  padding: 10px 14px;
  border: 1px solid rgba(21, 84, 209, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand-blue-dark);
  font-size: 0.9rem;
  font-weight: 760;
  text-align: center;
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  align-items: stretch;
}

.breath-stage,
.control-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 50px rgba(34, 59, 95, 0.1);
}

.breath-stage {
  min-height: 680px;
  padding: clamp(22px, 4vw, 44px);
  display: grid;
  grid-template-rows: auto minmax(330px, 1fr) auto auto auto;
  gap: 22px;
  overflow: hidden;
}

.stage-copy {
  max-width: 620px;
}

.stage-copy p:last-child {
  max-width: 56ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.visual-zone {
  min-height: 330px;
  display: grid;
  place-items: center;
}

.progress-shell {
  width: min(58vw, 380px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--brand-blue) var(--session-progress), rgba(21, 84, 209, 0.12) 0),
    radial-gradient(circle, #ffffff 60%, transparent 61%);
  transition: background 180ms linear;
}

.breath-circle {
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  transform: scale(var(--breath-scale));
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.86), transparent 30%),
    linear-gradient(145deg, var(--aqua), var(--brand-blue) 62%, var(--warm));
  color: #ffffff;
  box-shadow:
    0 24px 70px rgba(21, 84, 209, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  will-change: transform;
}

.breath-circle span {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 760;
}

.breath-circle strong {
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.breath-cue {
  min-height: 34px;
  color: var(--brand-blue-dark);
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  font-weight: 720;
  line-height: 1.35;
  text-align: center;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metrics-row div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.82);
}

.metrics-row span,
.session-result span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metrics-row strong {
  display: block;
  color: var(--ink);
  font-size: clamp(0.98rem, 1.3vw, 1.1rem);
  line-height: 1.25;
}

.session-result {
  padding: 16px 18px;
  border: 1px solid rgba(42, 157, 143, 0.28);
  border-left: 5px solid var(--recovery);
  border-radius: 8px;
  background: rgba(235, 250, 247, 0.95);
}

.session-result strong {
  display: block;
  color: #14554d;
  font-size: 1.05rem;
  line-height: 1.4;
}

.control-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.mode-grid {
  display: grid;
  gap: 10px;
}

.mode-card,
.timer-option,
.primary-action,
.secondary-action {
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.mode-card {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.mode-card span,
.mode-card small {
  display: block;
}

.mode-card span {
  font-weight: 780;
  line-height: 1.25;
}

.mode-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.mode-card:hover,
.timer-option:hover,
.secondary-action:hover {
  transform: translateY(-1px);
  border-color: rgba(21, 84, 209, 0.46);
}

.mode-card.is-selected {
  border-color: var(--brand-blue);
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(21, 84, 209, 0.22);
}

.timer-block {
  display: grid;
  gap: 10px;
}

.timer-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.timer-option {
  min-height: 48px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 780;
}

.timer-option.is-selected {
  border-color: var(--brand-blue);
  background: var(--brand-blue);
  color: #ffffff;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.contact-footer {
  padding: 0 0 18px;
}

.contact-footer address {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: normal;
}

.contact-footer strong {
  color: var(--brand-blue-dark);
}

.contact-footer a {
  color: var(--brand-blue);
  font-weight: 720;
  text-decoration: none;
}

.contact-footer a:hover {
  text-decoration: underline;
}

.primary-action,
.secondary-action {
  min-height: 54px;
  border: 1px solid transparent;
  font-weight: 820;
}

.primary-action {
  background: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(21, 84, 209, 0.25);
}

.primary-action:hover {
  transform: translateY(-1px);
  background: #0f46b7;
}

.secondary-action {
  border-color: var(--line);
  background: #ffffff;
  color: var(--brand-blue-dark);
}

button:focus-visible {
  outline: 3px solid rgba(232, 168, 79, 0.75);
  outline-offset: 3px;
}

@media (max-width: 920px) {
  .practice-layout {
    grid-template-columns: 1fr;
  }

  .breath-stage {
    min-height: auto;
  }

  .control-panel {
    order: -1;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 12px 0;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-logo {
    width: 132px;
  }

  .state-pill {
    align-self: stretch;
  }

  .breath-stage,
  .control-panel {
    padding: 18px;
  }

  .visual-zone {
    min-height: 270px;
  }

  .progress-shell {
    width: min(78vw, 310px);
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .contact-footer address {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
