/* =========================================================
   EPOCOACH — Premium Carbon Tech
   Mobile-first, vanilla CSS3, no external dependencies
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
    --bg:            #0a0a0a;
    --bg-2:          #141414;
    --surface:       #1a1a1a;
    --surface-2:     #202020;
    --line:          rgba(255, 255, 255, 0.08);
    --line-strong:   rgba(255, 255, 255, 0.16);

    --white:         #ffffff;
    --text:          #cccccc;
    --text-dim:      #8a8a8a;

    --accent:        #FF4D00;
    --accent-2:      #FF5500;
    --accent-glow:   rgba(255, 77, 0, 0.45);
    --accent-soft:   rgba(255, 77, 0, 0.12);

    --radius:        16px;
    --radius-sm:     10px;
    --radius-pill:   100px;

    --shadow:        0 18px 50px rgba(0, 0, 0, 0.55);
    --shadow-accent: 0 12px 34px rgba(255, 77, 0, 0.32);

    --maxw:          1200px;
    --gutter:        clamp(16px, 5vw, 40px);

    --ease:          cubic-bezier(0.22, 1, 0.36, 1);
    --font:          -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 86px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 { color: var(--white); line-height: 1.18; font-weight: 800; letter-spacing: -0.01em; }
strong { color: var(--white); font-weight: 700; }

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

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

/* ---------- Carbon-fiber weave background (pure CSS) ---------- */
/* Reused twill-weave pattern that imitates углеволокно */
.carbon-divider {
    height: 14px;
    width: 100%;
    background-color: #0d0d0d;
    background-image:
        linear-gradient(27deg, #1c1c1c 12.5%, transparent 12.5%, transparent 25%, #1c1c1c 25%, #1c1c1c 37.5%, transparent 37.5%, transparent 50%),
        linear-gradient(-27deg, #1c1c1c 12.5%, transparent 12.5%, transparent 25%, #1c1c1c 25%, #1c1c1c 37.5%, transparent 37.5%, transparent 50%);
    background-size: 12px 12px;
    border-top: 1px solid var(--accent-soft);
    border-bottom: 1px solid rgba(0,0,0,0.6);
    position: relative;
}
.carbon-divider::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    opacity: 0.5;
    height: 1px;
    top: -1px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 28px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
    will-change: transform;
    text-align: center;
}
.btn-lg { padding: 18px 34px; font-size: 17px; }
.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--white);
    box-shadow: var(--shadow-accent);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 44px var(--accent-glow); }
.btn-primary:active { transform: translateY(-1px) scale(0.99); }

.btn-ghost {
    background: transparent;
    color: var(--white);
    border: 1.5px solid var(--line-strong);
    padding: 12px 22px;
    font-size: 15px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-ghost:active { transform: translateY(0); }

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 72px;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark { display: flex; flex-shrink: 0; filter: drop-shadow(0 0 6px var(--accent-glow)); }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { color: var(--white); font-weight: 800; font-size: 19px; letter-spacing: 0.12em; }
.logo-sub { color: var(--text-dim); font-size: 10.5px; letter-spacing: 0.04em; }

.main-nav { display: none; gap: 28px; }
.nav-link {
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    padding: 6px 0;
    transition: color 0.2s var(--ease);
}
.nav-link::after {
    content: ""; position: absolute; left: 0; bottom: 0;
    width: 0; height: 2px; background: var(--accent);
    transition: width 0.25s var(--ease);
}
.nav-link:hover { color: var(--white); }
.nav-link:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-phone {
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-weight: 700;
    font-size: 15px;
    padding: 9px 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-pill);
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.header-phone svg { color: var(--accent); }
.header-phone:hover { border-color: var(--accent); }

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    color: var(--white);
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-tg:hover { border-color: #29a9eb; color: #29a9eb; transform: translateY(-2px); }

/* Burger */
.burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line-strong);
}
.burger span {
    display: block; height: 2px; width: 100%;
    background: var(--white); border-radius: 2px;
    transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-active span:nth-child(2) { opacity: 0; }
.burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding-top: 132px;
    padding-bottom: 60px;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 77, 0, 0.14), transparent 42%),
        radial-gradient(circle at 85% 70%, rgba(255, 77, 0, 0.10), transparent 45%),
        repeating-linear-gradient(45deg, #0d0d0d 0 8px, #111 8px 16px),
        repeating-linear-gradient(-45deg, rgba(0,0,0,0.5) 0 8px, transparent 8px 16px),
        var(--bg);
    background-blend-mode: screen, screen, normal, normal, normal;
    background-size: auto, auto, 22px 22px, 22px 22px, auto;
}
/* If a real hero image is dropped into images/hero-carbon.(png|jpg), it layers on top */
.hero-bg::before {
    content: "";
    position: absolute; inset: 0;
    background-image: image-set(url("images/hero-carbon.jpg") 1x);
    background-image: url("images/hero-carbon.jpg");
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s var(--ease);
}
.hero-bg.has-image::before { opacity: 0.55; }

.hero-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.78) 55%, var(--bg) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: 880px; }

.hero-badge {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-pill);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 22px;
    background: var(--accent-soft);
}
.hero-title {
    font-size: clamp(32px, 8vw, 60px);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}
.hero-subtitle {
    font-size: clamp(16px, 3.4vw, 20px);
    color: var(--text);
    max-width: 680px;
    margin-bottom: 28px;
}

.hero-hook {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(255,77,0,0.18), rgba(255,77,0,0.06));
    border: 1px solid var(--accent);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 30px;
    box-shadow: 0 0 30px rgba(255,77,0,0.18);
}
.hook-fire { font-size: 22px; flex-shrink: 0; }
.hook-text { color: var(--white); font-size: clamp(14px, 3.2vw, 17px); }

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 26px;
    margin-top: 26px;
}
.hero-points li { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 14.5px; }
.hero-points .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
    flex-shrink: 0;
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 100px) 0; position: relative; }
.section-tag {
    display: inline-block;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.section-tag.center, .section-title.center, .section-lead.center { text-align: center; }
.section-title { font-size: clamp(26px, 6vw, 42px); margin-bottom: 18px; }
.section-lead { color: var(--text); font-size: clamp(15px, 3vw, 18px); max-width: 680px; margin: 0 auto 44px; }
.center.section-tag { display: block; }

/* ---------- Lab section ---------- */
.lab-section { background: var(--bg-2); }
.lab-grid { display: grid; gap: 40px; }
.lab-text { font-size: clamp(15px, 3vw, 17px); margin-bottom: 30px; }

.lab-formats { display: grid; gap: 16px; margin-bottom: 32px; }
.format-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.format-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.format-icon {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 14px;
}
.format-card h3 { font-size: 18px; margin-bottom: 8px; }
.format-card p { font-size: 14.5px; color: var(--text); }

.lab-visual-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.lab-stat {
    background: var(--surface);
    padding: 28px 20px;
    text-align: center;
    transition: background 0.3s var(--ease);
}
.lab-stat:hover { background: var(--surface-2); }
.stat-num { display: block; font-size: clamp(30px, 7vw, 44px); font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { display: block; margin-top: 8px; font-size: 13px; color: var(--text-dim); }

/* ---------- Program steps ---------- */
.steps { display: grid; gap: 18px; }
.step-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.step-card::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--accent);
    transform: scaleY(0); transform-origin: top;
    transition: transform 0.35s var(--ease);
}
.step-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.step-card:hover::before { transform: scaleY(1); }
.step-num {
    display: inline-block;
    font-size: 14px; font-weight: 800; color: var(--accent);
    letter-spacing: 0.1em; margin-bottom: 12px;
    border: 1px solid var(--accent-soft); border-radius: 8px;
    padding: 4px 10px;
}
.step-card h3 { font-size: 18px; margin-bottom: 10px; }
.step-card p { font-size: 14.5px; color: var(--text); }

/* ---------- Blog ---------- */
.blog-grid { display: grid; gap: 20px; }
.blog-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.blog-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.blog-card-top { display: flex; align-items: center; justify-content: space-between; }
.blog-cat {
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--accent); background: var(--accent-soft);
    padding: 5px 12px; border-radius: var(--radius-pill);
}
.blog-art {
    width: 46px; height: 46px; border-radius: 12px;
    background-color: #0d0d0d;
    background-image:
        repeating-linear-gradient(45deg, #1c1c1c 0 4px, transparent 4px 8px),
        repeating-linear-gradient(-45deg, rgba(255,77,0,0.25) 0 4px, transparent 4px 8px);
    border: 1px solid var(--line);
}
.blog-card h3 { font-size: 17px; line-height: 1.3; overflow-wrap: break-word; word-break: break-word; }
.blog-card p { font-size: 14px; color: var(--text); flex-grow: 1; }
.blog-card .btn-ghost { align-self: flex-start; margin-top: 4px; }

/* ---------- CTA ---------- */
.cta-section { background: var(--bg-2); }
.cta-inner {
    text-align: center;
    max-width: 760px;
    background: linear-gradient(135deg, rgba(255,77,0,0.10), rgba(20,20,20,0.4));
    border: 1px solid var(--accent-soft);
    border-radius: 24px;
    padding: clamp(36px, 7vw, 60px) clamp(24px, 5vw, 50px);
    box-shadow: 0 0 60px rgba(255,77,0,0.10);
}
.cta-title { font-size: clamp(24px, 5.5vw, 38px); margin-bottom: 16px; }
.cta-text { font-size: clamp(15px, 3vw, 18px); margin-bottom: 30px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg); border-top: 1px solid var(--line); padding-top: clamp(48px, 8vw, 72px); }
.footer-inner { display: grid; gap: 38px; padding-bottom: 44px; }
.footer-logo { margin-bottom: 16px; }
.footer-about { font-size: 14px; color: var(--text-dim); max-width: 360px; }
.footer-title { font-size: 16px; margin-bottom: 18px; letter-spacing: 0.04em; }
.contact-list { display: flex; flex-direction: column; gap: 14px; }
.contact-link {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--text); font-size: 15.5px; font-weight: 600;
    transition: color 0.2s var(--ease);
}
.contact-link svg { color: var(--accent); flex-shrink: 0; }
.contact-link:hover { color: var(--white); }

.footer-messengers { display: flex; flex-direction: column; gap: 12px; }
.msg-link {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 18px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-pill);
    color: var(--white); font-weight: 600; font-size: 14.5px;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.msg-tg:hover { border-color: #29a9eb; color: #29a9eb; transform: translateY(-2px); }
.msg-link svg { flex-shrink: 0; }

.footer-bottom { border-top: 1px solid var(--line); padding: 22px 0; }
.footer-bottom p { font-size: 13px; color: var(--text-dim); text-align: center; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.modal-overlay[hidden] { display: none; }
.modal-overlay.is-open { opacity: 1; }

.modal-window {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: linear-gradient(160deg, #161616, #0e0e0e);
    border: 1.5px solid var(--accent);
    border-radius: 22px;
    padding: clamp(28px, 6vw, 42px) clamp(22px, 5vw, 38px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 50px rgba(255,77,0,0.18);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.35s var(--ease);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.modal-overlay.is-open .modal-window { transform: translateY(0) scale(1); }

.modal-close {
    position: absolute; top: 14px; right: 16px;
    width: 40px; height: 40px;
    font-size: 28px; line-height: 1; color: var(--text-dim);
    border-radius: 50%;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.modal-close:hover { color: var(--white); background: var(--surface-2); }
.modal-fire { font-size: 34px; margin-bottom: 10px; }
.modal-title { font-size: clamp(21px, 5vw, 27px); margin-bottom: 12px; }
.modal-sub { font-size: 14.5px; color: var(--text); margin-bottom: 26px; }

/* ---------- Form ---------- */
.lead-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.input {
    width: 100%;
    padding: 15px 18px;
    background: var(--bg);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 16px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input::placeholder { color: var(--text-dim); }
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input.is-invalid { border-color: #ff3b30; box-shadow: 0 0 0 3px rgba(255,59,48,0.15); }
.field-error { font-size: 12.5px; color: #ff6b60; min-height: 0; }

.btn-submit { position: relative; margin-top: 6px; }
.btn-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-submit.is-loading .btn-label { opacity: 0.6; }
.btn-submit.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-note { font-size: 11.5px; color: var(--text-dim); text-align: center; }
.form-status { font-size: 14.5px; text-align: center; min-height: 0; }
.form-status.is-success { color: #34d36a; padding-top: 4px; }
.form-status.is-error { color: #ff6b60; padding-top: 4px; }

/* ---------- Body lock when modal open ---------- */
body.modal-open { overflow: hidden; }

/* ---------- Mobile nav drawer ---------- */
@media (max-width: 899px) {
    .main-nav {
        position: fixed;
        top: 72px; left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(10,10,10,0.98);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--line);
        padding: 8px var(--gutter) 18px;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }
    .main-nav.is-open { display: flex; opacity: 1; transform: translateY(0); pointer-events: auto; }
    .nav-link { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
    .nav-link::after { display: none; }
}

/* =========================================================
   RESPONSIVE — Tablet ≥ 600px
   ========================================================= */
@media (min-width: 600px) {
    .lab-formats { grid-template-columns: 1fr 1fr; }
    .steps { grid-template-columns: 1fr 1fr; }
    .blog-grid { grid-template-columns: 1fr 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   RESPONSIVE — Desktop ≥ 900px
   ========================================================= */
@media (min-width: 900px) {
    .main-nav { display: flex; }
    .header-phone { display: inline-flex; }
    .burger { display: none; }

    .lab-grid { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
    .footer-inner { grid-template-columns: 1.6fr 1fr 1fr; }
}

/* =========================================================
   RESPONSIVE — Wide ≥ 1100px
   ========================================================= */
@media (min-width: 1100px) {
    .steps { grid-template-columns: repeat(4, 1fr); }
    .blog-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =========================================================
   UltraWide ≥ 1600px — keep content centered, no stretch
   ========================================================= */
@media (min-width: 1600px) {
    :root { --maxw: 1320px; }
    .hero-inner { max-width: 960px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
