/* ── Design Tokens ─────────────────────────────────────── */
:root {
    --bg: #0a0a0a;
    --surface: #111111;
    --border: #1e1e1e;
    --muted: #3a3a3a;
    --text: #e8e8e8;
    --subtle: #666666;
    --accent: #00ffa3;
    --accent-dim: #00ffa320;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
}

/* ── Background grid texture ───────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* ── Everything sits above the grid ───────────────────── */
nav,
main,
footer {
    position: relative;
    z-index: 1;
}

/* ── Sticky Nav ────────────────────────────────────────── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: #0a0a0acc;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

.nav-logo {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.05em;
}

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

.nav-links a {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--subtle);
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}

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

/* ── Hero ──────────────────────────────────────────────── */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    max-width: 860px;
    margin: 0 auto;
}

.hero-tag {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-name {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--text);
    line-height: 1.05;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-tagline {
    font-family: 'DM Mono', monospace;
    font-size: clamp(14px, 2vw, 18px);
    color: var(--subtle);
    max-width: 540px;
    line-height: 1.6;
    min-height: 2.4em;
}

/* ── Blinking cursor ───────────────────────────────────── */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--accent);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

blockquote p {
    text-wrap: balance;
    /* Prevents awkward single words on new lines */
}

/* Optional: Add a subtle glow to the quote text */
blockquote p:hover {
    color: #fff;
    text-shadow: 0 0 30px var(--accent-dim);
    transition: all 0.5s ease;
}

/*--- Now Section ----- */
#now-content {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 1.0s ease-out;
}

#now-content.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cursor-mini {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--accent);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- Timeline Refinements --- */
.timeline-item {
    position: relative;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

#stories .border-l {
    border-left-width: 1px;
    border-image: linear-gradient(to bottom,
            var(--accent) 0%,
            var(--muted) 50%,
            transparent 100%) 1 100%;
}

.timeline-item:hover div.absolute {
    box-shadow: 0 0 15px var(--accent);
    transform: scale(1.3);
    background-color: #fff;
}

/* --- Project Card Refinements --- */
.project-card {
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out,
        border-color 0.3s, box-shadow 0.3s;
}

.project-card.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(400px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(0, 255, 163, 0.04), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.project-card:hover {
    border-color: var(--accent-dim);
    box-shadow: 0 0 20px rgba(0, 255, 163, 0.05);
}

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

.project-card h3 {
    letter-spacing: -0.01em;
}

/* --- Ambient Marquee --- */
.skill-stream-container {
    width: 100%;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    overflow: hidden;
    background: var(--bg);
    position: relative;
    z-index: 10;
    display: flex;
}

/* --- Ambient Marquee --- */
.animate-marquee {
    display: flex;
    gap: 3rem;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;

    /* FIXED: Using a system token for readable contrast */
    color: var(--accent);

    white-space: nowrap;
    animation: scrollStream 30s linear infinite;
    will-change: transform;
}

.animate-marquee:hover {
    animation-play-state: paused;
    /* Bring to full opacity/brightness on hover */
    /* color: var(--accent);
    transition: color 0.3s ease; */
}

@keyframes scrollStream {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ── Scroll hint ────────────────────────────────────────── */
.scroll-hint {
    margin-top: 4rem;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scroll-hint::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--muted);
}

/* ── Welcome overlay ───────────────────────────────────── */
#welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    animation: overlayFade 0.6s ease 1s forwards;
}

.welcome-word {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.35em;
    text-transform: uppercase;
}

.welcome-line {
    width: 40px;
    height: 1px;
    background: var(--accent);
    opacity: 0.4;
}

@keyframes overlayFade {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ── Reading List ── */
.read-item {
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.read-item.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.read-item h3.text-\[var\(--muted\)\] {
    color: var(--muted);
}

/* ── Footer ── */
footer {
    transition: opacity 1s ease;
}

footer a {
    text-decoration: none;
    letter-spacing: 0.1em;
}

footer .animate-ping {
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {

    75%,
    100% {
        transform: scale(2);
        opacity: 0;
    }
}