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

:root {
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
}

/* Dark Theme - Hakone Forest Colors */
:root {
    /* Forest/Hakone Green Palette */
    --earth-green: #1a3a1a;
    --earth-green-light: #2d5a2d;
    --earth-green-bright: #4a7c4a;
    --highlight-green: #6b9b6b;
    --accent-green: #8ab88a;
    
    /* Background Colors */
    --bg-primary: #0a0a0a;
    --bg-overlay: rgba(0, 0, 0, 0.4);
    --bg-gradient-start: #0f2027;
    --bg-gradient-mid: #203a43;
    --bg-gradient-end: #2c5364;
    
    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-blur: 12px;
    
    /* Text Colors */
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-tertiary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    /* Shadow */
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-strong: rgba(0, 0, 0, 0.7);
    
    /* Optional Background Gradient (set to 'on' or 'off') */
    --bg-gradient-enabled: on; /* Change to 'off' to disable */
}

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

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* ============================================
   OPTIONAL BACKGROUND GRADIENT/TEXTURE
   Toggle by changing --bg-gradient-enabled to 'off' in theme variables above
   ============================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    opacity: var(--bg-gradient-enabled, 0);
    
    /* Modern radial gradient with subtle movement */
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(45, 90, 45, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(26, 58, 26, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(74, 124, 74, 0.04) 0%, transparent 50%);
    transition: opacity 0.5s ease;
}

/* Show gradient when enabled */
body::before {
    opacity: 1;
}

/* Subtle animated mesh texture overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: var(--bg-gradient-enabled, 0);
    
    /* Mesh/noise texture */
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.015) 2px, rgba(255, 255, 255, 0.015) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(255, 255, 255, 0.015) 2px, rgba(255, 255, 255, 0.015) 4px);
    transition: opacity 0.5s ease;
}

body::after {
    opacity: 0.4;
}

/* TO DISABLE: Simply change --bg-gradient-enabled to 'off' in the theme variables at the top of this file */

/* ============================================
   BACKGROUND VIDEO/IMAGE
   ============================================ */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-video,
.background-image {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.background-image {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.background-image.active {
    opacity: 1;
}

/* Fallback animated gradient with leaf pattern */
.background-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(74, 124, 74, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(45, 90, 45, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(107, 155, 107, 0.08) 0%, transparent 50%);
    opacity: 0.6;
}

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

/* Overlay for better text contrast */
.background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    z-index: 1;
    transition: background 0.3s ease;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    background-image: url('teemu-paananen-OOE4xAnBhKo-unsplash-medium.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.35;
    transition: opacity 0.5s ease;
    will-change: opacity;
}

/* WebP support for modern browsers */
@supports (background-image: url('test.webp')) {
    .hero-background-image {
        background-image: url('teemu-paananen-OOE4xAnBhKo-unsplash-medium.webp');
    }
}

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--spacing-md);
    background: radial-gradient(ellipse at center, transparent 0%, var(--bg-primary) 100%);
    overflow: hidden; /* Ensure absolute positioned background stays contained on mobile */
}

.content-wrapper {
    text-align: center;
    z-index: 10;
    max-width: 1200px;
    width: 100%;
}

/* ============================================
   BRAND/LOGO
   ============================================ */
.brand {
    margin-bottom: clamp(2.5rem, 6vw, 4rem);
    animation: fadeInDown 1s ease-out;
}

.logo {
    font-size: clamp(1.25rem, 3.5vw, 2rem);
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-shadow: 
        0 2px 10px var(--shadow-strong),
        0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0.95;
}

/* ============================================
   HERO TEXT
   ============================================ */
.hero-text-container {
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-text {
    font-size: clamp(3.5rem, 12vw, 9rem);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--earth-green-bright);
    text-shadow: 
        0 2px 8px var(--shadow-strong),
        0 4px 16px rgba(0, 0, 0, 0.6),
        0 8px 32px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.025em;
}

/* Highlight "Re" prefix */
.highlight {
    color: var(--highlight-green);
    font-weight: 800;
    text-shadow: 
        0 2px 8px var(--shadow-strong),
        0 4px 16px rgba(0, 0, 0, 0.6),
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(107, 155, 107, 0.3);
}

.tagline {
    font-size: clamp(0.9rem, 1.8vw, 1.15rem);
    font-weight: 400;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
    text-shadow: 
        0 2px 8px var(--shadow-strong),
        0 4px 16px rgba(0, 0, 0, 0.5);
    line-height: 1.7;
    max-width: 900px;
    margin: 0 auto;
    opacity: 0.9;
}

.tagline-highlight {
    color: var(--accent-green);
    font-weight: 600;
}

/* ============================================
   SCROLL INDICATOR
   ============================================ */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeIn 1s ease-out 0.6s both;
}

.scroll-indicator:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.scroll-text {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 400;
}

.scroll-arrow {
    color: var(--earth-green-bright);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ============================================
   MISSION SECTION
   ============================================ */
.mission-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(3rem, 8vw, 5rem) var(--spacing-md);
    position: relative;
    z-index: 2;
    background: transparent;
}

.mission-container {
    max-width: 900px;
    width: 100%;
}

.mission-text {
    font-size: clamp(1.1rem, 2.3vw, 1.4rem);
    line-height: 1.9;
    color: var(--text-primary);
    font-weight: 400;
    text-align: center;
    padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 3vw, 2rem);
    background: transparent;
    animation: fadeInUp 1s ease-out 0.2s both;
    max-width: 100%;
}

.mission-highlight {
    color: var(--accent-green);
    font-weight: 600;
    position: relative;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    background: linear-gradient(to bottom, transparent, var(--bg-primary));
    position: relative;
    z-index: 2;
}

.contact-container {
    max-width: 750px;
    width: 100%;
    text-align: center;
}

.section-title {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-wrapper {
    margin-top: 3rem;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 12px 40px var(--shadow-color);
}

.section-subtitle {
    font-size: 1.25rem;
    margin-bottom: 0;
    color: var(--accent-green);
    letter-spacing: 0.02em;
    opacity: 0.95;
    font-weight: 400;
}

/* ============================================
   MAILERLITE FORM STYLING
   ============================================ */
.mailerlite-form {
    max-width: 100%;
    margin: 0 auto;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    margin-top: 0;
}

.form-instructions {
    color: var(--text-tertiary);
    line-height: 1.8;
    font-size: 0.95rem;
    text-align: left;
}

/* Style MailerLite form elements when embedded */
.mailerlite-form input[type="email"],
.mailerlite-form input[type="text"] {
    width: 100%;
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mailerlite-form input[type="email"]:focus,
.mailerlite-form input[type="text"]:focus {
    outline: none;
    border-color: var(--earth-green-bright);
    background: var(--glass-bg);
    box-shadow: 0 0 0 3px rgba(74, 124, 74, 0.15);
    transform: translateY(-1px);
}

.mailerlite-form input::placeholder {
    color: var(--text-muted);
}

.mailerlite-form button,
.mailerlite-form input[type="submit"] {
    width: 100%;
    padding: 1.125rem 2rem;
    background: var(--earth-green-bright);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mailerlite-form button:hover,
.mailerlite-form input[type="submit"]:hover {
    background: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(74, 124, 74, 0.25);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: var(--spacing-md);
    text-align: center;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    z-index: 2;
    letter-spacing: 0.03em;
    border-top: 1px solid var(--glass-border);
    opacity: 0.8;
}

.footer p {
    margin: 0.5rem 0;
}

.photo-credit {
    font-size: 0.75rem;
    opacity: 0.7;
}

.photo-credit a {
    color: var(--accent-green);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.photo-credit a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
        --glass-blur: 8px; /* Reduce blur on mobile for better performance */
    }
    
    /* Mobile-optimized background image */
    .hero-background-image {
        position: absolute; /* Fix iOS Safari jank with position: fixed */
        background-image: url('teemu-paananen-OOE4xAnBhKo-unsplash-small.jpg');
        background-attachment: scroll; /* Improve mobile scrolling performance */
        will-change: auto; /* Remove will-change on mobile */
    }
    
    /* WebP support for mobile */
    @supports (background-image: url('test.webp')) {
        .hero-background-image {
            background-image: url('teemu-paananen-OOE4xAnBhKo-unsplash-small.webp');
        }
    }
    
    .hero-text {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .tagline {
        font-size: clamp(0.85rem, 2.8vw, 1.05rem);
        padding: 0 1rem;
        letter-spacing: 0.03em;
    }
    
    .mission-text {
        font-size: clamp(1rem, 3.5vw, 1.2rem);
        padding: clamp(1.5rem, 4vw, 2rem) 1rem;
    }
    
    .scroll-indicator {
        margin-top: var(--spacing-md);
    }
    
    .form-wrapper {
        padding: 2rem;
        margin-top: 2rem;
    }
    
    .section-title {
        margin-bottom: 0.75rem;
    }
    
}

@media (max-width: 480px) {
    .logo {
        letter-spacing: 0.25em;
        font-size: clamp(1rem, 4.5vw, 1.5rem);
    }
    
    .hero-text {
        font-size: clamp(2rem, 9vw, 3rem);
    }
    
    .tagline {
        font-size: 0.8rem;
        letter-spacing: 0.02em;
    }
    
    .mission-text {
        font-size: 0.95rem;
        line-height: 1.8;
        padding: 1.5rem 0.75rem;
    }
    
    .form-wrapper {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-arrow {
        animation: none;
    }
}

/* GPU acceleration for smooth animations */
.background-video,
.background-image {
    transform: translateZ(0);
}

