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

/* ===== HEADER & NAVIGATION ===== */

/* Header Base */
.site-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-sticky);
    padding-top: 72px;
    transition: opacity var(--transition-base), padding var(--transition-base);
}

/* Header Overlay */
.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
    z-index: -1;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

/* Sticky Header */
.site-header.is-sticky {
    position: fixed;
    top: 0;
    width: calc(100% - 40px);
    max-width: calc(100% - 40px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--base-white);
    padding: 15px 0;
    box-shadow: var(--shadow-md);
    z-index: var(--z-fixed);
    animation: fadeIn var(--transition-slow) ease forwards;
}

/* Header Inner Container */
.site-header__inner {
    max-width: 1457px;
    margin: 0 auto;
    padding: 0 var(--desktop-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navigation */
.nav-list {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
}

.nav-link {
    font-size: var(--text-nav-size);
    font-weight: 700;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 4px;
    transition: color var(--transition-base);
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-link--active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--brand-primary);
}

/* Sticky State Adjustments */
.site-header.is-sticky .header-overlay {
    opacity: 0;
}

.site-header.is-sticky .site-header__logo img {
    width: 180px !important;
    transition: width var(--transition-base);
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height, 0px));
    min-height: 600px; /* Fallback for very short screens */
    max-height: 900px; /* Prevent excessive stretching on ultra-widescreens */
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%; /* Fill the hero-section height */
    overflow: hidden;
    line-height: 0;
}

.hero-slide {
    display: none;
    width: 100%;
    height: 100%; /* Fill the slider container */
}

.hero-slide.active {
    display: block;
}

.hero-img {
    width: 100%;
    height: 100%; /* Fill the entire slide */
    object-fit: cover;
    object-position: center center; /* Explicit center alignment */
}

.hero-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-lg);
    z-index: 10;
}

.dot {
    width: var(--dot-size);
    height: var(--dot-size);
    border-radius: 50%;
    cursor: pointer;
    background-color: transparent;
    border: 2px solid var(--base-white);
    padding: 0;
    margin: 0;
    min-height: 24px;
    min-width: 24px;
}

.dot.active {
    background-color: var(--base-white);
}

/* ===== INTRO SECTION ===== */
.intro-section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    background-color: var(--base-white);
}

.intro-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
}

/* Typography */
.intro-heading {
    font-family: var(--font-heading);
    color: var(--brand-primary);
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.intro-heading .heading-italic {
    display: block;
    font-weight: 700;
    font-style: italic;
    font-size: var(--text-h2);
    margin-bottom: 0.2rem;
}

.intro-heading .heading-main {
    display: block;
    font-weight: 700;
    font-style: normal;
    font-size: var(--text-h2);
}

.intro-body {
    max-width: 500px;
    text-align: center;
    margin: 0 auto;
    font-size: var(--text-body-size);
    color: var(--text-body);
    line-height: 1.6;
}

/* Image */
.intro-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

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

/* Bottom Row */
.intro-bottom-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 4.375rem;
    color: var(--brand-primary);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: var(--text-nav-size);
    color: var(--text-body);
    font-weight: 600;
}

.stat-sub {
    font-size: var(--text-xsmall);
    display: block;
    margin-top: 0.25rem;
    font-weight: 400;
}

.intro-btn-col {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: var(--space-sm);
}

/* ===== PURPOSE SECTION ===== */
.purpose-section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    background-color: var(--base-bg-light);
}

.purpose-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.purpose-label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-body-size);
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

.purpose-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-h2);
    color: var(--brand-primary);
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    text-align: center;
}

.purpose-body {
    font-size: 1.25rem;
    color: var(--text-body);
    line-height: 1.5;
    max-width: 800px;
    text-align: center;
    margin: 0 auto;
}

.purpose-action {
    display: flex;
    justify-content: center;
}

.purpose-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform var(--transition-slow) ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

/* ===== LATEST LAUNCHES SECTION ===== */
.launches-section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    background-color: var(--base-white);
}

.launches-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-h2);
    color: var(--brand-primary);
    margin-bottom: var(--space-xs);
    text-align: center;
}

.section-sub {
    font-size: 1.25rem;
    color: var(--text-body);
    text-align: center;
}

.launches-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

.launch-card {
    background-color: var(--base-white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: var(--space-lg);
    transition: transform var(--transition-base) ease;
    max-width: 400px;
    margin: 0 auto;
}

.launch-card:hover {
    transform: translateY(-5px);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--base-white);
    font-size: var(--text-xsmall);
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: var(--border-radius-pill);
    z-index: 2;
}

.badge-red { background-color: var(--brand-secondary); }
.badge-green { background-color: var(--brand-tertiary); }
.badge-purple { background-color: var(--brand-primary); }

.card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: flex-start;
    padding: var(--space-lg);
}

.card-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-bottom: var(--space-sm);
}

.card-type {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-body);
    line-height: 1.2;
    width: 100%;
}

.separator-line {
    padding-bottom: 4px;
    margin-bottom: var(--space-xs);
    border-bottom: 1px solid #D9D9D9;
}

.card-size {
    font-size: var(--text-nav-size);
    font-weight: 700;
    color: var(--text-body);
    margin-bottom: var(--space-lg);
}

.card-price-box {
    margin-top: auto;
    background-color: var(--brand-primary);
    border-radius: var(--border-radius);
    padding: var(--space-sm) var(--space-lg);
    color: var(--base-white);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.price-label {
    font-size: var(--text-nav-size);
    font-weight: 400;
}

.price-amount {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.625rem;
    line-height: 1.2;
}

.launches-footer {
    display: flex;
    justify-content: center;
    margin-top: var(--space-2xl);
}

/* ===== TOWNSHIP SECTION ===== */
.township-section {
    padding-top: var(--space-3xl);
    padding-bottom: 0;
    background-color: var(--base-white);
    width: 100%;
    overflow: hidden;
}

.township-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.township-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-h2);
    color: var(--brand-primary);
    line-height: 1.2;
    display: inline-block;
    text-align: center;
}

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

.township-map {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.township-col-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    justify-content: center;
    align-items: center;
}

.township-desc {
    font-size: var(--text-body-size);
    color: var(--text-body);
    line-height: 1.6;
    max-width: 500px;
    text-align: center;
}

.township-distance-img {
    width: 100%;
    height: auto;
    max-width: 400px;
    display: block;
}

.township-fw-image {
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.township-fw-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== INTEREST FORM SECTION ===== */
.interest-section {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-3xl);
    background-color: var(--base-white);
    text-align: center;
}

.interest-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-h2);
    color: var(--brand-primary);
    margin-bottom: var(--space-xl);
    line-height: 1.2;
    text-align: center;
}

.interest-form {
    max-width: 364px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--text-body);
    border-radius: var(--border-radius-pill);
    background-color: var(--base-white);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-small);
    color: var(--text-dark);
    text-align: center;
    outline: none;
    transition: border-color var(--transition-base) ease;
}

.form-input:focus {
    border-color: var(--brand-primary);
}

.form-input::placeholder {
    color: var(--text-body);
    opacity: 0.8;
}

.form-disclaimer {
    margin-top: var(--space-xs);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.disclaimer-text {
    font-family: var(--font-body);
    font-size: var(--text-xsmall);
    color: var(--text-body);
    text-align: left;
    line-height: 1.4;
}

/* ===== BUTTONS ===== */
.btn--pill {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: var(--brand-primary);
    color: var(--base-white);
    padding: 0.8rem 2.5rem;
    border-radius: var(--border-radius-pill);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-body-size);
    text-transform: capitalize;
    min-height: 44px;
    min-width: 44px;
    transition: all var(--transition-base) ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn--pill:hover {
    background-color: #453875;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--pill-lg {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: var(--brand-primary);
    color: var(--base-white);
    padding: var(--space-sm) 3.5rem;
    border-radius: var(--border-radius-pill);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.5rem;
    transition: all var(--transition-base) ease;
    min-height: 44px;
    min-width: 44px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn--pill-lg:hover {
    background-color: #453875;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn--submit {
    background-color: var(--brand-primary);
    color: var(--base-white);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--text-nav-size);
    padding: 0.6rem 3rem;
    border: none;
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    transition: all var(--transition-base) ease;
    min-width: 122px;
    min-height: 44px;
}

.btn--submit:hover {
    background-color: #453875;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(52, 34, 84, 0.85);
    color: var(--base-white);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
    transition-property: opacity, visibility, transform, background-color;
    outline: none;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus {
    background-color: rgba(52, 34, 84, 1);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.back-to-top:active {
    transform: translateY(-1px) scale(0.98);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--base-white);
    outline-offset: 3px;
}

/* ===== GLOBAL IMAGE RULES ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablet: 768px - 991px */
@media (min-width: 768px) {
    .purpose-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .intro-bottom-row {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-xl);
    }
    
    .intro-btn-col {
        grid-column: auto;
        margin-top: 0;
        align-items: center;
        justify-content: center;
    }
    
    /* Hero dots adjustment for tablet */
    .hero-dots {
        gap: var(--space-md);
    }
}

/* Desktop: 992px and above */
@media (min-width: 992px) {
    /* Intro Section */
    .intro-layout {
        grid-template-columns: 
            minmax(2rem, 1fr) 
            minmax(auto, calc(var(--container-width) / 2)) 
            minmax(auto, calc(var(--container-width) / 2)) 
            minmax(2rem, 1fr);
        gap: 0;
        align-items: center;
    }

    .intro-text-col {
        grid-column: 2 / 3;
        padding-left: var(--desktop-padding);
        padding-right: 4rem;
        text-align: left;
    }

    .intro-image-wrapper {
        grid-column: 3 / 5;
        justify-content: flex-end;
    }
    
    .intro-bottom-row {
        grid-column: 2 / 4;
        grid-template-columns: repeat(4, 1fr);
        padding-left: var(--desktop-padding);
        padding-right: var(--desktop-padding);
        margin-top: var(--space-2xl);
    }

    .intro-btn-col {
        justify-content: flex-end;
        align-self: center;
    }
    
    .intro-heading,
    .intro-body {
        text-align: left;
    }
    
    /* Purpose Section */
    .purpose-header {
        grid-template-columns: 7fr 3fr;
        align-items: end;
    }

    .purpose-action {
        justify-content: flex-end;
        padding-bottom: 10px;
    }
    
    .purpose-heading,
    .purpose-body {
        text-align: left;
    }
    
    /* Launches Section */
    .launches-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-xl);
    }
    
    .launch-card {
        max-width: none;
        margin: 0;
    }
    
    /* Township Section */
    .township-grid {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: center;
        gap: var(--space-2xl);
    }
    
    .township-col-right {
        align-items: flex-start;
    }
    
    .township-desc {
        text-align: left;
        margin: 0;
    }
}

/* Mobile: 767px and below */
@media (max-width: 767px) {
    /* Header */
    .site-header.is-sticky {
        width: calc(100% - 40px);
        max-width: calc(100% - 40px);
    }
    
    .site-header__inner {
        padding: 0 var(--mobile-padding);
    }
    
    .nav-list {
        gap: var(--space-sm);
        font-size: var(--text-small);
    }
    
    .site-header__logo img {
        width: 160px !important;
    }
    
    /* Section Spacing */
    .intro-section,
    .purpose-section,
    .launches-section,
    .township-section,
    .interest-section {
        padding-top: var(--space-xl);
        padding-bottom: var(--space-xl);
    }
    
    /* Intro */
    .intro-layout {
        gap: var(--space-xl);
        padding: 0 var(--mobile-padding);
    }
    
    .intro-bottom-row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
        padding: 0;
    }
    
    .intro-btn-col {
        grid-column: span 2;
        justify-content: center;
        margin-top: var(--space-sm);
    }
    
    /* Purpose */
    .purpose-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .purpose-header {
        padding: 0 var(--mobile-padding);
    }
    
    /* Form */
    .interest-form {
        max-width: 100%;
        padding: 0 var(--mobile-padding);
    }
    
    .form-input {
        padding: var(--space-sm) var(--space-lg);
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Hero */
    .hero-dots {
        bottom: 20px;
        gap: var(--space-sm);
    }
    
    .dot {
        width: calc(var(--dot-size) * 0.6);
        height: calc(var(--dot-size) * 0.6);
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

/* Tablet Landscape: 1024px and below */
@media (max-width: 1024px) {
    .back-to-top {
        bottom: 25px;
        right: 25px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Small Mobile: 480px and below */
@media (max-width: 480px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 42px;
        height: 42px;
        font-size: 0.95rem;
    }
    
    .intro-bottom-row {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .intro-btn-col {
        grid-column: 1;
    }
}

/* Township Mobile */
@media (max-width: 991px) {
    .township-grid {
        gap: var(--space-xl);
        padding: 0 var(--mobile-padding);
    }
    
    .township-desc {
        text-align: center;
        margin: 0 auto;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .back-to-top {
        background-color: var(--brand-primary);
        border: 1px solid var(--base-white);
    }
    
    .btn--pill,
    .btn--pill-lg,
    .btn--submit {
        border: 2px solid var(--base-white);
    }
    
    .form-input {
        border: 2px solid var(--text-dark);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .back-to-top,
    .btn--pill,
    .btn--pill-lg,
    .btn--submit,
    .gallery-img,
    .launch-card,
    .nav-link,
    .site-header {
        transition: none;
        animation: none;
    }
    
    .back-to-top:hover,
    .back-to-top:focus,
    .btn--pill:hover,
    .btn--pill-lg:hover,
    .btn--submit:hover,
    .gallery-item:hover .gallery-img,
    .launch-card:hover {
        transform: none;
    }
    
    .back-to-top {
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    
    .site-header.is-sticky {
        animation: none;
    }
}