/* Kvatr homepage. The palette is the DTU deck's (2026-09-30): navy and cream, an orange and a blue
   for the lit windows. The type is Noto Sans for every word in seven languages, as on the web app
   (docs/languages.md, phase 5); Space Grotesk stays only in the logo's word.

   Dark mode follows the visitor's system setting (prefers-color-scheme) — no toggle, no script.
   The hero, the header, the "Kvatr" boxes, the screens and the contact band stay navy in both
   themes; everything else reads its colours from the tokens below.

   Every text/background pair holds WCAG AA (4.5:1) in both themes (checked 2026-10-01). */

:root {
    --navy: #16232E;
    --navy-2: #1D2F3E;
    --navy-3: #2B4155;
    --navy-line: #2E4558;
    --cream: #F5F3EE;
    --on-navy-muted: #B9C6CF;
    --orange: #F0925E;
    --blue: #7CC3E0;

    --bg: #F3F2EE;
    --bg-alt: #E7EBEA;
    --surface: #FBFAF7;
    --surface-cool: #E2E9EE;
    --surface-warm: #F7E0D2;
    --text: #16232E;
    --muted: #4A5866;
    --accent: #A9481A;
    --accent-cool: #2A6886;
    --border: #DEDBD3;

    --font-head: 'Noto Sans', ui-sans-serif, system-ui, sans-serif;
    --font-body: 'Noto Sans', ui-sans-serif, system-ui, sans-serif;
    --font-logo: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    --radius: 12px;
    --gutter: 24px;

    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0F171E;
        --bg-alt: #131E27;
        --surface: #17232C;
        --surface-cool: #1E2F3C;
        --surface-warm: #3A2B22;
        --text: #ECE8E1;
        --muted: #A3B0BA;
        --accent: #F0925E;
        --accent-cool: #7CC3E0;
        --border: #263540;
    }
}

/* ---- Base ---- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    /* Noto Sans at 600 reads lighter than Space Grotesk did; 650 keeps the headings as heavy as before. */
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
}

h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); max-width: 22em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { margin: 0; }

a { color: var(--accent-cool); text-underline-offset: 3px; }

ul, ol { margin: 0; padding: 0; list-style: none; }

svg { display: block; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.container.narrow { max-width: 760px; }

@media (max-width: 600px) {
    :root { --gutter: 16px; }
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    background: var(--orange);
    color: var(--navy);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus { top: 12px; }

/* ---- Buttons ---- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--orange);
    color: var(--navy);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid var(--orange);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover { background: #F4A77B; border-color: #F4A77B; }

.button-ghost {
    background: transparent;
    color: var(--cream);
    border-color: var(--navy-line);
}

.button-ghost:hover { background: var(--navy-2); border-color: var(--on-navy-muted); }

.button-small { min-height: 40px; padding: 8px 18px; font-size: 0.9375rem; }

/* ---- Header ---- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--navy);
    border-bottom: 1px solid var(--navy-line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 68px;
}

.brand { text-decoration: none; color: var(--cream); }

/* The logo's proportions are brand/kvatr-logo.svg's: the mark's box is 64 units to the word's
   54.6, and the word starts 14.7 units after the mark. */
.logo { display: inline-flex; align-items: center; gap: 0.27em; font-size: 1.5rem; color: var(--cream); }

.logo-mark { width: auto; height: 1.17em; flex: none; }

.logo-word {
    font-family: var(--font-logo);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.header-nav { display: flex; gap: 28px; margin-left: auto; }

.header-nav a {
    color: var(--on-navy-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9875rem;
}

.header-nav a:hover { color: var(--cream); }

@media (max-width: 860px) {
    .header-nav { display: none; }
    .header-inner .language-menu { margin-left: auto; }
}

/* On a narrow phone a long word in a heading (»Конфіденційність«, »Datenschutzerklärung«) breaks rather
   than push the page sideways. */
@media (max-width: 400px) {
    h1, h2, h3 { hyphens: auto; overflow-wrap: break-word; }
}

/* A 320 px phone fits the logo, the language menu and one button (WCAG 1.4.10): »Log ind« — the one a person on a
   phone comes for (#33) — stays, and »Kontakt« gives way to the page's own contact band. */
@media (max-width: 400px) {
    .header-inner { gap: 12px; }
    .header-inner .button-small { padding-inline: 12px; }
    .header-inner .header-contact { display: none; }
}

/* The language menu (Shared/LanguageMenu.razor): a <details>, so it opens without script. The
   summary shows the page's language code; the list opens below it, over the page, with the seven
   languages by their own names. On navy in both themes, like the header. */
.language-menu { position: relative; flex: none; }

.language-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--navy-line);
    border-radius: 999px;
    color: var(--cream);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    list-style: none;
}

.language-menu summary::-webkit-details-marker { display: none; }

.language-menu summary::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--on-navy-muted);
}

.language-menu[open] summary::after { border-top: 0; border-bottom: 5px solid var(--on-navy-muted); }

.language-menu summary:hover { border-color: var(--on-navy-muted); }

.language-menu summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.language-menu ul {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    min-width: 11rem;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--navy-2);
    border: 1px solid var(--navy-line);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.language-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--on-navy-muted);
    text-decoration: none;
    font-size: 0.9375rem;
}

.language-menu a:hover,
.language-menu a:focus-visible { background: var(--navy-3); color: var(--cream); }

.language-menu a[aria-current="page"] { color: var(--cream); font-weight: 600; }

.language-menu a[aria-current="page"]::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--orange);
    vertical-align: middle;
}

/* ---- Hero ---- */

.hero {
    background: var(--navy);
    color: var(--cream);
    padding: 88px 0 0;
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: end;
    gap: 48px;
}

.hero-text { padding-bottom: 96px; }

.hero h1 {
    font-size: clamp(2.75rem, 6.4vw, 5.25rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 18px 0 22px;
}

.hero-lead {
    font-size: clamp(1.125rem, 1.9vw, 1.375rem);
    color: var(--on-navy-muted);
    max-width: 30em;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero-status {
    margin-top: 28px;
    font-size: 0.9375rem;
    color: var(--on-navy-muted);
}

.hero-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--blue);
    vertical-align: 1px;
}

.hero-art { align-self: end; }

.skyline { width: 100%; max-width: 520px; height: auto; margin-left: auto; }

@media (max-width: 860px) {
    .hero { padding-top: 56px; }
    .hero-inner { grid-template-columns: 1fr; gap: 0; }
    .hero-text { padding-bottom: 40px; }
    .skyline { max-width: 360px; margin: 0 auto; }
}

/* ---- Sections ---- */

.section { padding: 96px 0; }

.section-alt { background: var(--bg-alt); }

@media (max-width: 600px) {
    .section { padding: 64px 0; }
}

.eyebrow {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.eyebrow-on-dark { color: var(--orange); margin: 0; }

.lead {
    font-size: 1.1875rem;
    color: var(--muted);
    max-width: 40em;
    margin-top: 18px;
}

.page-title { font-size: clamp(2.25rem, 5vw, 3.25rem); margin-bottom: 16px; }

.section .narrow .button { margin-top: 28px; }

.note { margin-top: 32px; color: var(--muted); max-width: 52em; }

/* ---- The privacy page (Pages/Privacy.razor): running text at a reading width ---- */

.privacy h2 { font-size: 1.375rem; margin: 40px 0 12px; max-width: none; }

.privacy p,
.privacy ul { max-width: 65ch; margin: 0 0 12px; }

.privacy ul { padding-left: 1.25em; list-style: disc; display: grid; gap: 8px; }

.privacy .note { margin-top: 16px; }

.note strong { color: var(--text); }

.source { margin-top: 24px; font-size: 0.875rem; color: var(--muted); }

/* ---- Cards ---- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.card h3 { margin-bottom: 8px; }

.card p { color: var(--muted); }

.card-grid { display: grid; gap: 20px; margin-top: 40px; }

.card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px) {
    .card-grid-3 { grid-template-columns: 1fr; }
}

/* ---- Stats ---- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat { display: flex; flex-direction: column; gap: 8px; }

.stat-number {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(2.5rem, 4.4vw, 3.25rem);
    line-height: 1;
    color: var(--accent);
}

.stat-text { color: var(--text); }

@media (max-width: 980px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* ---- The platform flow: in → Kvatr → out ---- */

.flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    margin-top: 44px;
}

.flow-label {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.pill-list { display: grid; gap: 10px; }

.pill-list li { padding: 11px 16px; border-radius: 8px; color: var(--text); }

.pill-list-cool li { background: var(--surface-cool); }

.pill-list-warm li { background: var(--surface-warm); }

.flow-arrow::before {
    content: "→";
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

.flow-core {
    background: var(--navy);
    color: var(--cream);
    border-radius: 16px;
    padding: 28px;
}

.flow-core-title {
    font-family: var(--font-head);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.module-grid li {
    background: var(--navy-2);
    border: 1px solid var(--navy-3);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9375rem;
}

@media (max-width: 960px) {
    .flow { grid-template-columns: 1fr; gap: 16px; }
    .flow-arrow { justify-self: center; }
    .flow-arrow::before { content: "↓"; }
}

/* ---- People ---- */

.person-role {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.card .person-role { color: var(--accent); }

/* ---- Contact ---- */

.contact {
    background: var(--navy);
    color: var(--cream);
    padding: 96px 0;
    text-align: center;
}

.contact h2 { margin: 0 auto; }

.contact-lead { color: var(--on-navy-muted); font-size: 1.1875rem; margin: 18px auto 32px; max-width: 34em; }

@media (max-width: 600px) {
    .contact { padding: 64px 0; }
    .contact .button { width: 100%; }
}

/* ---- Footer ---- */

.site-footer {
    background: var(--navy);
    color: var(--on-navy-muted);
    border-top: 1px solid var(--navy-line);
    padding: 40px 0;
    font-size: 0.9375rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px;
}

.footer-brand { display: flex; flex-direction: column; gap: 12px; max-width: 26em; }

.footer-meta { display: flex; flex-direction: column; gap: 4px; }

.site-footer a { color: var(--cream); }

.footer-copy { margin-top: 8px; }
