/* ==========================================================================
   UNIFIED.CSS — SEU / Chat X.509 Light + ERPUNO Dark (Final v4)
   Fully supports new index.html (СЕУ) + all previous pages
   Ported .section-products .product-grid .solutions-grid .section-standards
   H1 perfectly centered • Original ERPUNO footer restored
   ========================================================================== */

:root {
    /* Light theme — Apple X.509 style */
    --bg:           #f5f5f7;
    --surface:      #ffffff;
    --text:         #1d1d1f;
    --text-sec:     #6e6e73;
    --accent:       #0071e3;
    --accent-hover: #0066cc;
    --border:       rgba(0,0,0,0.08);
    --radius:       18px;
    --nav-height:   44px;
    --shadow:       0 20px 60px rgba(0,0,0,0.12);
    --shadow-hover: 0 40px 100px rgba(0,0,0,0.18);
    --transition:   0.33s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html.dark {
    /* Dark theme — ERPUNO style */
    --bg:           #0f1115;
    --surface:      #17191f;
    --text:         #e5e7eb;
    --text-sec:     #9ca3af;
    --accent:       #3b82f6;
    --accent-hover: #2563eb;
    --border:       #2d3748;
    --radius:       12px;
    --nav-height:   64px;
    --shadow:       0 20px 50px rgba(0,0,0,0.35);
    --shadow-hover: 0 35px 80px rgba(0,0,0,0.5);
    --transition:   0.22s ease;
}

/* ── Base ──────────────────────────────────────── */
* { 
    margin:0; 
    padding:0; 
    box-sizing:border-box; 
}
html { 
    scroll-behavior:smooth; 
    -webkit-text-size-adjust:100%; 
}
body {
    background:var(--bg);
    color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
    font-size:17px;
    line-height:1.5;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

/* ── Navigation ────────────────────────────────── */
nav, .sticky {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(245,245,247,0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: background .4s ease;
}
html.dark nav,
html.dark .sticky {
    background: rgba(15,17,21,0.92);
}
nav.scrolled,
.sticky.scrolled {
    background: rgba(245,245,247,0.98);
}
html.dark nav.scrolled,
html.dark .sticky.scrolled {
    background: rgba(15,17,21,0.98);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}
.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}
.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}
.nav-links a {
    color: var(--text-sec);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}
.nav-links a:hover { 
    color: var(--accent); 
}
.cta-button {
    background: var(--accent);
    color: white;
    padding: 8px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
}
.cta-button:hover { 
    background: var(--accent-hover); 
}

/* ── Hero — H1 perfectly centered ───────────────────────────── */
header {
    padding: 120px 24px 80px;
    text-align: center;
}
html.dark header {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #0f1115, #1a1f2e);
}
.hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
h1 {
    font-family: SF Pro Display, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(56px, 10vw, 96px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 0.95;
    margin-top: 56px;
    margin-bottom: 16px;
}
.hero-subtitle {
    font-size: 1.375rem;
    color: var(--text-sec);
    max-width: 720px;
    margin: 0 auto 2.5rem;
}

/* ── Sections (ported from erpuno.css — 1280px wide) ─────────── */
.section-products, 
.section-solutions, 
.section-standards {
    max-width: 1280px;
    margin: 120px auto;
    padding: 0 24px;
}
h2 {
    font-family: SF Pro Display, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: -0.015em;
}

/* Products grid (ported & improved) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
}
.product-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}
.product-card h3 { 
    font-size: 1.5rem; 
    margin-bottom: 1rem; 
    color: var(--text);
}
.product-card p {
    color: var(--text-sec);
    margin-bottom: 1.5rem;
}
.product-card a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* Solutions grid */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    text-align: center;
}
.solutions-grid > div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text);
}

/* Standards */
.standards-list {
    list-style: none;
    font-size: 1.125rem;
    color: var(--text-sec);
    max-width: 800px;
    margin: 0 auto 28px;
    line-height: 2;
}

/* ── Code snippet ──────────────────────────────── */
figure code {
    display: block;
    background: #1d1d1f;
    color: #f5f5f7;
    padding: 20px 24px;
    border-radius: var(--radius);
    font-family: SF Mono, Menlo, monospace;
    font-size: 15px;
    overflow-x: auto;
    margin: 32px 0;
}

/* ── Aside ─────────────────────────────────────── */
aside {
    max-width: 860px;
    margin: 80px auto;
    padding: 0 24px;
}

/* ── CTA Banner ────────────────────────────────── */
.cta-banner {
    text-align: center;
    padding: 6rem 24px;
    margin: 120px 0 0;
    background: linear-gradient(135deg, var(--surface), #1a1f2e);
    border-radius: var(--radius);
}
html.dark .cta-banner {
    background: linear-gradient(135deg, #1B1F1F, #1B1217);
}

/* ── Footer — ORIGINAL ERPUNO STYLE (no centering) ─────────────────────── */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 80px 24px 60px;
    color: var(--text-sec);
    font-size: 15px;
}
html.dark footer {
    background: #0a0c10;
    padding: 5rem 24px 3rem;
}

.footer-columns {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
}

.footer-columns h4 {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
    color: var(--text);
    font-weight: 600;
}

.footer-columns ul {
    list-style: none;
}

.footer-columns a {
    color: var(--text-sec);
    text-decoration: none;
    line-height: 2.1;
    display: block;
}
.footer-columns a:hover {
    color: var(--accent);
}

/* Support for simple footer in index.html */
footer a:not(.footer-columns a) {
    color: var(--accent);
}
.heart {
    color: #ff3b30;
}

/* ── Responsive + iOS fixes ────────────────────── */
@media (max-width: 768px) {
    header { padding-top: 100px; }
    .section-products, .section-solutions, .section-standards { margin: 100px auto; }
    h2, h3 { font-size: 48px; }
    .product-grid, .solutions-grid { gap: 1.5rem; }
    .footer-columns {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 2rem;
    }
    footer { padding: 60px 24px 40px; }
    html.dark footer { padding: 4rem 24px 2.5rem; }
}

@media (max-width: 480px) {
    nav, .sticky { padding: 0 16px; }
    h1 { font-size: 56px; }
    footer { padding-left: 16px; padding-right: 16px; }
}

/* iOS notch / safe area */
@supports (padding:max(0px)) {
    nav, .sticky {
        padding-top: max(0px, env(safe-area-inset-top));
    }
}
