/* ── Design tokens ── */
:root {
    /* СибГМУ Brand Colors */
    --bg: #fafafa;
    --fg: #2E3146;
    --muted: #5a5d6e;
    --border: #e5e3df;
    --accent: #C93239;
    --accent-light: #f8eaea;
    --card-bg: #ffffff;
    --nav-bg: rgba(250, 250, 250, 0.85);
    --radius: 10px;
    --max-w: 1200px;
}

[data-theme="dark"] {
    --bg: #1a1a2e;
    --fg: #e8e8f0;
    --muted: #a0a0b0;
    --border: #2d2d44;
    --accent: #e84a52;
    --accent-light: #2a2a4e;
    --card-bg: #1e1e3f;
    --nav-bg: rgba(26, 26, 46, 0.85);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 12px;
}

h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

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

a { color: inherit; text-decoration: none; }

/* ── Nav ── */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ssmu-logo {
    height: 32px;
    width: auto;
}

[data-theme="dark"] .ssmu-logo {
    content: "Лого белый.png";
}

.logo span { color: var(--accent); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-links a {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--fg); }

/* ── Theme Toggle ── */
.theme-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.2s;
}

.theme-btn:hover { color: var(--fg); }

.sun { display: none; }
[data-theme="dark"] .sun { display: block; }
[data-theme="dark"] .moon { display: none; }

/* ── Hero ── */
#hero {
    padding: 140px 0 80px;
    text-align: center;
}

.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-light);
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 24px;
}

#hero h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

#hero h1 span { color: var(--accent); }

.full-product-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--accent);
    margin: 0 auto 12px;
    max-width: 600px;
    letter-spacing: 0.01em;
}

.tagline {
    font-size: 20px;
    font-weight: 300;
    color: var(--muted);
    margin: 0 auto 36px;
    max-width: 580px;
    position: relative;
    padding-top: 16px;
}

.tagline::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background: var(--accent);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    transition: transform 0.2s, opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--fg);
    background: var(--accent-light);
    color: var(--accent);
    transform: none;
}

/* ── Sections ── */
section {
    padding: 80px 0;
    position: relative;
}

/* Container-width divider for first section (after hero) */
#about::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--max-w);
    height: 1px;
    background: var(--border);
}

/* Container-width divider for sections (not first) */
section + section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--max-w);
    height: 1px;
    background: var(--border);
}

/* ── Two-col layout ── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.two-col p { margin-bottom: 12px; }

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
}

/* ── Features ── */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.feature {
    padding: 28px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

.feature:hover { border-color: var(--accent); }

.feature-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

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

/* ── Docs ── */
#docs p {
    margin-bottom: 12px;
}

.doc-email-inline {
    color: var(--accent);
    font-weight: 600;
}

.doc-email-inline:hover {
    text-decoration: underline;
}

.docs-list {
    display: flex;
    flex-direction: column;
}

.doc-row {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left 0.2s;
}

.doc-row:hover { padding-left: 8px; }

.doc-title {
    font-weight: 600;
    min-width: 280px;
    color: var(--fg);
}

.doc-desc {
    flex: 1;
    font-size: 14px;
    color: var(--muted);
}

.doc-arrow {
    font-size: 18px;
    color: var(--muted);
    transition: color 0.2s;
}

.doc-row:hover .doc-arrow { color: var(--accent); }

.doc-row-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.doc-info {
    flex: 1;
}

.doc-info .doc-desc {
    display: block;
    margin-top: 4px;
}

.btn-small {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    white-space: nowrap;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-small:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ── Info Block ── */
.info-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 16px;
}

.info-block p {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
}

.info-block p:last-child {
    margin-bottom: 0;
}

.req-list {
    list-style: none;
    padding: 0;
}

.req-list li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.req-list li:last-child {
    border-bottom: none;
}

.req-list li strong {
    color: var(--fg);
}

/* ── License section ── */
.license-note {
    margin-top: 16px;
    font-size: 14px;
}

.license-note a {
    color: var(--accent);
    font-weight: 600;
}

.license-note a:hover {
    text-decoration: underline;
}

/* ── Gallery ── */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.gallery-item img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.gallery-caption {
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
}

/* ── Document Image ── */
.section-desc {
    margin-bottom: 24px;
}

.doc-image {
    max-width: 680px;
    margin: 0 auto;
}

.doc-image img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* ── Two-col docs section ── */
.docs-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-top: 32px;
}

.doc-column {
    display: grid;
    grid-template-rows: auto auto;
    align-items: start;
    height: 100%;
}

.doc-column h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--fg);
}

.doc-column p {
    margin-bottom: 20px;
    font-size: 14px;
    min-height: 3.6em;
}

.doc-column .doc-image {
    margin: 0;
    max-width: none;
    display: block;
    width: 100%;
}

.doc-column .doc-image img {
    width: 100%;
    display: block;
}

/* ── Contact ── */
.contact-inner { max-width: 480px; }

.contact-details {
    margin-top: 20px;
}

.contact-details p {
    margin-bottom: 8px;
}

.contact-details strong { color: var(--fg); }

/* ── Footer ── */
footer {
    padding: 40px 0;
    position: relative;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

footer p {
    font-size: 13px;
    color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    #hero { padding: 100px 0 60px; }
    #hero h1 { font-size: 32px; }
    .subtitle { font-size: 15px; }

    .two-col, .features-grid, .gallery-grid, .stats-grid {
        grid-template-columns: 1fr;
    }

    .doc-title { min-width: auto; flex: 1; }
    .doc-desc { display: none; }

    .nav-inner { padding: 0 16px; }
    .logo { font-size: 16px; }
    .nav-links { gap: 16px; }
    .nav-links a { font-size: 12px; }
}

@media (max-width: 480px) {
    #hero h1 { font-size: 28px; }
    .btn { width: 100%; text-align: center; }
    .hero-actions { flex-direction: column; }
    .nav-links { display: none; } /* Mobile menu could be added here, but for now we simplify */
}
