/* ============================================
   ENCODIUS - Base Styles
   Variables, Reset, Typography, Utilities
   ============================================ */

:root {
    /* Colors - blue SaaS palette */
    --bg: #FFFFFF;
    --bg-inset: #F7FAFF;
    --surface: #FFFFFF;

    --ink: #0A1832;
    --ink-secondary: #4A5568;
    --ink-nav: #3D4A63;
    --ink-muted: #5C6B84;
    --ink-faint: #8C97AD;

    --border: #E7ECF5;
    --border-strong: #DCE3F0;
    --border-cta: #DCE3F0;

    --accent: #1D4ED8;
    --accent-hover: #123AA6;
    --accent-bg: #EEF4FF;
    --accent-bg-border: #D7E4FE;

    --dark-bg: #0A1832;
    --dark-bg-raised: #0F2657;
    --dark-ink: #F3F6FC;
    --dark-ink-secondary: #B7C4DD;
    --dark-ink-muted: #8AB4F8;
    --dark-ink-faint: #6C7C9C;
    --dark-border: rgba(255, 255, 255, 0.14);

    /* Typography */
    --font-sans: 'Instrument Sans', Helvetica, Arial, sans-serif;
    --font-display: 'Manrope', 'Instrument Sans', Helvetica, Arial, sans-serif;

    /* Spacing */
    --section-padding: 128px;
    --container-width: 1200px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.25s ease;

    /* Border Radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 16px;
    --radius-pill: 999px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.5;
    color: var(--ink);
    background-color: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-wrap: pretty;
}

main {
    overflow: hidden;
}

input, textarea, button, select {
    font: inherit;
}

::selection {
    background: #DCE2FA;
}

/* Skip Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    padding: 12px 24px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    border-radius: var(--radius-md);
    z-index: 9999;
    transition: top var(--transition-base);
}

.skip-link:focus {
    top: 16px;
}

/* Focus States (Accessibility) */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 32px;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: var(--accent);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* Eyebrow / section label */
.eyebrow {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
}

.section--dark .eyebrow {
    color: var(--dark-ink-muted);
}

/* Tag - pill chip above a hero heading */
.tag {
    display: inline-flex;
    align-items: center;
    background: var(--accent-bg);
    border: 1px solid var(--accent-bg-border);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 28px;
    white-space: nowrap;
}

/* Section heading */
.section-title {
    font-size: clamp(30px, 3.2vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-weight: 800;
}

.section-lead {
    color: var(--ink-secondary);
    font-size: 17px;
    line-height: 1.55;
}

/* Grid utilities */
.grid {
    display: grid;
    gap: 32px;
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Card grid - bordered cards with hover lift */
.card-grid {
    display: grid;
    gap: 24px;
    /* Uniform card height across every row, not just within one */
    grid-auto-rows: 1fr;
}

.card-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(10, 24, 50, 0.08);
}

.card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card p {
    color: var(--ink-muted);
    font-size: 15px;
    line-height: 1.5;
}

.section--dark .card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.14);
}

.section--dark .card:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: none;
    box-shadow: none;
}

.section--dark .card h3 {
    color: var(--dark-ink);
}

.section--dark .card p {
    color: var(--dark-ink-secondary);
}

/* Hero honeycomb / gradient text */
/* Closed loops (0% == 100%) rather than `alternate`, so the drift never
   retraces the same straight line - the eye reads a wandering path as
   movement where a ping-pong just reads as static. */
@keyframes hexFloatA {
    0%   { transform: translate(0, 0) rotate(0deg) scale(1);        opacity: 0.9; }
    25%  { transform: translate(52px, 30px) rotate(3deg) scale(1.06); opacity: 1; }
    50%  { transform: translate(20px, 62px) rotate(-2deg) scale(1.02); opacity: 0.94; }
    75%  { transform: translate(-30px, 26px) rotate(4deg) scale(1.07); opacity: 1; }
    100% { transform: translate(0, 0) rotate(0deg) scale(1);        opacity: 0.9; }
}

@keyframes hexFloatB {
    0%   { transform: translate(0, 0) rotate(0deg) scale(1);         opacity: 0.92; }
    25%  { transform: translate(-38px, 34px) rotate(-3deg) scale(1.05); opacity: 1; }
    50%  { transform: translate(24px, 56px) rotate(2deg) scale(1.01);  opacity: 0.9; }
    75%  { transform: translate(42px, 16px) rotate(-4deg) scale(1.05); opacity: 0.98; }
    100% { transform: translate(0, 0) rotate(0deg) scale(1);         opacity: 0.92; }
}

@keyframes hexCellFade {
    0%, 100% { opacity: 0; }
    50%      { opacity: 1; }
}


@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .hero__comb,
    .hero__comb-edge use { animation: none !important; }
    /* Edge cells rest at opacity 0, so give them a static value once the
       fade is off or they would vanish entirely */
    .hero__comb-edge use { opacity: 0.5; }
    .hero__title-accent { animation: none !important; }
}

/* Reveal (scroll animation hook) - hidden only once JS confirms it can reveal it */
html.js [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

html.js [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html.js [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ============================================
   BASE RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .grid--4, .card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--3, .card-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 760px) {
    :root {
        --section-padding: 80px;
    }
    .grid--2, .grid--3, .grid--4,
    .card-grid--2, .card-grid--3, .card-grid--4 {
        grid-template-columns: minmax(0, 1fr);
    }
    .container {
        padding: 0 20px;
    }
}
