/* Монти: tokens and shared parts of every page (design/tokens.json, design/IDENTITY.md).
   Page-specific blocks stay inline in each page. Light by default, dark by
   prefers-color-scheme or data-theme on <html> (pages accept ?theme=dark|light). */
:root {
  --surface: #f3f3ef;
  --raised: #ffffff;
  --sunken: #e6e5df;
  --stage: #121116;
  --stage-border: transparent;
  --on-stage: #f3f3ef;
  --on-stage-muted: #a3a0ad;
  --on-stage-soft: #c9c7d0;
  --line: #d6d5ce;
  --line-strong: #8c8996;
  --ink: #121116;
  --ink-soft: #3a3842;
  --ink-muted: #5e5b67;
  --lime: #c6f432;
  --on-lime: #121116;
  --lime-text: #4a6b00;
  --rec: #ff5b3a;
  --on-rec: #121116;
  --focus: #121116;
  --night: #121116;
  --paper: #f3f3ef;
  --white: #ffffff;
  --phone: #1b1a20;
  --phone-edge: #2a2930;
  --screen: #2c2b33;
  --clip-off: #4a4853;
  --mascot-body: #121116;
  --mascot-eye: #ffffff;
  --mascot-pupil: #121116;
  --mascot-smile: #c6f432;
  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
  --font-sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --pill: 999px;
  --section-gap: clamp(64px, 8vw, 112px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #121116; --raised: #1b1a20; --sunken: #232229; --stage: #0b0a0e; --stage-border: #2a2930;
    --line: #2a2930; --line-strong: #6e6b78; --ink: #f3f3ef; --ink-soft: #d3d1d9; --ink-muted: #a3a0ad;
    --lime-text: #c6f432; --focus: #c6f432;
    --mascot-body: #f3f3ef; --mascot-eye: #121116; --mascot-pupil: #ffffff; --mascot-smile: #121116;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #121116; --raised: #1b1a20; --sunken: #232229; --stage: #0b0a0e; --stage-border: #2a2930;
  --line: #2a2930; --line-strong: #6e6b78; --ink: #f3f3ef; --ink-soft: #d3d1d9; --ink-muted: #a3a0ad;
  --lime-text: #c6f432; --focus: #c6f432;
  --mascot-body: #f3f3ef; --mascot-eye: #121116; --mascot-pupil: #ffffff; --mascot-smile: #121116;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 40px;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.on-dark a:focus-visible, .on-dark button:focus-visible { outline-color: var(--lime); }
h1, h2, h3 { margin: 0; font-family: var(--font-display); text-wrap: balance; }
p { margin: 0; }
img, svg, video { max-width: 100%; }
.wrap { max-width: 1280px; margin-inline: auto; }
.section { margin-top: var(--section-gap); display: flex; flex-direction: column; gap: 40px; }
.section-head { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.h2 { font-weight: 800; font-size: clamp(32px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -0.02em; }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.45; color: var(--ink-muted); max-width: 60ch; }
.muted { color: var(--ink-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border-radius: var(--pill); border: 1px solid transparent; font-family: var(--font-sans); font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none; text-align: center; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-lime { background: var(--lime); color: var(--on-lime); }
.btn-dark { background: var(--stage); color: var(--on-stage); border-color: var(--stage-border); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost-dark { background: transparent; color: var(--on-stage); border-color: #6e6b78; }
.btn-lg { min-height: 64px; padding: 0 36px; font-family: var(--font-display); font-size: 18px; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .45; transform: none; }
button.btn { -webkit-appearance: none; appearance: none; }

/* Mascot parts */
.m-body { fill: var(--mascot-body); } .m-eye { fill: var(--mascot-eye); } .m-pupil { fill: var(--mascot-pupil); } .m-smile { stroke: var(--mascot-smile); }
.m-lid { fill: var(--lime); } .m-stripe { fill: var(--night); } .m-rec { fill: var(--rec); }

/* Header */
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding-block: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-word { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.site-nav ul { display: flex; gap: 4px 28px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: inline-block; padding: 12px 0; text-decoration: none; font-weight: 500; }
.site-nav a:hover { color: var(--lime-text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-actions .btn { min-height: 48px; }
.nav-cabinet { display: none; }

/* Tags and chips */
.tag-lime { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--pill); background: var(--lime); color: var(--on-lime); font-weight: 600; font-size: 14px; }
.tag-rec { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: var(--pill); background: var(--rec); color: var(--on-rec); font-weight: 600; font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--pill); background: var(--raised); font-size: 15px; font-weight: 500; }
.chip b { color: var(--lime-text); font-variant-numeric: tabular-nums; }
.save { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: var(--pill); background: var(--lime); color: var(--on-lime); font-size: 13px; font-weight: 600; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); flex-shrink: 0; }
.rec-dot.live { animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* Cards */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--raised); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h3 { font-weight: 600; font-size: 22px; line-height: 1.25; }
.card p { color: var(--ink-muted); }

/* Packages of frames: the landing and the cabinet */
.pkg { padding: 24px; gap: 8px; }
.pkg h3, .pkg h4 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.pkg-price { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 2.6vw, 36px); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card .pkg-frames, .pkg-frames { color: var(--ink); font-weight: 600; }
.pkg-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--ink-muted); font-variant-numeric: tabular-nums; flex: 1; }
.pkg .btn { margin-top: 8px; }
.pkg-best { box-shadow: inset 0 0 0 2px var(--ink); }

/* Segmented choice (calculator, payment method, examples) */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label, .seg button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--pill); border: 1px solid var(--line-strong); background: transparent; color: inherit; cursor: pointer; font: 500 16px/1.2 var(--font-sans); }
.seg input:checked + label, .seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }

/* A calm notice: one line of context, never an alarm */
.note { padding: 16px 20px; border-radius: var(--r-md); background: var(--sunken); color: var(--ink-soft); }
.note a { color: var(--ink); font-weight: 600; }

/* Footer */
.site-footer { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 32px; color: var(--ink-muted); font-size: 15px; }
.site-footer .logo-word { font-size: 20px; color: var(--ink); }
.footer-brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-footer a { display: inline-block; padding-block: 12px; color: var(--ink-muted); }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* never 3 + 1 */
}
@media (max-width: 720px) {
  .site-header .wrap { column-gap: 12px; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; }
  .site-nav ul { flex-wrap: nowrap; white-space: nowrap; }
  .nav-cabinet { display: list-item; }
  .header-login { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 520px) {
  /* Packages: one per row — name and frames on the left, the price on the right. */
  .pkg-grid { grid-template-columns: minmax(0, 1fr); }
  .pkg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 20px; }
  .pkg-price { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 28px; white-space: nowrap; }
  .pkg-rate, .pkg .btn { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .rec-dot.live { animation: none; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
