:root {
    /* Variables for Dark Mode (Default) */
    --bg-body: #000000;
    --bg-alt: #111111;
    --bg-glass: rgba(20, 20, 20, 0.8);
    --bg-modal: rgba(0, 0, 0, 0.9);
    --bg-overlay: rgba(0, 0, 0, 0.7);
    /* Digs the image into background */
    /* Dark background */
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent: #2997ff;
    /* Apple Blue */
    --border: #333;
    --card-bg: #1c1c1e;

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-body: #ffffff;
    --bg-alt: #f5f5f7;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-modal: rgba(200, 200, 200, 0.85);
    --bg-overlay: rgba(255, 255, 255, 0.5);
    /* Reduced fade to show more image */
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #0066cc;
    --border: #d2d2d7;
    --card-bg: #ffffff;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* 
   FIXED BACKGROUND (Mobile Safe)
   Using a fixed pseudo-element ensures the background covers 
   the VIEWPORT (Screen) and not the document height. 
   This prevents the "Zoomed In" effect on mobile.
*/
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: url('assets/bg-test.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Static Color Overlay (Theme Aware) */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--bg-overlay);
    transition: background-color 0.5s var(--ease);
    pointer-events: none;
}

button,
input,
textarea {
    font-family: inherit;
}

/* Sticky Navigation */
.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    display: flex;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-content {
    width: 100%;
    max-width: 1000px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s var(--ease);
}

.brand-logo.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a.active {
    font-weight: 600;
    /* Subtle bold for active state */
}

.cta-link {
    background: var(--text-primary);
    color: var(--bg-body) !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
}

#theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
}

/* Hero */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.massive-text {
    font-size: 14vw;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 0;
    background: linear-gradient(180deg, var(--text-primary) 20%, rgba(128, 128, 128, 0.5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: scaleIn 1s var(--ease);
}

.hero-sub {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 10px;
    opacity: 0;
    animation: fadeIn 1s var(--ease) 0.5s forwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    gap: 10px;
    opacity: 0;
    animation: fadeIn 1s var(--ease) 1.5s forwards;
}

.scroll-indicator svg {
    animation: bounce 2s infinite;
}

/* Sections */
summary {
    list-style: none;
}

.content-section {
    padding: 120px 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bg-alt {
    background-color: var(--bg-alt);
}

@media (max-width: 768px) {
    .container {
        padding: 0 25px;
    }
}

.container {
    max-width: 980px;
    padding: 0 20px;
    margin: 0 auto;
    width: 100%;
}

.text-center {
    text-align: center;
}

.eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: block;
}

.section-heading {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 20px 0;
    color: var(--text-primary);
}

.section-sub {
    font-size: 1.5rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 60px;
    font-weight: 400;
}

/* Grids & Cards */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.feature-box {
    text-align: center;
}

.feature-icon {
    width: 48px;
    height: 48px;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.feature-box h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.feature-box p {
    color: var(--text-secondary);
}

/* Alliance Cards */
.alliance-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    /* Increased gap for better spacing */
    max-width: 1200px;
    /* Ensure 4 can fit */
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s var(--ease);
    /* Default fallback */
    flex: 1 1 250px;
}

/* Layout 4 and 5 share standard sizing now */
.layout-4 .card,
.layout-5 .card {
    /* Standard flexible sizing */
    flex: 1 1 300px;
    max-width: 350px;
}

/* Ensure links acting as cards look correct */
a.card {
    text-decoration: none;
    color: inherit;
    display: block;
    /* maintain box layout */
    cursor: pointer;
}

/* Layout 5: 3 then 2 */
.layout-5 .card {
    /* Safe width to fit 3 in a row with 30px gap */
    flex: 0 0 30%;
    max-width: 400px;
    min-width: 250px;
}

.card:hover {
    transform: scale(1.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.pill {
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Whales */
.grid-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    text-align: left;
}

.whale-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.whale-row {
    background: var(--bg-alt);
    padding: 15px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    /* Ensures avatar and text are centered */
    gap: 20px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #333;
    flex-shrink: 0;
    /* Prevents avatar from squishing */
    background-size: cover;
    background-position: center;
    border: 2px solid var(--accent);
}

.details {
    display: flex;
    flex-direction: column;
}

.details strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.details span {
    color: var(--text-secondary);
}

/* Culture */
.culture-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.culture-item {
    background: var(--card-bg);
    /* Use card background */
    padding: 30px;
    border-radius: 12px;
}


/* Form */
.form-wrapper {
    max-width: 500px;
    text-align: center;
    margin: 0 auto;
}

.apple-form {
    text-align: left;
}

.apple-form .form-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.apple-form label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* On mobile, stack them */
@media (max-width: 480px) {
    .apple-form .form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.apple-form input,
.apple-form textarea,
.apple-form select {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--text-primary);
    font-size: 1rem;
    transition: 0.2s;
    appearance: none;
    /* Remove default arrow for custom styling if desired, simpler to keep for now */
}

.apple-form input:focus,
.apple-form textarea:focus,
.apple-form select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-body);
}

.submit-btn {
    background: var(--accent);
    color: white;
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* Footer */
footer {
    padding: 50px 0;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-alt);
    font-size: 0.8rem;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s var(--ease);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Responsive */
/* Responsive */
@media (max-width: 768px) {
    .massive-text {
        font-size: 18vw;
    }

    .nav-links a:not(.cta-link) {
        display: none;
    }

    /* Hide text links on mobile */
    .section-heading {
        font-size: 2.5rem;
    }

    .grid-split,
    .alliance-cards,
    .culture-grid {
        grid-template-columns: 1fr;
    }

    /* Cards stack on mobile/tablet independently of layout class */
    .layout-4 .card,
    .layout-5 .card {
        flex: 1 1 100%;
        max-width: 500px;
    }

    .container {
        padding: 0 25px;
    }
}

/* Image Modal */
/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Theme aware background */
    background-color: var(--bg-modal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.3s;

    /* Flexbox Centering */
    align-items: center;
    justify-content: center;
}

.modal-content {
    display: block;
    max-width: 90%;
    max-height: 80vh;
    /* Reduced slightly to leave room for UI */
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid var(--accent);
    box-shadow: 0 0 50px rgba(41, 151, 255, 0.2);
    margin: 0;

    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

/* Close Buttons */
.close-btn {
    position: absolute;
    cursor: pointer;
    z-index: 2001;
    color: var(--text-primary);
    transition: transform 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

/* Desktop Cross (Top Right) */
.desktop-close {
    top: 30px;
    right: 30px;
}

.desktop-close i {
    width: 32px;
    height: 32px;
    stroke-width: 1.5px;
    /* Thinner/Sleek */
}

/* Mobile Back (Bottom Left) */
.mobile-back {
    bottom: 30px;
    left: 20px;
    font-size: 1.1rem;
    font-weight: 500;
}

.mobile-back i {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
}

/* Animation */
.modal-content {
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Hide Mobile Back on Desktop */
@media (min-width: 769px) {
    .mobile-back {
        display: none;
    }
}

/* Hide Desktop Cross on Mobile */
@media (max-width: 768px) {
    .desktop-close {
        display: none;
    }
}