/* ===================================================================
   DESIGN TOKENS
=================================================================== */

/* 1. Define the custom font */
@font-face {
    font-family: 'Varem';
    src: url('../fonts/Varem.ttf') format('truetype');
}

/* 2. Apply it to elements */
body {
    font-family: 'Varem', sans-serif;
}

:root {
    --ink: #000000;
    --ink-soft: rgba(255,255,255,0.05);
    --paper: rgba(0,0,0,0.96);
    --panel: rgba(0,0,0,0.9);
    --line: rgba(255,255,255,0.12);
    --line-dark: rgba(255,255,255,0.2);

    --text: #ffffff;
    --text-soft: rgba(255,255,255,0.94);
    --muted: rgba(255,255,255,0.7);
    --on-dark: #ffffff;
    --on-dark-muted: rgba(255,255,255,0.65);

    --accent: #ff0a15;
    --accent-bright: #ff3546;
    --accent-soft: rgba(255,10,21,0.16);

    --font-display: 'Varem', sans-serif;
    --font-body: 'Varem', sans-serif;
    --font-mono: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

    --radius: 10px;
    --nav-h: 68px;
}

#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75); /* 0.5 = 50% black darkness */
    z-index: 0;
}

* { box-sizing: border-box; }

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 100% 4px;
    opacity: 0.3;
    animation: scanline 10s linear infinite;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at top, rgba(255,10,21,0.06), transparent 17%),
                radial-gradient(circle at 80% 15%, rgba(255,10,21,0.05), transparent 14%),
                radial-gradient(circle at 20% 70%, rgba(255,255,255,0.03), transparent 12%);
    opacity: 0.55;
    z-index: 0;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.85s ease-out, transform 0.85s ease-out;
    will-change: opacity, transform;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@keyframes scanline {
    from { background-position: 0 0; }
    to { background-position: 0 100%; }
}

@keyframes glowPulse {
    from { text-shadow: 0 0 0 rgba(255,10,21,0); }
    to { text-shadow: 0 0 28px rgba(255,10,21,0.18); }
}

@keyframes flicker {
    0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% { opacity: 1; }
    20%, 21.999%, 63%, 63.999%, 65%, 69.999% { opacity: 0.8; }
}

html {
    scroll-behavior: smooth;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    will-change: opacity, transform;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

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

.page-loaded .hero h1,
.page-loaded .hero p.lede,
.page-loaded .hero .tag-row,
.page-loaded .hero .btn-row,
.page-loaded .hero .terminal {
    animation: fadeInUp 0.75s ease-out both;
}

.page-loaded .hero h1 { animation-delay: 0.1s; }
.page-loaded .hero p.lede { animation-delay: 0.18s; }
.page-loaded .hero .tag-row { animation-delay: 0.26s; }
.page-loaded .hero .btn-row { animation-delay: 0.34s; }
.page-loaded .hero .terminal { animation-delay: 0.42s; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--paper);
    margin: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--text-soft);
    margin: 0;
}

a { color: inherit; text-decoration: none; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.eyebrow::before {
    content: "//";
    color: var(--muted);
}

.section {
    min-height: calc(100vh - var(--nav-h));
    padding: 4rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-margin-top: var(--nav-h);
}

@media (max-width: 820px) {
    .section {
        min-height: 0;
        padding: 4rem 0;
    }
}

.section-head {
    max-width: 640px;
    margin-bottom: 3rem;
}

.section-head h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.15;
}

.container-narrow {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===================================================================
   NAV
=================================================================== */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,10,21,0.25);
    box-shadow: inset 0 -1px 0 rgba(255,10,21,0.12);
}

.site-nav .container-narrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    color: var(--on-dark);
    font-size: 1rem;
    text-shadow: 0 0 12px rgba(255,10,21,0.18);
    animation: flicker 8s linear infinite both;
}

.brand img {
    width: 30px;
    height: 30px;
    border-radius: 6px;
}

.brand .dot { color: var(--accent-bright); }

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

.nav-links a {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--on-dark-muted);
    transition: color 0.2s ease;
}

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

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    color: var(--on-dark);
    padding: 0.4rem 0.6rem;
    font-family: var(--font-mono);
}

@media (max-width: 820px) {
    .nav-links {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--ink);
        flex-direction: column;
        gap: 0;
        border-bottom: 1px solid var(--line-dark);
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links li { border-top: 1px solid var(--line-dark); }
    .nav-links a { display: block; padding: 1rem 1.5rem; }
    .nav-toggle { display: block; }
}

/* ===================================================================
   HERO (dark, terminal)
=================================================================== */
.hero {
    background: var(--ink);
    color: var(--on-dark);
    padding: 3rem 0;
    position: relative;
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    scroll-snap-align: start;
}

.hero .hero-grid { width: 100%; }

@media (max-width: 900px) {
    .hero { min-height: 0; padding: 3.5rem 0; }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 {
    color: var(--on-dark);
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: 1.05;
    margin-bottom: 1.2rem;
}

.hero h1 span {
    color: var(--accent-bright);
    text-shadow: 0 0 18px rgba(255,10,21,0.22);
    animation: glowPulse 2.4s ease-in-out infinite alternate;
}

.hero p.lede {
    color: var(--on-dark-muted);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    max-width: 46ch;
    margin-bottom: 2rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2.2rem;
}

.tag {
    font-family: var(--font-body);
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--line-dark);
    border-radius: 100px;
    color: var(--on-dark-muted);
}

.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.8rem 1.4rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-bright); }

.btn-ghost {
    border-color: var(--line-dark);
    color: var(--on-dark);
}
.btn-ghost:hover { border-color: var(--on-dark-muted); }

/* .btn-ghost-light {
    border-color: var(--line);
    color: var(--text);
}
.btn-ghost-light:hover { border-color: var(--muted); } */

/* Terminal window */
.terminal {
    background: var(--ink-soft);
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--line-dark);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.terminal-dot.red { background: var(--accent); box-shadow: 0 0 10px rgba(255,10,21,0.45); }
.terminal-dot.yellow { background: rgba(255,255,255,0.9); }
.terminal-dot.green { background: var(--accent-bright); }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--on-dark-muted);
    margin-left: 0.5rem;
}

.terminal-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    line-height: 1.7;
    min-height: 220px;
}

.terminal-body .prompt { color: var(--accent); }
.terminal-body .path { color: rgba(255,255,255,0.9); }
.terminal-body .out { color: var(--on-dark-muted); }
.terminal-body .accent-text { color: var(--accent-bright); }

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: var(--on-dark);
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ===================================================================
   ABOUT
=================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 820px) {
    .about-grid { grid-template-columns: 1fr; }
}

.profile-frame {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel);
}

.profile-frame img {
    width: 100%;
    display: block;
    filter: grayscale(35%);
    transition: filter 0.4s ease;
}
.profile-frame:hover img { filter: grayscale(0%); }

.about-copy p {
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 1.2rem;
}

.stat-row {
    display: flex;
    gap: 2.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat b {
    font-family: var(--font-display);
    font-size: 1.8rem;
    display: block;
    color: var(--text-soft);
}

.stat span {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

/* ===================================================================
   SKILLS
=================================================================== */
.skills-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.skills-panel .terminal-bar { background: var(--paper); border-color: var(--line); }
.skills-panel .terminal-title { color: var(--muted); }

.skills-body { padding: 2rem; }

.skill-group {
    margin-bottom: 1.6rem;
}

.skill-group:last-child { margin-bottom: 0; }

.skill-group h4 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 0.8rem;
}

.skill-group h4::before { content: "\"" attr(data-key) "\": "; color: var(--muted); }

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.chip {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    color: var(--text-soft);
}

/* ===================================================================
   EXPERIENCE (timeline)
=================================================================== */
.timeline {
    border-left: 2px solid var(--line);
    margin-left: 0.6rem;
}

.timeline-item {
    position: relative;
    padding: 0 0 2.4rem 2rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--accent);
}

.timeline-year {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    margin-bottom: 0.3rem;
    display: block;
}

.timeline-item h4 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

.timeline-item p {
    color: var(--muted);
    max-width: 60ch;
    line-height: 1.65;
    margin: 0;
}

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

/* ===================================================================
   PROJECTS (file-tab cards)
=================================================================== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
}

/* Mobile view (screens 768px wide or smaller) */
@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr; /* Switch to a single column */
        gap: 2rem;                 /* Reduce gap for smaller screens */
    }
}

.project-card {
    background: rgba(0,0,0,0.84);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
    transform: scale(1.1);
    box-shadow: 0 18px 44px rgba(255,10,21,0.18);
    border-color: rgba(255,10,21,0.35);
}

.file-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.file-tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.project-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.project-body { padding: 1.3rem 1.4rem 1.5rem; flex: 1; display: flex; flex-direction: column; }

.project-body h4 { font-size: 1.15rem; margin-bottom: 0.3rem; }

.project-cat {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.7rem;
}

.project-body p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
}

.project-body .btn { margin-top: 1rem; align-self: flex-start; }

/* ===================================================================
   CONTACT
=================================================================== */
.contact-wrap {
    background: rgba(0,0,0,0.95);
    border: 1px solid rgba(255,10,21,0.18);
    box-shadow: 0 40px 80px rgba(255,10,21,0.08);
    border-radius: 20px;
    padding: 3.5rem;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3rem;
    color: var(--on-dark);
}

@media (max-width: 820px) {
    .contact-wrap { grid-template-columns: 1fr; padding: 2rem; }
}

.contact-lede {
    font-family: var(--font-mono);
    color: var(--on-dark-muted);
    margin-top: 1rem;
    max-width: 40ch;
}

.contact-wrap h2 { color: var(--on-dark); }

.contact-wrap .eyebrow { color: var(--accent-bright); }

.contact-list { list-style: none; padding: 0; margin: 2rem 0; }
.contact-list li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0;
    border-top: 1px solid var(--line-dark);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}
.contact-list li:last-child { border-bottom: 1px solid var(--line-dark); }
.contact-list i { color: var(--accent-bright); width: 18px; }

.social-row { display: flex; gap: 0.8rem; }
.social-row a {
    width: 40px; height: 40px;
    border: 1px solid var(--line-dark);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--on-dark-muted);
    transition: all 0.2s ease;
}
.social-row a:hover { color: var(--on-dark); border-color: var(--on-dark-muted); }

.form-field { margin-bottom: 1.2rem; }
.form-field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--on-dark-muted);
    margin-bottom: 0.4rem;
}
.form-field input, .form-field textarea {
    width: 100%;
    background: var(--ink-soft);
    border: 1px solid var(--line-dark);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    color: var(--on-dark);
    font-family: var(--font-mono);
    font-size: 0.92rem;
}
.form-field input:focus, .form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.field-msg { font-family: var(--font-mono); font-size: 0.72rem; margin-top: 0.3rem; display: block; }

#formStatus {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
#formStatus.ok { background: rgba(255,10,21,0.12); color: #fff; border: 1px solid rgba(255,10,21,0.35); }
#formStatus.err { background: rgba(255,10,21,0.18); color: #fff; border: 1px solid rgba(255,10,21,0.55); }

/* ===================================================================
   FOOTER
=================================================================== */
.site-footer {
    background: var(--ink);
    color: var(--on-dark-muted);
    padding: 2rem 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-align: center;
    border-top: 1px solid var(--line-dark);
}

@media (prefers-reduced-motion: reduce) {
    .cursor { animation: none; }
    .project-card { transition: none; }
}
