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

:root {
    --zinc-900: #18181b;
    --zinc-800: #27272a;
    --zinc-700: #3f3f46;
    --zinc-500: #71717a;
    --zinc-200: #e4e4e7;
    --white: #ffffff;
    --black: #09090b;
    --purple: #a78bfa;
    --cyan: #22d3ee;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--black);
    color: var(--white);
    overflow-x: hidden;
}

.mono {
    font-family: var(--font-mono);
}

/* Sidebar Rail */
.sidebar-rail {
    position: fixed;
    left: 0;
    top: 0;
    width: 72px;
    height: 100vh;
    background: var(--zinc-900);
    border-right: 1px solid var(--zinc-700);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    z-index: 100;
}

.rail-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--cyan);
    margin-bottom: 3rem;
}

.rail-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.rail-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none;
    position: relative;
}

.rail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--zinc-500);
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.rail-link.active .rail-dot {
    background: var(--cyan);
    transform: scale(1.5);
    box-shadow: 0 0 12px var(--cyan);
}

.rail-grid-lines {
    position: absolute;
    bottom: 2rem;
    width: 40px;
    height: 60px;
    background: repeating-linear-gradient(
        0deg,
        var(--zinc-700) 0px,
        var(--zinc-700) 1px,
        transparent 1px,
        transparent 8px
    );
    opacity: 0.4;
}

/* Main Scroll Container */
.scroll-container {
    margin-left: 72px;
}

/* Sections */
.section {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Grid Overlay */
.grid-overlay {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent calc(100% / 12 - 1px),
            rgba(63, 63, 70, 0.08) calc(100% / 12 - 1px),
            rgba(63, 63, 70, 0.08) calc(100% / 12)
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 79px,
            rgba(63, 63, 70, 0.08) 79px,
            rgba(63, 63, 70, 0.08) 80px
        );
    pointer-events: none;
}

/* Hero Section */
.section--hero {
    background: var(--black);
    flex-direction: column;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.06em;
    line-height: 0.92;
    display: flex;
    flex-direction: column;
}

.title-line {
    display: block;
    color: var(--white);
}

.title-line--accent {
    color: var(--cyan);
    text-shadow: 0 0 40px rgba(34, 211, 238, 0.3);
}

.hero-subtitle {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--zinc-500);
    letter-spacing: 0.05em;
}

.glitch-bar {
    width: 120px;
    height: 3px;
    background: var(--purple);
    margin: 2rem auto 0;
    position: relative;
    animation: glitch-shift 3s infinite;
}

@keyframes glitch-shift {
    0%, 90%, 100% { transform: translateX(0); opacity: 1; }
    92% { transform: translateX(-20px); opacity: 0.5; }
    94% { transform: translateX(15px); opacity: 0.8; }
    96% { transform: translateX(-5px); opacity: 1; }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--zinc-500);
    font-size: 0.75rem;
    animation: float 2s ease-in-out infinite;
}

.scroll-arrow {
    width: 1px;
    height: 24px;
    background: var(--zinc-500);
    position: relative;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -3px;
    width: 7px;
    height: 7px;
    border-bottom: 1px solid var(--zinc-500);
    border-right: 1px solid var(--zinc-500);
    transform: rotate(45deg);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Section Content */
.section-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

.section-tag {
    font-size: 0.75rem;
    color: var(--purple);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin-bottom: 1.5rem;
}

.section-body {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--zinc-200);
    max-width: 560px;
}

.text-fragment {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--cyan);
    opacity: 0.6;
}

/* Work Section */
.section--work {
    background: var(--zinc-900);
}

.work-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.work-card {
    background: var(--zinc-800);
    border: 1px solid var(--zinc-700);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s;
}

.work-card:hover {
    border-color: var(--cyan);
    transform: translateX(8px);
}

.work-card-number {
    font-size: 0.75rem;
    color: var(--purple);
    margin-bottom: 0.75rem;
}

.work-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.work-card-desc {
    font-size: 0.8rem;
    color: var(--zinc-500);
}

.work-card-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--cyan);
    transition: width 0.4s ease;
}

.work-card:hover .work-card-line {
    width: 100%;
}

/* Process Section */
.section--process {
    background: var(--black);
}

.process-steps {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.process-step {
    padding-left: 1.5rem;
    border-left: 2px solid var(--zinc-700);
    transition: border-color 0.3s;
}

.process-step:hover {
    border-left-color: var(--purple);
}

.process-number {
    font-size: 0.75rem;
    color: var(--cyan);
    display: block;
    margin-bottom: 0.5rem;
}

.process-step h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.process-step p {
    font-size: 0.8rem;
    color: var(--zinc-500);
}

/* Contact Section */
.section--contact {
    background: var(--zinc-900);
}

.contact-link {
    display: inline-block;
    margin-top: 2rem;
    font-size: 1rem;
    color: var(--cyan);
    text-decoration: none;
    padding: 1rem 2rem;
    border: 1px solid var(--cyan);
    transition: background 0.3s, color 0.3s;
}

.contact-link:hover {
    background: var(--cyan);
    color: var(--black);
}

.contact-code {
    margin-top: 3rem;
    font-size: 0.75rem;
    color: var(--zinc-500);
    opacity: 0.5;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar-rail {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 0 1rem;
        border-right: none;
        border-top: 1px solid var(--zinc-700);
    }

    .rail-logo {
        margin-bottom: 0;
        margin-right: 1rem;
    }

    .rail-links {
        flex-direction: row;
    }

    .rail-grid-lines {
        display: none;
    }

    .scroll-container {
        margin-left: 0;
        margin-bottom: 60px;
    }

    .section-content {
        padding: 2rem 1.5rem;
    }
}
