/* ==========================================================================
   MARKETING BASE STYLES
   Shared across all marketing pages: variables, reset, grid, nav, footer,
   buttons, sections, CTA, fade-in animation.
   ========================================================================== */


/* ==========================================================================
   VARIABLES
   ========================================================================== */

:root {
    --m-font: "Geologica", sans-serif;

    /* Colors */
    --m-navy: #0a2540;
    --m-text: #425466;
    --m-text-light: #637381;
    --m-white: #ffffff;
    --m-off-white: #f6f9fc;
    --m-border: #e3e8ee;
    --m-teal: #3c6465;
    --m-teal-light: #4dbebe;
    --m-blue: #518ac8;
    --m-purple: #7b61ff;
    --m-gradient-start: #4dbebe;
    --m-gradient-mid: #518ac8;
    --m-gradient-end: #7b61ff;

    /* Sizing */
    --m-nav-height: 64px;
    --m-container: 1200px;
    --m-container-wide: 1400px;
    --m-section-gap: 140px;
    --m-radius: 12px;
    --m-radius-lg: 16px;
    --m-margin: 40px;
    --m-gutter: 24px;
    --m-card-padding: 40px;
    --m-grid-gap: 20px;
}


/* ==========================================================================
   RESET & BASE
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--m-font);
    color: var(--m-text);
    background: var(--m-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Grid lines — inner dashed dividers (behind content) */
.grid-overlay {
    position: fixed;
    top: var(--m-nav-height);
    bottom: 0;
    left: 0;
    right: 0;
    max-width: var(--m-container-wide);
    width: calc(100% - 2 * var(--m-margin));
    margin: 0 auto;
    padding: 0 var(--m-grid-gap);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--m-grid-gap);
    z-index: 0;
    pointer-events: none;
}

/* Grid rails — outer edges (on top of content) */
.grid-rails {
    position: fixed;
    top: var(--m-nav-height);
    bottom: 0;
    left: 0;
    right: 0;
    max-width: var(--m-container-wide);
    width: calc(100% - 2 * var(--m-margin));
    margin: 0 auto;
    border-left: 1px solid var(--m-border);
    border-right: 1px solid var(--m-border);
    z-index: 1001;
    pointer-events: none;
}

/* Dashed divider mixin — applied via left border on targeted columns */
.grid-col {
    background-image: none;
}

/* Default (quarters): dividers at 1/4, 1/2, 3/4 boundaries */
.grid-col:nth-child(4),
.grid-col:nth-child(7),
.grid-col:nth-child(10) {
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(227, 232, 238, 0.5) 0px, rgba(227, 232, 238, 0.5) 4px,
        transparent 4px, transparent 8px
    );
    background-size: 1px 100%;
    background-repeat: no-repeat;
    background-position: left;
}

/* Thirds: dividers at 1/3, 2/3 boundaries */
body.grid-thirds .grid-col:nth-child(4),
body.grid-thirds .grid-col:nth-child(7),
body.grid-thirds .grid-col:nth-child(10) {
    background-image: none;
}

body.grid-thirds .grid-col:nth-child(5),
body.grid-thirds .grid-col:nth-child(9) {
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(227, 232, 238, 0.5) 0px, rgba(227, 232, 238, 0.5) 4px,
        transparent 4px, transparent 8px
    );
    background-size: 1px 100%;
    background-repeat: no-repeat;
    background-position: left;
}

/* 2-column: center line only */
body.grid-lines-2 .grid-col:nth-child(4),
body.grid-lines-2 .grid-col:nth-child(10) { background-image: none; }

/* Rails only: no inner lines */
body.grid-lines-0 .grid-col { background-image: none; }

/* Hide everything */
body.grid-lines-hide .grid-overlay,
body.grid-lines-hide .grid-rails { display: none; }

body.nav-open {
    overflow: hidden;
}

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

img {
    max-width: 100%;
    height: auto;
}

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


/* ==========================================================================
   CONTAINER
   ========================================================================== */

.container {
    max-width: var(--m-container-wide);
    width: calc(100% - 2 * var(--m-margin));
    margin: 0 auto;
    padding: 0 var(--m-grid-gap);
}

.container-wide {
    max-width: var(--m-container-wide);
    width: calc(100% - 2 * var(--m-margin));
    margin: 0 auto;
    padding: 0 var(--m-grid-gap);
}


/* ==========================================================================
   NAVIGATION — Two-layer structure
   .nav-bar    (z-index: 2) — logo, links, buttons — always on top
   .nav-dropdown-layer (z-index: 1) — panels sit behind the nav bar
   ========================================================================== */

.nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Nav bar layer — on top */
.nav-bar {
    position: relative;
    z-index: 2;
    height: var(--m-nav-height);
    border-bottom: 1px solid var(--m-border);
}

.nav-inner {
    max-width: var(--m-container-wide);
    width: calc(100% - 2 * var(--m-margin));
    margin: 0 auto;
    padding: 0 var(--m-gutter);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* Transparent by default, solid white on hover or when a dropdown is open */
.nav:hover .nav-inner,
.nav.nav-active .nav-inner {
    background: var(--m-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--m-navy);
    letter-spacing: -0.02em;
}

.nav-logo-icon {
    width: 24px;
    height: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 450;
    color: var(--m-text);
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
    color: var(--m-navy);
    background: var(--m-off-white);
}

.nav-link.active {
    color: var(--m-navy);
    font-weight: 550;
}

.nav-link svg {
    transition: transform 0.2s ease;
}

.nav-link.active svg {
    transform: rotate(180deg);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 550;
    border-radius: 8px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.nav-btn-primary {
    background: var(--m-navy);
    color: var(--m-white);
}

.nav-btn-primary:hover {
    background: #0f3558;
}

.nav-btn-secondary {
    color: var(--m-text);
    border: 1px solid var(--m-border);
    background: var(--m-white);
}

.nav-btn-secondary:hover {
    color: var(--m-navy);
    border-color: #c4cdd5;
    background: var(--m-off-white);
}


/* ==========================================================================
   NAV DROPDOWN LAYER — behind the nav bar
   ========================================================================== */

.nav-dropdown-layer {
    position: relative;
    z-index: 1;
}

.nav-dropdown-panel {
    /* Alpine x-show handles visibility */
}

/* Hide panels before Alpine initializes */
[x-cloak] {
    display: none !important;
}

/* Panel transitions */
.panel-enter {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.panel-enter-start {
    opacity: 0;
    transform: translateY(-4px);
}

.panel-enter-end {
    opacity: 1;
    transform: translateY(0);
}

.panel-leave {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-dropdown-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
    max-width: var(--m-container-wide);
    width: calc(100% - 2 * var(--m-margin));
    margin: 0 auto;
    padding: 32px var(--m-gutter);
    background: var(--m-white);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.nav-dropdown-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 16px;
    border-right: 1px solid var(--m-border);
}

.nav-dropdown-section:last-child {
    border-right: none;
}

.nav-dropdown-heading {
    font-size: 14px;
    font-weight: 650;
    color: var(--m-navy);
    letter-spacing: -0.01em;
    padding: 0 0 16px;
}

.nav-dropdown-item {
    display: block;
    padding: 6px 0;
    transition: opacity 0.15s ease;
}

.nav-dropdown-item:hover {
    opacity: 0.7;
}

.nav-dropdown-item-title {
    font-size: 14px;
    font-weight: 450;
    color: var(--m-teal);
    line-height: 1.6;
}


/* ==========================================================================
   MOBILE NAV
   ========================================================================== */

.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.nav-mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--m-navy);
    border-radius: 1px;
    transition: all 0.2s ease;
}

.nav-mobile-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-mobile-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav-mobile-menu {
    display: none;
    position: fixed;
    inset: var(--m-nav-height) 0 0 0;
    background: var(--m-white);
    z-index: 999;
    overflow-y: auto;
}

.nav-mobile-menu.open {
    display: block;
}

.nav-mobile-menu-inner {
    padding: var(--m-gutter);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-mobile-link {
    display: block;
    padding: 14px 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--m-navy);
    border-bottom: 1px solid var(--m-border);
}

.nav-mobile-divider {
    border: none;
    border-top: 1px solid var(--m-border);
    margin: 12px 0;
}

.nav-mobile-cta {
    text-align: center;
    padding: 14px 24px;
    font-size: 16px;
    margin-top: 4px;
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 550;
    border-radius: 8px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--m-teal);
    color: var(--m-white);
}

.btn-primary:hover {
    background: var(--m-navy);
}

.btn-outline {
    border: 1px solid var(--m-border);
    color: var(--m-text);
    background: var(--m-white);
}

.btn-outline:hover {
    border-color: #c4cdd5;
    color: var(--m-navy);
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-white {
    background: var(--m-white);
    color: var(--m-navy);
}

.btn-white:hover {
    background: var(--m-off-white);
}


/* ==========================================================================
   SECTIONS
   ========================================================================== */

.section {
    padding: var(--m-section-gap) 0;
}

.section-header {
    max-width: 720px;
    margin-bottom: 64px;
}

.section-title {
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 700;
    color: var(--m-navy);
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: clamp(16px, 1.8vw, 19px);
    color: var(--m-text);
    line-height: 1.6;
}


/* ==========================================================================
   CTA SECTION
   ========================================================================== */

.cta-section {
    padding: var(--m-section-gap) 0;
}

.cta-card {
    background: var(--m-navy);
    border-radius: var(--m-radius-lg);
    padding: clamp(48px, 6vw, 80px) clamp(32px, 5vw, 80px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 70% at 20% 90%, rgba(77, 190, 190, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse 40% 50% at 80% 10%, rgba(123, 97, 255, 0.2) 0%, transparent 50%);
    z-index: 0;
}

.cta-card > * {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 700;
    color: var(--m-white);
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}

.cta-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 36px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}


/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    padding: 64px 0 40px;
    border-top: 1px solid var(--m-border);
    background: var(--m-white);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--m-grid-gap);
    margin-bottom: 48px;
}

.footer-brand {
    grid-column: span 4;
}

.footer-group {
    grid-column: span 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--m-navy);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.footer-tagline {
    font-size: 14px;
    color: var(--m-text-light);
    max-width: 260px;
    line-height: 1.5;
}

.footer-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--m-navy);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 8px;
}

.footer-link {
    font-size: 14px;
    color: var(--m-text);
    transition: color 0.15s ease;
    line-height: 1.8;
}

.footer-link:hover {
    color: var(--m-navy);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--m-border);
    font-size: 13px;
    color: var(--m-text-light);
}


/* ==========================================================================
   FADE-IN ANIMATION
   ========================================================================== */

.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.fade-in-stagger > .fade-in:nth-child(1) { transition-delay: 0s; }
.fade-in-stagger > .fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in-stagger > .fade-in:nth-child(3) { transition-delay: 0.2s; }
.fade-in-stagger > .fade-in:nth-child(4) { transition-delay: 0.3s; }
.fade-in-stagger > .fade-in:nth-child(5) { transition-delay: 0.4s; }
.fade-in-stagger > .fade-in:nth-child(6) { transition-delay: 0.5s; }


/* ==========================================================================
   RESPONSIVE — Base elements
   ========================================================================== */

@media (max-width: 1024px) {
    :root {
        --m-section-gap: 100px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-brand,
    .footer-group {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    :root {
        --m-section-gap: 80px;
        --m-margin: 20px;
    }

    .nav-links,
    .nav-right {
        display: none;
    }

    .nav-mobile-toggle {
        display: flex;
    }

    .footer-group {
        grid-template-columns: 1fr 1fr;
    }

    .cta-actions {
        flex-direction: column;
    }

    .cta-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer-group {
        grid-template-columns: 1fr;
    }
}
