@font-face {
    font-family: 'EB Garamond';
    font-style: italic;
    font-weight: 500;
    font-display: swap;
    src: url('./assets/fonts/EBGaramond-Italic-500.woff2') format('woff2');
}

:root {
    /* DEFAULT: Dark Mode (Apple-inspired) */
    color-scheme: dark;
    --bg-color: #14151a;
    --grid-line: rgba(255, 255, 255, 0.025);
    --primary: #f7f7f9;
    --text-secondary: rgba(247, 247, 249, 0.78);
    --accent: #0a84ff;
    --accent-secondary: rgba(100, 210, 255, 0.9);
    --alert: #ff453a;
    --glass: rgba(26, 27, 32, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 18px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --surface: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(255, 255, 255, 0.1);
    --hairline: rgba(255, 255, 255, 0.1);
    --glow: rgba(10, 132, 255, 0.2);
    --intro-color: rgba(247, 247, 249, 0.94);
    --intro-glow: rgba(10, 132, 255, 0.18);
    --bg-gradient: radial-gradient(1200px 800px at 10% -10%, rgba(120, 150, 255, 0.2), transparent 60%),
        radial-gradient(900px 700px at 90% 0%, rgba(110, 220, 255, 0.14), transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 60%);

    /* Layout */
    --page-pad-x: 24px;
    --page-pad-y: 72px;
    --grid-gap: 18px;
    --card-pad: 30px;
    --stack-gap: 16px;

    /* Typography */
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    --font-mono: "SF Mono", ui-monospace, "Menlo", "Consolas", monospace;

    /* Transition for Theme Switching */
    transition: background-color 0.5s, color 0.5s;
}

/* DARK MODE OVERRIDES */
/* LIGHT MODE OVERRIDES */
[data-theme="light"] {
    color-scheme: light;
    --bg-color: #f5f5f7;
    --grid-line: rgba(16, 19, 24, 0.04);
    --primary: #1d1d1f;
    --text-secondary: rgba(29, 29, 31, 0.65);
    --accent: #0071e3;
    --accent-secondary: rgba(90, 200, 250, 0.9);
    --alert: #ff3b30;
    --glass: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(16, 19, 24, 0.1);
    --glass-shadow: 0 18px 40px rgba(17, 21, 28, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --border: rgba(16, 19, 24, 0.18);
    --surface: rgba(16, 19, 24, 0.04);
    --surface-strong: rgba(16, 19, 24, 0.08);
    --hairline: rgba(16, 19, 24, 0.12);
    --glow: rgba(0, 113, 227, 0.2);
    --intro-color: rgba(29, 29, 31, 0.9);
    --intro-glow: rgba(0, 113, 227, 0.16);
    --bg-gradient: radial-gradient(1200px 800px at 10% -10%, rgba(10, 132, 255, 0.12), transparent 60%),
        radial-gradient(900px 700px at 90% 0%, rgba(90, 200, 250, 0.1), transparent 55%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.02), transparent 60%);
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Base Reset & Settings */
html {
    background-color: var(--bg-color);
    overflow-x: hidden;
    overscroll-behavior-x: none;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

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

body {
    background-color: transparent;
    color: var(--primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    overflow-y: auto;
    display: block;
    background-image: var(--bg-gradient);
    background-size: cover;
    background-attachment: fixed;
    -webkit-tap-highlight-color: transparent;

    /* Guideline: Touch & Layout */
    touch-action: pan-y;
    padding: calc(var(--page-pad-y) + env(safe-area-inset-top)) calc(var(--page-pad-x) + env(safe-area-inset-right)) calc(var(--page-pad-y) + env(safe-area-inset-bottom)) calc(var(--page-pad-x) + env(safe-area-inset-left));
}

/* Guideline: Accessibility Focus */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 2px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: none;
    background: var(--glass);
    color: var(--primary);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transform: translateY(-150%);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.skip-link:focus-visible {
    transform: translateY(0);
}

#main {
    scroll-margin-top: calc(var(--page-pad-y) + 24px);
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background-color: var(--bg-color);
    /* The actual opaque background layer */
}

/* Effects Overlays */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.05"/%3E%3C/svg%3E');
    pointer-events: none;
    z-index: 99;
    opacity: 0.05;
    mix-blend-mode: soft-light;
}

.scanline {
    display: none;
}

.intro-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    background-image: var(--bg-gradient);
    z-index: 1000;
    opacity: 1;
    animation: introOverlay 4.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    will-change: opacity;
}

.intro-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 60% at 50% 40%, rgba(255, 255, 255, 0.18), transparent 60%);
    opacity: 0.5;
    pointer-events: none;
    animation: introHalo 3.2s ease-in-out infinite;
    transform-origin: center;
}

.intro-text {
    position: relative;
    font-family: "EB Garamond", "New York", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", serif;
    font-style: italic;
    font-size: clamp(3.2rem, 8.2vw, 7.6rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    color: var(--intro-color);
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    opacity: 1;
    text-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    animation: introTextFade 4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
        introGlow 2.6s ease-in-out infinite;
    --char-stagger: 0.045s;
    will-change: opacity, text-shadow, transform;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-kerning: normal;
}

.intro-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px) scale(1.02);
    animation: introChar 2.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: calc(var(--i) * var(--char-stagger) + 0.2s);
    will-change: opacity, transform;
}

body.intro-done .intro-overlay {
    opacity: 0;
    pointer-events: none;
}

.hud-header,
.grid-container,
.section-projects {
    transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
        filter 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.intro-active .hud-header,
body.intro-active .grid-container,
body.intro-active .section-projects {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(8px);
}

body.intro-active .bento-box {
    animation-play-state: paused;
}



/* HUD Header */
.hud-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: 0.08em;
    z-index: 10;
    background: linear-gradient(180deg, rgba(17, 17, 20, 0.72), rgba(17, 17, 20, 0));
    border-bottom: 1px solid var(--hairline);
    backdrop-filter: blur(14px) saturate(160%);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hud-btn {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 11px;
    padding: 6px 12px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, border-color 0.3s;
    border-radius: 10px;
    letter-spacing: 0.12em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hud-btn:hover {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(10, 132, 255, 0.28);
}

.status-indicator .pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px rgba(10, 132, 255, 0.55);
    animation: blink 2s infinite;
}

.status-indicator {
    color: var(--text-secondary);
}

.time-display {
    color: var(--primary);
}

/* Bento Grid Layout */
/* Expanded Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "hero hero hero hero hero hero hero hero hero stats stats stats"
        "work work work work work work work work skills skills skills skills"
        "tools tools tools tools extra extra extra extra extra extra extra extra";
    gap: var(--grid-gap);
    width: min(1320px, 100%);
    max-width: 1320px;
    position: relative;
    margin: 0 auto 64px;
}

.grid-container::before,
.grid-container::after {
    content: '';
    position: absolute;
    inset: -40px;
    border-radius: 28px;
    pointer-events: none;
    z-index: -1;
}

.grid-container::before {
    background: radial-gradient(520px 320px at 15% 18%, rgba(10, 132, 255, 0.08), transparent 70%),
        radial-gradient(520px 320px at 85% 12%, rgba(255, 255, 255, 0.06), transparent 72%);
    filter: blur(16px);
}

.grid-container::after {
    border: 1px solid var(--hairline);
}

.bento-box {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)),
        var(--glass);

    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);

    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 18px;

    padding: var(--card-pad);
    position: relative;
    overflow: hidden;

    /* 3D Tilt Setup */
    transform-style: preserve-3d;
    transform: perspective(1000px);

    /* Orchestrated Entrance Animation */
    opacity: 0;
    animation: hudInit 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;

    transition: transform 0.2s, box-shadow 0.3s, border-color 0.3s;
}

/* Holographic Glare Effect */
.bento-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(255, 255, 255, 0.06) 0%,
            transparent 55%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2;
}

.bento-box:hover::before {
    opacity: 1;
}

/* Tech Decor Lines (Scan Overlay) */
.bento-box .deco-line {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent));
    opacity: 0.3;
}

/* Staggered Delays for "Cinematic Reveal" */
.bento-box:nth-child(1) {
    animation-delay: 0.1s;
}

/* Stats */
.bento-box:nth-child(2) {
    animation-delay: 0.2s;
}

/* Skills */
.bento-box:nth-child(3) {
    animation-delay: 0.3s;
}

/* Work */
.bento-box:nth-child(4) {
    animation-delay: 0.4s;
}

/* Tools */
.bento-box:nth-child(5) {
    animation-delay: 0.5s;
}

/* Summary */
.bento-box:nth-child(6) {
    animation-delay: 0.6s;
}

/* Contact */

@keyframes hudInit {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
        clip-path: inset(0 100% 0 0);
        /* Wipe effect */
    }

    50% {
        opacity: 0.5;
        clip-path: inset(0 0 0 0);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes introChar {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(1.02);
    }
    45% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes introTextFade {
    0%,
    68% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-2px);
    }
}

@keyframes introGlow {
    0%,
    100% {
        text-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    }
    50% {
        text-shadow: 0 14px 40px rgba(0, 0, 0, 0.22),
            0 0 18px var(--intro-glow);
    }
}

@keyframes introHalo {
    0%,
    100% {
        opacity: 0.45;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.04);
    }
}

@keyframes introOverlay {
    0%,
    78% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.bento-box::after {
    /* Tech Corner Marker (Top Right) */
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-top: 1px solid var(--hairline);
    border-right: 1px solid var(--hairline);
    transition: opacity 0.3s, width 0.3s, height 0.3s;
    opacity: 0;
}

.bento-box:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4), 0 0 18px var(--glow);
}

.bento-box:hover::before {
    width: 100%;
    height: 100%;
    opacity: 0.06;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.6));
}

.bento-box:hover::after {
    border-color: var(--accent);
    width: 15px;
    height: 15px;
}

/* 1. Hero Box */
.hero-box {
    grid-area: hero;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.glitch {
    font-family: var(--font-display);
    /* Responsive font size: min 2rem, preferred 5vw, max 6rem */
    font-size: clamp(2rem, 5vw, 6rem);
    line-height: 1;
    position: relative;
    color: var(--primary);
    white-space: nowrap;
    /* Prevent wrapping explosion */
    overflow: visible;
    /* Allow slight overlap if needed */
    letter-spacing: -0.02em;
    transition: color 0.3s;
}

.terminal-text {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-secondary);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    opacity: 0.85;
}

.terminal-text::before {
    content: '';
    width: 18px;
    height: 1px;
    background: var(--accent);
    opacity: 0.6;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.hero-left {
    display: flex;
    flex-direction: column;
}

.hero-right {
    border-left: 1px solid var(--hairline);
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hero-summary {
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.hero-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.hero-points li {
    border-left: 1px solid var(--hairline);
    padding-left: 12px;
}

.hero-info {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    flex-wrap: wrap;
}

.meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.contact-item {
    align-items: center;
}

.meta-label {
    color: var(--accent-secondary);
}

.meta-value {
    color: var(--text-secondary);
}

.copy-btn {
    border: 1px solid var(--hairline);
    background: rgba(15, 17, 24, 0.4);
    color: var(--accent-secondary);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.copy-btn:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 14px rgba(10, 132, 255, 0.35);
    transform: translateY(-1px);
}

.copy-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.copy-btn.is-copied {
    background: var(--accent-secondary);
    color: #0b0b0f;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 12px rgba(124, 92, 255, 0.35);
}

.meta-sep {
    color: var(--accent-secondary);
}

/* Fixed Role */
.role-fixed {
    font-family: var(--font-mono);
    color: var(--accent);
    margin: 20px 0;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* 2. Stats Box */
.stats-box {
    grid-area: stats;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
}

.stats-box .section-label {
    margin-bottom: 0.6rem;
}

.stat-row {
    font-family: var(--font-mono);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 10px;
}

.stat-row .label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-row .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.stat-suffix {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 3. Skills Radar */
.skills-box {
    grid-area: skills;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-wrap: balance;
}

.skill-tags .tag {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 10px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.2s;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.skill-tags {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.skill-tags .tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(10, 132, 255, 0.12);
    transform: translateY(-2px);
}

/* 4. Works */
.work-box {
    grid-area: work;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 460px;
    overflow-y: auto;
}

.work-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.work-item {
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 16px;
}

.work-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.work-role {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-top: 6px;
}

.work-detail {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 5. Tool Stack (New) */
.tools-box {
    grid-area: tools;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-content: flex-start;
}

.tool-chip {
    font-family: var(--font-body);
    font-size: 0.8rem;
    padding: 6px 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--hairline);
    border-radius: 999px;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

/* 6. Awards/Blog (New) */
.extra-box {
    grid-area: extra;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    /* Hide overflow on main container */
}

.extra-box .section-label {
    flex-shrink: 0;
    margin-bottom: 15px;
}

.summary-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.summary-list li {
    border-left: 1px solid var(--accent);
    padding-left: 12px;
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 15px 0;
    border-bottom: 1px solid var(--hairline);
    font-family: var(--font-mono);
    transition: color 0.3s, padding-left 0.3s, background-color 0.3s;
    color: var(--text-secondary);
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.project-item:hover {
    padding-left: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-secondary);
}

.project-item .year {
    opacity: 0.5;
    flex: 0 0 auto;
}

.project-item .name {
    flex: 1 1 12ch;
    min-width: 0;
    overflow-wrap: anywhere;
}

.project-item .type {
    flex: 0 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Lower Content Stack */
.section-projects {
    width: min(1320px, 92vw);
    margin: 0 auto 90px;
    display: flex;
    flex-direction: column;
    gap: var(--stack-gap);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.project-card {
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-secondary);
}

.project-role {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.project-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.project-list li {
    border-left: 1px solid var(--hairline);
    padding-left: 12px;
}

.project-impact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-impact span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    background: var(--surface);
    color: var(--primary);
}

/* Animations */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .bento-box {
        animation: none !important;
        opacity: 1;
        transform: none;
    }

    .radar-visual .scanning-line {
        animation: none !important;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --page-pad-x: 16px;
        --page-pad-y: 64px;
        --grid-gap: 16px;
        --card-pad: 24px;
        --stack-gap: 14px;
    }

    body {
        background-attachment: scroll;
    }

    .grid-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: auto;
        margin-bottom: 48px;
    }

    .grid-container::before,
    .grid-container::after {
        inset: -24px;
    }

    .glitch {
        font-size: clamp(2.6rem, 7vw, 4.6rem);
    }

    .cursor-target,
    .cursor-follower {
        display: none;
    }

    .section-projects {
        width: 100%;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    /* Hide custom cursor on touch */
    * {
        cursor: auto;
    }

    .work-box {
        overflow: visible;
    }

}

@media (max-width: 768px) {
    .grid-container::before,
    .grid-container::after {
        inset: 0;
    }
    :root {
        --page-pad-x: 14px;
        --page-pad-y: 88px;
        --card-pad: 22px;
    }

    .hud-header {
        padding: 14px 14px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .status-indicator {
        font-size: 11px;
    }

    .hud-btn {
        font-size: 10px;
        padding: 6px 10px;
    }

    .time-display {
        font-size: 11px;
        letter-spacing: 0.06em;
        white-space: nowrap;
    }

    .glitch {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .role-fixed {
        margin: 14px 0;
        font-size: 1rem;
    }

    .terminal-text {
        font-size: 0.68rem;
        letter-spacing: 0.14em;
    }

    .hero-layout {
        grid-template-columns: 1fr;
    }

    .hero-right {
        border-left: none;
        padding-left: 0;
        padding-top: 12px;
        border-top: 1px solid var(--hairline);
    }

    .hero-summary {
        font-size: 0.98rem;
    }

    .hero-info {
        padding: 12px 14px;
    }

    .section-label {
        font-size: 0.72rem;
    }

    .skill-tags {
        grid-template-columns: 1fr;
    }

    .project-grid {
        gap: 12px;
    }

    .project-card {
        padding: 20px;
        min-height: 0;
    }

    .project-title {
        font-size: 0.95rem;
    }

    .hero-info {
        font-size: 0.86rem;
        row-gap: 6px;
    }

    .copy-btn {
        font-size: 0.54rem;
        padding: 3px 8px;
        letter-spacing: 0.14em;
    }

    .meta-sep {
        display: none;
    }
}

@media (max-width: 520px) {
    :root {
        --page-pad-x: 12px;
        --page-pad-y: 102px;
        --grid-gap: 12px;
        --card-pad: 20px;
    }

    .hud-header {
        padding: 12px;
    }

    .hud-btn {
        padding: 6px 8px;
        letter-spacing: 0.1em;
    }

    .time-display {
        font-size: 10px;
    }

    .glitch {
        font-size: clamp(2.2rem, 10vw, 3.6rem);
    }

    .stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .stat-row .value {
        font-size: 1.5rem;
    }

    .tool-chip {
        font-size: 0.75rem;
    }

    .project-item {
        padding: 12px 0;
    }

    .intro-text {
        font-size: clamp(2.4rem, 9vw, 4.2rem);
        text-align: center;
    }
}
