/* 
   Design System: Calm Intelligence. Quiet Confidence.
   SF Pro system stack only.
*/

:root {
    /* Colors */
    --color-bg: #F9F8F6;

    /* Warm off-white */
    --color-text-primary: #1A1A1A;
    /* Soft black */
    --color-text-secondary: #666666;
    /* Muted grey */
    --color-accent: #8B9978;
    /* Starting color - sage */
    --color-accent-rgb: 139,
        153,
        120;
    /* RGB for canvas */

    /* Color transition for living feel */
    --color-transition: 2s ease-in-out;

    /* Typography */
    --font-stack: -apple-system,
        BlinkMacSystemFont,
        "SF Pro Text",
        "SF Pro Icons",
        "Helvetica Neue",
        Helvetica,
        Arial,
        sans-serif;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 48px;
    --spacing-xl: 80px;
    --spacing-xxl: 160px;

    /* Transitions */
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s var(--ease-standard);
    --transition-medium: 0.4s var(--ease-standard);
}

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

html {
    scroll-behavior: auto;
    /* No scroll hijacking */
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-stack);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Sections */
section {
    position: relative;
    width: 100%;
    padding: var(--spacing-xxl) 0;
}

.ambient-frame {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-xxl);
    width: 100%;
}

/* Typography Hierarchy */
h1 {
    font-size: 64px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    color: var(--color-text-primary);
}

.title {
    font-size: 32px;
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.intro-content,
.contact-content {
    /* Ensure clear centering block */
    width: 600px;
    /* Or max-width with 100% to let it center properly in flex */
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

.statement {
    font-size: 24px;
    font-weight: 400;
    max-width: 600px;
    color: var(--color-text-primary);
    line-height: 1.4;
    margin-left: auto;
    margin-right: auto;
}

h2 {
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.section-label {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
    opacity: 0.6;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px;
    color: var(--color-text-secondary);
    opacity: 0.6;
    transition: all var(--transition-medium);
    background: radial-gradient(circle, rgba(249, 248, 246, 0.8) 0%, rgba(249, 248, 246, 0) 70%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 30px 40px;
    border-radius: 50%;
    cursor: pointer;
}

.scroll-indicator:hover {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.scroll-indicator.is-hidden {
    opacity: 0;
}

.indicator-arrow {
    margin-top: 4px;
    animation: bounce-slow 3s infinite var(--ease-standard);
}

@keyframes bounce-slow {

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

    50% {
        transform: translateY(6px);
    }
}

/* Cursor Enhancement */
#cursor-halo {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(15, 32, 28, 0.2);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s var(--ease-standard), height 0.3s var(--ease-standard), border-color 0.3s var(--ease-standard);
    display: none;
    /* Enabled via JS */
}

@media (pointer: fine) {
    #cursor-halo {
        display: block;
    }
}

/* Ambient Canvas */
.ambient-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 1;
}

.ambient-canvas-container::before,
.ambient-canvas-container::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 15vh;
    pointer-events: none;
    z-index: 1;
}

.ambient-canvas-container::before {
    top: 0;
    background: linear-gradient(to bottom, var(--color-bg), transparent);
}

.ambient-canvas-container::after {
    bottom: 0;
    background: linear-gradient(to top, var(--color-bg), transparent);
}

.ambient-canvas {
    width: 100%;
    height: 100%;
}

/* Project Section */
.project-list {
    display: flex;
    flex-direction: column;
    margin-top: var(--spacing-lg);
}

.project-card {
    position: relative;
    cursor: pointer;
    padding: var(--spacing-lg) 0;
    border-top: 1px solid rgba(var(--color-accent-rgb), 0.4);
    transition: transform var(--transition-medium), border-color var(--color-transition);
}

.project-card:last-child {
    border-bottom: 1px solid rgba(var(--color-accent-rgb), 0.4);
}

.project-card:hover .project-title {
    color: var(--color-accent);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 600px) {
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
}

.project-title {
    font-size: 32px;
    font-weight: 400;
    transition: color var(--transition-medium), color var(--color-transition);
}

.project-meta {
    font-size: 14px;
    color: var(--color-text-secondary);
    opacity: 0.6;
}

.project-expansion {
    position: relative;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card.is-expanded+.project-expansion {
    max-height: 2000px;
}

.expansion-content {
    padding: var(--spacing-sm) 0 var(--spacing-xl) 0;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.4s;
}

.project-card.is-expanded+.project-expansion .expansion-content {
    opacity: 1;
    transform: translateY(0);
}

/* New Stacked Layout */
.expansion-layout {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.expansion-visual {
    background: transparent;
    aspect-ratio: 21/9;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--color-text-secondary);
    border-radius: 4px;
}

.expansion-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
}

.detail-block {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    /* Reduced from sm for tighter layout */
}

.detail-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.close-button {
    margin-top: var(--spacing-lg);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity var(--transition-medium);
    text-align: right;
}

.close-button:hover {
    opacity: 1;
}

@media (max-width: 900px) {
    .expansion-details {
        grid-template-columns: 1fr;
    }
}

/* --- Static Story Sections --- */
.static-section {
    padding: var(--spacing-xxl) 0;
    /* More spacing for major sections */
    min-height: 40vh;
    /* Reduced from 60vh for a tighter layout */
    display: flex;
    flex-direction: column;
}

/* --- Operational Overhaul Styles (Sticky Transition) --- */

.sticky-track {
    height: 280vh;
    /* Reduced for tighter exit padding */
    position: relative;
    background: rgba(0, 0, 0, 0.015);
    border-top: 1px solid rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
    padding: 0 !important;
    /* Override default section padding */
}

.sticky-inner {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Perfectly viewport centered */
    padding-top: 0;
    overflow: hidden;
}

.static-section.operational-theme .ambient-canvas,
.sticky-track.operational-theme .ambient-canvas {
    opacity: 0.05 !important;
}

.philosophy-stack {
    max-width: 600px;
    position: relative;
    min-height: 300px;
    /* Space for the stacked content */
}

.philosophy-background {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--color-text-dim);
    margin-bottom: var(--spacing-sm);
    /* Tighten to progress bar */
}

.philosophy-background.is-visible {
    opacity: 0.9;
}

.philosophy-items-container {
    position: relative;
    height: 120px;
    /* Exact same spot for all points */
}

.philosophy-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.philosophy-item.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.philosophy-item h3 {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.01em;
}

.philosophy-item p {
    font-size: 1rem;
    color: var(--color-text-dim);
    line-height: 1.6;
    opacity: 0.8;
}

/* Progress Bar (Inline) */
.philosophy-progress-container {
    width: 100%;
    height: 2px;
    background: rgba(0, 0, 0, 0.03);
    margin-bottom: var(--spacing-lg);
    /* Consistent distance to points */
    transition: opacity 0.5s ease;
    /* Ensure smooth exit */
}

.philosophy-progress-container.is-exiting {
    opacity: 0 !important;
}

.philosophy-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--color-accent);
    transition: width 0.1s linear;
}


.centered {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}


.container-narrow {
    max-width: 800px;
}

.lead-text {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--color-text-dim);
    max-width: 680px;
    max-width: 600px;
    margin: 0;
    /* Align to top with label */
    text-align: left;
}

/* Split Layout for Story Sections */
.split-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    align-items: start;
    /* Ensure top alignment */
}

@media (min-width: 1024px) {
    .split-layout {
        grid-template-columns: 400px 1fr;
        /* Label Left, Content Right */
        max-width: 1200px;
    }

    .split-layout.reverse {
        grid-template-columns: 1fr 400px;
        /* Content Left, Label Right */
    }

    .split-layout.reverse .section-label {
        text-align: right;
    }

    .split-layout .section-label {
        position: sticky;
        top: 40px;
        margin-bottom: 0;
    }
}

.section-label.centered {
    text-align: center;
}

.principles-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.principle-card {
    background: transparent;
    padding: 0;
    border: none;
    max-width: 600px;
    /* Keep text lines readable on the right */
    transition: transform 0.3s ease;
}

.principle-card h3 {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.principle-card p {
    font-size: 1.1rem;
    color: var(--color-text-dim);
    line-height: 1.6;
    margin: 0;
}

.line-bubble.type-subtitle {
    width: auto;
    max-width: 600px;
}

.line-bubble.type-paragraph {
    width: 450px;
}

.line-bubble.type-principle {
    width: 300px;
}

.line-bubble-visual {
    margin-bottom: var(--spacing-sm);
    border-radius: 6px;
    overflow: hidden;
    height: 120px;
}

/* The original .principle-item:last-child rule was removed as it's now handled by the new combined rule and the specific override above. */

.principle-visual {
    width: 100%;
    aspect-ratio: 16/9;
    background: rgba(var(--color-accent-rgb), 0.05);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.principle-content h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.principle-content p {
    font-size: 16px;
    color: var(--color-text-secondary);
}

@media (max-width: 900px) {
    .sticky-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .sticky-column {
        position: relative;
        top: 0;
        margin-bottom: var(--spacing-lg);
    }

    .sticky-subtitle-container {
        opacity: 1;
        transform: none;
    }
}


/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--spacing-xxl);
    align-items: start;
}

.about-content {
    max-width: 600px;
}

.about-text {
    font-size: 24px;
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

.about-text p {
    margin-bottom: var(--spacing-md);
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-photo {
    aspect-ratio: 3/4;
    background: rgba(15, 32, 28, 0.03);
    border-radius: 4px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--color-text-secondary);
    overflow: hidden;
}

.about-photo-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 300px;
}

.about-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.about-footer .text-link {
    margin-right: 0;
    width: fit-content;
}

.about-footer .location {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.dynamic-sat {
    filter: grayscale(100%);
    transition: filter 0.2s ease, opacity 0.3s ease;
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .about-photo-column {
        order: -1;
        width: 100%;
        max-width: 250px;
        margin-bottom: var(--spacing-md);
    }

    .about-photo {
        width: 100%;
    }

    #about {
        padding: var(--spacing-xl) 0;
    }
}

/* Links */
.text-link {
    color: var(--color-text-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: border-color var(--transition-medium);
    margin-right: var(--spacing-md);
}

.text-link:hover {
    border-bottom-color: var(--color-accent);
}

/* Responsive Scaling */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 40px;
    }

    h2 {
        font-size: 24px;
    }

    .content-wrapper {
        padding: 0 var(--spacing-md);
    }
}

/* Contact Section with Sticky Footer */
#contact {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
    position: relative;
    overflow: hidden;
}

#contact .content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    max-width: 1400px;
    /* var(--max-width) might not be defined? safe fallback or check var */
    margin: 0 auto;
    padding: var(--spacing-xxl) var(--spacing-md) var(--spacing-md);
    z-index: 2;
    position: relative;
}

#contact .contact-content {
    margin: auto;
    /* Centers vertically and horizontally */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Scroll Reveal Animations */
.reveal-on-scroll {
    opacity: 0;
    /* Horizontal ease: Start slightly left */
    transform: translateX(-30px);
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1),
        transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Footer Specific Fade - Remove fade after load */
#contact .ambient-canvas-container {
    opacity: 0;
    transition: opacity 2s ease-in-out;
    transition-delay: 0.5s;
    pointer-events: none;
}

#contact.is-visible .ambient-canvas-container {
    opacity: 1;
}

/* Legal Footer */
.legal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-xxl);
    padding-top: var(--spacing-lg);
    /* Border removed as requested */
    font-size: 12px;
    color: var(--color-text-secondary);
    width: 100%;

    /* Center Content */
    max-width: 1400px;
    /* Standard Max Width */
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.copyright {
    opacity: 0.6;
}

.legal-links {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    opacity: 0.6;
    /* Applied here instead of parent */
}

.legal-trigger {
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    transition: color var(--transition-medium);
}

.legal-trigger:hover {
    color: var(--color-text-primary);
}

/* Duplicates removed */

.legal-content {
    padding: var(--spacing-md);
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.legal-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.legal-panel.active {
    display: block;
    animation: fadeSlideUp 0.4s forwards;
}

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

.legal-panel h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.legal-panel p {
    margin-bottom: var(--spacing-sm);
}

.legal-close {
    margin-top: var(--spacing-md);
    text-align: right;
}

#close-legal {
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

#close-legal:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

@media (max-width: 600px) {
    .legal-footer {
        flex-direction: column;
        gap: var(--spacing-xs);
        align-items: center;
        text-align: center;
    }
}

/* Footer Layout Tweaks */
#contact {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
}

#contact .content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    padding-bottom: var(--spacing-md);
}

#contact .contact-content {
    margin-top: auto;
    margin-bottom: auto;
}

.legal-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
}

/* Legal Controls & Swapping */
.legal-controls {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    position: relative;
    min-width: 150px;
    gap: 8px;
}

.legal-links,
.legal-close-trigger {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.legal-links.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    position: absolute;
    right: 0;
}

.legal-close-trigger {
    /* Solid background to hide lines */
    background: var(--color-bg);
    /* Optional: Soft shadow to create the 'uplift' fee without transparency */
    box-shadow: 0 0 15px 5px var(--color-bg);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 99px;
    padding: 3px 12px;
    /* Adjusted padding */
    color: inherit;
    font-family: inherit;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    line-height: 1;
}

.legal-close-trigger.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.legal-close-trigger:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Updated Accordion Background */
.legal-accordion {
    background: rgba(249, 248, 246, 0.95);
    margin-top: var(--spacing-md);
    border-radius: 4px;

    /* Initial State: Closed */
    max-height: 0;
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, min-height 0.4s ease;
}

.legal-accordion.is-open {
    max-height: 500px;
    /* Safe upper limit */
    min-height: 350px;
    /* Stability when open */
    opacity: 1;
}

.legal-tabs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-md) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.legal-tab {
    background: none;
    border: none;
    padding-bottom: var(--spacing-xs);
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.legal-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.legal-content {
    display: grid;
    grid-template-areas: "content";
    padding: var(--spacing-md);
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.legal-panel {
    grid-area: content;
    min-height: 200px;

    /* Layout Stability: Use visibility hidden so it takes up space in grid */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;

    /* Ensure width is full */
    width: 100%;
}

.legal-panel.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Remove slide transform to prevent overlay issues in grid */
.legal-panel h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.legal-panel p {
    margin-bottom: var(--spacing-xs);
}

/* Privacy policy needs slightly more spacing between paragraphs */
#panel-privacy p {
    margin-bottom: var(--spacing-sm);
}

/* Mobile Footer Overrides - must be at end to take precedence */
@media (max-width: 600px) {
    .legal-controls {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-xs);
        align-items: center;
        justify-content: center;
        min-width: auto;
        width: 100%;
        position: static;
    }

    .legal-links {
        flex-direction: column;
        gap: var(--spacing-xs);
        align-items: center;
        position: static;
    }

    .legal-links.is-hidden {
        position: static;
    }

    .legal-close-trigger {
        position: static;
        transform: none;
        left: auto;
        right: auto;
    }

    .legal-close-trigger.is-visible {
        transform: none;
    }

    /* Reduce spacing between labels and text in project details */
    .detail-block .section-label {
        margin-bottom: var(--spacing-sm);
    }
}

/**
 * Language Switcher
 */
.lang-switcher-wrapper {
    position: absolute;
    z-index: 100;
}

.hero-switcher {
    position: fixed;
    top: 0;
    /* Set by JS */
    right: 48px;
    padding: 10px 20px;
    background: radial-gradient(circle, rgba(249, 248, 246, 0.95) 0%, rgba(249, 248, 246, 0) 70%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    z-index: 200;
    transition: opacity 0.3s ease;
    margin-top: -15px;
    /* Fine-tune baseline alignment with 'Scroll' label */
}

.footer-switcher {
    position: static;
    /* Force back into document flow */
    margin: 0;
    display: flex;
    justify-content: flex-end;
    padding: 0;
    background: none;
    /* Ultra-minimal in footer */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.footer-switcher:hover {
    opacity: 1;
}

.footer-switcher .lang-btn {
    font-size: 0.6rem;
    padding: 2px 6px;
}

.language-switcher {
    display: flex;
    gap: 12px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--color-text-primary);
    opacity: 0.4;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.lang-btn:hover {
    opacity: 0.8;
}

.lang-btn.active {
    opacity: 1;
    border-bottom-color: var(--color-accent);
}

@media (max-width: 900px) {
    .hero-switcher {
        position: fixed;
        background: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
    }

    .footer-switcher {
        margin: 10px auto 0;
        justify-content: center;
    }
}

/* Interactive Diagram */
.interactive-diagram-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Tabs sit flush on panes */
    width: 100%;
}

.diagram-intro {
    font-size: 14px;
    color: var(--color-text-secondary);
    opacity: 0.6;
    margin-bottom: var(--spacing-md);
}

/* Tabs */
.diagram-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(var(--color-accent-rgb), 0.15);
    margin-bottom: 0;
    padding-left: var(--spacing-md);
    position: relative;
    z-index: 2;
}

.diagram-tab {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 10px 24px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    position: relative;
    transition: all 0.2s ease;
    margin-bottom: -1px;
    /* Overlap divider for folder lip */
    z-index: 1;
}

.diagram-tab.is-active {
    color: var(--color-accent);
    background: #F2F2F0;
    /* Opaque shade matches pane exactly */
    border-color: rgba(var(--color-accent-rgb), 0.15);
    border-bottom: none;
    /* Remove bottom border to blend into pane */
    margin-bottom: -1px;
    /* Overlap the divider line */
    z-index: 3;
    /* Sit above the divider line */
}

.diagram-tab:hover:not(.is-active) {
    color: var(--color-accent);
    opacity: 0.8;
}

.diagram-tab:not(.is-active) {
    opacity: 0.6;
}

.diagram-tab:hover {
    opacity: 1;
    color: var(--color-accent);
}

.diagram-panes {
    position: relative;
    min-height: 420px;
    background: #F2F2F0;
    /* Matches active tab exactly */
    border-radius: 8px;
    border-top-left-radius: 0;
    /* Break at the folder lip */
    border: 1px solid rgba(var(--color-accent-rgb), 0.15);
    /* Enclose body */
    border-top: none;
    /* Keep top seamless with tab divider */
    padding: var(--spacing-md);
    display: flex;
}

.diagram-pane {
    display: none;
    width: 100%;
}

.diagram-pane.is-active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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

.architecture-diagram {
    flex: 1;
    flex-direction: column;
}

.diagram-main-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
}

.diagram-section-title {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
    opacity: 0.8;
}

/* ─────────────────────────────────────────────────────────
   Mobile Portrait Diagram Prompt
───────────────────────────────────────────────────────── */
@media (max-width: 768px) and (orientation: portrait) {
    .interactive-diagram-container {
        position: relative;
        min-height: 200px;
    }

    .interactive-diagram-container::after {
        content: 'Please rotate your device to view the interactive diagram properly.';
        position: absolute;
        inset: 0;
        background: #F2F2F0;
        /* same as pane background */
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 40px;
        font-size: 14px;
        line-height: 1.5;
        color: var(--color-accent);
        border: 1px solid rgba(var(--color-accent-rgb), 0.15);
        border-radius: 8px;
    }

    /* Hide the actual complicated contents underneath so they don't leak or break layout */
    .diagram-panes,
    .diagram-tabs,
    .diagram-intro {
        visibility: hidden;
    }
}

.diagram-layer {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.layer-info {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.layer-label {
    font-size: 12px;
    /* Reduced from 13px */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
}

.layer-note {
    font-size: 10px;
    /* Reduced from 11px */
    color: var(--color-text-secondary);
    opacity: 0.8;
}

.layer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.card-row {
    display: flex;
    gap: var(--spacing-sm);
}

.diagram-card {
    flex: 1;
    background: #FFFEFD;
    /* Slightly lighter than bg */
    border: 1px solid rgba(var(--color-accent-rgb), 0.2);
    padding: 8px;
    /* Reduced from 12px (~33%) */
    border-radius: 6px;
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.diagram-card.is-wider {
    flex: 1.5;
}

.diagram-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.card-title {
    font-size: 12px;
    /* Reduced from 14px */
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-annotation {
    font-size: 10px;
    /* Reduced from 11px */
    color: var(--color-text-secondary);
    line-height: 1.3;
}

/* Hub Pattern */
.collab-hub-layer {
    display: flex;
    justify-content: center;
    margin: -12px 0;
    padding-left: 140px;
}

.hub-card {
    background: var(--color-accent);
    color: white;
    padding: 8px 24px;
    border-radius: 6px;
    text-align: center;
    min-width: 280px;
    box-shadow: 0 4px 12px rgba(var(--color-accent-rgb), 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
    margin: 4px 0;
    /* Add slight breathing room from lines */
}

.hub-card.routing-hub {
    background: rgba(var(--color-accent-rgb), 0.85);
    /* Slightly different shade */
}

.hub-card:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(var(--color-accent-rgb), 0.3);
}

.hub-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hub-annotation {
    font-size: 10px;
    opacity: 0.9;
}

.connector-vertical.orthogonal {
    margin-left: 140px;
    height: 32px;
    color: rgba(var(--color-accent-rgb), 0.25);
    transition: color 0.3s ease;
}

.connector-vertical.orthogonal svg path,
.connector-vertical.orthogonal svg line {
    fill: none;
    stroke: currentColor;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.architecture-diagram:hover .connector-vertical.orthogonal {
    color: rgba(var(--color-accent-rgb), 0.4);
}

.diagram-layer:hover+.connector-vertical.orthogonal,
.collab-hub-layer:hover+.connector-vertical.orthogonal,
.connector-vertical.orthogonal:hover {
    color: var(--color-accent);
}

.connector-vertical.orthogonal:hover svg path,
.connector-vertical.orthogonal:hover svg line {
    animation: linePulse 1.5s infinite ease-in-out;
}


/* Connectors */
.connector-vertical {
    height: 24px;
    /* Reduced from 40px (40%) */
    color: rgba(var(--color-accent-rgb), 0.2);
    margin-left: 140px;
    /* Offset to match layer-content */
}

.connector-vertical svg line {
    transition: opacity 0.3s ease;
}

.connector-vertical:hover svg line {
    animation: linePulse 1.5s infinite ease-in-out;
    color: var(--color-accent);
}

@keyframes linePulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

.diagram-divider-v {
    display: none;
    /* Removed in tabbed layout */
}

/* Build Cycles Section */
.build-cycles-section {
    flex: 1;
    flex-direction: column;
}

.build-cycles-wrapper {
    display: flex;
    gap: var(--spacing-xl);
    flex: 1;
}

.build-cycle {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    height: 100%;
}

/* Removed cycle-header-container as header is now directly in cycle */

.cycle-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-bottom: var(--spacing-sm);
    text-align: center;
    width: 100%;
}

.cycle-steps {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Vertical stretch */
    align-items: center;
    width: 100%;
}

.cycle-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.step-card {
    background: white;
    padding: var(--spacing-sm);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 240px;
    /* More compact width */
    min-height: 80px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(var(--color-accent-rgb), 0.05);
}

.step-visual {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.step-content {
    flex: 1;
}

.step-card:hover {
    transform: translateX(4px);
    /* Horizontal lift for tabbed list */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.03);
}

.step-card:hover+.step-arrow {
    animation: arrowPulse 1s infinite alternate;
}

.step-title {
    font-size: 11px;
    /* Reduced from 12px */
    font-weight: 600;
    margin-bottom: 1px;
}

.step-annotation {
    font-size: 9px;
    /* Reduced from 10px */
    color: var(--color-text-secondary);
    line-height: 1.2;
}

.step-arrow {
    margin: 2px 0;
    /* Reduced from 4px */
    color: var(--color-accent);
    opacity: 0.4;
    font-size: 14px;
    /* Reduced from 18px */
}

@keyframes arrowPulse {
    from {
        opacity: 0.4;
        transform: translateY(0);
    }

    to {
        opacity: 1;
        transform: translateY(3px);
    }
}

/* Mobile Responsiveness */
@media (max-width: 1100px) {
    .interactive-diagram-container {
        flex-direction: column;
    }

    .diagram-divider-v {
        width: 100%;
        height: 1px;
        margin: var(--spacing-md) 0;
    }

    .build-cycles-wrapper {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .build-cycle {
        flex-direction: column;
    }

    .cycle-header {
        writing-mode: horizontal-tb;
        transform: none;
        margin-bottom: 10px;
        opacity: 0.9;
    }

    .step-card:hover {
        transform: translateY(-3px);
    }
}

@media (max-width: 600px) {
    .diagram-layer {
        gap: 8px;
    }

    .layer-info {
        flex: 0 0 auto;
    }

    .connector-vertical {
        margin-left: 0;
        height: 20px;
    }

    .card-row {
        flex-direction: column;
    }

    .build-cycles {
        flex-direction: column;
    }
}

/* Floating Navigation Controls */
.nav-controls {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
    pointer-events: none;
}

.nav-btn {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #F2F2F0;
    border: 1px solid rgba(var(--color-accent-rgb), 0.15);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nav-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.nav-btn:hover {
    background: var(--color-accent);
    color: #F9F8F6;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(var(--color-accent-rgb), 0.2);
}

.nav-btn.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}



@media (max-width: 900px) {
    .nav-controls {
        bottom: 24px;
        right: 24px;
    }
}

/* ─────────────────────────────────────────────────────
   Video Thumbnail Grid (AI Creative Production)
───────────────────────────────────────────────────── */
.expansion-layout:has(.video-thumbs-grid) {
    gap: 40px;
    /* Reduced from var(--spacing-xl) which is 80px */
}

.expansion-visual:has(.video-thumbs-grid) {
    width: 50%;
    /* Make thumbnails half the size */
}

@media (max-width: 900px) {
    .expansion-visual:has(.video-thumbs-grid) {
        width: 100%;
        /* Keep full width on mobile */
    }
}

.video-thumbs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    width: 100%;
    height: 100%;
}

.video-thumb {
    position: relative;
    all: unset;
    cursor: pointer;
    display: block;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #000;
    transition: box-shadow 0.3s var(--ease-standard);
    /* Hardware acceleration to prevent text/layout shifting */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.video-thumb:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.3s ease, transform 0.3s var(--ease-standard);
}

.video-thumb:hover .video-thumb-img {
    filter: brightness(0.7);
    transform: scale(1.05);
}

.video-thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Prevents flickering if hovering over icon */
    z-index: 2;
}

.video-thumb:hover .video-thumb-overlay {
    opacity: 1;
}

.play-icon {
    width: 56px;
    height: 56px;
    fill: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.video-thumb-label {
    position: absolute;
    bottom: 12px;
    left: 14px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Prevents flickering if hovering over text */
    z-index: 2;
}

.video-thumb:hover .video-thumb-label {
    opacity: 1;
}

@media (max-width: 600px) {
    .video-thumbs-grid {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────────────────
   Video Lightbox
───────────────────────────────────────────────────── */
.video-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-lightbox[hidden] {
    display: none;
}

.vl-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}

.vl-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(90vw, 1100px);
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    animation: vl-appear 0.3s var(--ease-standard) both;
}

@keyframes vl-appear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(16px);
    }

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

#vl-video {
    width: 100%;
    max-height: 80vh;
    display: block;
    background: #000;
}

/* Controls bar */
.vl-controls {
    background: rgba(10, 10, 10, 0.9);
    padding: 10px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Scrubber */
.vl-scrubber-row {
    width: 100%;
}

#vl-scrubber {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
    transition: height 0.15s ease;
}

#vl-scrubber:hover {
    height: 5px;
}

#vl-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease;
}

#vl-scrubber:hover::-webkit-slider-thumb {
    transform: scale(1.3);
}

#vl-scrubber::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

/* Add filled-track effect via background-image updated by JS-compatible gradient */
#vl-scrubber::-webkit-slider-runnable-track {
    background: transparent;
}

/* Button row */
.vl-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vl-btn {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease, background 0.2s ease;
}

.vl-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.vl-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

.vl-close-btn {
    margin-left: auto;
    width: 32px;
    height: 32px;
}

.vl-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─────────────────────────────────────────────────────────
   Fullscreen Specific Overrides
───────────────────────────────────────────────────────── */
.vl-panel:fullscreen,
.vl-panel:-webkit-full-screen,
.vl-panel.is-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    background: #000;
}

.vl-fs-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: background 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.vl-fs-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.vl-fs-close svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Only show the top right exit button when the actual panel is in fullscreen */
.vl-panel:fullscreen .vl-fs-close,
.vl-panel:-webkit-full-screen .vl-fs-close,
.vl-panel.is-fullscreen .vl-fs-close {
    display: flex;
}