:root {
  --color-button-bg: #1a1a1a;
  --color-button-text: #ffffff;
  --color-button-bg-hover: #333333;
  --color-button-text-hover: #ffffff;
    --color-bg-primary: #ffffff;
    --color-bg-primary-rgb: 255, 255, 255;
    --color-bg-secondary: #f8f9fa;
    --color-bg-secondary-rgb: 248, 249, 250;
    --color-text-primary: #000000;
    --color-text-primary-rgb: 0, 0, 0;
    --color-text-secondary: #666666;
    --color-accent: #000000;
    --color-accent-rgb: 0, 0, 0;
    --color-border: rgba(0, 0, 0, 0.15);
    --color-border-heavy: rgba(0, 0, 0, 0.8);
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --transition-speed: 0.25s;
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --spacing-unit: 1rem;
    --border-radius: 0px;
    --shadow-sharp: 6px 6px 0px var(--color-accent);
    --shadow-inset: inset 0 0 0 1px var(--color-border);
}
  --color-button-bg: #1a1a1a;
  --color-button-text: #ffffff;
  --color-button-bg-hover: #333333;
  --color-button-text-hover: #ffffff;
    --color-bg-primary: #ffffff;
    --color-bg-primary-rgb: 255, 255, 255;
    --color-bg-secondary: #f8f9fa;
    --color-bg-secondary-rgb: 248, 249, 250;
    --color-text-primary: #000000;
    --color-text-primary-rgb: 0, 0, 0;
    --color-text-secondary: #666666;
    --color-accent: #000000;
    --color-accent-rgb: 0, 0, 0;
    --color-border: rgba(0, 0, 0, 0.1);
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --transition-speed: 0.3s;
    --transition-ease: cubic-bezier(0.2, 1, 0.3, 1);
    --spacing-unit: 1rem;
    --border-radius: 0px;
    --shadow-sharp: 4px 4px 0px rgba(0, 0, 0, 0.1);
    --shadow-diffuse: 0 10px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --color-bg-primary: #0a0a0a;
    --color-bg-primary-rgb: 10, 10, 10;
    --color-bg-secondary: #141414;
    --color-bg-secondary-rgb: 20, 20, 20;
    --color-text-primary: #ffffff;
    --color-text-primary-rgb: 255, 255, 255;
    --color-text-secondary: #a0a0a0;
    --color-accent: #ffffff;
    --color-accent-rgb: 255, 255, 255;
    --color-button-bg: #e0e0e0;
    --color-button-text: #0a0a0a;
    --color-button-bg-hover: #ffffff;
    --color-button-text-hover: #0a0a0a;
    --color-border: rgba(255, 255, 255, 0.1);
    --shadow-sharp: 4px 4px 0px rgba(255, 255, 255, 0.05);
    --shadow-diffuse: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
    border-radius: 0px !important;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-speed) var(--transition-ease), 
                color var(--transition-speed) var(--transition-ease);
    margin: 0;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
    will-change: transform;
}

.container-fluid {
    max-width: 1400px;
    padding-left: 2rem;
    padding-right: 2rem;
    margin: 0 auto;
}

h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    text-transform: uppercase;
    color: var(--color-text-primary);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    display: block;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(var(--color-bg-primary-rgb), 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem 0;
    transition: all var(--transition-speed) var(--transition-ease);
}

.navbar-scrolled {
    padding: 0.75rem 0;
    background: rgba(var(--color-bg-primary-rgb), 0.95);
    box-shadow: var(--shadow-sharp);
}

.nav-link {
    position: relative;
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    padding: 0.5rem 1rem !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    transform-origin: left;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.cta-button, .btn-view {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--color-button-bg);
    color: var(--color-button-text);
    border: 1px solid var(--color-button-bg);
    border-radius: 0px;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: transform var(--transition-speed) var(--transition-ease), background-color var(--transition-speed) var(--transition-ease), color var(--transition-speed) var(--transition-ease), box-shadow var(--transition-speed) var(--transition-ease);
    cursor: pointer;
    outline: none;
}

.btn-view {
    margin-top: auto;
}

.cta-button:hover, .btn-view:hover {
    background: transparent;
    color: var(--color-accent);
    box-shadow: var(--shadow-sharp);
    transform: translate(-4px, -4px);
}

.cta-button:active, .btn-view:active {
    transform: translate(0, 0);
}

.cta-button:focus-visible, .btn-view:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}
}

/* Scroll Reveal Animations - Progressive Scrollytelling */
.reveal-section {
    --scroll-reveal: 0;
    opacity: var(--scroll-reveal);
    transform: translateY(calc(30px * (1 - var(--scroll-reveal))));
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
    visibility: visible; /* Controlled by opacity */
}

/* Child Stagger Logic */
.reveal-section > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-section.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay utilities for scrollytelling child elements */
.reveal-section > *:nth-child(1) { transition-delay: 0ms; }
.reveal-section > *:nth-child(2) { transition-delay: 150ms; }
.reveal-section > *:nth-child(3) { transition-delay: 300ms; }
.reveal-section > *:nth-child(4) { transition-delay: 450ms; }
.reveal-section > *:nth-child(5) { transition-delay: 600ms; }
.reveal-section > *:nth-child(6) { transition-delay: 750ms; }

@media (prefers-reduced-motion: reduce) {
    .reveal-section {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

/* Unified Card Styling */
.glass-panel, .project-item, .testimonial-card, .service-card, .about-card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    padding: 2rem;
    transition: all var(--transition-speed) var(--transition-ease);
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 0; /* Strict 0px radius */
}

.glass-panel:hover, .project-item:hover, .testimonial-card:hover, .service-card:hover, .about-card:hover {
    box-shadow: var(--shadow-sharp);
    transform: translate(-4px, -4px);
    border-color: var(--color-accent);
}

/* Original selectors kept for specific overrides if any, but base unified above */
.glass-panel, .project-item, .testimonial-card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    padding: 2rem;
    transition: all var(--transition-speed) var(--transition-ease);
    position: relative;
    display: flex;
    flex-direction: column;
}

.glass-panel:hover, .project-item:hover, .testimonial-card:hover {
    box-shadow: var(--shadow-sharp);
    transform: translate(-4px, -4px);
    border-color: var(--color-accent);
}

/* Section Backgrounds & Patterns */
#hero {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    background: radial-gradient(circle at 20% 30%, rgba(var(--color-accent-rgb), 0.05) 0%, transparent 50%),
                linear-gradient(to bottom, var(--color-bg-primary), var(--color-bg-primary));
}

/* Hero is above-the-fold: always visible by default, override .reveal-section hidden state */
#hero.reveal-section {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

#projects {
    background-color: var(--color-bg-primary);
    background-image: radial-gradient(var(--color-border) 1px, transparent 1px);
    background-size: 40px 40px;
}

#services {
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, rgba(var(--color-accent-rgb), 0.02) 100%);
}

#about {
    background-color: var(--color-bg-primary);
    background-image: radial-gradient(circle at 10% 60%, rgba(var(--color-accent-rgb), 0.06) 0%, transparent 50%);
}

#testimonials {
    background: radial-gradient(circle at 80% 20%, rgba(var(--color-accent-rgb), 0.03) 0%, transparent 40%);
}

#contact {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    border-bottom: none;
}

#contact h2, #contact .eyebrow, #contact p {
    color: var(--color-text-primary);
}

#contact .cta-button {
    background: var(--color-accent);
    color: var(--color-bg-primary);
    border: 2px solid var(--color-accent);
    padding: 1.5rem 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    position: relative;
    box-shadow: 8px 8px 0px var(--color-text-primary);
    transition: all var(--transition-speed) var(--transition-ease);
    border-radius: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

#contact .cta-button:hover {
    background: var(--color-bg-primary);
    color: var(--color-accent);
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0px var(--color-accent);
}

#contact .cta-button:active {
    transform: translate(2px, 2px);
    box-shadow: 4px 4px 0px var(--color-accent);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.logo-mark {
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-bg-primary);
    font-size: 1rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: opacity var(--transition-speed) var(--transition-ease);
}

.nav-links a:hover {
    opacity: 0.6;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-accent);
    color: var(--color-bg-primary);
    padding: 8px;
    z-index: 1001;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

[data-theme="dark"] {
    --color-bg-primary: #121212;
    --color-bg-primary-rgb: 18, 18, 18;
    --color-text-primary: #E9ECEF;
    --color-text-primary-rgb: 233, 236, 239;
    --color-accent: #FFFFFF;
    --color-accent-rgb: 255, 255, 255;
    --color-border: #333333;
}

[data-bs-theme="dark"] {
    --color-bg-primary: #121212;
    --color-bg-primary-rgb: 18, 18, 18;
    --color-text-primary: #E9ECEF;
    --color-text-primary-rgb: 233, 236, 239;
    --color-accent: #FFFFFF;
    --color-accent-rgb: 255, 255, 255;
    --color-border: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important; /* Strict 0px radius override */
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-heading);
    transition: background-color var(--transition-speed) var(--transition-ease), color var(--transition-speed) var(--transition-ease);
    overflow-x: hidden;
}

#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--color-bg-primary);
    z-index: 10;
    padding: 0 5%;
}

.hero-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    padding: 4rem;
    z-index: 10;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    opacity: 1 !important;
    visibility: visible !important;
}

.hero-content h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.85;
    margin-bottom: 4rem;
    letter-spacing: -0.04em;
    font-weight: 900;
    text-transform: uppercase;
    border-left: 16px solid var(--color-accent);
    padding-left: 3rem;
    text-shadow: 0 0 30px rgba(var(--bg-rgb), 0.9);
}

.hero-content .lead {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    max-width: 800px;
    margin-bottom: 6rem;
    opacity: 0.9;
    line-height: 1.4;
    padding-left: 4rem;
    border-left: 1px solid var(--color-border);
}

.hero-stats {
    display: flex;
    gap: 4rem;
    margin-bottom: 6rem;
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
    width: 100%;
    position: relative;
}

.hero-stats::before {
    content: 'METRICS_v2.0';
    position: absolute;
    top: -0.75rem;
    left: 0;
    background: var(--color-bg-primary);
    padding-right: 1rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--color-accent);
}

.stat-item {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 1rem;
    border-left: 1px solid var(--color-border);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
    letter-spacing: -0.05em;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.5;
    margin-top: 0.5rem;
}

#threejs-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.8;
}

#threejs-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to right, rgba(var(--bg-rgb), 0.9) 0%, rgba(var(--bg-rgb), 0.4) 50%, transparent 100%);
}

@media (min-width: 992px) {
    #threejs-container {
        left: 50%;
        width: 50%;
    }
    #threejs-overlay {
        background: linear-gradient(to right, rgba(var(--bg-rgb), 1) 40%, rgba(var(--bg-rgb), 0) 70%);
    }
}

.hero-content {
    min-height: 65vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 1rem 1rem;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hero visibility override - ensure visible even without JS reveal trigger */
#hero.reveal-section {
    opacity: 1;
    transform: none;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    opacity: 0.8;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
    align-items: stretch;
}

.project-item {
    position: relative;
    border: 1px solid var(--color-border);
    padding: 3rem;
    transition: all var(--transition-speed) var(--transition-ease);
    background: var(--color-bg-primary);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    box-shadow: 4px 4px 0px var(--color-border);
    overflow: hidden;
    outline: 1px solid transparent;
    outline-offset: 4px;
}

.project-item::after {
    content: 'MODULE_PRJ';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.1em;
    opacity: 0.3;
}

.project-item:hover {
    transform: translate(-4px, -4px);
    border-color: var(--color-accent);
    box-shadow: 12px 12px 0px var(--color-accent);
}

.project-item::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, transparent 50%, var(--color-accent) 50%);
    opacity: 0;
    transition: opacity var(--transition-speed) var(--transition-ease);
}

.project-item:hover::after {
    opacity: 1;
}

.tech-chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--color-border);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    transition: all var(--transition-speed) var(--transition-ease);
    background: transparent;
}

.project-item:hover .tech-chip {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.project-item:hover {
    transform: translate(-10px, -10px);
    border-color: var(--color-accent);
    box-shadow: 20px 20px 0px var(--color-accent);
}

.project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--color-accent);
    opacity: 0;
    transition: all var(--transition-speed) var(--transition-ease);
}

.project-item:hover::before {
    opacity: 1;
    height: 12px;
}

.item-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.tech-chip {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-border);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.year-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-left: auto;
    opacity: 0.6;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0;
    margin-top: 3rem;
    margin-bottom: 0;
    padding: 0 2rem;
    border-bottom: 1px solid var(--color-border);
}

.tab-btn {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-bottom: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-ease);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    margin-right: -1px;
    z-index: 1;
}

.tab-btn:hover {
    color: var(--color-text-primary);
    background: rgba(var(--color-accent-rgb), 0.05);
}

.tab-btn.active {
    color: var(--color-bg-primary);
    background: var(--color-accent);
    border-color: var(--color-accent);
    z-index: 2;
    font-weight: 600;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

/* Scrollytelling - ensure visibility and proper layering */
.scrolly-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
}

.scrolly,
.scrolly-section {
  position: relative;
  z-index: 1;
  opacity: 1;
  transform: none;
}
/* fadeInUp animation handled by scrollytelling IntersectionObserver */
.tab-panel.active {
    display: block;
}

.service-card,
.glass-panel {
    border: 1px solid var(--color-border);
    padding: 4rem;
    min-height: 300px;
    background: var(--color-bg-primary);
    transition: all var(--transition-speed) var(--transition-ease);
    position: relative;
    overflow: hidden;
    box-shadow: 8px 8px 0px var(--color-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-border);
    transition: all var(--transition-speed) var(--transition-ease);
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, transparent 50%, var(--color-border) 50%);
    transition: all var(--transition-speed) var(--transition-ease);
}

.service-card:hover {
    border-color: var(--color-accent);
    transform: translate(-8px, -8px);
    box-shadow: 16px 16px 0px var(--color-accent);
}

.service-card:hover::before {
    background: var(--color-accent);
    height: 8px;
}

.service-card:hover::after {
    background: linear-gradient(135deg, transparent 50%, var(--color-accent) 50%);
    width: 60px;
    height: 60px;
}

.testimonial blockquote {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    border-left: 16px solid var(--color-accent);
    padding: 5rem 6rem;
    background: var(--color-bg-secondary);
    position: relative;
    box-shadow: 12px 12px 0px var(--color-border);
    margin: 4rem 0;
    border-radius: 0 !important;
}

.testimonial blockquote::before {
    content: '“';
    position: absolute;
    top: -2rem;
    left: 2rem;
    font-size: 10rem;
    font-family: serif;
    color: var(--color-accent);
    opacity: 0.15;
    line-height: 1;
    pointer-events: none;
}

#about .lead {
    font-size: 1.5rem;
    font-weight: 300;
    max-width: 70ch;
    margin-bottom: 3rem;
    line-height: 1.6;
    color: var(--color-text-primary);
    border-left: 2px solid var(--color-accent);
    padding-left: 2rem;
}

h2 {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
}

.border-top {
    border-top: 1px solid var(--color-border) !important;
}

footer {
    padding: 6rem 0;
    border-top: 4px solid var(--color-text-primary);
    margin-top: 8rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), transparent, var(--color-accent));
}

footer a {
    position: relative;
    text-decoration: none;
    color: var(--color-text-secondary);
    transition: color var(--transition-speed) var(--transition-ease);
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

footer a:hover {
    color: var(--color-text-primary);
}

footer a:hover::after {
    width: 100%;
}

/* Background Treatments */
.bg-gradient-blob {
    position: relative;
    overflow: hidden;
}

.bg-gradient-blob::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at 50% 50%, rgba(var(--color-accent-rgb, 0,0,0), 0.05), transparent 70%);
    z-index: -1;
    animation: drift 20s infinite alternate ease-in-out;
}

@keyframes drift {
    from { transform: translate(-5%, -5%) scale(1); }
    to { transform: translate(5%, 5%) scale(1.1); }
}

.bg-aurora-diagonal {
    position: relative;
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, rgba(var(--color-accent-rgb, 0,0,0), 0.02) 100%);
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 0;
    }
    .nav-links {
        display: none; /* Simplified for now, usually a mobile menu toggle would go here */
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 3.5rem;
    }
}

@media (max-width: 576px) {
    .service-card,
    .glass-panel {
        padding: 1.5rem;
    }
    h2 {
        font-size: 2rem;
    }
    .hero-content {
        padding-top: 3rem;
    }
}
    text-transform: uppercase;
}

.sub-headline {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 3rem;
    line-height: 1.4;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

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

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
    opacity: 0.6;
}

.cta-button {
    display: inline-block;
    padding: 1.25rem 2.5rem;
    background-color: var(--color-accent);
    color: var(--color-bg-primary);
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    border: 1px solid var(--color-accent);
    transition: all var(--transition-speed) var(--transition-ease);
    position: relative;
}

.cta-button:hover {
    background-color: transparent;
    color: var(--color-text-primary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content > * {
    animation: fadeInUp 0.8s var(--transition-ease) both;
}

.hero-content .eyebrow { animation-delay: 0.1s; }
.hero-content h1 { animation-delay: 0.2s; }
.hero-content .sub-headline { animation-delay: 0.3s; }
.hero-content .hero-stats { animation-delay: 0.4s; }
.hero-content .hero-actions { animation-delay: 0.5s; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-stats {
        gap: 1.5rem;
    }
    .stat-value {
        font-size: 2rem;
    }
}

.btn-view {
    border-radius: 0 !important;
    color: var(--color-accent) !important;
    border: 2px solid var(--color-accent) !important;
    background-color: transparent !important;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.15), 8px 8px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    padding: 0.75rem 1.5rem;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    min-height: 44px;
    min-width: 44px;
    position: relative;
}

.btn-view::after {
    content: '→';
    margin-left: 8px;
    transition: transform 0.2s ease;
}

[data-bs-theme="dark"] .btn-view {
    box-shadow: 4px 4px 0px rgba(255, 255, 255, 0.1), 8px 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-view:hover {
    background-color: var(--color-accent) !important;
    color: var(--color-bg-primary) !important;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    transform: translate(2px, 2px);
}

.btn-view:hover::after {
    transform: translateX(4px);
}

[data-bs-theme="dark"] .btn-view:hover {
    box-shadow: 0 0 15px var(--color-accent), 2px 2px 0px rgba(255, 255, 255, 0.2);
}

/* --- ANIMATIONS & TRANSITIONS --- */
@media (prefers-reduced-motion: no-preference) {
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes fadeInLeft {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    @keyframes fadeInRight {
        from {
            opacity: 0;
            transform: translateX(20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .fadeInUp {
        animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .fadeInLeft {
        animation: fadeInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .fadeInRight {
        animation: fadeInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

}

/* Fallback for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal-section, .reveal-section > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .fadeInUp, .fadeInLeft, .fadeInRight {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* Smooth Scroll & Section Spacing */
html {
    scroll-behavior: smooth;
}

section {
    scroll-margin-top: 80px;
    padding: 8rem 0;
    position: relative;
    background-color: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    transition: background-color var(--transition-speed) var(--transition-ease);
    overflow: hidden;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0.1;
}

section:nth-child(even) {
    background-color: var(--color-bg-secondary);
}

section > .container,
section > .container-fluid {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    section {
        padding: 5rem 0;
    }
}

/* Preloader & Skeleton Loading */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-bar {
    width: 200px;
    height: 2px;
    background-color: var(--color-border);
    position: relative;
    overflow: hidden;
}

.loader-bar::after {
    content: '';
    display: block;
    width: 40%;
    height: 100%;
    background-color: var(--color-accent);
    position: absolute;
    left: 0;
    top: 0;
    animation: loadingBar 1.5s infinite ease-in-out;
}

@keyframes loadingBar {
    0% { left: -40%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Three.js Canvas Fade-in */
#threejs-container {
    opacity: 0;
    transition: opacity 1.5s ease;
}
#threejs-container.loaded {
    opacity: 1;
}

/* Micro-interactions & Typography */
p {
    max-width: 65ch;
}

/* Strict 0px border-radius overrides */
*,
.btn,
.card,
.form-control,
.nav-link,
.dropdown-menu,
.modal-content,
.badge,
.project-item,
.tech-chip {
    border-radius: 0px !important;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    h1 { font-size: 3.5rem !important; }
    h2 { font-size: 2.2rem !important; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.8rem !important; }
    h2 { font-size: 1.8rem !important; }
    .nav-links {
        display: none; /* Hamburger menu toggle handled in JS */
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2.2rem !important; }
    h2 { font-size: 1.5rem !important; }
    section {
        padding: 4rem 0;
    }
}

@media (max-width: 320px) {
    h1 { font-size: 1.8rem !important; }
    h2 { font-size: 1.3rem !important; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-delay: 0s !important;
        animation-duration: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
        scroll-behavior: auto !important;
    }
    .reveal-section {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* R3D3_SECTION: about-section-styles */
/* About Section Refinements */
#about {
    padding: 120px 0;
}

.lead-text {
    font-size: 1.25rem;
    line-height: 1.7;
    max-width: 100%;
    margin-bottom: 2rem;
    border-left: 3px solid var(--color-accent);
    padding-left: 1.5rem;
    color: var(--color-text-primary);
}

.about-body {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 100%;
    color: var(--color-text-secondary);
}

.about-card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    padding: 4rem;
    transition: all var(--transition-speed) var(--transition-ease);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 10px 10px 0px var(--color-border);
    border-radius: 0 !important;
}

.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--color-border);
    transition: all var(--transition-speed) var(--transition-ease);
}

.about-card:hover {
    border-color: var(--color-accent);
    transform: translate(-10px, -10px);
    box-shadow: 20px 20px 0px var(--color-accent);
}

.about-card:hover::before {
    background: var(--color-accent);
    height: 15px;
}

.about-card h5 {
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-accent);
}

.about-card p {
    margin-bottom: 0;
    line-height: 1.6;
    color: var(--color-text-primary);
}

@media (max-width: 768px) {
    #about {
        padding: 60px 0;
    }
    
    .about-card {
        padding: 1.5rem;
    }
    
    .lead-text {
        font-size: 1.1rem;
        padding-left: 1rem;
    }
}
/* ========================================
   SCROLLYTELLING ANIMATIONS
   ======================================== */

.scrolly-section {
  position: relative;
  z-index: 1;
  isolation: isolate;
  min-height: 100vh;
  opacity: 1;
  visibility: visible;
}

.scrolly-section.reveal-section,
.scrolly-section.fadeInUp {
  opacity: 1;
  visibility: visible;
  transform: none;
  animation: none;
}

.scrolly-section:not(.in-view) {
  opacity: 1;
}

.scrolly-section:not(#hero) {
  z-index: auto;
}

#hero.scrolly-section {
  z-index: 0;
}

/* Base scrolly section - visible by default, animated via .in-view */
/* Duplicate opacity:0 block removed to fix scrollytelling visibility */

/* In-view state - triggered by IntersectionObserver */
.scrolly-section.in-view {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

/* Staggered child animations */
.scrolly-section.in-view > * {
    opacity: 0;
    transform: translateY(20px);
    animation: staggerFadeUp 0.6s var(--transition-ease) forwards;
}

.scrolly-section.in-view > *:nth-child(1) { animation-delay: 0.1s; }
.scrolly-section.in-view > *:nth-child(2) { animation-delay: 0.2s; }
.scrolly-section.in-view > *:nth-child(3) { animation-delay: 0.3s; }
.scrolly-section.in-view > *:nth-child(4) { animation-delay: 0.4s; }
.scrolly-section.in-view > *:nth-child(5) { animation-delay: 0.5s; }
.scrolly-section.in-view > *:nth-child(6) { animation-delay: 0.6s; }
.scrolly-section.in-view > *:nth-child(7) { animation-delay: 0.7s; }
.scrolly-section.in-view > *:nth-child(8) { animation-delay: 0.8s; }

/* Animation variants */
.scrolly-section[data-animation="fade-up"] {
    transform: translateY(40px);
}

.scrolly-section[data-animation="fade-down"] {
    transform: translateY(-40px);
}

.scrolly-section[data-animation="slide-left"] {
    transform: translateX(60px);
}

.scrolly-section[data-animation="slide-right"] {
    transform: translateX(-60px);
}

.scrolly-section[data-animation="scale-in"] {
    transform: scale(0.95);
}

.scrolly-section[data-animation="rotate-in"] {
    transform: rotate(-2deg) translateY(30px);
}

/* Keyframes for staggered children */
@keyframes staggerFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reveal animation for existing reveal-section class - Progressive Scroll Reveal */
.reveal-section {
    --scroll-reveal: 0;
    opacity: var(--scroll-reveal);
    transform: translateY(calc(40px * (1 - var(--scroll-reveal))));
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.reveal-section.is-visible,
.reveal-section.in-view,
.fadeInUp.is-visible,
.fadeInUp.in-view {
    --scroll-reveal: 1 !important;
    opacity: 1 !important;
    transform: none !important;
}

.reveal-section > * {
    will-change: opacity, transform;
}

/* fadeInUp enhancement - Progressive Scroll Reveal */
.fadeInUp {
    --scroll-reveal: 0;
    opacity: var(--scroll-reveal);
    transform: translateY(calc(30px * (1 - var(--scroll-reveal))));
    transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .scrolly-section,
    .reveal-section,
    .fadeInUp {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }
    
    .scrolly-section.in-view > * {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* R3D3_SECTION_END */

/* Hero Always Visible Override */
#hero.reveal-section {
    --scroll-reveal: 1 !important;
    opacity: 1 !important;
    transform: none !important;
}

.scrolly-sticky {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  visibility: visible !important;
  display: block !important;
  min-height: 100vh;
}
