/* ===========================
   Root Variables
=========================== */
:root {
    --bg-dark: #1A1D21;
    --bg-dark-2: #202328;
    --bg-panel: #1F232A;
    --accent-blue: #3A7AFE;
    --accent-blue-soft: #5A8CFF;
    --text-primary: #E6EAF0;
    --text-secondary: #AEB4BE;
    --text-muted: #7A808A;
    --divider: #2A2E34;
}

/* ===========================
   Layout
=========================== */
html {
    overflow-x: hidden;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ===========================
   Navigation
=========================== */
.main-nav {
    background: #1A1D21;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.nav-links a {
    color: #1e40af;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.nav-links a.active {
    color: #ff2b3b;
    border-bottom: 2px solid #ff2b3b;
    border-radius: 0;
}

/* Resume nav link (was download button — now clean text link to resume.html) */
.resume-link {
    font-weight: 600;
    margin-left: 6px;
}

/* Mobile: stack nav rows so logo and links don't crowd */
@media (max-width: 640px) {
    .main-nav {
        flex-direction: column;
        padding: 10px 12px;
        gap: 8px;
    }
    .nav-links {
        justify-content: center;
        width: 100%;
    }
    .nav-links a {
        padding: 6px 8px;
        font-size: 0.95rem;
    }
}

/* ===========================
   Header
=========================== */
header {
    background: #1A1D21;
    color: white;
    padding: 60px 20px 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}

header::before {
    content: "";
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 100vw);
    height: 900px;
    background: radial-gradient(
        circle,
        rgba(255,255,255,0.08) 0%,
        rgba(255,255,255,0) 70%
    );
    z-index: -1;
}

/* ===========================
   Body Background
=========================== */
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(to bottom, var(--bg-dark), var(--bg-dark-2));
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Metallic Noise Texture */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        90deg,
        rgba(255,255,255,0.015) 0px,
        rgba(255,255,255,0.015) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: 0.25;
    z-index: 0;
}

/* ===========================
   Typography
=========================== */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

h1 {
    font-size: clamp(1.75rem, 6vw, 2.8rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h2 {
    font-size: 1.8rem;
    color: var(--accent-blue);
}

/* ===========================
   Section Styling
=========================== */
section {
    background: var(--bg-panel);
    margin: 40px auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 900px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
}

section:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}

/* ===========================
   Links
=========================== */
a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
    color: var(--accent-blue-soft);
    text-shadow: 0 0 8px var(--accent-blue-soft);
}

/* ===========================
   Buttons
=========================== */
button, .btn {
    background: var(--accent-blue);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

button:hover, .btn:hover {
    background: var(--accent-blue-soft);
    box-shadow: 0 0 12px var(--accent-blue-soft);
}

/* ===========================
   Lists
=========================== */
ul {
    padding-left: 20px;
}

li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ===========================
   Footer
=========================== */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===========================
   JR Circuit Header
=========================== */
.circuit-header {
    width: 100%;
    height: 60px;
    background: #0f0f11;
    border-bottom: 1px solid #1a1a1d;
    display: flex;
    align-items: center;
    padding-left: 20px;
    position: relative;
}

.header-logo {
    display: flex;
    align-items: center;
}

.jr-icon {
    width: 48px;
    height: auto;
}

.trace-static {
    stroke: #ff2b3b;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.node {
    fill: #ff2b3b;
    filter: url(#redGlowHeader);
}

.header-line {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 43, 59, 0.0) 0%,
        rgba(255, 43, 59, 0.6) 40%,
        rgba(255, 43, 59, 0.0) 100%
    );
    box-shadow: 0 0 8px rgba(255, 43, 59, 0.4);
}

/* Glow Pulse */
@keyframes bracketPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 43, 59, 0.4); }
    50% { box-shadow: 0 0 10px rgba(255, 43, 59, 0.7); }
}

.circuit-bracket {
    animation: bracketPulse 4s ease-in-out infinite;
}


/* ===========================
   Project Sections
=========================== */
.projects {
    padding: 40px 20px;
    margin-bottom: 40px;
    border-bottom: 1px solid #222;
    box-sizing: border-box;
}

.projects h2 {
    margin-bottom: 10px;
}

.projects p {
    margin-bottom: 20px;
}

/* ===========================
   Project Cards
=========================== */
.project-list {
    display: grid;
    gap: 24px;
}

.project-card {
    background: #111;
    padding: 24px;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: #ff4444;
}

.project-card h3 a {
    color: #ff4444;
}

.project-card ul {
    margin-top: 12px;
    padding-left: 20px;
}

.project-card li {
    margin-bottom: 6px;
    line-height: 1.4;
}

/* ===========================
   Fade-In Animation
=========================== */
.fade-in {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   SVG & Image Overflow Safety
=========================== */
svg {
    max-width: 100%;
    height: auto;
}

.footer-logo {
    max-width: 120px;
    width: 100%;
}

/* ===========================
   Mobile Responsive (tight)
=========================== */
@media (max-width: 480px) {
    h1 {
        font-size: 1.6rem;
    }
    h2 {
        font-size: 1.35rem;
    }
    section {
        padding: 20px 16px;
        margin: 24px auto;
    }
    .container {
        padding: 0 12px;
    }
    .projects {
        padding: 24px 12px;
    }
    .project-card {
        padding: 16px;
    }
    .main-nav {
        padding: 8px 10px;
    }
    .nav-links a {
        padding: 6px 6px;
        font-size: 0.85rem;
    }
}
