/* =========================================
   PRIME EIGHT STUDIO - GLOBAL DESIGN SYSTEM
   ========================================= */
:root {
    --bg-base: #000000;
    --bg-surface: #0a0a0a;
    --bg-card: #111111;
    --bg-deep: #050507;
    
    --neon-green: #88ff44;
    --neon-red: #ff4433;
    --neon-blue: #44aaff;
    --neon-white: #ffffff;
    
    --triad-red: #ff3333;
    --triad-blue: #3333ff;
    --triad-green: #33ff33;

    --neon-primary: var(--neon-white);
    --neon-dim: #222222; 
    
    --text-primary: #ffffff;
    --text-muted: #888888;
    --font-sans: 'Space Grotesk', 'Montserrat', sans-serif;
    
    --section-padding: 8rem 2rem;
}

/* 9-State Dynamic Mappings */
body[data-theme="carrier"] { --neon-primary: #ffffff; --neon-dim: #222222; }
body[data-theme="phase"] { --neon-primary: #88ff44; --neon-dim: #1a330d; }
body[data-theme="catalyst"] { --neon-primary: #ff4433; --neon-dim: #330d0d; }
body[data-theme="anchor"] { --neon-primary: #44aaff; --neon-dim: #0d1a33; }
body[data-theme="compression"] { --neon-primary: #ffcc00; --neon-dim: #332200; }
body[data-theme="inversion"] { --neon-primary: #00ffff; --neon-dim: #003333; }
body[data-theme="grounding"] { --neon-primary: #ff3366; --neon-dim: #330011; }
body[data-theme="flux"] { --neon-primary: #aa44ff; --neon-dim: #220033; }
body[data-theme="manifold"] { --neon-primary: #ff8833; --neon-dim: #331100; }

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
    -webkit-font-smoothing: antialiased;
}

/* Typography & Dynamic Glowing Headers */
.brand-heading { 
    font-size: 2.2rem; 
    font-weight: 300; 
    letter-spacing: 0.6em; 
    text-transform: uppercase; 
    color: var(--neon-primary); 
    margin-bottom: 2rem; 
    line-height: 1.2;
    transition: color 0.5s ease;
    text-shadow: 0 0 10px var(--neon-primary), 0 0 20px var(--neon-dim);
}

h1, h2, h3, h4 { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }
h3 { font-size: 1.3rem; text-wrap: balance; }
h4 { font-size: 0.9rem; letter-spacing: 0.1em; font-weight: 500; text-wrap: balance; }
p { color: var(--text-muted); line-height: 1.7; font-family: 'Montserrat', sans-serif; font-size: 1.15rem; text-wrap: pretty; }
strong { color: #cccccc; font-weight: 500; }

/* Utility / Helper Classes */
.text-center { text-align: center !important; }
.text-left { text-align: left; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.p-0 { padding: 0; }
.pt-2 { padding-top: 2rem !important; }
.pb-4 { padding-bottom: 4rem; }
.w-100 { width: 100%; }
.max-w-100 { max-width: 100%; }
.grid-span-full { grid-column: 1 / -1; }
.gap-1 { gap: 1rem; }
.flex-center-vert { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.card-flex-col { display: flex; flex-direction: column; }
.text-nowrap { white-space: nowrap; }

/* Pulsing Glow */
.pulsing-glow-text {
    color: #ffffff;
    animation: breathe-logo 3s ease-in-out infinite alternate;
}

@keyframes breathe-logo {
    0% { text-shadow: 0 0 5px #88ff44, 0 0 10px #88ff44, 0 0 15px #1a330d; }
    100% { text-shadow: 0 0 5px #ffffff, 0 0 15px #88ff44, 0 0 30px #88ff44, 0 0 50px #88ff44, 0 0 70px #1a330d; }
}

/* Buttons */
.dynamic-rd-btn { border-color: var(--neon-primary); color: var(--neon-primary); transition: all 0.5s ease; }
body[data-theme="carrier"] .dynamic-rd-btn { border-color: var(--neon-green); color: var(--neon-green); }
body[data-theme="carrier"] .dynamic-rd-btn:hover { background: var(--neon-green) !important; color: var(--bg-base) !important; box-shadow: 0 0 10px var(--neon-green) !important; }

nav.global-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px; padding: 0 2rem;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(10px); z-index: 1000;
    box-sizing: border-box; border-bottom: 1px solid var(--neon-dim);
    transition: border-color 0.5s ease;
}
.logo { text-decoration: none; font-size: 1rem; font-weight: 300; letter-spacing: 0.6em; text-transform: uppercase; color: var(--neon-primary) !important; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-group-main { display: flex; align-items: center; gap: 2rem; }
.nav-group-buttons { display: flex; align-items: center; gap: 1rem; }
.nav-links a.nav-text { color: var(--text-primary); text-decoration: none; font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; transition: color 0.3s; }
.nav-links a.nav-text:hover { color: var(--neon-primary); }

.portal-btn, .theme-selector {
    background: transparent; border: 1px solid var(--neon-primary);
    color: var(--neon-primary); padding: 0.5rem 1rem;
    font-family: var(--font-sans); font-size: 0.7rem; letter-spacing: 0.2em;
    text-transform: uppercase; cursor: pointer; transition: all 0.3s ease;
    text-decoration: none; display: inline-block; text-align: center;
}
.portal-btn:hover, .theme-selector:hover { 
    background: var(--neon-primary); color: var(--bg-base) !important; 
    box-shadow: 0 0 10px var(--neon-primary); text-shadow: none !important;
}

#theme-toggle-btn { width: 185px; text-align: center; box-sizing: border-box; flex-shrink: 0; white-space: nowrap; }
.theme-selector { min-width: 185px; display: inline-block; white-space: nowrap; }
.theme-selector::before { content: '[ STATE CHANGE ]'; }
.theme-selector:hover::before { content: '[ ' attr(data-active-state) ' ]'; }

/* Layouts */
section { padding: var(--section-padding); min-height: 100vh; border-bottom: 1px solid #111; scroll-margin-top: 80px; }
.container { max-width: 1400px; margin: 0 auto; width: 100%; padding: 0 1rem;}
.container-narrow { max-width: 1200px; }
.grid-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; margin-top: 3rem; }
.grid-layout-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 4rem; align-items: center; }
.responsive-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.responsive-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.card { background: var(--bg-card); border: 1px solid #222; padding: 2.5rem; border-radius: 4px; transition: border-color 0.5s ease; }

#projects { padding-top: 8rem; padding-bottom: 0; padding-left: 0; padding-right: 0; overflow-x: hidden; }

/* Adjusted typography for Project section to allow breathing room */
.brand-heading-projects { text-align: center; margin-bottom: 2rem; font-size: 2.2rem; letter-spacing: 0.4em; line-height: 1.5; }
.harmonic-expansion-text { letter-spacing: 0.8em; }

#applied-content { padding-top: 1.620rem; }

/* =========================================
   SPECIFIC SECTION FOLD ALIGNMENTS
   ========================================= */
/* Move these target viewports up 20px so they sit better in the fold */
#projects, #applied-kinematics, #fabrication {
    scroll-margin-top: 15px; 
}

#applied-kinematics, #expansions {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    padding-top: 5.75rem;
    padding-bottom: 4rem;
    min-height: 100vh;
}

.brand-heading-expansions { 
    text-align: center; 
    margin-bottom: 4rem; 
    font-size: 2.2rem; 
    letter-spacing: 0.8em; 
}

/* =========================================
   APPLIED KINEMATICS INTERACTIVE COMPONENT
   ========================================= */
.ak-box { 
    display: grid; 
    grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); 
    gap: 3.5rem; 
    align-items: stretch;
    margin-top: 0.75rem;
    margin-bottom: 0; 
    border: none; 
}

.ak-left-display {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    background: transparent; 
    overflow: hidden;
    min-height: 520px; 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-radius: 4px;
}

.ak-text-overlay {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2; 
    padding: 2.5rem 2.5rem 0 2.5rem;
    pointer-events: none; 
    display: flex;
    justify-content: center; 
}

.ak-dynamic-text { 
    position: relative; 
    width: 100%;
    max-width: 100%;
    min-height: 80px; 
}

.fade-text {
    position: absolute; top: 0; left: 0; width: 100%; 
    font-family: 'Space Grotesk', sans-serif; 
    font-weight: 500; 
    font-size: 1.1rem;
    letter-spacing: 0.15em; 
    text-transform: uppercase;
    text-align: center;
    color: var(--neon-primary); 
    line-height: 1.6; margin: 0; 
    text-wrap: balance; opacity: 0; transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease, color 0.5s ease;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 4px 20px rgba(0,0,0,0.9), 0 0 40px rgba(0,0,0,1);
}
.fade-text.active { opacity: 1; transform: translateY(0); }

.ak-right { 
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem; 
    justify-content: flex-start; 
}
.ak-selector {
    background: rgba(255, 255, 255, 0.015); border: 1px solid transparent; 
    padding: 2rem; border-radius: 6px; cursor: pointer; position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ak-module-title { margin: 0 0 0.5rem 0; color: var(--neon-primary); font-family: var(--font-sans); font-size: 1.1rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ak-module-desc { font-size: 1.1rem; color: rgba(255,255,255,0.45); line-height: 1.6; margin: 0; transition: color 0.3s ease; }

.ak-selector:hover, .ak-selector.active-selector {
    transform: translateX(-8px) scale(1.02); 
    background: rgba(255, 255, 255, 0.04);
    border-color: transparent; /* Hides original border */
    outline: 1px solid var(--neon-primary); /* Draws new outline */
    outline-offset: -2px; /* Pulls outline inward by 2px */
    box-shadow: 0 8px 25px rgba(0,0,0,0.5); 
    z-index: 2;
}
.ak-selector:hover .ak-module-desc, .ak-selector.active-selector .ak-module-desc { color: #ffffff; }

/* Desktop Hide Arrows */
@media (min-width: 951px) {
    .ak-nav-arrow { display: none !important; }
}

/* =========================================
   SUB-PROJECT CARD POLISH
   ========================================= */
.card-flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-dark { background: var(--bg-card); }
.card-padded { padding: 2.5rem; } 
.card-content-top { padding: 2.5rem 2.5rem 0 2.5rem; flex-grow: 1; }

.card-heading-primary { margin-bottom: 1.2rem; font-size: 1.25rem; color: var(--neon-primary); transition: color 0.5s ease; }
.card-heading-flex { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.2rem; font-size: 1.25rem; color: var(--neon-primary); transition: color 0.5s ease; }

.card-desc { font-size: 1.05rem; line-height: 1.6; margin-bottom: 0.85rem; }
.card-desc-no-margin { margin-bottom: 0; font-size: 1.05rem; line-height: 1.6; }
.card-text-bottom { font-size: 1.05rem; line-height: 1.6; color: rgba(255,255,255,0.6); }

.iframe-container-220 { width: 100%; height: 220px; position: relative; margin-top: 1.5rem; }
.interactive-link-block { display: block; margin: 0 -2.5rem 1.5rem -2.5rem; border-top: 1px solid #222; border-bottom: 1px solid #222; background: #111111; height: 220px; position: relative; cursor: pointer; overflow: hidden; }
.interactive-link-block iframe { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.interactive-link-block:hover iframe { transform: scale(1.08); }

.dev-list { display: flex; flex-direction: column; gap: 0.75rem; }
.dev-list-item { 
    font-family: var(--font-sans); font-size: 1rem; text-transform: uppercase; 
    letter-spacing: 0.05em; color: #e0e0e0; border-left: 3px solid var(--neon-dim); 
    padding-left: 1rem; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.dev-list-item:hover { transform: translateX(6px); color: var(--neon-white); border-left-color: var(--neon-primary); text-shadow: 0 0 8px rgba(255, 255, 255, 0.4); }
.anim-badge { font-size: 0.9rem; opacity: 0.55; font-family: 'Space Grotesk', sans-serif; letter-spacing: 0.05em; }

/* =========================================
   FABRICATION & STEM AND STONE LOGIC
   ========================================= */
.fab-content { padding: 2.5rem; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.fab-content h3 { margin-bottom: 1rem; line-height: 1.4; }
.fab-content-alt { padding: 1.5rem 2.5rem 2.5rem 2.5rem; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.fab-content-alt h3 { margin-bottom: 1rem; line-height: 1.4; }
.fab-btn { text-align: center; margin-top: 1.5rem; border-color: #555; color: #fff; }

.stem-stone-hero { position: relative; width: 100%; height: 280px; overflow: hidden; border-bottom: 1px solid #222; background: #000; }
.stem-stone-hero .ss-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.stem-stone-hero .ss-logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8); transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease; max-width: 55%; opacity: 1; pointer-events: none; z-index: 2; }
.card:hover .stem-stone-hero .ss-bg { transform: scale(1.06); }
.card:hover .stem-stone-hero .ss-logo { transform: translate(-50%, -50%) scale(1); opacity: 0; }

/* =========================================
   GATEWAY BANNER & TEASER
   ========================================= */
section.gateway-banner { 
    min-height: auto !important; 
    background-color: #0a0a0a; 
    background-image: radial-gradient(circle at 50% 50%, var(--neon-dim) 0%, #0a0a0a 70%); 
    transition: background-image 0.5s ease; 
    border-top: 1px solid #222; 
    border-bottom: 1px solid #222; 
    padding: 6rem 2rem; 
    position: relative; 
    overflow: hidden; 
}
.gateway-banner-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; width: 100%; position: relative; z-index: 1; }
.gateway-heading { font-size: 2.5rem; text-align: center; margin: 0; color: var(--neon-primary); line-height: 1; transition: color 0.5s ease; }
.gateway-text-block { text-align: center; }
.gateway-subheading { font-family: var(--font-sans); font-size: 1.4rem; text-transform: uppercase; color: #ffffff; letter-spacing: 0.1em; text-shadow: 0 0 12px rgba(255,255,255,0.4); margin: 0 auto 0.75rem auto; max-width: 800px; text-wrap: balance; }
.gateway-desc { max-width: 650px; margin: 0 auto; color: var(--text-primary); font-size: 1.1rem; text-wrap: balance; }
.gateway-btn { font-size: 1rem; padding: 1rem 2rem; margin: 0; display: inline-block; line-height: 1; }

#portal-teaser { background: #080808; }
.teaser-title { font-size: 1.8rem; }
.teaser-card { border-color: #222; background: #0a0a0a; }

/* Data Room Paragraph Alignments */
.teaser-card-desc { font-size: 1rem; margin-bottom: 1.5rem; text-align: left !important; }

.teaser-top-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 4rem; align-items: start; margin-bottom: 3.5rem; }
.teaser-intro-text { font-size: 1.15rem; color: #aaa; line-height: 1.7; margin: 0; text-wrap: pretty; }
.teaser-action-block { display: flex; align-items: center; height: 100%; }

.suite-combo-title { margin: 0 0 1rem 0; font-family: 'Space Grotesk', sans-serif; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.suite-id { font-size: 1.4rem; color: var(--neon-primary); font-weight: 300; letter-spacing: 0.1em; }
.suite-divider { color: #444; font-size: 1.2rem; font-weight: 300; }
.suite-name { font-size: 1.1rem; color: #fff; letter-spacing: 0.1em; }

.teaser-list { padding: 0; margin: 0; list-style: none; }
.teaser-list li { display: flex; align-items: baseline; gap: 0; margin-bottom: 0.6rem; font-family: 'Space Grotesk', sans-serif; font-size: 0.95rem; }
.engine-divider { color: var(--neon-primary); opacity: 0.95 !important; font-weight: 500; font-size: 0.85rem; margin-right: 0.6rem; transition: color 0.5s ease; flex-shrink: 0; }
.engine-name { color: #ffffff; letter-spacing: 0.05em; white-space: nowrap; flex-shrink: 0; }
.engine-leader { flex-grow: 1; height: 1em; margin: 0 0.5rem; background-image: radial-gradient(circle, #555 1px, transparent 1.5px); background-size: 12px 100%; background-position: center 75%; background-repeat: repeat-x; }

.status-avail { color: var(--triad-green); font-size: 0.8rem; letter-spacing: 0.1em; white-space: nowrap; flex-shrink: 0; }
.status-avail::before { content: "["; color: #ffffff; margin-right: 2px; }
.status-avail::after { content: "]"; color: #ffffff; margin-left: 2px; }
.confidentiality-disclaimer { text-align: center; margin-top: 4rem; font-size: 0.75rem; color: #555; letter-spacing: 0.1em; text-transform: uppercase; font-family: 'Space Grotesk', sans-serif; padding-top: 2.5rem; border-top: 1px solid #222; text-wrap: balance; line-height: 1.6; }

/* =========================================
   R&D SECTION
   ========================================= */
#rd { 
    padding-bottom: 24px !important; 
    display: flex; 
    flex-direction: column; 
}
.rd-header { text-align: center; margin-bottom: 2rem; }
.rd-content { 
    max-width: 900px; 
    margin: 0 auto 24px auto !important; 
}
.rd-block { margin-bottom: 2.5rem; }
/* Applied double spacing requested to first child */
.rd-block:first-child { margin-bottom: 5rem; }

.rd-block h3 { color: var(--neon-primary); margin-bottom: 1rem; }
.rd-block p { margin: 0; line-height: 1.6; }
.rd-iframe-container { 
    width: 100vw; 
    height: 60vh; 
    min-height: 500px; 
    position: relative; 
    left: 50%; 
    transform: translateX(-50%); 
    margin-bottom: 0 !important; 
    display: block; 
}
.rd-iframe-container iframe { display: block; pointer-events: auto; }

/* =========================================
   FOOTER SECTION
   ========================================= */
.site-footer { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding: 4rem 2rem; border-top: 1px solid #222; background: #050505; text-align: center; }
.footer-logo { font-size: 1rem; font-weight: 300; letter-spacing: 0.6em; text-transform: uppercase; }
.footer-location { font-family: 'Space Grotesk', sans-serif; font-size: .9rem; letter-spacing: 0.6em; text-transform: uppercase; color: #666666; text-shadow: 0 0 2px var(--neon-primary); margin: 0; }

/* Copyright Layout Rules */
.footer-copyright { font-size: .81rem; letter-spacing: 0.6em; color: #f7f7f7; text-transform: uppercase; margin: 0; text-align: center; line-height: 1.8; }
.copy-year, .copy-studio, .copy-rights { display: inline-block; }
.copy-rights { display: block; margin-top: 4px; }
.copy-studio::before { content: "\00a0"; }

.footer-contact-link { 
    font-family: 'Space Grotesk', sans-serif; 
    font-size: 0.85rem; 
    font-weight: 300; 
    letter-spacing: 0.6em; 
    text-transform: uppercase; 
    color: rgba(255, 255, 255, 0.5); 
    text-decoration: none; 
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
}
.footer-contact-link:hover { 
    color: #ffffff; 
    text-shadow: 0 0 10px var(--neon-white), 0 0 20px var(--neon-primary); 
    background: rgba(255, 255, 255, 0.05); 
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.1); 
}

/* =========================================
   IFRAME ENGINE UTILITIES
   ========================================= */
.iframe-absolute { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; outline: none; z-index: 1; }
.engine-section-full { position: relative; width: 100vw; height: 100vh; padding-top: 80px; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-base); border-bottom: none; }
#hero-frame { position: relative; flex: 1; }
.engine-section-inline { position: relative; width: 100%; height: 400px; overflow: hidden; }

.engine-section-cinematic { 
    position: relative; 
    width: 100%; 
    height: 65vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    overflow: hidden; 
    background: #020202; 
}
.engine-section-cinematic iframe { margin: 0 auto; }

.engine-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; display: block; z-index: 1; pointer-events: none; }
.engine-iframe.interactive { pointer-events: auto; }


/* =========================================
   RESPONSIVE DESIGN ENGINE (TABLET & MOBILE)
   ========================================= */

/* TABLET-SPECIFIC SCALING (600px - 950px) */
@media (min-width: 600px) and (max-width: 950px) {
    /* Tablet Headers & Margins */
    section { padding: 4rem 3rem !important; }
    .global-nav { padding: 1.5rem 3rem !important; }
    .global-nav .logo { letter-spacing: 0.8em !important; }
    .nav-group-main { gap: 3rem !important; }
    
    .brand-heading { font-size: 2rem !important; }
    .brand-heading-expansions { font-size: 2rem !important; letter-spacing: 0.75em !important; }
    /* Forces exactly 3 lines: THE / HARMONIC EXPANSION / MATRIX */
    .brand-heading-projects { text-align: center !important; font-size: 1.4rem !important; letter-spacing: 0.15em !important; margin-bottom: 2rem !important; max-width: 100% !important; margin-left: auto !important; margin-right: auto !important; line-height: 1.5 !important; }
    .harmonic-expansion-text { letter-spacing: 0.3em !important; }
	
    /* Expansions project cards paragraph text increase (Tablet only) */
    #expansions .card p, 
    #expansions .card-desc, 
    #expansions .card-desc-no-margin, 
    #expansions .card-text-bottom,
    #expansions .dev-list-item { 
        font-size: 1.25rem !important; 
        line-height: 1.7; 
    }
	
	/* =========================================
   SPECIFIC SECTION FOLD ALIGNMENTS
   ========================================= */
	/* Move these target viewports up 20px so they sit better in the fold */
	#projects, #fabrication {
		scroll-margin-top: 80px; 
}
	
	#applied-kinematics{
		scroll-margin-top: 140px; 
}
	#rd {
		scroll-margin-top: 110px; 
}
}

/* MOBILE & TABLET MASTER RESPONSIVENESS (< 950px) */
@media (max-width: 950px) {
    /* Navigation */
    .nav-group-buttons { display: none !important; }
    .global-nav { flex-direction: column !important; justify-content: center !important; height: auto !important; gap: 1rem; }
    
    /* Default to 1.5rem padding, tablet will overwrite to 3rem above */
    section { padding: 4rem 1.5rem; } 
    .global-nav { padding: 1.5rem 1.5rem !important; }
    
    .global-nav .logo { margin: 0; padding: 0; text-align: center; display: block; width: 100%; }
    .nav-links { width: 100%; display: flex; justify-content: center; }
    .nav-group-main { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }

    /* General Layouts */
    .container { padding: 0; max-width: 100%; }
    .responsive-grid-3, .responsive-grid-2 { grid-template-columns: 1fr; }
    .teaser-top-layout { grid-template-columns: 1fr; gap: 2rem; }
    .teaser-action-block { justify-content: center; }
    
    .brand-heading { text-align: center !important; font-size: 1.6rem !important; letter-spacing: 0.25em !important; margin-bottom: 2rem !important; }
    
    /* 3x Letter Spacing for Expansions Header */
    .brand-heading-expansions { text-align: center !important; font-size: 1.6rem !important; letter-spacing: 0.75em !important; margin-bottom: 2rem !important; }
    
    /* Forces exactly 3 lines: THE / HARMONIC EXPANSION / MATRIX by overriding the restrictive max-width */
    .brand-heading-projects { text-align: center !important; font-size: 1.4rem !important; letter-spacing: 0.15em !important; margin-bottom: 2rem !important; max-width: 100% !important; margin-left: auto !important; margin-right: auto !important; line-height: 1.8 !important; }
    .harmonic-expansion-text { letter-spacing: 0.3em !important; }

    /* Centering specific paragraphs & headers */
    p, .fab-header-center, .rd-block h3, .rd-block p { text-align: center !important; text-wrap: pretty; }
	
	/* =========================================
    SPECIFIC SECTION FOLD ALIGNMENTS
    ========================================= */
	/* Move these target viewports up 20px so they sit better in the fold */
	#fabrication {
		scroll-margin-top: 70px; 
}

    /* =========================================
       APPLIED KINEMATICS (AK) REBUILD
       ========================================= */
    #applied-kinematics { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; display: flex; flex-direction: column; scroll-margin-top: 120px; }
    
    /* Forces Header to scale gracefully and max out at 2 lines */
    .ak-heading { font-size: 1.4rem !important; margin-bottom: 0 !important; line-height: 1.2 !important; }
    
    /* Box is full height, spreading items via space-between */
    .ak-box { flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; margin-top: 1rem; gap: 1rem; }
    
    .ak-left-display { display: flex; flex-direction: column; justify-content: space-between; flex-grow: 1; border: none; min-height: auto; overflow: visible; }
    .ak-text-overlay { position: relative; padding: 0; display: block; height: auto; margin-bottom: 0; }
    .ak-dynamic-text { min-height: auto; }
    
    .fade-text { position: relative; transform: none !important; text-shadow: none; margin-bottom: 0; display: none; font-size: 0.95rem !important; }
    .fade-text.active { display: block; opacity: 1; }
    
    /* Engine is proportionally massive and strictly centered */
    #ak-iframe { height: 45vh !important; max-height: 450px; min-height: 280px; width: 100%; margin: auto 0; flex-grow: 0; }
    .iframe-absolute { position: relative !important; }
    
    /* Arrows and Selectors fixed to absolute bottom of view */
    .ak-carousel-wrapper { width: 100%; display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0; box-sizing: border-box; }
    
    /* Lock arrows to exact width so they match symmetry */
    .ak-nav-arrow { display: block !important; width: 40px; padding: 0 !important; font-size: 2.5rem !important; background: transparent; border: none; color: var(--neon-primary); cursor: pointer; text-align: center; }
    
    /* Box consumes remaining exact width between arrows */
    .ak-right { width: calc(100% - 90px); max-width: none; flex-grow: 0; margin: 0; display: flex; justify-content: center; }
    
    /* Scaled down selector */
    .ak-selector { display: none; padding: 1.2rem 0.5rem !important; margin: 0; width: 100%; text-align: center; border: 1px solid rgba(255,255,255,0.1); }
    .ak-selector.active-selector { display: block; }
    .ak-module-title { font-size: 0.95rem !important; }
    .ak-module-desc { font-size: 0.85rem !important; line-height: 1.5; }

    /* =========================================
       RESTRICTED ACCESS OVERRIDES
       ========================================= */
    .gateway-btn { display: none !important; }
    .teaser-action-block::after, .gateway-text-block::after {
        content: "[ ACCESS RESTRICTED: DESKTOP PROCESSING REQUIRED ]";
        display: block; color: #ff4433; font-family: 'Space Grotesk', sans-serif; font-size: 0.85rem; letter-spacing: 0.1em;
        margin-top: 1rem; text-align: center; border: 1px solid #ff4433; padding: 1rem; box-shadow: 0 0 8px rgba(255,68,51,0.2);
        width: 100%; box-sizing: border-box;
    }

    /* Elements to Scale / Hide / Modify */
    #rd { padding-top: 2rem !important; padding-bottom: 24px !important; min-height: auto; scroll-margin-top: 100px;  }
    .rd-header { margin-bottom: 1rem; }
    .rd-block { margin-bottom: 1rem; }
    .rd-iframe-container { min-height: 250px; height: 40vh; margin-top: 0.5rem; margin-bottom: 0 !important; }
    
    .synopsis-header, .synopsis-heading { font-size: 1.5rem !important; }
    .scroll-gutter { display: none !important; }
}

/* MICRO-MOBILE SCALING (Prevents long words from breaking horizontally on very small screens) */
@media (max-width: 400px) {
    .brand-heading-projects { font-size: 1.2rem !important; letter-spacing: 0.1em !important; }
}

/* MOBILE-SPECIFIC COPYRIGHT BREAKS (< 600px) */
@media (max-width: 599px) {
    .copy-year, .copy-studio, .copy-rights { display: block; }
    .copy-studio::before { content: ""; } 
    .copy-studio { margin-top: 4px; }
}

/* DESKTOP ONLY EXCLUSIONS */
@media (min-width: 951px) {
    .scroll-gutter { display: none; }
}