/* =====================================================
   STARKCODE — ГЛАВНАЯ СТРАНИЦА (в стиле apple.com, в цветах StarkCode)
   Подключается после style.css. Использует переменные темы,
   поэтому работает и в тёмной, и в светлой теме.
   ===================================================== */

.home-page {
    --hp-radius: 30px;
    --hp-gap: 14px;
    --hp-max: 1240px;
    --hp-glow: rgba(36, 123, 255, .16);
    --hp-glow-2: rgba(85, 72, 232, .16);
    --hp-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    --hp-grad: linear-gradient(135deg, #247BFF 0%, #5548E8 100%);
}
:root[data-theme="light"] .home-page {
    --hp-glow: rgba(36, 123, 255, .12);
    --hp-glow-2: rgba(85, 72, 232, .10);
    --hp-shadow: 0 18px 44px rgba(31, 45, 90, .12);
}

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- ШАПКА ---------- */

.home-page .site-header-inner { min-height: 60px; gap: 24px; position: relative; }
.home-page .site-logo img { width: auto; height: 30px; max-width: 150px; }

.home-page .site-nav {
    flex: 1;
    justify-content: center;
    margin: 0;
    gap: 6px;
}
.home-page .hn-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}
.home-page .hn-link::after { display: none; }
.home-page .hn-link:hover,
.home-page .hn-link:focus-visible,
.home-page .hn-trigger[aria-expanded="true"] { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.hn-trigger svg { transition: transform .25s ease; }
.hn-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.home-page .hn-link:focus-visible,
.hp-link:focus-visible,
.hn-mega a:focus-visible,
.hn-mobile a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* мега-меню */
.hn-mega {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, .25);
    opacity: 0;
    translate: 0 -8px;
    transition: opacity .22s ease, translate .22s ease;
}
.hn-mega:not([hidden]).is-open { opacity: 1; translate: 0 0; }
.hn-mega[hidden] { display: none; }
.hn-mega-inner {
    width: min(var(--hp-max), calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 40px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 48px;
}
.hn-mega-col { display: flex; flex-direction: column; gap: 10px; }
.hn-mega-title {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}
.hn-mega a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    opacity: .82;
    transition: opacity .18s ease, color .18s ease, translate .18s ease;
}
.hn-mega a:hover { opacity: 1; color: var(--blue); }
.hn-mega-main a { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.hn-mega-main a b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.hn-mega-main a small { color: var(--text-secondary); font-size: 13px; font-weight: 400; }
.hn-mega-main a:hover { translate: 4px 0; }

.hn-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(5, 8, 16, .42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity .22s ease;
}
.hn-backdrop.is-open { opacity: 1; }
.hn-backdrop[hidden] { display: none; }

/* бургер и мобильное меню */
.hn-burger {
    display: none;
    position: relative;
    width: 40px; height: 40px;
    border: 0; border-radius: 12px;
    background: none;
    cursor: pointer;
    color: var(--text);
}
.hn-burger span {
    position: absolute;
    left: 11px; right: 11px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .25s ease, top .25s ease;
}
.hn-burger span:nth-child(1) { top: 16px; }
.hn-burger span:nth-child(2) { top: 23px; }
.hn-burger[aria-expanded="true"] span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.hn-burger[aria-expanded="true"] span:nth-child(2) { top: 20px; transform: rotate(-45deg); }

.hn-mobile {
    position: fixed;
    inset: 0;
    z-index: 95;
    padding: 76px 24px 40px;
    overflow-y: auto;
    background: var(--bg);
}
.hn-mobile[hidden] { display: none; }
.hn-mobile nav { display: flex; flex-direction: column; gap: 4px; max-width: 520px; margin: 0 auto; }
.hn-mobile .hn-mega-title { margin: 22px 0 6px; }
.hn-mobile a {
    padding: 10px 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.02em;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}
body.hn-locked { overflow: hidden; }

/* ---------- ОБЩЕЕ ---------- */

.hp-main { overflow-x: clip; }
.hp-inner { width: min(var(--hp-max), calc(100% - 40px)); margin: 0 auto; }

.hp-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--blue);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
}
.hp-link span { transition: translate .2s ease; font-size: 1.2em; }
.hp-link:hover { text-decoration: underline; }
.hp-link:hover span { translate: 3px 0; }

.hp-heading { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.hp-heading h2 { margin: 10px 0 14px; font-size: clamp(30px, 4.6vw, 52px); line-height: 1.07; letter-spacing: -.03em; }
.hp-heading p { margin: 0; color: var(--text-secondary); font-size: 18px; line-height: 1.55; }

.hp-section { padding: 96px 0; }
.hp-section-alt { background: var(--bg-secondary); }

/* появление при скролле */
.js-reveal .reveal { opacity: 0; translate: 0 26px; transition: opacity .7s ease, translate .7s cubic-bezier(.2, .7, .2, 1); }
.js-reveal .reveal.is-visible { opacity: 1; translate: 0 0; }
[data-motion="reduced"] .reveal { opacity: 1 !important; translate: none !important; transition: none !important; }

/* ---------- HERO ---------- */

.hp-hero {
    position: relative;
    padding: 96px 20px 70px;
    text-align: center;
    background:
        radial-gradient(closest-side at 50% 0%, var(--hp-glow), transparent) 50% 0 / min(1100px, 100%) 640px no-repeat,
        radial-gradient(closest-side at 50% 50%, var(--hp-glow-2), transparent) 85% 20% / 520px 420px no-repeat;
}
.hp-eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: #a78bfa; }
:root[data-theme="light"] .hp-eyebrow { color: var(--purple); }
.hp-hero h1 {
    margin: 18px auto 0;
    max-width: 920px;
    font-size: clamp(34px, 7.4vw, 84px);
    line-height: 1.03;
    letter-spacing: -.045em;
}
.hp-hero h1 span {
    display: block;
    background: var(--hp-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hp-hero p { max-width: 640px; margin: 26px auto 0; color: var(--text-secondary); font-size: clamp(17px, 2vw, 21px); line-height: 1.5; }
.hp-hero-actions { margin-top: 34px; display: flex; justify-content: center; align-items: center; gap: 28px; flex-wrap: wrap; }

.hp-stats {
    list-style: none;
    margin: 56px auto 0;
    padding: 0;
    max-width: 720px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.hp-stats li { display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.hp-stats b { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.03em; }
.hp-stats span { color: var(--text-muted); font-size: 14px; }

/* ---------- ПЛИТКИ ---------- */

.hp-tiles {
    width: min(var(--hp-max), calc(100% - 28px));
    margin: 0 auto;
    padding-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hp-gap);
}
.hp-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 600px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--hp-radius);
    background:
        radial-gradient(ellipse 80% 50% at 50% 100%, var(--hp-glow), transparent 70%),
        var(--card);
    text-align: center;
    transition: border-color .3s ease, box-shadow .3s ease, transform .4s cubic-bezier(.2, .7, .2, 1);
}
.hp-tile:hover { border-color: var(--border-hover); box-shadow: var(--hp-shadow); }
.hp-tile-text { padding: 44px 32px 0; z-index: 1; }
.hp-tag { display: inline-block; margin-bottom: 10px; color: var(--text-muted); font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.hp-tile h2 { margin: 0; font-size: clamp(34px, 4.2vw, 52px); line-height: 1.05; letter-spacing: -.035em; }
.hp-tile p { max-width: 430px; margin: 12px auto 0; color: var(--text-secondary); font-size: 19px; line-height: 1.4; }
.hp-tile-links { margin-top: 22px; display: flex; gap: 22px; justify-content: center; align-items: center; flex-wrap: wrap; }
.hp-btn { padding: 11px 22px; font-size: 16px; min-height: 0; }
.hp-tile-media { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding: 28px 24px 0; min-height: 280px; }
.hp-tile-media img {
    display: block;
    width: 100%;
    max-width: 560px;
    height: auto;
    transform-origin: 50% 100%;
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.hp-tile:hover .hp-tile-media img { transform: scale(1.035) translateY(-4px); }

.hp-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 44px;
    display: flex;
    align-items: center;
    padding: 0 22px;
    gap: 12px;
    background: linear-gradient(to top, var(--card) 40%, transparent);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.hp-progress[hidden] { display: none; }
.hp-progress::before { content: ""; position: absolute; left: 22px; right: 22px; bottom: 14px; height: 4px; border-radius: 4px; background: var(--border); }
.hp-progress i { position: absolute; left: 22px; bottom: 14px; height: 4px; border-radius: 4px; background: var(--hp-grad); width: 0; transition: width .8s ease; }
.hp-progress span { position: absolute; right: 22px; bottom: 22px; }

.hp-tile-soon .hp-tag { color: #f5b82e; }
.hp-tile-soon .hp-tile-media img { filter: saturate(.8); opacity: .92; }

.hp-tile-ai {
    border: 0;
    color: #fff;
    background: var(--hp-grad);
}
.hp-tile-ai .hp-tile-text { padding-top: 44px; }
.hp-tile-ai .hp-tag, .hp-tile-ai p { color: rgba(255, 255, 255, .84); }
.hp-tile-ai h2 { color: #fff; }
.hp-btn-light { background: #fff; color: #2a2f9f; border: 0; box-shadow: none; }
.hp-btn-light:hover { background: #eef1ff; color: #2a2f9f; }
.hp-tile-ai:hover { box-shadow: 0 24px 60px rgba(85, 72, 232, .38); }

/* каталог для script.js (поиск и окно курса) — на главной не показываем */
#courseCatalog > .text, #courseCatalog > .search-box, #courseCatalog > #courseCount, #courseCatalog > #courseList { display: none; }
#courseCatalog { padding: 0; margin: 0; min-height: 0; }
/* ---------- ПУТЬ ---------- */

.hp-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; position: relative; counter-reset: x; }
.hp-path li {
    position: relative;
    display: flex; flex-direction: column; gap: 14px;
    padding: 24px 20px 26px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--card);
    transition: border-color .25s ease, translate .3s ease;
}
.hp-path li:hover { border-color: var(--border-hover); translate: 0 -4px; }
.hp-path li + li::before {
    content: "";
    position: absolute;
    left: -15px; top: 42px;
    width: 14px; height: 2px;
    background: var(--border-hover);
}
.hp-path .hp-branch { border-style: dashed; }
.hp-step {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--hp-grad);
    color: #fff;
    font-weight: 800;
}
.hp-path h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; }
.hp-path p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.45; }
.hp-path em { margin-top: auto; font-style: normal; font-size: 13px; font-weight: 600; color: var(--blue); }
.hp-path li.is-done .hp-step { background: #22c55e; }

/* ---------- КАРТОЧКИ ---------- */

.hp-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--hp-gap); }
.hp-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--hp-gap); }
.hp-card {
    padding: 30px 26px 34px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    transition: border-color .25s ease, translate .3s ease;
}
.hp-card:hover { border-color: var(--border-hover); }
.hp-card-num { display: inline-block; margin-bottom: 38px; font-size: 14px; font-weight: 800; letter-spacing: .1em; color: #a78bfa; }
:root[data-theme="light"] .hp-card-num { color: var(--purple); }
.hp-card h3 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.025em; }
.hp-card p { margin: 0; color: var(--text-secondary); font-size: 16px; line-height: 1.5; }
.hp-card-big { padding: 40px 32px 44px; min-height: 240px; background: radial-gradient(ellipse 90% 70% at 0% 0%, var(--hp-glow), transparent 70%), var(--card); }
.hp-card-big h3 { font-size: 28px; }

/* ---------- FAQ / CTA ---------- */

.hp-faq { padding-top: 96px; }
.hp-final { padding: 110px 20px 130px; text-align: center; background: radial-gradient(ellipse 60% 70% at 50% 100%, var(--hp-glow), transparent 70%); }
.hp-final h2 { margin: 0 0 14px; font-size: clamp(32px, 5.4vw, 60px); line-height: 1.06; letter-spacing: -.035em; }
.hp-final p { margin: 0 0 30px; color: var(--text-secondary); font-size: 19px; }

/* ---------- ПОДВАЛ ---------- */

.hp-footer { background: var(--bg-secondary); border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; }
.hp-footer-inner { width: min(var(--hp-max), calc(100% - 40px)); margin: 0 auto; padding: 28px 0 24px; }
.hp-footer-note { margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border); line-height: 1.5; }
.hp-footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.hp-footer h4 { margin: 0 0 12px; color: var(--text); font-size: 12px; font-weight: 700; }
.hp-footer-cols a { display: block; padding: 4px 0; color: var(--text-secondary); text-decoration: none; transition: color .2s ease; }
.hp-footer-cols a:hover { color: var(--text); text-decoration: underline; }
.hp-footer-bottom { padding-top: 18px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-muted); }

/* ---------- АДАПТИВ ---------- */

@media (max-width: 1000px) {
    .hp-path { grid-template-columns: repeat(2, 1fr); }
    .hp-path li + li::before { display: none; }
    .hp-steps { grid-template-columns: repeat(2, 1fr); }
    .hp-results { grid-template-columns: 1fr; }
    .home-page .site-nav { gap: 0; }
    .home-page .hn-link { padding: 8px 10px; }
}

@media (max-width: 820px) {
    .home-page .site-nav, .hn-mega { display: none !important; }
    .hn-burger { display: block; }
    .home-page .site-header-inner { gap: 10px; }
    .home-page .site-header-actions { margin-left: auto; }
    .hp-tiles { grid-template-columns: 1fr; }
    .hp-tile { min-height: 520px; }
    .hp-section { padding: 70px 0; }
    .hp-footer-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .hp-hero { padding: 64px 16px 50px; }
    .hp-stats { grid-template-columns: repeat(2, 1fr); }
    .hp-path, .hp-steps { grid-template-columns: 1fr; }
    .hp-tile-text { padding: 36px 22px 0; }
    .hp-tile p { font-size: 17px; }
    .hp-tile { min-height: 480px; }
    .hp-progress { padding: 0 18px; }
    .hp-btn { width: auto; }
    .home-page .site-logo img { height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .hp-tile, .hp-tile-media img, .hp-card, .hp-path li { transition: none; }
}

.hp-faq .home-section-heading { text-align: center; }
.hp-faq .home-section-heading .home-section-label { display: inline-block; }
