/* ============================================
   NATASHA URAKHCHINA - PERSONAL WEBSITE
   Sorayama-inspired Chrome/Metallic Futurism
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --chrome-light: #e0e0e0;
    --chrome-mid: #a8a8a8;
    --chrome-dark: #606060;
    --chrome-shine: #ffffff;
    --bg-deep: #0a0a0c;
    --bg-mid: #111115;
    --bg-card: #16161a;
    --accent-blue: #4a9eff;
    --accent-purple: #8a6aff;
    --accent-cyan: #00e5ff;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --text-dim: #555;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--chrome-dark) var(--bg-deep);
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
    cursor: default;
}

::selection {
    background: var(--accent-cyan);
    color: var(--bg-deep);
}

/* --- Background Canvas --- */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Fractal Overlay --- */
.fractal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
    background-image:
        repeating-conic-gradient(
            from 0deg at 50% 50%,
            transparent 0deg,
            rgba(255,255,255,0.03) 1deg,
            transparent 2deg
        );
    background-size: 200px 200px;
    mix-blend-mode: screen;
}

/* --- Chrome Text Effect --- */
.chrome-text {
    background: linear-gradient(
        135deg,
        #e8e8e8 0%,
        #a0a0a0 20%,
        #f5f5f5 40%,
        #808080 60%,
        #d0d0d0 80%,
        #ffffff 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chrome-text-large {
    background: linear-gradient(
        135deg,
        #f0f0f0 0%,
        #b0b0b0 15%,
        #ffffff 30%,
        #909090 50%,
        #e0e0e0 70%,
        #ffffff 85%,
        #c0c0c0 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: chromeShift 6s ease-in-out infinite;
}

@keyframes chromeShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- Navigation --- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    background: linear-gradient(180deg, rgba(10,10,12,0.95) 0%, rgba(10,10,12,0) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--chrome-mid);
    text-decoration: none;
    letter-spacing: 0.15em;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-cyan), transparent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--chrome-light);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-handle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-cyan);
    letter-spacing: 0.1em;
    opacity: 0.7;
}

/* --- Sections --- */
.section {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
}

.section-dark {
    background: linear-gradient(180deg,
        rgba(8,8,10,0.97) 0%,
        rgba(12,12,16,0.98) 50%,
        rgba(8,8,10,0.97) 100%
    );
}

.section-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 3rem;
    text-transform: uppercase;
}

.title-accent {
    color: var(--accent-cyan);
    margin-right: 0.5rem;
}

/* --- Hero Section --- */
#hero {
    flex-direction: column;
    text-align: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

#hero-3d {
    position: absolute;
    top: 5rem;
    left: 0;
    width: 100%;
    height: calc(100% - 5rem);
    z-index: -1;
    pointer-events: none;
}

#hero-3d canvas,
#about-polytope canvas,
#ccs-3d canvas,
#mission-3d canvas {
    pointer-events: none;
    max-width: 100%;
    height: auto;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-glitch {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    background: linear-gradient(
        135deg,
        #f0f0f0 0%,
        #b0b0b0 20%,
        #ffffff 35%,
        #808080 50%,
        #e0e0e0 65%,
        #ffffff 80%,
        #a0a0a0 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: chromeShift 4s ease-in-out infinite;
    position: relative;
    margin-bottom: 1.5rem;
}

.hero-glitch::before,
.hero-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: inherit;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-glitch::before {
    animation: glitch1 3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    opacity: 0.8;
}

.hero-glitch::after {
    animation: glitch2 3s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    opacity: 0.8;
}

@keyframes glitch1 {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(2px, -1px); }
    94% { transform: translate(-2px, 1px); }
    96% { transform: translate(1px, 0); }
}

@keyframes glitch2 {
    0%, 90%, 100% { transform: translate(0); }
    91% { transform: translate(-1px, 1px); }
    93% { transform: translate(2px, -1px); }
    95% { transform: translate(-2px, 0); }
}

.hero-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    color: var(--chrome-mid);
    letter-spacing: 0.3em;
    margin-bottom: 1.5rem;
}

.hero-tagline {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    font-weight: 600;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
    text-transform: lowercase;
    font-style: italic;
}

.hero-handle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    color: var(--accent-cyan);
    letter-spacing: 0.1em;
    margin-bottom: 4rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.scroll-indicator span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 1px solid var(--chrome-dark);
    border-bottom: 1px solid var(--chrome-dark);
    transform: rotate(45deg);
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.5; }
    50% { transform: rotate(45deg) translate(5px, 5px); opacity: 1; }
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.about-lead {
    font-size: 1.3rem !important;
    color: var(--text-primary) !important;
}

.highlight {
    color: var(--accent-cyan);
    font-weight: 600;
}

.about-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

#about-polytope {
    width: 450px;
    height: 450px;
}

.about-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

/* --- CCS Section --- */
.ccs-header {
    text-align: center;
    margin-bottom: 4rem;
}

.ccs-header .section-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.ccs-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: var(--accent-cyan);
    letter-spacing: 0.15em;
}

.ccs-hero-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(20,20,24,0.8), rgba(10,10,14,0.8));
}

#ccs-3d {
    width: 100%;
    height: 500px;
}

.ccs-intro p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.ccs-lead {
    font-size: 1.15rem !important;
    color: var(--text-primary) !important;
}

/* Feature Cards */
.ccs-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.ccs-feature-card {
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(22,22,26,0.9), rgba(14,14,18,0.9));
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.ccs-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--chrome-mid), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ccs-feature-card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.ccs-feature-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.2rem;
}

.icon-svg {
    width: 100%;
    height: 100%;
}

.ccs-feature-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--chrome-light);
    margin-bottom: 0.8rem;
}

.ccs-feature-card p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Architecture Flow */
.ccs-architecture {
    margin-bottom: 3rem;
    text-align: center;
}

.ccs-architecture h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.arch-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.arch-node {
    padding: 1.2rem 1.5rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    background: rgba(20,20,24,0.8);
    text-align: center;
    min-width: 140px;
    transition: all 0.3s ease;
}

.arch-node:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0,229,255,0.1);
}

.node-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--chrome-light);
    margin-bottom: 0.3rem;
}

.node-desc {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.arch-arrow {
    font-size: 1.5rem;
    color: var(--chrome-dark);
    padding: 0 0.3rem;
}

/* Code Block */
.ccs-code-block {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    background: rgba(8,8,12,0.9);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    background: rgba(30,30,36,0.8);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.code-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }

.code-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-left: 0.5rem;
}

.code-content {
    padding: 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--chrome-mid);
    overflow-x: auto;
}

.code-content code {
    color: inherit;
}

/* Chrome Button */
.chrome-button {
    display: inline-block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    padding: 1rem 2.5rem;
    border: 1px solid var(--chrome-dark);
    border-radius: 4px;
    color: var(--chrome-light);
    text-decoration: none;
    background: linear-gradient(135deg, rgba(40,40,46,0.5), rgba(20,20,24,0.5));
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.chrome-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s ease;
}

.chrome-button:hover {
    border-color: var(--chrome-mid);
    box-shadow: 0 0 30px rgba(255,255,255,0.05);
    transform: translateY(-2px);
}

.chrome-button:hover::before {
    left: 100%;
}

.ccs-link {
    display: block;
    text-align: center;
    max-width: 300px;
    margin: 0 auto;
}

/* --- Mission Section --- */
.mission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.mission-visual {
    display: flex;
    justify-content: center;
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    align-self: start;
}

#mission-3d {
    width: 400px;
    height: 400px;
}

.mission-text h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.mission-tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.mission-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.mission-text .chrome-button {
    margin-top: 0.5rem;
}

/* --- Axioms List --- */
.axioms-list {
    margin: 2rem 0;
}

.axioms-list h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.axiom-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding: 0.8rem 1rem;
    border-left: 1px solid rgba(255,255,255,0.08);
    transition: border-color 0.3s ease;
}

.axiom-item:hover {
    border-left-color: var(--accent-cyan);
}

.axiom-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
    min-width: 1.8rem;
    padding-top: 0.15rem;
    opacity: 0.7;
}

.axiom-item strong {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--chrome-light);
    display: block;
    margin-bottom: 0.3rem;
}

.axiom-item p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.skill-card {
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(22,22,26,0.9), rgba(14,14,18,0.9));
    transition: all 0.4s ease;
}

.skill-card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.skill-icon {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--chrome-dark);
    border-radius: 6px;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, var(--chrome-light), var(--chrome-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skill-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--chrome-light);
    margin-bottom: 0.8rem;
}

.skill-card p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* --- Writing/Transmissions Section --- */
.writing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.writing-card {
    padding: 2.5rem 2rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(18,18,22,0.9), rgba(12,12,16,0.9));
    text-decoration: none;
    color: inherit;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.writing-card:hover {
    border-color: rgba(0,229,255,0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 40px rgba(0,229,255,0.03);
}

.writing-icon {
    color: var(--chrome-mid);
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.writing-card:hover .writing-icon {
    color: var(--accent-cyan);
}

.writing-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--chrome-light);
    margin-bottom: 0.8rem;
}

.writing-card p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    flex: 1;
}

.card-link {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-cyan);
    letter-spacing: 0.1em;
    margin-top: 1.5rem;
    transition: letter-spacing 0.3s ease;
}

.writing-card:hover .card-link {
    letter-spacing: 0.2em;
}

/* --- Footer Gallery --- */
.footer-gallery {
    display: flex;
    width: 100%;
    gap: 0;
    opacity: 0.35;
    mix-blend-mode: lighten;
    mask-image: linear-gradient(180deg, transparent 0%, black 30%, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 30%, black 70%, transparent 100%);
}

.footer-gallery img {
    flex: 1;
    width: 0;
    height: auto;
    object-fit: cover;
    display: block;
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 2;
    padding: 0;
    padding-bottom: 2rem;
    border-top: none;
    text-align: center;
    overflow: hidden;
}

#footer .footer-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.footer-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links a {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--chrome-mid);
    text-decoration: none;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

.footer-copy {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

/* --- Responsive: Tablet --- */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-handle { display: none; }

    .about-grid,
    .ccs-hero-block,
    .mission-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .ccs-features,
    .skills-grid,
    .writing-grid {
        grid-template-columns: 1fr;
    }

    .arch-flow {
        flex-direction: column;
    }

    .arch-arrow {
        transform: rotate(90deg);
    }

    #about-polytope {
        width: 350px;
        height: 350px;
    }
    #mission-3d {
        width: 250px;
        height: 250px;
    }

    #ccs-3d {
        height: 350px;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    .mission-visual {
        order: -1;
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 600px) {
    /* Footer gallery: show only middle image */
    .footer-gallery img {
        display: none;
    }
    .footer-gallery {
        flex-direction: column;
        opacity: 0.6;
    }
    .footer-gallery img:nth-child(2),
    .footer-gallery img:nth-child(5) {
        display: block;
        flex: none;
        width: 100%;
    }

    /* Hero */
    #hero {
        min-height: 100svh;
        padding: 3rem 1rem;
    }

    .hero-glitch {
        font-size: clamp(1.4rem, 7vw, 2rem);
        letter-spacing: 0.04em;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 0.65rem;
        letter-spacing: 0.15em;
        margin-bottom: 1rem;
    }

    .hero-tagline {
        font-size: 1rem;
        letter-spacing: 0.08em;
    }

    .hero-handle {
        font-size: 0.75rem;
        margin-bottom: 2rem;
    }

    /* Hero 3D - scale to fit mobile viewport */
    #hero-3d canvas {
        max-width: 100vw;
        max-height: 100svh;
    }

    /* Nav */
    #main-nav {
        padding: 0.8rem 1rem;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    /* Sections */
    .section {
        padding: 3rem 1rem;
        min-height: auto;
    }

    .section-title {
        font-size: 1.2rem;
        letter-spacing: 0.06em;
        margin-bottom: 2rem;
    }

    /* About */
    .about-text p {
        font-size: 0.95rem;
    }

    .about-lead {
        font-size: 1.1rem !important;
    }

    .about-stats {
        gap: 1rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    #about-polytope {
        width: 300px;
        height: 300px;
    }

    /* CCS */
    .ccs-header .section-title {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    .ccs-subtitle {
        font-size: 0.8rem;
    }

    .ccs-hero-block {
        padding: 1rem;
    }

    .ccs-intro p {
        font-size: 0.9rem;
    }

    #ccs-3d {
        height: 300px;
    }

    .ccs-feature-card {
        padding: 1.5rem;
    }

    .ccs-feature-card h3 {
        font-size: 0.8rem;
    }

    .ccs-feature-card p {
        font-size: 0.85rem;
    }

    .arch-node {
        min-width: 100px;
        padding: 0.8rem 1rem;
    }

    .node-label {
        font-size: 0.75rem;
    }

    .code-content {
        font-size: 0.7rem;
        padding: 1rem;
    }

    .chrome-button {
        font-size: 0.7rem;
        padding: 0.8rem 1.8rem;
    }

    /* Mission */
    #mission-3d {
        width: 200px;
        height: 200px;
    }

    .mission-text h3 {
        font-size: 1.1rem;
    }

    .mission-text p {
        font-size: 0.9rem;
    }

    .axioms-list h4 {
        font-size: 0.75rem;
    }

    .axiom-item {
        padding: 0.6rem 0.8rem;
        gap: 0.8rem;
    }

    .axiom-item strong {
        font-size: 0.7rem;
    }

    .axiom-item p {
        font-size: 0.8rem;
    }

    /* Skills */
    .skill-card {
        padding: 1.5rem;
    }

    /* Writing */
    .writing-card {
        padding: 1.5rem;
    }

    /* Footer */
    #footer {
        padding: 3rem 1rem;
    }

    .footer-logo {
        font-size: 2rem;
    }

    .footer-links {
        gap: 1.2rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-links a {
        font-size: 0.7rem;
    }

    /* Scroll indicator */
    .scroll-indicator {
        bottom: 1rem;
    }

    .scroll-indicator span {
        font-size: 0.5rem;
    }
}

/* --- Responsive: Small phones --- */
@media (max-width: 380px) {
    .hero-glitch {
        font-size: 1.2rem;
    }

    .section {
        padding: 2.5rem 0.8rem;
    }

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

    #about-polytope {
        width: 250px;
        height: 250px;
    }
    #mission-3d {
        width: 160px;
        height: 160px;
    }

    #ccs-3d {
        height: 250px;
    }
}

/* --- Scroll Animations --- */
.section-container,
.hero-content {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease forwards;
}

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

/* Intersection Observer driven - will be toggled by JS */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
