/**
 * HealthOS Semantics public site.
 * Design system mirrors HealthOS Onco (header grid, full-bleed hero, large type,
 * dark gradient footer) with the Semantics teal palette and no hero photo.
 */

:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --surface: #fff;
  --surface-soft: #eaf2ef;
  --ink: #151c1a;
  --muted: #5c6b66;
  --line: #ccd8d3;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: rgba(15, 118, 110, .08);
  --chain: #115e59;
  --warn: #a66a16;
  --good: #20744e;
  --shadow: 0 18px 50px rgba(15, 40, 35, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.62;
  letter-spacing: 0;
}
a { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: white; padding: .65rem .9rem; border-radius: 6px; z-index: 10; }
.skip-link:focus { top: 1rem; }

/* ── Header ───────────────────────────────────── */

.site-header { position: sticky; top: 0; z-index: 5; background: rgba(246, 248, 247, .93); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: 1493px; margin: 0 auto; padding: .75rem clamp(.55rem, 2vw, 1rem); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; font-weight: 750; white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 6px; object-fit: contain; background: white; padding: 2px; }
.site-nav { display: flex; gap: .65rem; justify-content: center; flex-wrap: wrap; font-size: .92rem; }
.site-nav a { color: var(--muted); text-decoration: none; padding: .35rem .1rem; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: .6rem; justify-self: end; }
.beta-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 31px; padding: .32rem .62rem; border-radius: 999px; background: var(--accent); color: white; font-size: .74rem; font-weight: 820; line-height: 1; letter-spacing: .04em; white-space: nowrap; }
.lang-switcher { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: white; }
.lang-switcher a { padding: .32rem .55rem; text-decoration: none; font-size: .82rem; color: var(--muted); }
.lang-switcher a.active { background: var(--ink); color: white; }

/* ── Layout ───────────────────────────────────── */

.container { max-width: 1417px; margin: 0 auto; padding: clamp(1.2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem); }

main h1:not(.hero h1), main h2 { margin-top: 2.4rem; line-height: 1.15; }
main h1:not(.hero h1) { font-size: clamp(2rem, 4vw, 3.2rem); }
main h2 { font-size: clamp(1.65rem, 3vw, 2.4rem); }
main h3 { line-height: 1.2; }
main p, main li { color: #35443f; }

/* ── Hero (full-bleed band, no photo) ─────────── */

.hero {
  width: 100vw;
  margin: calc(-1 * clamp(1.2rem, 5vw, 3.5rem)) calc(50% - 50vw) 0;
  padding: clamp(2.6rem, 7vw, 4.6rem) max(clamp(1rem, 4vw, 2rem), calc((100vw - 1417px) / 2 + 2rem)) clamp(1.6rem, 4vw, 2.6rem);
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(15, 118, 110, .16), transparent 60%),
    linear-gradient(160deg, #ffffff 0%, var(--surface-soft) 100%);
  border-bottom: 1px solid var(--line);
}
.hero__copy, .hero > * { max-width: 945px; }
.eyebrow { margin: 0 0 .8rem; text-transform: uppercase; font-size: .78rem; color: var(--accent-dark); font-weight: 800; letter-spacing: .06em; }
.hero h1 { margin: 0; font-size: clamp(2rem, 5.2vw, 4rem); line-height: 1.02; letter-spacing: -.01em; }
.lead { max-width: 820px; font-size: clamp(1.08rem, 2vw, 1.3rem); color: #35443f; }
.hero-ctas { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-microcopy { margin-top: 1rem; max-width: 760px; color: var(--muted); font-size: .95rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .65rem .95rem; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 720; max-width: 100%; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn:hover { border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-dark); }

/* ── Stats ────────────────────────────────────── */

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin: 1rem 0 .4rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.stat .stat-value { display: block; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; color: var(--accent-dark); letter-spacing: -.01em; }
.stat .stat-label { font-size: .9rem; color: var(--muted); }
.stat-footnote { font-size: .85rem; color: var(--muted); margin-bottom: 1.4rem; }

/* ── Chain visual ─────────────────────────────── */

.chain-visual { display: flex; align-items: stretch; margin: 1.2rem 0 1.5rem; }
.chain-link { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .5rem; text-align: center; font-size: .92rem; font-weight: 700; position: relative; margin-right: 1.15rem; box-shadow: 0 1px 2px rgba(15, 40, 35, .05); }
.chain-link:first-child { border: 1.5px solid var(--chain); }
.chain-link:last-child { margin-right: 0; }
.chain-link small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.chain-link:not(:last-child)::after { content: "›"; position: absolute; right: -.95rem; top: 50%; transform: translateY(-50%); color: var(--chain); font-weight: 800; font-size: 1.15rem; line-height: 1; }

/* ── Cards / panels ───────────────────────────── */

.panel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin: 1rem 0 1.4rem; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.panel-card h3 { margin: 0 0 .45rem; font-size: 1.05rem; }
.panel-card p { margin: 0; font-size: .96rem; }
.panel-card .panel-who { font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-dark); display: block; margin-bottom: .45rem; }
.panel-card ul { margin: 0 0 .5rem; padding-left: 1.1rem; font-size: .92rem; }
.panel-card .panel-metric { font-size: .82rem; color: var(--muted); }

/* ── Audience tabs ────────────────────────────── */

.audience-tabs { margin: 1rem 0 1.6rem; }
.audience-tabs [role="tablist"] { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: .9rem; }
.audience-tabs [role="tab"] { border: none; background: none; font: inherit; font-weight: 700; font-size: .95rem; color: var(--muted); padding: .45rem .7rem; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px; }
.audience-tabs [role="tab"][aria-selected="true"] { color: var(--accent-dark); border-bottom-color: var(--accent); }
.audience-tabs [role="tabpanel"][hidden] { display: none; }
.audience-tabs [role="tabpanel"] ul { margin-bottom: .5rem; }

/* ── Packages / services ──────────────────────── */

.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: .85rem; margin: 1rem 0 1.2rem; }
.package-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.05rem; display: flex; flex-direction: column; }
.package-card h3 { margin: 0 0 .2rem; }
.package-card .package-for { font-size: .82rem; color: var(--muted); margin-bottom: .55rem; }
.package-card ul { font-size: .92rem; padding-left: 1.1rem; flex: 1; }
/* Fixed-height billing slot (fits up to 3 lines): the dashed top border sits at the
   same distance from the card bottom in every card, so the footers align. */
.package-card .package-billing { font-size: .84rem; font-weight: 700; color: var(--accent-dark); border-top: 1px dashed var(--line); padding-top: .55rem; margin-top: .4rem; min-height: 5.6em; }

/* ── Calculator ───────────────────────────────── */

.calc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: clamp(1.1rem, 3vw, 1.6rem); margin: 1rem 0 1.4rem; box-shadow: var(--shadow); }
.calc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem 1rem; margin-bottom: 1rem; align-items: stretch; }
.calc-field { display: flex; flex-direction: column; }
.calc-field label { display: flex; align-items: flex-end; flex: 1 0 auto; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: .25rem; }
.calc-field input { width: 100%; font: inherit; padding: .5rem .65rem; border: 1.5px solid var(--line); border-radius: 7px; background: var(--bg); }
.calc-field input:focus { border-color: var(--accent); outline: none; }
.calc-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .75rem; margin: .4rem 0 .8rem; }
.calc-result { background: var(--accent-soft); border: 1px solid rgba(15, 118, 110, .3); border-radius: 8px; padding: .8rem .95rem; }
.calc-result .calc-value { display: block; font-size: 1.45rem; font-weight: 800; color: var(--accent-dark); }
.calc-result .calc-label { font-size: .82rem; color: var(--muted); }
.calc-verdict { font-weight: 700; margin: .4rem 0 .8rem; }
.calc-disclaimer { font-size: .8rem; color: var(--muted); margin-bottom: .8rem; }

/* ── Misc content blocks ──────────────────────── */

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .9rem; margin: 1rem 0 1.3rem; }
.two-col > div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.two-col h3 { margin-top: 0; }

.cta-band { margin-top: 3rem; padding: clamp(1.5rem, 4vw, 2.4rem); background: var(--ink); color: white; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cta-band p { margin: 0; font-weight: 700; color: white; font-size: 1.08rem; }
.cta-band .btn:not(.primary) { background: rgba(255, 255, 255, .92); }

blockquote { margin: 1rem 0; padding: .8rem 1rem; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; color: var(--muted); }

table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: .75rem .85rem; }
th { background: var(--surface-soft); color: var(--ink); }
td { color: #35443f; }

pre { overflow: auto; border-radius: 8px; border: 1px solid var(--line); padding: 1rem; background: #eef4f1; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--surface-soft); border-radius: 4px; padding: .08em .32em; }
pre code { background: none; padding: 0; }

figure { margin: 1.2rem 0; text-align: center; }
figure img { max-width: 100%; height: auto; border-radius: 8px; }

/* Инлайн-схемы: векторная графика в языке питч-дека, без внешних ресурсов и скриптов. */
figure.diagram { margin: 1.3rem 0 1.7rem; text-align: center; }
figure.diagram svg { display: block; width: 100%; height: auto; max-width: 760px; margin: 0 auto; }
figure.diagram figcaption { margin-top: .55rem; font-size: .84rem; color: var(--muted); text-align: center; }

/* Скрытая таблица текст+диаграмма: список слева, SVG справа, без рамок и заливки. */
table.layout-table { table-layout: fixed; border: 0; background: transparent; margin: 1.5rem 0; }
table.layout-table caption { caption-side: top; text-align: left; color: var(--muted); font-weight: 700; font-size: .95rem; margin-bottom: .9rem; }
table.layout-table tr { border: 0; }
table.layout-table td { border: 0; background: transparent; padding: 5px; vertical-align: top; }
table.layout-table td:first-child { width: 50%; padding-right: 2rem; vertical-align: middle; }
table.layout-table td:last-child { width: 50%; }
table.layout-table ol { margin: 0; padding-left: 1.2rem; }
table.layout-table li { margin-bottom: .5rem; }
table.layout-table figure.diagram { margin: 0; }
table.layout-table figure.diagram svg { max-width: min(380px, 100%); margin: 0 auto; }
table.layout-table.diagram-lg figure.diagram svg { max-width: min(456px, 100%); }

/* ── Disclaimer + footer ──────────────────────── */

.disclaimer-band { max-width: 1417px; margin: 0 auto; padding: .9rem clamp(1rem, 4vw, 2rem); font-size: .82rem; color: var(--muted); }

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 1.2rem clamp(1rem, 4vw, 2rem);
  background: linear-gradient(90deg, rgba(10, 24, 21, .98) 0%, rgba(14, 42, 38, .98) 52%, rgba(15, 118, 110, .95) 100%);
  color: rgba(236, 245, 242, .84);
}
.site-footer__inner { max-width: 1417px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.25rem; flex-wrap: wrap; font-size: .88rem; }
.site-footer a { color: rgba(255, 255, 255, .92); }
.site-footer a:hover { color: #99f6e4; }

/* ── Responsive ───────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 900px) {
  .site-header__inner { grid-template-columns: 1fr; justify-items: start; }
  .site-nav { justify-content: flex-start; }
  .header-actions { flex-wrap: wrap; justify-self: start; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 680px) {
  .chain-visual { flex-direction: column; }
  .chain-link { margin-right: 0; margin-bottom: 1.35rem; }
  .chain-link:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -1.2rem; transform: translateX(50%); }
  .chain-link:last-child { margin-bottom: 0; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: clamp(1.7rem, 9vw, 2.6rem); }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .stat-row, .panel-grid { grid-template-columns: 1fr; }
  table.layout-table td:first-child,
  table.layout-table td:last-child { display: block; width: 100%; }
  table.layout-table td:first-child { padding-right: 0; padding-bottom: 1.2rem; }
}
