/* ============================================================
   DATA RETREAT 2026 — GLOBAL DESIGN SYSTEM
   File: assets/css/main.css
   
   Contains: CSS variables, resets, typography, buttons,
   utilities, navbar, footer, animations, responsive grid.
   ========================================================= */

/* ─── CSS VARIABLES (Design Tokens) ─────────────────────────── */
:root {
    /* Brand Colors */
    --color-primary:        #00004a;
    --color-primary-light:  #00006b;
    --color-primary-dark:   #000030;
    --color-accent:         #dbb45e;
    --color-accent-light:   #e8c97a;
    --color-accent-dark:    #c49a40;

    /* Neutrals */
    --color-white:          #ffffff;
    --color-bg:             #f4f6fb;
    --color-bg-dark:        #eaecf3;
    --color-text:           #1a1a2e;
    --color-text-muted:     #6b7280;
    --color-text-light:     #9ca3af;
    --color-border:         #e2e5ef;
    --color-border-light:   #f0f2f8;

    /* Semantic */
    --color-success:        #10b981;
    --color-error:          #ef4444;
    --color-warning:        #f59e0b;
    --color-info:           #3b82f6;

    /* Typography */
    --font-heading:         'Playfair Display', Georgia, serif;
    --font-body:            'DM Sans', 'Helvetica Neue', sans-serif;
    --font-mono:            'DM Mono', 'Courier New', monospace;

    /* Font sizes (fluid clamp-based) */
    --fs-xs:    0.75rem;
    --fs-sm:    0.875rem;
    --fs-base:  1rem;
    --fs-md:    1.125rem;
    --fs-lg:    1.25rem;
    --fs-xl:    1.5rem;
    --fs-2xl:   2rem;
    --fs-3xl:   clamp(2rem, 4vw, 2.75rem);
    --fs-4xl:   clamp(2.5rem, 5vw, 3.75rem);
    --fs-hero:  clamp(3rem, 7vw, 5.5rem);

    /* Spacing */
    --space-1:   0.25rem;
    --space-2:   0.5rem;
    --space-3:   0.75rem;
    --space-4:   1rem;
    --space-5:   1.25rem;
    --space-6:   1.5rem;
    --space-8:   2rem;
    --space-10:  2.5rem;
    --space-12:  3rem;
    --space-16:  4rem;
    --space-20:  5rem;
    --space-24:  6rem;
    --space-32:  8rem;

    /* Layout */
    --container-max:    1200px;
    --container-wide:   1440px;
    --container-narrow: 760px;
    --section-pad:      clamp(4rem, 8vw, 7rem);

    /* Effects */
    --radius-sm:    6px;
    --radius-md:    12px;
    --radius-lg:    20px;
    --radius-full:  9999px;

    --shadow-sm:    0 1px 3px rgba(0,0,74,0.08), 0 1px 2px rgba(0,0,74,0.04);
    --shadow-md:    0 4px 16px rgba(0,0,74,0.10), 0 2px 6px rgba(0,0,74,0.06);
    --shadow-lg:    0 12px 40px rgba(0,0,74,0.15), 0 4px 12px rgba(0,0,74,0.08);
    --shadow-glow:  0 0 30px rgba(219,180,94,0.25);

    --transition:   all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);

    /* Navbar */
    --navbar-h: 72px;
}

/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--navbar-h) + 1rem);
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    color: var(--color-text);
    background: var(--color-white);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, svg, video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
}

/* ─── TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 700;
    color: var(--color-primary);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }

p { line-height: 1.75; color: var(--color-text-muted); }

.accent-text { color: var(--color-accent); }
.primary-text { color: var(--color-primary); }

/* ─── LAYOUT UTILITIES ───────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.container--wide {
    max-width: var(--container-wide);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.section {
    padding-block: var(--section-pad);
}

.section--dark {
    background: var(--color-primary);
    color: var(--color-white);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
    color: var(--color-white);
}

.section--dark p {
    color: rgba(255,255,255,0.75);
}

.section--gray {
    background: var(--color-bg);
}

/* ─── SECTION LABELS ─────────────────────────────────────────── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-4);
}

.section-label::before {
    content: '';
    display: block;
    width: 28px;
    height: 2px;
    background: var(--color-accent);
    flex-shrink: 0;
}

.section-title {
    font-size: var(--fs-3xl);
    color: var(--color-primary);
    margin-bottom: var(--space-4);
    max-width: 700px;
}

.section-title--center {
    text-align: center;
    margin-inline: auto;
}

.section-subtitle {
    font-size: var(--fs-md);
    color: var(--color-text-muted);
    max-width: 600px;
    margin-bottom: var(--space-12);
}

.section-subtitle--center {
    text-align: center;
    margin-inline: auto;
}

.section-header {
    margin-bottom: var(--space-12);
}

.section-header--center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.875rem 1.875rem;
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.2s;
}

.btn:hover::after {
    background: rgba(255,255,255,0.08);
}

.btn-arrow {
    transition: transform 0.25s ease;
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Accent Button (Gold) */
.btn-accent {
    background: var(--color-accent);
    color: var(--color-primary);
    border-color: var(--color-accent);
    box-shadow: 0 4px 20px rgba(219,180,94,0.35);
}

.btn-accent:hover {
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    box-shadow: 0 6px 28px rgba(219,180,94,0.5);
    transform: translateY(-2px);
}

/* Primary Button (Navy) */
.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* Outline White (for dark backgrounds) */
.btn-outline-white {
    background: transparent;
    color: var(--color-white);
    border-color: rgba(255,255,255,0.5);
}

.btn-outline-white:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--color-white);
}

/* Size variants */
.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: var(--fs-xs);
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: var(--fs-base);
}

/* ─── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 74, 0.0);
    backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    transition: var(--transition-slow);
    height: var(--navbar-h);
}

.navbar.scrolled {
    background: rgba(0, 0, 74, 0.97);
    backdrop-filter: blur(20px);
    border-bottom-color: rgba(219, 180, 94, 0.2);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

/* Logo */
.nav-logo,
.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    flex-shrink: 0;
}

.logo-mark {
    width: 42px;
    height: 42px;
    background: var(--color-accent);
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    letter-spacing: -0.05em;
    flex-shrink: 0;
    transition: var(--transition);
}

.nav-logo:hover .logo-mark {
    transform: rotate(-3deg) scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-white);
    letter-spacing: -0.02em;
}

.logo-sub {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--color-accent);
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
    list-style: none;
}

.nav-link {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--color-accent);
    border-radius: 2px;
    transition: width 0.25s ease;
}

.nav-link:hover {
    color: var(--color-white);
}

.nav-link:hover::after {
    width: 60%;
}

/* Nav CTA */
.nav-cta {
    margin-left: var(--space-4);
    flex-shrink: 0;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-2);
    margin-left: auto;
    cursor: pointer;
}

.ham-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transition: var(--transition);
    transform-origin: center;
}

.hamburger.open .ham-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.open .ham-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.open .ham-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    background: var(--color-primary-dark);
    border-top: 1px solid rgba(219,180,94,0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
    max-height: 400px;
}

.mobile-nav-links {
    padding: var(--space-4) clamp(1rem, 4vw, 2rem) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    list-style: none;
}

.mobile-link {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: rgba(255,255,255,0.85);
    font-size: var(--fs-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-link:hover {
    background: rgba(219,180,94,0.1);
    color: var(--color-accent);
}

.mobile-cta {
    background: var(--color-accent) !important;
    color: var(--color-primary) !important;
    font-weight: 700;
    text-align: center;
    margin-top: var(--space-2);
    border-radius: var(--radius-full);
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
    background: var(--color-primary-dark);
    color: rgba(255,255,255,0.75);
    position: relative;
}

.footer-accent-line {
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-light) 50%, var(--color-accent) 100%);
}

.footer-container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding: var(--space-16) clamp(1rem, 4vw, 2rem) var(--space-12);
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: var(--space-12);
}

.footer-brand .footer-logo {
    margin-bottom: var(--space-4);
}

.footer-brand .logo-title {
    color: var(--color-white);
}

.footer-tagline {
    color: rgba(255,255,255,0.55);
    font-size: var(--fs-sm);
    line-height: 1.7;
    margin-bottom: var(--space-6);
    max-width: 280px;
}

.footer-social {
    display: flex;
    gap: var(--space-3);
}

.social-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-primary);
    transform: translateY(-3px);
}

.footer-heading {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-5);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    list-style: none;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: var(--fs-sm);
    transition: var(--transition);
    position: relative;
    padding-left: 0;
}

.footer-links a::before {
    content: '→';
    position: absolute;
    left: -18px;
    opacity: 0;
    transition: var(--transition);
    color: var(--color-accent);
    font-size: var(--fs-xs);
}

.footer-links a:hover {
    color: var(--color-white);
    padding-left: 18px;
}

.footer-links a:hover::before {
    opacity: 1;
    left: 0;
}

.footer-info li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    color: rgba(255,255,255,0.6);
    font-size: var(--fs-sm);
}

.info-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-org-name {
    color: var(--color-white);
    font-weight: 600;
    font-size: var(--fs-md);
    margin-bottom: var(--space-3);
}

.footer-org-desc {
    color: rgba(255,255,255,0.5);
    font-size: var(--fs-sm);
    line-height: 1.7;
    margin-bottom: var(--space-5);
}

.footer-btn {
    display: inline-flex;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: var(--space-6) 0;
}

.footer-bottom-inner {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-copy,
.footer-built {
    font-size: var(--fs-xs);
    color: rgba(255,255,255,0.35);
}

/* ─── SCROLL REVEAL ANIMATIONS ───────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered delay for child elements */
.stagger > *:nth-child(1) { transition-delay: 0.05s; }
.stagger > *:nth-child(2) { transition-delay: 0.12s; }
.stagger > *:nth-child(3) { transition-delay: 0.19s; }
.stagger > *:nth-child(4) { transition-delay: 0.26s; }
.stagger > *:nth-child(5) { transition-delay: 0.33s; }
.stagger > *:nth-child(6) { transition-delay: 0.40s; }

/* ─── UTILITY CLASSES ────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.fw-300 { font-weight: 300; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-0  { margin-top: 0; }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-10);
    }
}

@media (max-width: 768px) {
    .nav-links,
    .nav-cta {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }

    :root {
        --navbar-h: 64px;
    }
}

@media (max-width: 480px) {
    .btn-lg {
        padding: 0.9rem 1.75rem;
        font-size: var(--fs-sm);
    }
}

/* ── Force navy navbar on non-hero pages ─────────────────────
   Add  body_class = 'page--light';  in any PHP page before
   requiring header.php to activate this automatically.
   register.php already sets this (see register.php fix notes).
────────────────────────────────────────────────────────────── */
body.page--light .navbar,
body.page--light .navbar:not(.scrolled) {
    background: rgba(0, 0, 74, 0.97) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom-color: rgba(219, 180, 94, 0.2) !important;
}

/* ── Mobile navbar full visibility fix ───────────────────────
   Ensure the navbar and mobile menu never get clipped on mobile.
   The navbar needs overflow:visible so the mobile-menu dropdown
   can appear below it.
────────────────────────────────────────────────────────────── */
.navbar {
    overflow: visible !important;
}

/* Ensure mobile menu sits flush below the navbar bar */
.mobile-menu {
    position: absolute;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--color-primary-dark);
    border-top: 1px solid rgba(219, 180, 94, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Shadow so it visually sits above content below */
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.mobile-menu.open {
    max-height: 420px;
}

/* Increase tap target size for all nav items on mobile */
@media (max-width: 768px) {
    .mobile-link {
        padding: var(--space-4) var(--space-5);
        font-size: var(--fs-base);
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .mobile-cta {
        margin: var(--space-3) var(--space-4) var(--space-2);
        border-radius: var(--radius-full);
        justify-content: center;
        min-height: 52px;
    }

    /* Give hamburger a bigger tap target */
    .hamburger {
        padding: var(--space-3);
        margin: -var(--space-3);
    }

    .ham-bar {
        width: 26px;
    }
}