/*
  Design plan
  Subject: home physiotherapy for kids in Poland. Audience: parents and physios.
  Signature: resistance-band colours (yellow, red, green, blue), the way physios
  grade exercise difficulty. Used as data, never as decoration.
  Type: one family, Bricolage Grotesque, from 15px captions to 76px headlines.
  Layout: left-aligned, two-column hero, quiet sections separated by space and
  single rules. Cards only where something is an object on screen (the phone,
  the physio dashboard).
*/
:root {
  --ink: #16233B;
  --text: #3F4B61;
  --muted: #66728A;
  --paper: #F3F5F8;
  --white: #FFFFFF;
  --rule: #D9DFE8;
  --blue: #2F6FDB;
  --blue-dark: #2359B8;
  --band-yellow: #F2C230;
  --band-red: #DD4B3B;
  --band-green: #3C9A62;
  --band-blue: #2F6FDB;
  --ink-soft: #24344F;
  --on-ink: #EEF2F8;
  --on-ink-muted: #AEB9CC;

  --font: 'Bricolage Grotesque', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  font-optical-sizing: auto;
}

h1, h2, h3 { color: var(--ink); margin: 0; text-wrap: balance; font-weight: 700; }
h1 { font-size: clamp(40px, 6vw, 74px); line-height: 1.02; letter-spacing: -0.025em; }
h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -0.015em; }
h3 { font-size: 21px; line-height: 1.25; font-weight: 650; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--band-yellow); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.lead { font-size: 21px; line-height: 1.5; max-width: 33em; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 24px; flex-wrap: wrap; padding-block: 18px;
}
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 20px; }
.logo-mark { display: flex; flex-direction: column; gap: 3px; width: 26px; }
.logo-mark span { display: block; height: 4px; border-radius: 2px; }
.logo-mark span:nth-child(1) { background: var(--band-yellow); width: 60%; }
.logo-mark span:nth-child(2) { background: var(--band-red); width: 80%; }
.logo-mark span:nth-child(3) { background: var(--band-green); width: 100%; }
.nav { display: flex; align-items: center; gap: 8px 24px; flex-wrap: wrap; font-size: 16px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--blue); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font: 600 17px/1 var(--font); text-decoration: none; border: 2px solid transparent;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--white); }
.btn-light { background: var(--on-ink); color: var(--ink); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Sections */
.band { padding-block: 72px; }
@media (min-width: 900px) { .band { padding-block: 104px; } }
.band-white { background: var(--white); }
.band-ink { background: var(--ink); color: var(--on-ink-muted); }
.band-ink h2, .band-ink h3 { color: var(--on-ink); }
.band-ink a { color: var(--on-ink); }

.split { display: grid; gap: 32px 64px; }
@media (min-width: 900px) { .split { grid-template-columns: 5fr 7fr; } }
.split > * { min-width: 0; }

/* Hero */
.hero { padding-block: 56px 80px; }
.hero-grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; } }
.hero-grid > * { min-width: 0; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; }

/* Phone mock-up */
.phone {
  width: 100%; max-width: 340px; margin-inline: auto;
  background: var(--ink); border-radius: 40px; padding: 12px;
  box-shadow: 0 24px 48px -16px rgba(22, 35, 59, 0.45);
}
.screen { background: var(--white); border-radius: 30px; padding: 26px 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.screen-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.screen-day { font-weight: 700; color: var(--ink); font-size: 20px; }
.screen-sub { font-size: 14px; color: var(--muted); }
.stars { display: flex; gap: 6px; }
.stars svg { width: 30px; height: 30px; }
.stars .on { fill: var(--band-yellow); }
.stars .off { fill: var(--rule); }
.ex { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-top: 1px solid var(--rule); }
.ex-name { color: var(--ink); font-weight: 600; font-size: 16px; }
.ex-dose { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); font-size: 16px; }
.ex-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ex-state { font-size: 13px; color: var(--muted); text-align: right; }
.ex-state.done { color: var(--band-green); font-weight: 600; }
.chip { display: inline-block; width: 26px; height: 7px; border-radius: 4px; }
.chip.yellow { background: var(--band-yellow); }
.chip.red { background: var(--band-red); }
.chip.green { background: var(--band-green); }
.chip.blue { background: var(--band-blue); }

@media (prefers-reduced-motion: no-preference) {
  .stars .on { animation: star-in 420ms cubic-bezier(.2, .8, .3, 1.4) both; }
  .stars svg:nth-child(2) { animation-delay: 180ms; }
  .stars svg:nth-child(3) { animation-delay: 360ms; }
}
@keyframes star-in { from { transform: scale(0.4); opacity: 0; } }

/* Signature: the band progression */
.progress-head { display: flex; flex-direction: column; gap: 16px; max-width: 40em; margin-bottom: 56px; }
.track { display: grid; gap: 28px; position: relative; }
@media (min-width: 820px) { .track { grid-template-columns: repeat(4, 1fr); gap: 24px; } }
.stop { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stop-week { font-size: 15px; color: var(--on-ink-muted); }
.stop-band { height: 14px; border-radius: 7px; }
.stop-band.yellow { background: var(--band-yellow); }
.stop-band.red { background: var(--band-red); }
.stop-band.green { background: var(--band-green); }
.stop-dose { font-size: 34px; font-weight: 700; color: var(--on-ink); font-variant-numeric: tabular-nums; line-height: 1; }
.stop-note { font-size: 16px; }
.progress-foot { margin-top: 40px; font-size: 15px; }

/* Columns of text separated by rules */
.cols { display: grid; gap: 32px; }
@media (min-width: 820px) {
  .cols-3 { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .cols-3 > * { padding-inline: 32px; border-left: 1px solid var(--rule); }
  .cols-3 > *:first-child { padding-left: 0; border-left: 0; }
  .cols-2 { grid-template-columns: 1fr 1fr; column-gap: 64px; }
}
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.section-title { display: flex; flex-direction: column; gap: 16px; max-width: 36em; margin-bottom: 48px; }

/* Lists with rules */
.ruled { list-style: none; margin: 0; padding: 0; }
.ruled li { padding-block: 22px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.ruled li:last-child { border-bottom: 1px solid var(--rule); }

/* Steps (a real sequence) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 32px; counter-reset: step; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 3px solid var(--ink); }
.steps li::before { content: counter(step); font-weight: 700; font-size: 40px; line-height: 1; color: var(--blue); font-variant-numeric: tabular-nums; }

/* Physio dashboard mock-up */
.dash { background: var(--white); border-radius: 16px; border: 1px solid var(--rule); padding: 24px; box-shadow: 0 24px 48px -24px rgba(22, 35, 59, 0.3); }
.dash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-title { font-weight: 700; color: var(--ink); }
.dash-scroll { overflow-x: auto; }
.dash table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: 15px; }
.dash th { font-weight: 500; color: var(--muted); text-align: center; padding: 0 4px 10px; }
.dash th:first-child, .dash td:first-child { text-align: left; }
.dash td { padding: 9px 4px; border-top: 1px solid var(--rule); text-align: center; color: var(--ink); }
.dash td.sum { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.dash th.sum { text-align: right; }
.cell { display: inline-block; width: 20px; height: 20px; border-radius: 5px; vertical-align: middle; }
.cell.done { background: var(--blue); }
.cell.miss { border: 2px solid var(--rule); }
.cell.rest { background: var(--paper); }
.dash-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; color: var(--muted); }
.dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dash-legend .cell { width: 14px; height: 14px; border-radius: 4px; }
@media (max-width: 520px) {
  .dash { padding: 18px 14px; }
  .dash table { min-width: 0; font-size: 13px; }
  .dash th, .dash td { padding-inline: 2px; }
  .dash td .cell { width: 15px; height: 15px; border-radius: 4px; }
}
.flag { display: inline-block; font-size: 13px; font-weight: 600; color: var(--band-red); }

/* Quote */
.quote { font-size: clamp(26px, 3vw, 36px); line-height: 1.25; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; max-width: 26em; }

/* FAQ */
.faq details { border-top: 1px solid var(--rule); padding-block: 20px; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 650; color: var(--ink); font-size: 19px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; color: var(--blue); font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 12px; max-width: 40em; }

/* Store buttons (placeholders until links exist) */
.store { display: inline-flex; flex-direction: column; justify-content: center; min-height: 56px; padding: 8px 20px; border-radius: 12px; background: var(--ink); color: var(--white); text-decoration: none; line-height: 1.2; }
.store small { font-size: 12px; opacity: 0.8; }
.store b { font-size: 18px; }
.band-ink .store { background: var(--on-ink); color: var(--ink); }

/* Plans */
.plans { list-style: none; margin: 0; padding: 0; }
.plans li { display: grid; gap: 6px 32px; padding-block: 24px; border-top: 1px solid var(--rule); }
.plans li:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 720px) { .plans li { grid-template-columns: 14em 1fr; align-items: baseline; } }
.plan-name { font-weight: 700; color: var(--ink); font-size: 21px; }

/* Footer */
.site-footer { background: var(--ink); color: var(--on-ink-muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; padding-block: 40px; }
.site-footer a { color: var(--on-ink); }
.footer-links { display: flex; gap: 12px 24px; flex-wrap: wrap; }
.site-footer .logo { color: var(--on-ink); font-size: 18px; }
