/* ==========================================================================
   SEA-PRO — страница-распределитель (gateway page)
   Чистый CSS3: custom properties, Grid, Flexbox, clamp(), backdrop-filter,
   aspect-ratio, prefers-reduced-motion. Без внешних шрифтов и библиотек.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Базовая палитра: графит / глубокий морской синий / белый / стальной серый */
    --color-bg-deep: #050a12;
    --color-bg-navy: #0a1526;
    --color-bg-navy-soft: #0e1d34;
    --color-steel: #8fa3b8;
    --color-steel-dim: #5c6e82;
    --color-white: #f5f8fb;

    /* Акцент: бирюзовый / голубое свечение */
    --color-accent: #2dd4bf;
    --color-accent-2: #38bdf8;
    --color-accent-glow: rgba(45, 212, 191, 0.35);

    /* Стекло */
    --glass-bg: rgba(245, 248, 251, 0.045);
    --glass-bg-hover: rgba(245, 248, 251, 0.08);
    --glass-border: rgba(245, 248, 251, 0.12);
    --glass-border-hover: rgba(45, 212, 191, 0.45);

    /* Системный стек шрифтов — без загрузки внешних файлов */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

    /* Ритм и радиусы */
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --space-5: 3rem;
    --space-6: 4.5rem;
    --space-7: 7rem;

    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 999px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-base: 500ms;
    --duration-slow: 1200ms;

    --shadow-card: 0 30px 60px -20px rgba(2, 8, 20, 0.65);
    --shadow-card-hover: 0 40px 80px -20px rgba(2, 8, 20, 0.8);
}

/* --------------------------------------------------------------------------
   2. Reset & базовые элементы
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    color-scheme: dark;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-sans);
    color: var(--color-white);
    background: var(--color-bg-deep);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

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

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

/* Плавный якорный скролл, но отключается для reduced-motion ниже */
html {
    scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   3. Фоновая сцена — градиенты, сетка, свечения, шум, волны
   Всё это фиксированный слой позади контента (position:fixed), не мешает
   скроллу и не участвует в layout — «фон не должен отвлекать от контента».
   -------------------------------------------------------------------------- */
.scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 50% at 50% -10%, rgba(45, 212, 191, 0.10), transparent 60%),
        radial-gradient(ellipse 55% 45% at 100% 100%, rgba(56, 189, 248, 0.08), transparent 60%),
        linear-gradient(180deg, var(--color-bg-deep) 0%, var(--color-bg-navy) 55%, var(--color-bg-navy-soft) 100%);
}

/* Тонкая инженерная сетка — индустриальный минимализм */
.scene-grid {
    position: absolute;
    inset: -2px;
    background-image:
        linear-gradient(rgba(143, 163, 184, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(143, 163, 184, 0.07) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 85%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 85%);
    will-change: transform;
}

/* Мягкие светящиеся сферы — двигаются parallax-ом от мыши (см. script.js)
   и слегка «дышат» через keyframes ниже */
.scene-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    will-change: transform;
}
.scene-glow--a {
    top: 8%;
    left: 12%;
    width: clamp(240px, 30vw, 520px);
    aspect-ratio: 1;
    background: var(--color-accent);
    animation: drift-a 16s ease-in-out infinite;
}
.scene-glow--b {
    bottom: 4%;
    right: 8%;
    width: clamp(260px, 34vw, 560px);
    aspect-ratio: 1;
    background: var(--color-accent-2);
    animation: drift-b 20s ease-in-out infinite;
}
.scene-glow--c {
    top: 42%;
    left: 50%;
    width: clamp(200px, 26vw, 420px);
    aspect-ratio: 1;
    background: #6ee7ff;
    opacity: 0.28;
    animation: drift-c 24s ease-in-out infinite;
}

/* Абстрактные морские линии внизу экрана — не буквальные "волны",
   а тонкие расходящиеся штрихи, намекающие на кильватерный след */
.scene-lines {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6%;
    height: 42vh;
    opacity: 0.35;
}
.scene-lines svg {
    width: 100%;
    height: 100%;
}
.scene-lines path {
    animation: line-shift 14s ease-in-out infinite;
}
.scene-lines path:nth-child(2) { animation-delay: -3s; opacity: 0.7; }
.scene-lines path:nth-child(3) { animation-delay: -7s; opacity: 0.45; }

/* Лёгкий шум поверх всего — убирает "плоскость" градиентов, выполнен через
   инлайн SVG feTurbulence, без внешних PNG/JPG */
.scene-noise {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift-a {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(4%, 6%); }
}
@keyframes drift-b {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, -4%); }
}
@keyframes drift-c {
    0%, 100% { transform: translate(-50%, 0) scale(1); }
    50% { transform: translate(-50%, -4%) scale(1.08); }
}
@keyframes line-shift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* --------------------------------------------------------------------------
   4. Layout — контентный слой поверх сцены
   -------------------------------------------------------------------------- */
.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-inline: clamp(20px, 6vw, 64px);
}

.hero {
    width: 100%;
    max-width: 1040px;
    padding-top: clamp(64px, 12vh, 128px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

/* Статус-бейдж "Скоро открытие" */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 14px;
    border-radius: var(--radius-full);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--color-steel);
    text-transform: uppercase;
}
.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 0 var(--color-accent-glow);
    animation: pulse 2.4s ease-out infinite;
    flex: none;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(45, 212, 191, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}

/* Главная надпись — единственный "логотип" страницы */
.hero-title {
    font-size: clamp(3.2rem, 12vw, 9rem);
    line-height: 0.95;
    font-weight: 800;
    letter-spacing: clamp(-0.02em, -0.5vw, -0.01em);
    background: linear-gradient(180deg, #ffffff 0%, #d7e4ee 45%, var(--color-accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 120px var(--color-accent-glow);
    white-space: nowrap;
}

.hero-subtitle {
    max-width: 620px;
    font-size: clamp(1rem, 1.6vw, 1.1875rem);
    line-height: 1.6;
    color: var(--color-steel);
    font-weight: 400;
}

.hero-status {
    margin-top: var(--space-1);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-white);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.hero-status::before,
.hero-status::after {
    content: "";
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-steel-dim));
}
.hero-status::after {
    background: linear-gradient(90deg, var(--color-steel-dim), transparent);
}

/* --------------------------------------------------------------------------
   5. Карточки-направления (glassmorphism)
   -------------------------------------------------------------------------- */
.routes {
    width: 100%;
    max-width: 1040px;
    margin-top: clamp(48px, 8vh, 96px);
    padding-bottom: clamp(56px, 10vh, 96px);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(16px, 3vw, 28px);
}
@media (max-width: 760px) {
    .routes {
        grid-template-columns: 1fr;
    }
}

.route-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: clamp(28px, 4vw, 40px);
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    isolation: isolate;
    transition: transform var(--duration-base) var(--ease-out),
        border-color var(--duration-base) var(--ease-out),
        box-shadow var(--duration-base) var(--ease-out),
        background var(--duration-base) var(--ease-out);
}

/* Внутреннее свечение на hover — не отдельный элемент, а псевдоэлемент,
   что бы не плодить DOM и не мешать hit-области ссылки */
.route-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 0%), var(--color-accent-glow), transparent 60%);
    transition: opacity var(--duration-base) var(--ease-out);
}

.route-card:hover,
.route-card:focus-within {
    transform: translateY(-6px);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-card-hover);
}
.route-card:hover::before,
.route-card:focus-within::before {
    opacity: 1;
}

.route-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: linear-gradient(155deg, rgba(45, 212, 191, 0.18), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(45, 212, 191, 0.25);
    color: var(--color-accent);
    flex: none;
}
.route-icon svg {
    width: 26px;
    height: 26px;
}

.route-title {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-white);
}

.route-desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-steel);
    flex: 1;
}

.route-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -4px;
}
.route-tag {
    font-size: 0.75rem;
    padding: 5px 11px;
    border-radius: var(--radius-full);
    background: rgba(245, 248, 251, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--color-steel);
    letter-spacing: 0.01em;
}

/* Кнопка-ссылка внутри карточки — растягиваем link на всю карточку через
   ::after + position:absolute, чтобы вся площадь была кликабельной,
   а видимая кнопка при этом остаётся отдельным декоративным элементом */
.route-cta {
    margin-top: var(--space-1);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-bg-deep);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
    transition: background var(--duration-base) var(--ease-out),
        transform var(--duration-base) var(--ease-out);
}
.route-card:hover .route-cta {
    background: var(--color-accent);
    color: var(--color-bg-deep);
}
.route-cta-arrow {
    width: 18px;
    height: 18px;
    flex: none;
    transition: transform var(--duration-base) var(--ease-out);
}
.route-card:hover .route-cta-arrow {
    transform: translateX(4px);
}

/* Ссылка-обёртка карточки — растянута на всю карточку, но текст читается
   скринридерами благодаря aria-label на самой ссылке (см. index.html) */
.route-card-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
}
.route-card-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: var(--space-4) var(--space-2) var(--space-5);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-steel-dim);
    letter-spacing: 0.01em;
}
.site-footer p + p {
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   7. Появление контента (JS выставляет .is-ready на <body> после загрузки —
   без JS всё остаётся видимым, деградация не ломает страницу)
   -------------------------------------------------------------------------- */
.badge,
.hero-title,
.hero-subtitle,
.hero-status,
.route-card {
    opacity: 0;
    transform: translateY(18px);
}

body.is-ready .badge { animation: reveal var(--duration-slow) var(--ease-out) 0.05s forwards; }
body.is-ready .hero-title { animation: reveal-title var(--duration-slow) var(--ease-out) 0.15s forwards; }
body.is-ready .hero-subtitle { animation: reveal var(--duration-slow) var(--ease-out) 0.35s forwards; }
body.is-ready .hero-status { animation: reveal var(--duration-slow) var(--ease-out) 0.48s forwards; }

body.is-ready .route-card { animation: reveal var(--duration-slow) var(--ease-out) forwards; }
body.is-ready .route-card:nth-of-type(1) { animation-delay: 0.6s; }
body.is-ready .route-card:nth-of-type(2) { animation-delay: 0.72s; }

@keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes reveal-title {
    0% { opacity: 0; transform: translateY(18px) scale(0.94); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Если JS отключён — контент виден сразу, без анимации застревания в opacity:0 */
body:not(.js) .badge,
body:not(.js) .hero-title,
body:not(.js) .hero-subtitle,
body:not(.js) .hero-status,
body:not(.js) .route-card {
    opacity: 1;
    transform: none;
}

/* --------------------------------------------------------------------------
   8. Доступность движения — уважаем системную настройку
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .scene-glow,
    .scene-lines path,
    .badge-dot {
        animation: none !important;
    }
    .badge,
    .hero-title,
    .hero-subtitle,
    .hero-status,
    .route-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .route-card,
    .route-cta,
    .route-cta-arrow {
        transition: none !important;
    }
}

/* --------------------------------------------------------------------------
   9. Точки адаптива
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .hero-title {
        white-space: normal;
    }
    .route-card {
        padding: 24px;
    }
}

@media (min-width: 1600px) {
    .hero,
    .routes {
        max-width: 1200px;
    }
}
