/* asipkina.com — shared styles
   World: the interval timer of a follow-along workout. Flat colour fields, hard edges,
   heavy uppercase numerals. Font: Onest (SIL OFL 1.1), self-hosted. */

@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/onest-cyrillic-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/onest-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/onest-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/onest-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* fields */
  --chalk: #e8eaec;   --chalk-2: #dadde1;  --chalk-3: #f4f5f6;
  --cobalt: #1d45d8;  --cobalt-2: #2a52e4; --cobalt-3: #163bbd;
  --black: #0f1012;   --black-2: #1d1f23;
  --yellow: #f7d117;  --yellow-2: #fbe36b; --yellow-3: #e2bc00;
  --cyan: #a6e4f0;    --cyan-2: #c9eff7;   --cyan-3: #ecfafd;
  --ink: #0f1012;
  --paper: #f4f6f8;   /* text on cobalt and black */
  --soft-cobalt: #c5d0fa;
  --soft-black: #b8bcc3;
  --soft-chalk: #474c54;

  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step-small: 0.875rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.2rem + 5vw, 5.5rem);
  --step-display: clamp(3.5rem, 1rem + 9vw, 8.5rem);

  --m: clamp(16px, 2.5vw, 32px);           /* page margin, both sides */
  --gap: clamp(120px, 12vw, 200px);        /* between big things */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--chalk);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.f-yellow :focus-visible, .f-cyan :focus-visible, .f-chalk :focus-visible { outline-color: var(--cobalt); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- display type ---------- */
.display, .head {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: .88;
  text-wrap: balance;
}
.display { font-size: var(--step-display); }
.head { font-size: var(--step-head); }
.lead { font-size: var(--step-lead); line-height: 1.3; }
.small { font-size: var(--step-small); line-height: 1.45; }

/* ---------- fields ---------- */
.f-chalk  { background: var(--chalk);  color: var(--ink); }
.f-cobalt { background: var(--cobalt); color: var(--paper); }
.f-black  { background: var(--black);  color: var(--paper); }
.f-yellow { background: var(--yellow); color: var(--ink); }
.f-cyan   { background: var(--cyan);   color: var(--ink); }

/* ---------- buttons: square, filled, one shape ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 24px;
  border: 0; border-radius: 0;
  background: var(--yellow); color: var(--ink);
  font-weight: 700; font-size: var(--step-body); line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease-out);
}
.btn:hover { background: var(--yellow-2); text-decoration: none; }
.btn:active { transform: translateY(2px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.f-yellow .btn, .btn--ink { background: var(--ink); color: var(--paper); }
.f-yellow .btn:hover, .btn--ink:hover { background: var(--black-2); color: var(--paper); }
.btn--quiet { background: var(--chalk-2); color: var(--ink); }
.btn--quiet:hover { background: var(--chalk-3); }
.f-black .btn--quiet { background: var(--black-2); color: var(--paper); }
.f-black .btn--quiet:hover { background: #2a2d33; }
.f-cobalt .btn--quiet { background: var(--cobalt-3); color: var(--paper); }
.f-cobalt .btn--quiet:hover { background: var(--cobalt-2); }

.icon {
  width: 22px; height: 22px; flex: none; background-color: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat;
}
.icon-youtube { --src: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E"); }
.icon-tiktok { --src: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z'/%3E%3C/svg%3E"); }
.icon-instagram { --src: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077'/%3E%3C/svg%3E"); }

/* ---------- top bar: ink wordmark block, yellow tab, action at right ---------- */
.bar {
  display: grid;
  grid-template-columns: auto minmax(0, 42%) 1fr auto;
  align-items: stretch;
  min-height: 56px;
  background: var(--chalk);
  position: relative; z-index: 5;
}
.bar__mark {
  display: flex; align-items: center; padding: 0 var(--m);
  background: var(--ink); color: var(--paper);
  font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; font-size: var(--step-body);
  text-decoration: none; white-space: nowrap;
}
.bar__tab {
  display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px);
  padding: 0 clamp(16px, 2vw, 28px);
  background: var(--yellow);
}
.bar__tab a { font-weight: 700; text-decoration: none; font-size: var(--step-body); white-space: nowrap; }
.bar__tab a:hover { text-decoration: underline; }
.bar__social { grid-column: 4; display: flex; }
.bar__icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; min-height: 56px; background: var(--chalk-2); color: var(--ink); transition: background-color .15s; }
.bar__icon:hover { background: var(--ink); color: var(--paper); }
.bar__icon .icon { width: 20px; height: 20px; }
.bar .btn { min-height: 56px; background: var(--cobalt); color: var(--paper); }
.bar .btn:hover { background: var(--cobalt-2); }

@media (max-width: 720px) {
  .bar { grid-template-columns: auto 1fr auto; }
  .bar__tab { grid-column: 1 / -1; grid-row: 2; min-height: 48px; padding: 0 var(--m); overflow-x: auto; }
  .bar__social { grid-column: 3; }
  .bar__icon { width: 48px; }
  .bar .btn { padding: 0 16px; }
  .bar .btn span:not(.icon) { display: none; }
}

/* ---------- small footer for tool pages ---------- */
.foot {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px;
  padding: clamp(56px, 8vw, 96px) var(--m) 32px;
}
.foot__handle { font-size: clamp(3rem, 1rem + 10vw, 9rem); font-weight: 900; letter-spacing: -0.05em; line-height: .85; text-decoration: none; }
.foot__handle:hover { text-decoration: none; color: var(--black-2); }
.foot__links { display: flex; gap: 20px; flex-wrap: wrap; font-weight: 700; }

/* =========================================================
   Tool pages (calculator, 1RM, box breathing)
   ========================================================= */

.tool-head {
  padding: clamp(48px, 7vw, 96px) var(--m) clamp(56px, 7vw, 104px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 32px; align-items: start;
}
.tool-head .title {
  grid-column: 1; max-width: 16ch;
  font-size: var(--step-head); font-weight: 900; text-transform: uppercase;
  letter-spacing: -0.04em; line-height: .9; text-wrap: balance; hyphens: manual;
}
.tool-head .subtitle { grid-column: 1; max-width: 40ch; font-size: var(--step-lead); line-height: 1.3; color: var(--soft-cobalt); }
.tool-head .lang-switcher { grid-column: 2; grid-row: 1; display: flex; gap: 8px; }
.lang-switcher a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  background: var(--cobalt-3); color: var(--paper); font-weight: 700; font-size: 1rem; text-decoration: none;
}
.lang-switcher a:hover { background: var(--cobalt-2); }
@media (max-width: 640px) {
  .tool-head { grid-template-columns: 1fr; }
  .tool-head .lang-switcher { grid-column: 1; grid-row: auto; order: -1; }
}

.tool-body { padding: clamp(56px, 7vw, 104px) var(--m); }
.tool-body > * { max-width: 1440px; }

.section-title {
  font-size: var(--step-lead); font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; line-height: 1.1;
  margin-bottom: 28px;
}

/* form */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.form-group {
  display: grid; align-content: start; gap: 10px;
  background: var(--chalk-2); padding: 18px 18px 18px;
}
.form-group > label, .setting-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-weight: 700; font-size: 1rem; line-height: 1.3; }
.label-hint { font-weight: 400; color: var(--soft-chalk); }
.form-group input[type="number"], .form-group select {
  width: 100%; min-height: 52px; padding: 0 14px;
  background: var(--chalk-3); border: 0; border-radius: 0;
  font-size: var(--step-lead); font-weight: 700;
  appearance: none; -webkit-appearance: none; -moz-appearance: textfield;
}
.form-group input::-webkit-outer-spin-button, .form-group input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-group select {
  font-size: var(--step-body); padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M0 0h12L6 8z' fill='%230f1012'/%3E%3C/svg%3E");
  background-position: calc(100% - 18px) 50%;
  background-size: 12px 8px; background-repeat: no-repeat;
}
.form-group select:disabled { color: var(--soft-chalk); cursor: not-allowed; }
.form-group input:focus-visible, .form-group select:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 0; background-color: #fff; }
.form-group input::placeholder { color: #5f6570; }

/* radios as a segmented block */
.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.radio-option { position: relative; }
.radio-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.radio-option label {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 6px 10px; background: var(--chalk-3);
  font-weight: 700; font-size: 1rem; line-height: 1.2; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.radio-option input:checked + label { background: var(--ink); color: var(--paper); }
.radio-option input:focus-visible + label { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.radio-option:hover input:not(:checked) + label { background: #fff; }

.calculate-btn { margin-top: 12px; width: 100%; min-height: 64px; font-size: var(--step-lead); }

/* tabs (1RM) */
.exercise-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; }
.tab-button {
  min-height: 60px; padding: 8px 12px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--chalk-2); font-weight: 700; font-size: 1rem; line-height: 1.2;
  transition: background-color .15s, color .15s;
}
.tab-button:hover { background: var(--chalk-3); }
.tab-button.active { background: var(--cobalt); color: var(--paper); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: rise-in .35s var(--ease-out) both; }

/* results: black field, timer numerals */
.results { display: none; padding: clamp(56px, 7vw, 104px) var(--m); }
.results.show { display: block; }
.results > * { max-width: 1440px; }
.results .section-title { color: var(--paper); }
.results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.results .result-highlight { grid-column: 1 / -1; }
@media (max-width: 860px) { .results-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .results-grid { grid-template-columns: 1fr; } }
.result-item { background: var(--black-2); padding: 20px; display: grid; gap: 10px; align-content: space-between; min-height: 132px; }
.result-label { font-size: 1rem; line-height: 1.35; color: var(--soft-black); }
.result-item .result-value { font-size: var(--step-lead); font-weight: 900; letter-spacing: -0.02em; }
.result-highlight {
  grid-column: 1 / -1; background: var(--yellow); color: var(--ink);
  padding: clamp(20px, 3vw, 36px); display: grid; gap: 8px;
}
.result-highlight .result-label { color: var(--ink); font-weight: 700; font-size: var(--step-body); }
.result-highlight .result-value { font-size: var(--step-display); font-weight: 900; letter-spacing: -0.05em; line-height: .85; }
.result-unit { font-size: var(--step-lead); font-weight: 900; margin-left: 10px; }
.results.show .result-highlight .result-value { animation: rise-in .6s var(--ease-out) both; }

.percentage-table { margin-top: 40px; }
.percentage-table h3 { font-size: var(--step-lead); font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; margin-bottom: 16px; }
.percentage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.percentage-item { background: var(--black-2); padding: 16px; display: grid; gap: 4px; }
.percentage-label { color: var(--soft-black); font-size: 1rem; }
.percentage-value { font-size: var(--step-lead); font-weight: 900; }

/* reading block */
.info-section { padding: clamp(56px, 7vw, 104px) var(--m); }
.info-section { columns: 2 380px; column-gap: clamp(32px, 5vw, 80px); }
.info-section > * { break-inside: avoid; }
.info-section h2, .info-section h3 { break-after: avoid; }
.info-section h2, .info-section h3 { font-size: var(--step-lead); font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; line-height: 1.15; margin: 48px 0 14px; }
.info-section h2:first-child, .info-section h3:first-child { margin-top: 0; }
.info-section p { margin-bottom: 14px; }
.info-section ul { margin: 0 0 18px; padding-left: 1.2em; }
.info-section li { margin-bottom: 8px; padding-left: 4px; }
.info-section li::marker { color: var(--cobalt); font-weight: 900; }
.formula-box {
  background: var(--chalk-2); padding: 20px 22px; margin: 6px 0 18px;
  font-weight: 900; font-size: var(--step-lead); letter-spacing: -0.01em;
}
.f-cyan .formula-box { background: var(--cyan-2); }

/* =========================================================
   Box breathing: the stage changes colour with each phase
   ========================================================= */
.breathing-container { padding: 0; }
.stage {
  --track: rgba(15, 16, 18, .16);
  --mark: var(--ink);
  display: grid; justify-items: center; align-content: center; gap: clamp(16px, 3vh, 28px);
  min-height: min(92svh, 860px);
  padding: clamp(40px, 6vw, 72px) var(--m);
  background: var(--chalk-2); color: var(--ink);
  text-align: center;
  transition: background-color .6s var(--ease-out), color .6s var(--ease-out);
}
.stage[data-phase="ready"]       { background: var(--yellow); }
.stage[data-phase="inhale"]      { background: var(--cobalt); color: var(--paper); --track: rgba(244,246,248,.22); --mark: var(--yellow); }
.stage[data-phase="hold-inhale"],
.stage[data-phase="hold-exhale"] { background: var(--black);  color: var(--paper); --track: rgba(244,246,248,.18); --mark: var(--yellow); }
.stage[data-phase="exhale"]      { background: var(--cyan); }

.breath-text { font-size: var(--step-head); font-weight: 900; text-transform: uppercase; letter-spacing: -0.04em; line-height: .9; min-height: .9em; }
.cycle-text { font-size: var(--step-lead); font-weight: 700; min-height: 1.3em; }

.breathing-box-container { width: min(72vw, 52svh, 420px); aspect-ratio: 1; }
.breathing-box { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.timer-text { font-size: clamp(5rem, 2rem + 14vw, 11rem); font-weight: 900; letter-spacing: -0.05em; line-height: 1; }
.side { position: absolute; background: var(--track); overflow: hidden; }
.side::after { content: ""; position: absolute; inset: 0; background: var(--mark); transform: scaleX(0); }
.side--top    { top: 0; left: 0; right: 0; height: 12px; }
.side--right  { top: 0; right: 0; bottom: 0; width: 12px; }
.side--bottom { bottom: 0; left: 0; right: 0; height: 12px; }
.side--left   { top: 0; left: 0; bottom: 0; width: 12px; }
.side--top::after    { transform-origin: left center; }
.side--right::after  { transform: scaleY(0); transform-origin: center top; }
.side--bottom::after { transform-origin: right center; }
.side--left::after   { transform: scaleY(0); transform-origin: center bottom; }

@keyframes fill-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fill-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.breathing-box.inhale .side--top::after { animation: fill-x var(--dur, 4s) linear both; }
.breathing-box.hold-inhale .side--top::after { transform: scaleX(1); }
.breathing-box.hold-inhale .side--right::after { animation: fill-y var(--dur, 4s) linear both; }
.breathing-box.exhale .side--top::after { transform: scaleX(1); }
.breathing-box.exhale .side--right::after { transform: scaleY(1); }
.breathing-box.exhale .side--bottom::after { animation: fill-x var(--dur, 4s) linear both; }
.breathing-box.hold-exhale .side--top::after, .breathing-box.hold-exhale .side--bottom::after { transform: scaleX(1); }
.breathing-box.hold-exhale .side--right::after { transform: scaleY(1); }
.breathing-box.hold-exhale .side--left::after { animation: fill-y var(--dur, 4s) linear both; }
.breathing-box.paused .side::after { animation-play-state: paused; }

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.controls .btn { min-width: 132px; }
.stage[data-phase="ready"] .btn-primary,
.stage[data-phase="exhale"] .btn-primary { background: var(--ink); color: var(--paper); }
.btn-secondary { background: rgba(15,16,18,.1); color: inherit; }
.btn-secondary:hover { background: rgba(15,16,18,.18); }
.stage[data-phase="inhale"] .btn-secondary,
.stage[data-phase^="hold"] .btn-secondary { background: rgba(244,246,248,.14); }

.settings {
  padding: clamp(40px, 6vw, 72px) var(--m);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  background: var(--chalk);
}
.settings > * { min-width: 0; }
.settings-title { grid-column: 1 / -1; font-size: var(--step-lead); font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; margin-bottom: 20px; }
.setting-item { background: var(--chalk-2); padding: 20px; display: grid; gap: 14px; align-content: start; }
.setting-range { width: 100%; accent-color: var(--cobalt); height: 28px; cursor: pointer; }
.setting-range:disabled { cursor: not-allowed; opacity: .5; }
.sound-note { grid-column: 1 / -1; margin-top: 12px; font-size: 1rem; color: var(--soft-chalk); }
@media (max-width: 760px) { .settings { grid-template-columns: 1fr; } }

.toggle-switch { position: relative; display: inline-block; width: 64px; height: 36px; }
.toggle-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.toggle-slider { position: absolute; inset: 0; background: var(--chalk-3); transition: background-color .2s; }
.toggle-slider::before { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; background: var(--ink); transition: transform .25s var(--ease-out), background-color .2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--cobalt); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(28px); background: var(--yellow); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 3px solid var(--cobalt); outline-offset: 2px; }

/* ---------- motion helpers ---------- */
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
