:root {
    --void: #0a0a0a;
    --mars: #4a4540;
    --dust: #5c534a;
    --stone: #6b665f;
    --fog: #9a958e;
    --light: #e8e4df;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--void);
    color: var(--light);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

nav, section, footer {
    position: relative;
    z-index: 10;
}

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

/* Navigation */
nav {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
}

.logo {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.nav-link {
    color: var(--light);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    opacity: 0.6;
    transition: opacity 0.3s;
}
.nav-link:hover { opacity: 1; }

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 4rem;
    position: relative;
}

.hero-title {
    font-size: clamp(3rem, 12vw, 10rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 0.9;
    opacity: 0;
    animation: fadeUp 1s ease forwards;
}

.hero-subtitle {
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    color: var(--stone);
    margin-top: 2rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 1s ease 0.3s forwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 4rem;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--stone);
    opacity: 0;
    animation: fadeUp 1s ease 0.6s forwards;
}
.scroll-indicator::after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    background: var(--dust);
    margin-top: 1rem;
    animation: scrollPulse 2s ease infinite;
}

/* Sections */
section {
    padding: 8rem 4rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    content-visibility: auto;
    contain-intrinsic-size: 100vh;
}

.section-label {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: var(--stone);
    text-transform: uppercase;
    margin-bottom: 3rem;
}

.section-text {
    font-size: clamp(1.2rem, 3vw, 2rem);
    line-height: 1.6;
    max-width: 800px;
    color: var(--fog);
}
.section-text strong { color: var(--light); }

/* Manifesto */
.manifesto {
    background: linear-gradient(180deg, var(--void) 0%, #0f0e0d 50%, var(--void) 100%);
}

.manifesto-lines {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.manifesto-line {
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    color: var(--stone);
    transition: color 0.3s;
}
.manifesto-line:hover { color: var(--light); }
.manifesto-line.highlight { color: var(--light); font-weight: 700; }

.manifesto-list {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin: 2.5rem 0;
}

.manifesto-item { text-align: center; flex: 1; }

.manifesto-title {
    font-weight: 400;
    letter-spacing: 0.06em;
    font-size: 2.6rem;
    color: var(--light);
    text-transform: uppercase;
    text-shadow: 0 2px 12px #000a, 0 1px 0 var(--mars);
}

.manifesto-desc {
    color: var(--fog);
    display: inline-block;
    font-size: 1.5rem;
    margin-top: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.03em;
}

/* Projects */
.projects { border-top: 1px solid #1a1a1a; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.project-card {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #1a1918 0%, #12110f 100%);
    border: 1px solid #1f1e1c;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s;
}
.project-card:hover { border-color: var(--dust); }

.project-card span {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--stone);
    text-transform: uppercase;
}

.project-number {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    color: var(--dust);
}

/* Footer */
footer {
    padding: 4rem;
    border-top: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-motto {
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    color: var(--stone);
    line-height: 1.8;
}

.footer-info {
    text-align: right;
    font-size: 0.7rem;
    color: var(--dust);
    letter-spacing: 0.1em;
}
.footer-info a { color: var(--fog); text-decoration: none; }

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 1; }
}

/* ASCII Background */
.ascii-section {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.ascii-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; height: 100%;
    padding: 2rem;
    position: relative;
}

.ascii-display {
    font-family: 'Courier New', monospace;
    font-size: clamp(0.25rem, 0.5vw, 0.45rem);
    line-height: 1.15;
    color: var(--light);
    text-align: center;
    white-space: pre;
    letter-spacing: 0.03em;
    opacity: 0.18;
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;
    background: transparent;
    padding: 0; border: none;
    display: block;
    filter: blur(0.3px) brightness(1.1);
    transform: scale(1.02);
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    word-break: break-all;
    will-change: contents;
}

video#ascii-video,
canvas#ascii-canvas { display: none; }

/* Analog fallback (CORS blocked) */
.analog-fallback video#ascii-video {
    display: block !important;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    object-fit: cover;
    opacity: 0.25;
    filter: grayscale(100%) contrast(1.5) brightness(0.8) sepia(20%);
    z-index: 0;
}
.analog-fallback .ascii-display { display: none !important; }
.analog-fallback::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.25) 50%), linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 2;
}

/* Responsive */
@media (max-width: 900px) {
    .manifesto-list { flex-direction: column; gap: 4rem; align-items: center; }
    .manifesto-title { font-size: 2.2rem; }
    .manifesto-desc { font-size: 1.2rem; }
}

@media (max-width: 768px) {
    nav, .hero, section, footer { padding-left: 2rem; padding-right: 2rem; }
    nav { padding-top: 1.5rem; padding-bottom: 1.5rem; }
    section { padding-top: 6rem; padding-bottom: 6rem; min-height: auto; }
    .ascii-display { font-size: clamp(0.2rem, 0.4vw, 0.35rem); opacity: 0.1; transform: scale(1.1); }
    .ascii-container { padding: 1rem; }
}

@media (min-width: 1920px) {
    .ascii-display { font-size: clamp(0.4rem, 0.7vw, 0.6rem); }
}
