@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #f3f6ef;
  --paper-deep: #e9eee4;
  --ink: #1d302a;
  --muted: #59665e;
  --line: #cbd5cb;
  --green: #17483d;
  --green-dark: #10382f;
  --mint: #c4e3d3;
  --lime: #d4e977;
  --coral: #e77963;
  --sky: #b8d8d7;
  --white: #fffefa;
  --display-font: Georgia, "Times New Roman", serif;
  --body-font: "Aptos", "Trebuchet MS", sans-serif;
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(135deg, transparent 0 42px, rgba(37, 94, 80, .025) 42px 43px);
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
[hidden] { display: none !important; }

.site-header {
  width: min(1240px, calc(100% - 64px));
  min-height: 86px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; color: var(--ink); text-decoration: none; font-size: 19px; font-weight: 700; }
.brand-mark { width: 26px; height: 26px; display: inline-grid; place-items: center; font-size: 21px; line-height: 1; }
.main-nav { display: flex; align-items: stretch; height: 86px; gap: 34px; }
.nav-tab { position: relative; border: 0; padding: 0 2px; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.nav-tab::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: transparent; }
.nav-tab.is-active { color: var(--ink); font-weight: 700; }
.nav-tab.is-active::after { background: var(--green); }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; border-radius: 50%; background: var(--paper-deep); color: var(--green); font-size: 11px; }
.privacy-note { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.privacy-dot, .state-indicator { width: 8px; height: 8px; border-radius: 50%; background: #609877; }

.app-shell { width: min(1120px, calc(100% - 64px)); min-height: calc(100vh - 160px); margin: 0 auto; }
.page-view { padding: 58px 0 36px; }
.session-intro, .progress-intro { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: var(--display-font); font-size: 52px; line-height: 1.06; font-weight: 400; letter-spacing: 0; }
.session-intro h1, .progress-intro h1 { font-size: 36px; }

.session-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); gap: 88px; align-items: center; }
.breathing-column { min-width: 0; }
.session-state { display: flex; align-items: center; gap: 9px; margin: 0 0 13px 12px; color: var(--muted); font-size: 12px; }
.state-indicator { background: #9eaa9d; transition: background .25s ease; }
.session-state.is-running .state-indicator { background: var(--coral); animation: pulse-dot 1.8s ease-in-out infinite; }
.session-state.is-paused .state-indicator { background: #d29b4f; }

.breath-stage { position: relative; width: min(100%, 470px); aspect-ratio: 1; display: grid; place-items: center; margin: 0 auto; isolation: isolate; }
.breath-orbit { position: absolute; border-radius: 50%; pointer-events: none; }
.orbit-one { inset: 4%; border: 1px solid rgba(37, 94, 80, .15); }
.orbit-two { inset: 10%; border: 1px dashed rgba(37, 94, 80, .2); transform: rotate(17deg); }
.orbit-three { inset: 17%; border: 1px solid rgba(37, 94, 80, .12); }
.breath-core {
  width: 61%; aspect-ratio: 1; border-radius: 50%; position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  isolation: isolate;
}
.breath-core::before {
  position: absolute; z-index: -1; inset: 0; border-radius: inherit; content: "";
  transform: scale(.91); transition: transform 5000ms cubic-bezier(.33, .06, .25, 1);
  background: radial-gradient(circle at 36% 30%, #e6f1d0 0, #cde5c9 46%, #b8dbcf 100%);
  box-shadow: 0 24px 72px rgba(45, 105, 79, .12), inset 0 0 0 1px rgba(255, 255, 255, .48);
  will-change: transform;
}
.breath-stage[data-phase="inhale"] .breath-core::before { transform: scale(1.08); background: radial-gradient(circle at 36% 30%, #e7f2cd 0, #c6e3c1 50%, #b1d9cb 100%); }
.breath-stage[data-phase="exhale"] .breath-core::before { transform: scale(.91); background: radial-gradient(circle at 36% 30%, #e4efd4 0, #c8e2cf 52%, #b3d8d5 100%); }
.breath-stage.is-paused .breath-core::before { transition-duration: 0ms !important; }
.phase-label { min-height: 31px; margin-top: 13px; color: var(--ink); font-family: var(--display-font); font-size: 22px; }
.phase-count { margin-top: 5px; color: var(--green-dark); font-family: var(--display-font); font-size: 58px; line-height: .95; font-variant-numeric: tabular-nums; }
.phase-unit { margin-top: 7px; color: var(--muted); font-size: 11px; }
.breath-stage[data-phase="idle"] .phase-unit { display: none; }
.orbit-caption { position: absolute; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--paper); border-radius: 50%; background: var(--green); color: var(--white); font-size: 10px; font-weight: 700; box-shadow: 0 2px 8px rgba(16, 56, 47, .2); }
.caption-top { top: 12%; left: 50%; transform: translateX(-50%); }
.caption-bottom { bottom: 12%; left: 50%; transform: translateX(-50%); background: var(--green-dark); color: var(--white); }

.breath-footer { display: flex; justify-content: space-between; align-items: center; margin: 10px 11px 13px; gap: 12px; }
.phase-instruction { color: var(--muted); font-size: 12px; }
.session-clock { color: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.session-clock span { color: var(--muted); font-weight: 400; }
.progress-track { width: calc(100% - 22px); height: 3px; margin: 0 11px; overflow: hidden; background: #dfe6dc; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--coral); transition: width .12s linear; }

.session-controls { padding: 16px 0 12px; }
.controls-heading { margin-bottom: 26px; }
h2 { margin-bottom: 0; font-family: var(--display-font); font-size: 26px; line-height: 1.2; font-weight: 400; }
.duration-fieldset { min-width: 0; margin: 0 0 22px; padding: 0; border: 0; }
.duration-options { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); background: rgba(255, 254, 250, .54); }
.duration-option { position: relative; cursor: pointer; }
.duration-option + .duration-option { border-left: 1px solid var(--line); }
.duration-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.duration-option span { min-height: 63px; display: flex; justify-content: center; align-items: baseline; gap: 3px; padding: 19px 6px; color: var(--muted); font-size: 17px; transition: color .2s, background .2s; }
.duration-option small { font-size: 10px; }
.duration-option input:checked + span { background: var(--green); color: var(--white); }
.duration-option input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: -3px; }
.duration-option:not(:has(input:checked)):hover span { background: #e9eee4; color: var(--ink); }
.session-actions { display: grid; gap: 8px; }
.breath-action { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; padding: 16px; border: 0; border-radius: 50%; background: transparent; color: var(--green-dark); cursor: pointer; font-size: 13px; font-weight: 700; }
.breath-action:hover { background: rgba(255, 254, 250, .25); }
.breath-action .button-symbol { font-size: 21px; }
.breath-stage.is-paused .phase-label, .breath-stage.is-paused .phase-count, .breath-stage.is-paused .phase-unit { visibility: hidden; }
.button { min-height: 54px; border: 0; cursor: pointer; transition: background .18s ease, transform .18s ease, opacity .18s ease; }
.button:active { transform: translateY(1px); }
.button-primary { display: flex; align-items: center; justify-content: center; gap: 11px; padding: 0 20px; background: var(--green); color: var(--white); font-size: 14px; font-weight: 700; }
.button-primary:hover { background: var(--green-dark); }
.button-symbol { font-size: 12px; }
.button-quiet { min-height: 37px; padding: 5px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; text-decoration-color: #b3beb4; text-underline-offset: 3px; }
.button-quiet:hover, .text-button:hover { color: var(--coral); }
.session-message { display: block; min-height: 20px; margin: 10px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.sound-settings { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sound-settings summary { display: flex; align-items: center; gap: 10px; min-height: 53px; cursor: pointer; list-style: none; color: var(--ink); font-size: 12px; font-weight: 700; }
.sound-settings summary::-webkit-details-marker { display: none; }
.settings-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #e3ebe0; color: var(--green); font-size: 14px; }
.summary-chevron { margin-left: auto; color: var(--green); font-size: 20px; font-weight: 400; transition: transform .2s ease; }
.sound-settings[open] .summary-chevron { transform: rotate(45deg); }
.settings-content { padding: 0 0 14px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 50px; border-top: 1px solid rgba(213, 222, 212, .7); cursor: pointer; }
.setting-copy { display: grid; gap: 4px; }
.setting-copy strong { font-size: 11px; font-weight: 600; }
.setting-copy small { color: var(--muted); font-size: 10px; }
.switch { position: relative; flex: 0 0 auto; width: 37px; height: 21px; margin: 0; appearance: none; border-radius: 12px; background: #c8d0c7; cursor: pointer; transition: background .18s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(29, 48, 42, .18); transition: transform .18s ease; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(16px); }
.volume-row { display: grid; grid-template-columns: 1fr 90px 39px; align-items: center; gap: 10px; min-height: 42px; border-top: 1px solid rgba(213, 222, 212, .7); color: var(--muted); font-size: 10px; }
.volume-row input { width: 100%; accent-color: var(--green); }
.volume-row output { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.wake-status { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.gentle-note { display: flex; align-items: center; gap: 9px; margin: 39px 0 0; color: var(--muted); font-size: 11px; }
.gentle-note span { color: var(--coral); font-size: 15px; }

.progress-intro { margin-bottom: 42px; }
.summary-strip { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-stat { min-height: 143px; display: flex; flex-direction: column; justify-content: center; padding: 22px 25px; border-left: 1px solid var(--line); }
.summary-stat:first-child { border-left: 0; padding-left: 0; }
.summary-stat-primary strong { color: var(--green); }
.stat-label { color: var(--muted); font-size: 11px; }
.summary-stat strong { margin-top: 8px; font-family: var(--display-font); font-size: 39px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-unit { margin-top: 7px; color: var(--muted); font-size: 10px; }
.trophy-section, .history-section { padding-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.trophy-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trophy-item { min-height: 112px; display: flex; align-items: center; gap: 12px; padding: 17px 12px; border-left: 1px solid var(--line); }
.trophy-item:first-child { border-left: 0; padding-left: 0; }
.trophy-medal { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border: 1px solid #c6d2c6; border-radius: 50%; color: #9aa89b; font-family: var(--display-font); font-size: 15px; }
.trophy-item.is-earned .trophy-medal { border-color: var(--coral); background: var(--coral); color: var(--white); }
.trophy-copy { display: grid; gap: 5px; }
.trophy-copy strong { font-size: 11px; font-weight: 700; }
.trophy-copy span { color: var(--muted); font-size: 10px; }
.trophy-item:not(.is-earned) .trophy-copy strong { color: var(--muted); }
.history-heading { margin-bottom: 14px; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.history-list { border-top: 1px solid var(--line); }
.history-row { min-height: 65px; display: grid; grid-template-columns: minmax(145px, 1.2fr) minmax(100px, .8fr) minmax(100px, .8fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.history-date { color: var(--ink); font-size: 12px; }
.history-duration { font-family: var(--display-font); font-size: 19px; }
.history-status { color: #4f8064; font-size: 10px; }
.history-status.is-abandoned { color: #b76650; }
.history-cycle { color: var(--muted); font-size: 10px; text-align: right; }
.empty-history { padding: 25px 0; color: var(--muted); font-size: 12px; }
.return-button { width: fit-content; min-width: 210px; margin-top: 34px; }

.site-footer { width: min(1240px, calc(100% - 64px)); min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 5; max-width: min(370px, calc(100vw - 48px)); padding: 14px 19px; background: var(--ink); color: var(--white); font-size: 12px; line-height: 1.5; box-shadow: 0 10px 35px rgba(29, 48, 42, .17); animation: toast-in .25s ease-out; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes pulse-dot { 50% { box-shadow: 0 0 0 5px rgba(231, 121, 99, .13); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .session-layout { grid-template-columns: minmax(0, 1fr) minmax(290px, .85fr); gap: 38px; }
  .breath-stage { width: min(100%, 410px); }
  .summary-stat { padding-right: 15px; padding-left: 15px; }
  .trophy-item { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 680px) {
  .site-header { width: calc(100% - 36px); min-height: 70px; grid-template-columns: 1fr auto; }
  .brand { font-size: 17px; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; height: 45px; justify-content: center; gap: 38px; border-top: 1px solid var(--line); }
  .nav-tab { font-size: 12px; }
  .privacy-note { align-self: center; font-size: 10px; }
  .app-shell { width: calc(100% - 36px); min-height: calc(100vh - 180px); }
  .page-view { padding-top: 37px; }
  .session-intro, .progress-intro { align-items: flex-start; flex-direction: column; gap: 0; margin-bottom: 18px; }
  h1 { font-size: 39px; line-height: 1.08; }
  .session-intro h1, .progress-intro h1 { font-size: 30px; }
  .session-layout { grid-template-columns: 1fr; gap: 13px; }
  .breath-stage { width: min(100%, 410px); }
  .session-state { margin-left: 4px; }
  .breath-footer { margin-right: 4px; margin-left: 4px; }
  .progress-track { width: calc(100% - 8px); margin-right: 4px; margin-left: 4px; }
  .session-controls { padding-top: 17px; }
  .controls-heading { margin-bottom: 17px; }
  .controls-heading h2 { font-size: 23px; }
  .gentle-note { align-items: flex-start; margin-top: 25px; line-height: 1.5; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-stat { min-height: 112px; padding: 16px 13px; border-top: 1px solid var(--line); }
  .summary-stat:nth-child(odd) { border-left: 0; }
  .summary-stat:first-child, .summary-stat:nth-child(2) { border-top: 0; }
  .summary-stat:first-child { padding-left: 0; }
  .summary-stat strong { font-size: 34px; }
  .trophy-section, .history-section { padding-top: 32px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-heading h2 { font-size: 23px; }
  .trophy-list { grid-template-columns: 1fr; }
  .trophy-item { min-height: 73px; flex-direction: row; align-items: center; padding: 10px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .trophy-item:last-child { border-bottom: 0; }
  .trophy-item:first-child { padding-left: 0; }
  .trophy-copy { grid-template-columns: 1fr auto; align-items: baseline; width: 100%; }
  .history-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; }
  .history-date { grid-column: 1; }
  .history-duration { grid-column: 2; grid-row: 1 / span 2; text-align: right; }
  .history-status { grid-column: 1; }
  .history-cycle { grid-column: 2; grid-row: 3; min-height: 12px; }
  .history-row:has(.history-cycle) { grid-template-rows: auto auto auto; }
  .return-button { margin-top: 25px; }
  .site-footer { width: calc(100% - 36px); min-height: 64px; font-size: 9px; }
}

@media (max-width: 390px) {
  h1 { font-size: 35px; }
  .session-intro h1, .progress-intro h1 { font-size: 28px; }
  .breath-stage { width: 100%; }
  .phase-count { font-size: 51px; }
  .phase-label { font-size: 19px; }
  .session-layout { gap: 3px; }
  .privacy-note { gap: 5px; font-size: 9px; }
  .duration-option span { min-height: 56px; padding: 16px 4px; font-size: 16px; }
  .volume-row { grid-template-columns: 1fr 76px 35px; }
}

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