/* Base Styles */
:root {
    --primary: #D32626;
    --text: #747474;
    --white: #ffffff;
    --bg: #f8f8f8;
}

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

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    line-height: 1.8;
    background-color: #e8e8e8;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Fixed background pattern that works on mobile */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(../images/template/background_argyle_dark.png);
    background-position: center;
    background-repeat: repeat;
    z-index: 0;
    pointer-events: none;
}

/* Subtle overlay to soften the background */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    z-index: 0;
    pointer-events: none;
}

/* Page Transition Overlay - hidden, used for tracking only */
.page-transition-overlay {
    display: none;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    opacity: 1;
    transform: translateX(0);
    flex: 1;
}

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Pages Container - No longer used with separate HTML files */
/* .pages-container { ... } */
/* .page { ... } */

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 8px 40px 4px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 3px;
}

.logo-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 25px !important;
    width: auto !important;
    max-height: 25px !important;
    max-width: none !important;
    object-fit: contain;
    display: block;
    margin-top: 5px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.title {
    font-size: 2.0rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 1.5px;
    line-height: 1;
    margin-top: 5px;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text);
    letter-spacing: 0.3px;
    margin-left: 5px;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-item {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hero Section */
.hero {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 40px 60px;
    background: transparent;
    position: relative;
    z-index: 1;
}

.hero .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
}

.hero-text {
    text-align: center;
    max-width: 500px;
    background: var(--white);
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.hero-title {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 0;
}

.hero .animation-frame {
    max-width: 590px;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    background: var(--white);
    padding: 20px;
}

.hero .animation-frame iframe {
    width: 550px;
    height: 400px;
    border: none;
    display: block;
    margin: 0 auto;
}

/* Sections */
.section {
    padding: 120px 0 10px 0;
    background: transparent;
    position: relative;
    z-index: 1;
}

.section-header {
    background: var(--white);
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--primary);
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.section .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text);
    text-align: center;
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.9;
}

/* Story Layout */
.story {
    max-width: 800px;
    margin: 10px auto;
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.story-text {
    margin: 10px 0;
}

.story-text p {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text);
}

.story-image {
    margin: 30px 0;
    text-align: center;
}

.story-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.story-gallery {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin: 10px 0;
}

.story-gallery img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Image Flow */
.image-flow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    width: 800px;
    max-width: 100%;
    margin: 10px auto;
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.image-flow.small {
    grid-template-columns: 1fr;
    width: 800px;
    max-width: 100%;
    margin: 10px auto;
}

.image-flow img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Message Box */
.message-box {
    text-align: center;
    padding: 10px 40px;
    margin: 10px 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.message-box p {
    font-size: 1.1rem;
    color: var(--text);
    margin: 10px 0;
    font-style: italic;
}

/* Hide mobile break on desktop */
.mobile-break {
    display: none;
}

/* Center social icons in message box */
.message-box .social {
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 15px;
}

/* Slideshow */
.slideshow-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.slideshow-box {
    background: var(--white);
    padding: 50px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.slideshow {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.slide {
    width: 100%;
    height: auto;
    display: none;
}

.slide.active {
    display: block;
}

.control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border: none;
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
}

.slideshow-wrapper:hover .control {
    opacity: 0.7;
}

.control:hover {
    background: var(--primary);
    color: var(--white);
    opacity: 1;
}

.control.prev {
    left: -25px;
}

.control.next {
    right: -25px;
}

.dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.indicator.active {
    background: var(--primary);
    transform: scale(1.2);
}

/* Coda Slider Navigation Arrows */
.coda-slider-wrapper {
    position: relative;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    user-select: none;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 3px;
}

.slider-arrow-left {
    left: 20px;
}

.slider-arrow-right {
    right: 20px;
}

.coda-slider-wrapper:hover .slider-arrow {
    opacity: 0.7;
}

.slider-arrow:hover {
    opacity: 1 !important;
}

/* Animation Frame */
.animation-frame {
    max-width: 740px;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    background: var(--white);
    padding: 20px;
}

.animation-frame iframe {
    width: 700px;
    height: 525px;
    border: none;
    display: block;
    margin: 0 auto;
}

/* About Section */
.about-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    column-gap: 60px;
    row-gap: 20px;
    align-items: start;
    margin-top: 20px;
    background: var(--white);
    padding: 50px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.about-layout .section-title {
    grid-column: 1 / -1;
    margin-bottom: -20px;
}

.about-image img {
    width: 100%;
    border-radius: 50%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.about-text p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 25px;
}

.contact {
    font-weight: 600;
    margin-top: 30px;
}

.contact a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid var(--primary);
}

.contact a:hover {
    border-bottom-width: 2px;
}

/* Footer */
.footer {
    background: var(--white);
    color: var(--text);
    padding: 10px 15px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    position: relative;
    z-index: 1;
    border-top: 1px solid #eee;
}

.footer .container {
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    font-size: 0.95rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.social {
    display: flex;
    gap: 20px;
}

.social a {
    transition: transform 0.3s;
}

.social a:hover {
    transform: translateY(-3px);
}

.social img {
    width: 24px;
    height: 24px;
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.3));
    transition: all 0.3s ease;
    display: block;
}

.social a:hover img {
    filter: drop-shadow(2px 4px 5px rgba(0,0,0,0.4));
}

/* Responsive */
@media (max-width: 768px) {
    html {
        height: 100%;
    }

    body {
        min-height: 100vh;
    }

    .container {
        padding: 0 15px;
    }

    .header {
        padding-top: 7px;
    }

    .header-content {
        flex-direction: row;
        gap: 20px;
        padding: 7px 25px 7px 25px;
        position: relative;
        align-items: flex-start;
    }

    /* Show hamburger on mobile */
    .hamburger {
        display: flex;
        margin-top: 12px;
    }

    /* Smaller title on mobile */
    .title {
        font-size: 1.5rem;
    }

    /* Smaller logo on mobile */
    .logo img {
        height: 21px !important;
        max-height: 21px !important;
    }

    /* Hide nav by default on mobile */
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .nav.active {
        max-height: 310px;
        padding: 0;
    }

    .nav-item {
        font-size: 0.95rem;
        padding: 15px 25px;
        border-bottom: 1px solid #eee;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-item::after {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 140px 25px 60px;
    }

    .hero-title {
        font-size: 1.2rem;
    }

    /* Option 28 approach - device-independent centering */
    .hero .animation-frame {
        position: relative;
        height: 262px; /* 242px animation + 20px padding top/bottom */
        width: calc(100vw - 40px); /* Full width minus margins */
        max-width: 100%;
        margin: 0 auto;
        padding: 10px 20px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .hero .animation-frame iframe {
        position: absolute;
        left: 50%;
        top: 10px;
        transform: translateX(-50%) scale(0.60);
        transform-origin: top center;
        width: 550px;
        height: 400px;
    }

    .section {
        padding: 120px 0 40px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .image-flow {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Classics page mobile padding */
    body[data-page="classics"] .story,
    body[data-page="classics"] .image-flow,
    body[data-page="classics"] .image-flow.small {
        padding: 15px;
    }

    /* Show mobile break on mobile */
    .mobile-break {
        display: inline;
    }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .about-image {
        max-width: 250px;
        margin: 0 auto;
    }

    /* Iguana animation - same approach as brain */
    .animation-frame {
        position: relative;
        height: 335px; /* 315px animation + 20px padding top/bottom */
        width: calc(100vw - 40px);
        max-width: 100%;
        margin: 0 auto;
        padding: 10px 20px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .animation-frame iframe {
        position: absolute;
        left: 50%;
        top: 10px;
        transform: translateX(-50%) scale(0.60);
        transform-origin: top center;
        width: 700px;
        height: 525px;
    }

    /* Footer optimization for mobile */
    .footer {
        padding: 20px 20px;
    }

    .footer .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        padding: 0;
    }

    .copyright {
        font-size: 0.75rem;
        color: #888;
        text-align: left;
    }

    .social {
        justify-content: flex-end;
        gap: 15px;
    }

    .social img {
        width: 22px;
        height: 22px;
    }
}

/* Small mobile devices - Option 28 approach */
@media (max-width: 400px) {
    .hero .animation-frame {
        height: 232px; /* 212px animation + 20px padding top/bottom */
    }

    .hero .animation-frame iframe {
        transform: translateX(-50%) scale(0.53);
    }

    /* Iguana animation for small screens */
    .animation-frame {
        height: 298px; /* 278px animation + 20px padding top/bottom */
    }

    .animation-frame iframe {
        transform: translateX(-50%) scale(0.53);
    }
}
