:root {
    --c-text:        #1f2937;
    --c-muted:       #475569;
    --c-accent:      #1e3a8a;
    --c-accent-soft: #3b82f6;
    --c-bg:          #ffffff;
    --c-bg-dark:     #0b1220;

    --font-display:  'Playfair Display', Georgia, serif;
    --font-body:     'Inter', system-ui, -apple-system, sans-serif;

    --max-content:   1200px;
    --max-wide:      1400px;

    --gutter:        clamp(0.75rem, 2vw, 1.5rem);
    --section-y:     clamp(3rem, 7vw, 6rem);
    --hero-pad-top:  clamp(3rem, 9vw, 9rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.55;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.hero {
    min-height: 100vh;
    padding: var(--hero-pad-top) var(--gutter) var(--section-y);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    isolation: isolate;
}

.hero__inner {
    text-align: center;
    margin-top: clamp(0px, 4vh, 4rem);
    position: relative;
    width: 100%;
}

.hero__title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1.6rem, 8.5vw, 7rem);
    letter-spacing: 0.06em;
    margin: 0 0 clamp(0.6rem, 1.5vw, 1.25rem);
    text-transform: uppercase;
    position: relative;
    z-index: 1;

    transform-origin: 50% 50%;
    will-change: transform, clip-path, opacity;

    background-image: linear-gradient(
        180deg,
        #1e3a8a   0%,
        #2563eb 12.5%,
        #3b82f6  25%,
        #2563eb 37.5%,
        #1e3a8a  50%,
        #2563eb 62.5%,
        #3b82f6  75%,
        #2563eb 87.5%,
        #1e3a8a 100%
    );
    background-size: 100% 200%;
    background-position: 0 0%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;

    filter:
        drop-shadow(0 0 8px rgba(59, 130, 246, 0.40))
        drop-shadow(0 -4px 16px rgba(96, 165, 250, 0.28));

    animation:
        hero-fire   18s linear      infinite,
        hero-cycle  18s ease-in-out infinite;
}

@keyframes hero-fire {
    0%   { background-position: 0   0%; }
    100% { background-position: 0 100%; }
}

@keyframes hero-cycle {
    0%   { clip-path: inset(0 100% 0 0); opacity: 1; }
    18%  { clip-path: inset(0   0% 0 0); opacity: 1; }
    92%  { clip-path: inset(0   0% 0 0); opacity: 1; }
    98%  { clip-path: inset(0   0% 0 0); opacity: 0; }
    100% { clip-path: inset(0 100% 0 0); opacity: 0; }
}

.hero__subtitle {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(0.85rem, 2.2vw, 1.85rem);
    color: #1f2937;
    margin: 0;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 2;
    max-width: 95vw;
    margin-inline: auto;
}
.hero__subtitle .accent { color: var(--c-accent-soft); }
.hero__mark {
    display: inline-block;
    margin-left: 0.35rem;
    color: var(--c-accent);
    font-size: 0.85em;
    transform: translateY(-0.05em);
}

.cards {
    margin: clamp(2.5rem, 6vw, 6rem) auto 0;
    width: 100%;
    max-width: var(--max-content);
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 3vw, 2rem);
    padding-inline: var(--gutter);
}

.card {
    text-align: center;
    padding: clamp(0.75rem, 1.5vw, 1.5rem) clamp(0.5rem, 1vw, 1rem);
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.5rem, 1vw, 0.75rem);
    cursor: pointer;
    will-change: transform;

    transform: scale(1.35);
    opacity: 0;
    animation: card-intro 0.9s cubic-bezier(.22, .61, .36, 1) forwards;
    animation-delay: calc(var(--i, 0) * 120ms + 200ms);

    transition: transform 0.35s cubic-bezier(.2, .7, .2, 1);
}

@keyframes card-intro {
    0%   { transform: scale(1.35); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

.card:hover { transform: scale(1.08); }

.card__icon {
    width: clamp(48px, 7vw, 64px);
    height: clamp(48px, 7vw, 64px);
    color: var(--c-accent);
    transition: transform 0.35s cubic-bezier(.2, .7, .2, 1), color 0.35s ease;
}
.card:hover .card__icon { transform: scale(1.1); color: var(--c-accent-soft); }
.card__icon svg { width: 100%; height: 100%; }

.card__title {
    font-weight: 500;
    color: var(--c-muted);
    letter-spacing: 0.02em;
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
}
.card__text {
    font-size: clamp(0.8rem, 1.1vw, 0.85rem);
    font-weight: 600;
    color: var(--c-muted);
    max-width: 26ch;
    line-height: 1.45;
}

.features-heading {
    background: #ffffff;
    padding: clamp(3rem, 6vw, 5rem) var(--gutter) clamp(2rem, 4vw, 3rem);
    text-align: center;
}
.features-heading h2 {
    font-family: var(--font-display);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;

    font-size: clamp(0.85rem, 2.4vw, 2rem);
    color: var(--c-accent);
    margin: 0 auto;
    max-width: var(--max-content);

    text-wrap: balance;
}
.features-heading h2 .brand {
    color: #0b1220;

    white-space: nowrap;
}

.features {
    position: relative;
    padding: var(--section-y) var(--gutter);
    background: var(--c-bg-dark);
    color: #e2e8f0;
    overflow: hidden;
    isolation: isolate;
}
.features__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.features__video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
}
.features__overlay {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 25% 30%, rgba(59,130,246,.14), transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(220,38,38,.14), transparent 55%),
        linear-gradient(180deg, rgba(11,18,32,.55), rgba(11,18,32,.7));
}

.features__grid {
    position: relative; z-index: 1;
    width: 100%;
    max-width: var(--max-content);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2rem);
}
.features__grid--secondary { margin-top: clamp(2rem, 4vw, 4rem); }

.feature {
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
    gap: clamp(0.6rem, 1.2vw, 0.9rem);
    transition: transform 0.3s ease;
}
.feature:hover { transform: translateY(-4px); }

.feature__icon {
    width: clamp(44px, 5vw, 56px);
    height: clamp(44px, 5vw, 56px);
    color: #cbd5e1;
}
.feature__icon svg { width: 100%; height: 100%; }
.feature h3 {
    margin: 0;
    font-weight: 500;
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
    color: #f1f5f9;
    letter-spacing: 0.02em;
}
.feature p {
    margin: 0;
    font-size: clamp(0.8rem, 1.1vw, 0.85rem);
    color: #cbd5e1;
    font-weight: 600;
    max-width: 28ch;
    line-height: 1.5;
}

.how {
    padding: var(--section-y) var(--gutter) calc(var(--section-y) + 2rem);
    background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
    text-align: center;
    overflow: hidden;
}
.how__title {
    font-family: var(--font-display);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: clamp(1.3rem, 3vw, 2.6rem);
    color: var(--c-accent);
    margin: 0 0 clamp(2rem, 4vw, 3rem);
}
.how__stage {
    display: flex; justify-content: center;
    margin: 0 auto clamp(2rem, 4vw, 3rem);
    width: 100%;
    max-width: 1100px;
}
.how__video-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 60px -25px rgba(11, 18, 32, .55);
    background: #000;
    transform: translateX(-115%);
    opacity: 0;
    will-change: transform, opacity;

    cursor: zoom-in;
    transition: box-shadow 0.25s ease;
}
.how__video-wrap:hover,
.how__video-wrap:focus-visible {
    box-shadow: 0 30px 60px -18px rgba(30, 58, 138, 0.45),
                0 0 0 2px rgba(59, 130, 246, 0.5);
    outline: none;
}
.how__video-wrap:hover .how__video-hint,
.how__video-wrap:focus-visible .how__video-hint {
    opacity: 1;
    transform: translate(0, 0);
}

.how__video { width: 100%; height: auto; pointer-events: none; }

.how__video-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 41, 106, 0.78);
    color: #e0e7ff;
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translate(4px, -4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.how__video-hint svg { width: 18px; height: 18px; }

@media (hover: none) {
    .how__video-hint { opacity: 1; transform: none; }
}

.how__cta { margin-top: 2rem; }
.cta {
    display: inline-block;
    padding: clamp(0.75rem, 1.5vw, 1rem) clamp(2rem, 5vw, 3.5rem);
    border: 2px solid var(--c-accent);
    border-radius: 6px;
    background: transparent;
    color: var(--c-accent);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.cta:hover { background: var(--c-accent); color: #fff; transform: translateY(-2px); }

@media (min-width: 300px) {

    .cards { gap: 1.75rem; }
    .features__grid { gap: 2.25rem 1.5rem; }
    .cta { letter-spacing: 0.22em; }
}

@media (min-width: 540px) {
    .cards            { grid-template-columns: repeat(2, 1fr); }
    .features__grid   { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 915px) {
    .cards            { grid-template-columns: repeat(4, 1fr); }
    .features__grid   { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
    .features__grid   { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1920px) {
    :root {
        --max-content: 1400px;
        --max-wide:    1600px;
    }
    .hero__title    { font-size: clamp(5rem, 7vw, 8.5rem); }
}

@media (min-width: 2560px) {
    :root {
        --max-content: 1600px;
    }
}

.video-modal[hidden] { display: none; }

.video-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.5rem, 2vw, 1.5rem);
    background: rgba(5, 11, 30, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: video-modal-in 0.28s ease-out;
}

@keyframes video-modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.video-modal__close {
    position: absolute;
    top: clamp(0.75rem, 2vw, 1.5rem);
    right: clamp(0.75rem, 2vw, 1.5rem);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(96, 165, 250, 0.55);
    background: rgba(30, 58, 138, 0.85);
    color: #e0e7ff;
    padding: 0;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.video-modal__close::before,
.video-modal__close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}
.video-modal__close::before { transform: rotate(45deg); }
.video-modal__close::after  { transform: rotate(-45deg); }
.video-modal__close:hover,
.video-modal__close:focus-visible {
    background: rgba(59, 130, 246, 0.95);
    border-color: rgba(147, 197, 253, 0.9);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18);
    transform: scale(1.06);
    outline: none;
}

.video-modal__stage {
    width: min(1200px, 100%);
    max-height: 86vh;
    position: relative;
    overflow: hidden;
    border-radius: clamp(8px, 1.2vw, 14px);
    box-shadow:
        0 30px 80px -20px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(59, 130, 246, 0.25);
    background: #000;

    touch-action: none;
}

.video-modal__video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 86vh;
    object-fit: contain;
    background: #000;
    cursor: zoom-in;
    transform-origin: center center;

    transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

@media (hover: none) {
    .video-modal__video { cursor: default; }
}

@media (prefers-reduced-motion: reduce) {
    .hero__title,
    .how__video-wrap,
    .card,
    .video-modal,
    .video-modal__video {
        transition: none !important;
        animation: none !important;
    }
    .hero__title,
    .how__video-wrap,
    .card {
        transform: none !important;
        opacity: 1 !important;
    }
}

.cta:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,.35); }
