/* ==========================================================================
   Symbolic Labs Publishing - Main Stylesheet
   Elegant, handwritten-inspired design with warm, wise aesthetic
   ========================================================================== */

/* CSS Custom Properties for consistent theming */
:root {
    /* Typography Scale */
    --font-primary: 'Amarante', serif;
    --font-secondary: 'Amarante', serif;
    --font-body: 'Amarante', serif;
    
    /* Color Palette - Warm, Academic, Sophisticated */
    --color-primary: #B8860B;        /* Dark goldenrod */
    --color-secondary: #CD853F;      /* Peru */
    --color-accent: #DEB887;         /* Burlywood */
    --color-text-primary: #2F1B14;   /* Dark coffee */
    --color-text-secondary: #5D4037; /* Medium brown */
    --color-text-light: #8D6E63;     /* Light brown */
    --color-background: #FFF8E7;     /* Warm ivory */
    --color-surface: #FFFEF7;        /* Pure ivory */
    --color-border: #E8D5B7;         /* Warm beige */
    
    /* Spacing & Layout */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    --container-max-width: 1200px;
    --content-max-width: 800px;
    
    /* Visual Effects */
    --shadow-soft: 0 2px 8px rgba(139, 69, 19, 0.1);
    --shadow-medium: 0 4px 16px rgba(139, 69, 19, 0.15);
    --border-radius: 8px;
    
    /* Animation */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-gentle: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================================================
   Base Styles & Typography
   ========================================================================== */

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

html {
    font-size: 18px;
    scroll-behavior: smooth;
    line-height: 1.6;
    /* Optimize scrolling performance */
    scroll-padding-top: 10vh; /* Account for header when jumping to sections */
}

body {
    font-family: var(--font-body);
    color: var(--color-text-primary);
    background: linear-gradient(135deg, var(--color-background) 0%, var(--color-surface) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    /* Optimize for smooth scrolling performance */
    -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Amarante Font Utility Class */
.amarante-regular {
    font-family: "Amarante", serif;
    font-weight: 400;
    font-style: normal;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
    font-weight: 400;
}

h2 {
    font-size: 2.8rem;
    font-weight: 400;
}

h3 {
    font-size: 2.2rem;
    font-weight: 400;
}

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
    color: var(--color-text-secondary);
}

strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

em {
    font-style: italic;
    color: var(--color-primary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-smooth);
    border-bottom: 1px solid transparent;
}

a:hover, a:focus {
    color: var(--color-secondary);
    border-bottom-color: var(--color-secondary);
}

/* ==========================================================================
   Layout & Containers
   ========================================================================== */

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.content-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.section {
    padding: var(--spacing-xxl) 0;
    position: relative;
    /* Ensure all sections are positioned consistently for smooth scrolling */
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: opacity; /* Optimize for opacity changes */
}

.section:nth-child(even) {
    background: rgba(255, 255, 255, 0.3);
}

/* Section visibility state managed by JavaScript */
.section-visible {
    opacity: 1 !important;
}

/* Skip Link for Accessibility */
.skip-link {
    position: fixed;
    top: -100px;
    left: 20px;
    background: var(--color-primary);
    color: white !important;
    padding: 12px 16px;
    z-index: 10000;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-medium);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.skip-link:focus,
.skip-link:active {
    top: 20px;
    color: white !important;
    outline: 3px solid white;
    outline-offset: 2px;
    transform: scale(1.05);
}

/* ==========================================================================
   Interactive Header & Navigation (Three.js Example Style)
   ========================================================================== */

#container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(255, 248, 231, 0.1) 0%, rgba(255, 254, 247, 0.1) 100%);
    gap: var(--spacing-lg);
}

/* Three.js canvas wrapper - positioned above title */
#canvas-wrapper {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

#info {
    position: relative;
    text-align: center;
    z-index: 100;
    pointer-events: none;
    color: var(--color-text-primary);
    flex-shrink: 0;
}

#info h1 {
    font-family: var(--font-primary);
    font-size: 4rem;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.1;
}

#info p {
    font-family: var(--font-secondary);
    font-size: 1.4rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.header-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    pointer-events: auto;
}

.header-nav a {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    border: 1px solid rgba(184, 134, 11, 0.2);
}

.header-nav a:hover {
    background: rgba(184, 134, 11, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

/* Responsive Header */
@media (max-width: 768px) {
    #container {
        padding: var(--spacing-sm);
        gap: var(--spacing-md);
        min-height: 100vh;
    }

    #canvas-wrapper {
        max-width: 350px;
    }

    #info h1 {
        font-size: 2.5rem;
    }

    #info p {
        font-size: 1.1rem;
        padding: 0 var(--spacing-md);
    }

    .header-nav {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .header-nav a {
        font-size: 1rem;
        padding: var(--spacing-xs);
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    #container {
        padding: var(--spacing-xs);
        gap: var(--spacing-sm);
        min-height: 100vh;
    }

    #canvas-wrapper {
        max-width: 280px;
    }

    #info h1 {
        font-size: 2rem;
    }

    #info p {
        font-size: 1rem;
    }

    .header-nav a {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

/* Very small heights - ensure no overlap */
@media (max-height: 600px) {
    #container {
        gap: var(--spacing-xs);
        padding: var(--spacing-xs);
    }

    #canvas-wrapper {
        max-width: 200px;
    }

    #info h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    #info p {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .header-nav a {
        font-size: 0.85rem;
        padding: 4px 8px;
    }
}


/* ==========================================================================
   Section Styling
   ========================================================================== */

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -var(--spacing-sm);
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

/* Hero Section */
.hero-section {
    background: radial-gradient(ellipse at center, rgba(222, 184, 135, 0.1) 0%, transparent 70%);
    text-align: center;
}

.vision-statement {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
    text-align: justify;
}

/* Values Section */
.values-section {
    background: linear-gradient(135deg, rgba(205, 133, 63, 0.05) 0%, rgba(184, 134, 11, 0.05) 100%);
}

.intro-text {
    font-style: italic;
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
}

.values-list {
    list-style: none;
    margin-left: 0;
}

.values-list li {
    margin-bottom: var(--spacing-lg);
    padding-left: var(--spacing-xl);
    position: relative;
    line-height: 1.8;
}

.values-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-accent);
    font-size: 1.2rem;
    font-weight: bold;
}

/* Philosophy Section */
.philosophy-section {
    background: rgba(255, 255, 255, 0.2);
}

.philosophy-statement {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
    margin-bottom: var(--spacing-lg);
}

/* Innovation Section */
.innovation-section {
    background: linear-gradient(135deg, rgba(222, 184, 135, 0.08) 0%, rgba(232, 213, 183, 0.1) 100%);
}

.innovation-intro {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.innovation-list {
    list-style: none;
    margin: var(--spacing-lg) 0;
    padding-left: var(--spacing-md);
}

.innovation-list li {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
    position: relative;
    line-height: 1.7;
}

.innovation-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-primary);
    font-weight: bold;
}

.innovation-statement {
    text-align: center;
    font-style: italic;
    margin-top: var(--spacing-lg);
}

/* Estonia Section */
.estonia-section {
    background: rgba(255, 248, 231, 0.3);
}

.estonia-statement {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
    margin-bottom: var(--spacing-lg);
}

/* Aspiration Section */
.aspiration-section {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.06) 0%, rgba(205, 133, 63, 0.06) 100%);
}

.aspiration-statement {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-style: italic;
}

/* Contact Section */
.contact-section {
    background: rgba(255, 255, 255, 0.4);
    text-align: center;
}

.contact-image {
    margin-bottom: var(--spacing-xl);
}

.contact-img {
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    transition: var(--transition-smooth);
}

.contact-img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(139, 69, 19, 0.2);
}

.contact-list {
    list-style: none;
    display: inline-block;
    text-align: left;
}

.contact-list li {
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
}

.contact-label {
    font-family: var(--font-secondary);
    font-weight: 600;
    color: var(--color-primary);
}

.contact-link {
    font-weight: 500;
    margin-left: var(--spacing-xs);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    text-align: center;
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xxl);
}

.footer-tagline {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.95;
}

.footer-credits {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Additional responsive adjustments for content sections */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .values-list li,
    .innovation-list li {
        padding-left: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .values-list li,
    .innovation-list li {
        padding-left: var(--spacing-md);
    }
    
    .vision-statement,
    .philosophy-statement,
    .estonia-statement {
        text-align: left;
    }
}

/* ==========================================================================
   Accessibility & User Experience Enhancements
   ========================================================================== */

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* 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-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-text-primary: #000000;
        --color-text-secondary: #333333;
        --color-background: #ffffff;
    }
}

/* Print styles */
@media print {
    .site-header nav,
    #logo-canvas,
    .site-footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}
