/*
 * CoralCore Website Styles
 * Ocean-Inspired Design System
 * Combines serene blues with vibrant coral accents for a fresh, engaging look
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* Primary Colors - Ocean Palette */
    --color-primary: #1a5fb4;
    --color-primary-dark: #0d3b7a;
    --color-primary-light: #3584e4;
    --color-accent: #62a0ea;
    --color-accent-light: #99c1f1;

    /* Coral & Reef Colors */
    --color-coral: #ff6b6b;
    --color-coral-light: #ff8e8e;
    --color-reef-blue: #22d3ee;
    --color-reef-teal: #2dd4bf;
    --color-ocean-deep: #0F172A;
    --color-ocean-mid: #1E293B;
    --color-ocean-light: #334155;

    /* Neutral Colors */
    --color-bg-light: #f6f8fa;
    --color-bg-white: #ffffff;
    --color-bg-dark: #0d1117;
    --color-bg-dark-secondary: #161b22;

    /* Text Colors */
    --color-text-dark: #1f2328;
    --color-text-muted: #57606a;
    --color-text-light: #ffffff;
    --color-text-light-muted: #8b949e;

    /* Semantic Colors */
    --color-success: #2da44e;
    --color-warning: #bf8700;
    --color-error: #cf222e;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #1a5fb4 0%, #3584e4 50%, #62a0ea 100%);
    --gradient-reef: linear-gradient(135deg, #22d3ee 0%, #2dd4bf 50%, #38bdf8 100%);
    --gradient-ocean: linear-gradient(180deg, #0F172A 0%, #1E293B 20%, #334155 45%, #2a7ab8 65%, #5bb4d9 80%, #7dd3fc 90%, #D9C7A6 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(246, 248, 250, 0.9));
    --gradient-dark: linear-gradient(180deg, #0d1117 0%, #161b22 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 40px rgba(26, 95, 180, 0.3);
    --shadow-reef-glow: 0 0 40px rgba(34, 211, 238, 0.3);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', var(--font-sans);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-text-dark);
    background-color: var(--color-bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: var(--color-primary-dark);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-dark);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--space-md);
}

.text-gradient {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-4xl) 0;
}

.section-dark {
    background: var(--gradient-dark);
    color: var(--color-text-light);
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: var(--color-text-light);
}

.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.flex {
    display: flex;
    gap: var(--space-md);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-center {
    text-align: center;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-base);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-hero);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    list-style: none;
}

.nav-links a {
    color: var(--color-text-dark);
    font-weight: 500;
    padding: var(--space-sm) 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text-dark);
    margin: 6px 0;
    transition: all var(--transition-fast);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #0EA5E9 0%, #06B6D4 50%, #14B8A6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    z-index: 1;
    font-weight: 600;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #06B6D4 0%, #0EA5E9 100%);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(14, 165, 233, 0.5);
    color: white;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    color: var(--color-text-light);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
    padding-top: 72px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.hero-text {
    color: var(--color-text-light);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255, 255, 255, 0.15);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--color-text-light);
    margin-bottom: var(--space-lg);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--space-xl);
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-mockup {
    width: 280px;
    height: 580px;
    background: #1a1a2e;
    border-radius: 40px;
    padding: 12px;
    box-shadow: var(--shadow-xl), 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: float 6s ease-in-out infinite;
    border: 4px solid #2a2a3e;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    text-align: center;
    padding: var(--space-xl);
}

.phone-screen .app-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-hero);
    border-radius: 20px;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.stats-preview {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-2xl);
    gap: var(--space-xl);
}

.stats-preview .stat-item {
    text-align: center;
    padding: var(--space-md) 0;
}

.stats-preview .stat-number {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-accent-light);
    margin-bottom: var(--space-xs);
}

.stats-preview .stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reef-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.reef-layer {
    position: absolute;
    bottom: 0;
    width: 100%;
}

.reef-back {
    height: 20%;
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.3) 0%, rgba(20, 184, 166, 0.6) 100%);
    clip-path: polygon(0% 100%,
            0% 70%,
            5% 60%,
            10% 75%,
            15% 55%,
            20% 65%,
            25% 50%,
            30% 70%,
            35% 45%,
            40% 60%,
            45% 40%,
            50% 55%,
            55% 35%,
            60% 50%,
            65% 40%,
            70% 60%,
            75% 45%,
            80% 65%,
            85% 50%,
            90% 70%,
            95% 55%,
            100% 65%,
            100% 100%);
}

.reef-mid {
    height: 15%;
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.3) 0%, rgba(45, 212, 191, 0.6) 100%);
    clip-path: polygon(0% 100%,
            0% 60%,
            8% 50%,
            15% 70%,
            22% 45%,
            30% 65%,
            38% 40%,
            45% 60%,
            55% 38%,
            62% 55%,
            70% 42%,
            78% 60%,
            85% 48%,
            92% 65%,
            100% 55%,
            100% 100%);
}

.reef-front {
    height: 10%;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.4) 0%, rgba(34, 211, 238, 0.7) 100%);
    clip-path: polygon(0% 100%,
            0% 70%,
            10% 55%,
            20% 75%,
            30% 50%,
            40% 70%,
            50% 45%,
            60% 65%,
            70% 50%,
            80% 70%,
            90% 55%,
            100% 65%,
            100% 100%);
}

.bubbles {
    position: absolute;
    bottom: 20%;
    left: 0;
    width: 100%;
    height: 60%;
    pointer-events: none;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: rise 8s infinite ease-in;
}

.bubble:nth-child(1) {
    width: 8px;
    height: 8px;
    left: 10%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 12px;
    height: 12px;
    left: 25%;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    width: 6px;
    height: 6px;
    left: 45%;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    width: 10px;
    height: 10px;
    left: 60%;
    animation-delay: 1s;
}

.bubble:nth-child(5) {
    width: 14px;
    height: 14px;
    left: 80%;
    animation-delay: 3s;
}

.bubble:nth-child(6) {
    width: 8px;
    height: 8px;
    left: 90%;
    animation-delay: 5s;
}

@keyframes rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }

    100% {
        transform: translateY(-300px) scale(0.5);
        opacity: 0;
    }
}

.fish {
    position: absolute;
    font-size: 2rem;
    animation: swim 15s linear infinite;
}

.fish-1 {
    top: 40%;
    animation-delay: 0s;
}

.fish-2 {
    top: 55%;
    animation-delay: 5s;
    font-size: 1.5rem;
}

.fish-3 {
    top: 30%;
    animation-delay: 10s;
    font-size: 1.2rem;
}

.fish-4 {
    top: 50%;
    animation-delay: 2s;
    font-size: 1.8rem;
    animation-duration: 8s;
}

.fish-5 {
    top: 25%;
    animation-delay: 5s;
    font-size: 1.4rem;
    animation-duration: 10s;
}

/* Specific swim animation for container-bound fish */
.reef-visual .fish {
    animation-name: swim-contained;
}

@keyframes swim-contained {
    0% {
        right: -50px;
        transform: scaleX(1);
        /* Facing left */
    }

    100% {
        right: 100%;
        transform: scaleX(1);
    }
}

@keyframes swim {
    0% {
        transform: translateX(calc(100vw + 100px));
    }

    100% {
        transform: translateX(-100px);
    }
}

/* ============================================
   REEF CONCEPT SECTION
   ============================================ */
.reef-concept {
    background: linear-gradient(180deg, var(--color-reef-teal) 0%, white 20%);
}

.reef-animation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: start;
}

.reef-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.reef-visual {
    position: relative;
    height: 300px;
    background: linear-gradient(180deg, #0c4a6e 0%, #0369a1 40%, #0ea5e9 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.3);
}

/* Sand at bottom */
.reef-visual::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, transparent 0%, #d4a373 50%, #bc8a5f 100%);
    border-radius: 50% 50% 0 0 / 30px 30px 0 0;
}

/* Coral Assets Configuration */
.coral-asset {
    position: absolute;
    bottom: 0;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    animation: sway 4s ease-in-out infinite;
    transform-origin: bottom center;
}

.coral-asset:hover {
    transform: scale(1.1);
    z-index: 10;
}

.coral-left {
    width: 100px;
    left: 10%;
    bottom: 20px;
    animation-delay: 0s;
}

.coral-center {
    width: 130px;
    left: 50%;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.6s ease;
    transform-origin: bottom center;
    image-rendering: -webkit-optimize-contrast;
}

.coral-asset:hover {
    z-index: 20 !important;
}

/* Back Layer (Smaller, darker, slower) */
.coral-back-left {
    width: 90px;
    left: 25%;
    bottom: 40px;
    z-index: 1;
    animation-delay: 0.2s;
}

.coral-back-right {
    width: 85px;
    right: 25%;
    bottom: 45px;
    z-index: 1;
    animation-delay: 0.5s;
}

/* Mid Layer */
.coral-mid-left {
    width: 110px;
    left: 10%;
    bottom: 30px;
    z-index: 2;
    animation-delay: 1.2s;
}

.coral-mid-right {
    width: 100px;
    right: 10%;
    bottom: 35px;
    z-index: 2;
    animation-delay: 0.9s;
}

/* Front Layer (Largest, main focus) */
.coral-front-left {
    width: 120px;
    left: 35%;
    bottom: 15px;
    z-index: 3;
    animation-delay: 0s;
}

.coral-front-center {
    width: 140px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    z-index: 4;
    animation-delay: 1.5s;
}

.coral-front-right {
    width: 115px;
    right: 32%;
    bottom: 20px;
    z-index: 3;
    animation-delay: 0.7s;
}

/* CSS Fish Assets (Clean & Animated) */
.fish-css {
    position: absolute;
    display: flex;
    align-items: center;
    opacity: 0;
    /* Hidden by default until health increases */
    transition: opacity 0.5s ease;
}

.fish-body {
    width: 40px;
    height: 24px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fish-tail {
    width: 12px;
    height: 18px;
    background: #f59e0b;
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
    margin-right: -4px;
    animation: tail-flop 0.5s infinite alternate ease-in-out;
}

.fish-eye {
    width: 4px;
    height: 4px;
    background: black;
    border-radius: 50%;
    position: absolute;
    top: 6px;
    right: 8px;
    border: 1px solid white;
}

.fish-1 {
    top: 30%;
    right: -100px;
    animation: swim-across 12s linear infinite;
}

.fish-1 .fish-body {
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
}

.fish-1 .fish-tail {
    background: #0ea5e9;
}

.fish-2 {
    top: 60%;
    right: -100px;
    animation: swim-across 18s linear infinite;
    animation-delay: -5s;
    transform: scale(0.8);
}

.fish-2 .fish-body {
    background: linear-gradient(90deg, #f472b6, #db2777);
}

.fish-2 .fish-tail {
    background: #db2777;
}

.fish-tiny {
    top: 20%;
    right: -100px;
    animation: swim-across 9s linear infinite;
    animation-delay: -2s;
    transform: scale(0.5);
}

@keyframes tail-flop {
    from {
        transform: rotate(10deg);
    }

    to {
        transform: rotate(-10deg);
    }
}

@keyframes swim-across {
    0% {
        right: -100px;
        transform: scaleX(1);
    }

    49% {
        transform: scaleX(1);
    }

    50% {
        right: 110%;
        transform: scaleX(-1);
    }

    /* Turn around */
    99% {
        transform: scaleX(-1);
    }

    100% {
        right: -100px;
        transform: scaleX(1);
    }
}

/* CSS Starfish */
.starfish-css {
    position: absolute;
    bottom: 15px;
    left: 20%;
    width: 30px;
    height: 30px;
    background: #fb923c;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    opacity: 0;
    transition: opacity 0.5s ease;
    transform: rotate(15deg);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}

/* Health Score Slider Controls */
.reef-controls {
    text-align: center;
    padding: var(--space-xl) 0;
    margin-top: var(--space-lg);
}

.reef-controls label {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text-dark);
    margin-bottom: var(--space-md);
}

.reef-controls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 400px;
    height: 12px;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 25%, #eab308 50%, #22c55e 75%, #06b6d4 100%);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.reef-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--color-primary);
    transition: transform 0.2s ease;
}

.reef-controls input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.reef-controls input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
}

.level-labels {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: var(--space-md) auto 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.level-labels .health-value {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.1rem;
}

@keyframes sway {

    0%,
    100% {
        transform: rotate(-2deg) translateX(0);
    }

    50% {
        transform: rotate(2deg) translateX(3px);
    }
}

.reef-description {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.reef-step {
    text-align: center;
    padding: var(--space-md);
}

.step-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.reef-step h3 {
    margin-bottom: var(--space-xs);
}

.reef-step p {
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* ============================================
   GAMIFICATION SECTION
   ============================================ */
.xp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    text-align: left;
    margin-top: var(--space-2xl);
}

.xp-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.xp-item h4 {
    font-family: var(--font-display);
    color: var(--color-reef-teal);
    margin-bottom: var(--space-xs);
}

.xp-item p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.achievements-showcase {
    margin-top: var(--space-3xl);
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-lg);
    justify-content: center;
}

.achievement {
    text-align: center;
    padding: var(--space-md);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.achievement-name {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ============================================
   TESTIMONIALS SECTION
   ============================================ */
.testimonials {
    background: var(--color-bg-white);
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.testimonial-card {
    background: var(--color-bg-white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.testimonial-rating {
    color: var(--color-coral);
    font-size: 1.25rem;
    margin-bottom: var(--space-md);
}

.testimonial-text {
    color: var(--color-text-dark);
    font-style: italic;
    margin-bottom: var(--space-xl);
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.author-avatar {
    width: 50px;
    height: 50px;
    background: var(--gradient-hero);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.author-info {
    font-size: 0.875rem;
}

.author-name {
    font-weight: 600;
    color: var(--color-text-dark);
}

.author-title {
    color: var(--color-text-muted);
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features {
    background: var(--color-bg-white);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-3xl);
}

.section-header p {
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

.feature-card {
    background: var(--color-bg-white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-hero);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(26, 95, 180, 0.1), rgba(53, 132, 228, 0.1));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-lg);
    color: var(--color-primary);
}

.feature-card h3 {
    margin-bottom: var(--space-sm);
}

.feature-card p {
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats {
    background: var(--gradient-dark);
    color: var(--color-text-light);
}

.stat-item {
    text-align: center;
    padding: var(--space-xl);
}

.stat-number {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--color-accent-light);
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: 1rem;
    color: var(--color-text-light-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
    background: var(--color-bg-light);
    text-align: center;
}

.cta-box {
    background: var(--gradient-hero);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl) var(--space-xl);
    color: var(--color-text-light);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.cta-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
    pointer-events: none;
}

.cta-box h2 {
    color: var(--color-text-light);
    margin-bottom: var(--space-md);
    font-size: clamp(2rem, 4vw, 3rem);
}

.cta-box p {
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    font-size: 1.25rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
    position: relative;
    z-index: 2;
}

.cta-buttons .btn {
    background: white;
    color: var(--color-primary);
    box-shadow: var(--shadow-lg);
}

.cta-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    background: white;
}

.app-store-badge {
    display: inline-block;
    height: 54px;
    transition: transform var(--transition-base);
    margin-top: var(--space-md);
}

.app-store-badge img {
    height: 100%;
    width: auto;
}

.app-store-badge:hover {
    transform: scale(1.05);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo {
    margin-bottom: var(--space-md);
    color: var(--color-text-light);
}

.footer-brand p {
    color: var(--color-text-light-muted);
    font-size: 0.875rem;
}

.footer-links h4 {
    color: var(--color-text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-lg);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: var(--color-text-light-muted);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-text-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-bottom p {
    color: var(--color-text-light-muted);
    font-size: 0.875rem;
    margin: 0;
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--color-text-light-muted);
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background: var(--color-primary);
    color: var(--color-text-light);
}

/* ============================================
   LEGAL PAGES (Privacy, Terms)
   ============================================ */
.legal-page {
    padding-top: 120px;
    min-height: 100vh;
}

.legal-header {
    background: var(--gradient-hero);
    color: var(--color-text-light);
    padding: var(--space-3xl) 0;
    margin-bottom: var(--space-3xl);
}

.legal-header h1 {
    color: var(--color-text-light);
    margin-bottom: var(--space-sm);
}

.legal-header .last-updated {
    opacity: 0.8;
    font-size: 0.875rem;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-lg) var(--space-4xl);
}

.legal-content h2 {
    font-size: 1.5rem;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
    color: var(--color-primary);
}

.legal-content h3 {
    font-size: 1.25rem;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
}

.legal-content p,
.legal-content li {
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.legal-content ul,
.legal-content ol {
    padding-left: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.legal-content ul li,
.legal-content ol li {
    margin-bottom: var(--space-sm);
}

/* ============================================
   SUPPORT PAGE
   ============================================ */
.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
}

.contact-card {
    background: var(--gradient-hero);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    color: var(--color-text-light);
    text-align: center;
}

.contact-card h3 {
    color: var(--color-text-light);
    margin-bottom: var(--space-md);
}

.contact-card p {
    opacity: 0.9;
    margin-bottom: var(--space-sm);
}

.contact-email {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-accent-light);
    margin-bottom: var(--space-xl);
}

.faq-section h3 {
    margin-bottom: var(--space-xl);
    color: var(--color-text-dark);
}

.faq-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: var(--space-lg) 0;
}

.faq-question {
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--color-primary);
    transition: transform var(--transition-fast);
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    color: var(--color-text-muted);
    display: none;
    padding-top: var(--space-sm);
}

.faq-item.active .faq-answer {
    display: block;
}

.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.troubleshooting-item {
    background: var(--color-bg-white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.troubleshooting-item h4 {
    color: var(--color-text-dark);
    margin-bottom: var(--space-md);
}

.troubleshooting-item ul {
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.resource-card {
    background: var(--color-bg-white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.resource-card h4 {
    color: var(--color-text-dark);
    margin-bottom: var(--space-md);
}

.resource-card p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}



/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

/* ============================================
   ABOUT PAGE SPECIFIC STYLES
   ============================================ */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    color: var(--color-text-muted);
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

.steps {
    counter-reset: step;
    margin-top: var(--space-3xl);
}

.step {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
}

.step-content h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--color-text-dark);
    margin-bottom: var(--space-sm);
}

.step-content p {
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.metric {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.metric-name {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.metrics-note {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: var(--space-xl);
}

.gamification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.gamification-item {
    text-align: center;
    padding: var(--space-xl);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent-light));
    border-radius: var(--radius-xl);
    color: white;
}

.gamification-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.gamification-item h4 {
    font-family: var(--font-display);
    color: white;
    margin-bottom: var(--space-sm);
}

.gamification-item p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.xp-rewards {
    margin-top: var(--space-3xl);
}

.ai-feature,
.social-feature,
.wellness-feature,
.nutrition-feature {
    margin-bottom: var(--space-2xl);
    padding: var(--space-xl);
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.ai-feature:hover,
.social-feature:hover,
.wellness-feature:hover,
.nutrition-feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.ai-feature h3,
.social-feature h3,
.wellness-feature h3,
.nutrition-feature h3 {
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

.privacy-features {
    text-align: center;
    margin-top: var(--space-xl);
}

.privacy-features ul {
    list-style: none;
    margin: var(--space-xl) 0;
}

.privacy-features li {
    margin-bottom: var(--space-sm);
    padding: var(--space-sm) 0;
    color: var(--color-text-muted);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .phone-mockup {
        width: 240px;
        height: 500px;
    }

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

    .support-grid {
        grid-template-columns: 1fr;
    }

    .reef-animation {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .reef-visual {
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg-white);
        flex-direction: column;
        padding: var(--space-lg);
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    .section {
        padding: var(--space-3xl) 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        max-width: none;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .step {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .step-number {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .phone-mockup {
        width: 200px;
        height: 420px;
    }
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent-light);
    border-radius: var(--radius-full);
    border: 3px solid var(--color-bg-light);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}