:root {
    --bg-base: #050505;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --card-bg: rgba(20, 20, 25, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-bg: rgba(30, 30, 40, 0.8);
    --card-hover-border: rgba(138, 43, 226, 0.5);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 12px 48px rgba(138, 43, 226, 0.15);
    
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #d946ef 100%);
    --btn-bg: rgba(255, 255, 255, 0.05);
    --btn-hover-bg: rgba(255, 255, 255, 0.1);
    
    --status-live: #22c55e;
    --status-beta: #eab308;
    --status-wip: #ef4444;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* Background Canvas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

/* Animated Gradient Background Wrapper */
.page-wrapper {
    position: relative;
    z-index: 1;
}

.page-wrapper::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.08) 0%, rgba(217, 70, 239, 0.05) 30%, transparent 70%);
    animation: rotateBg 60s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Layout Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* HERO SECTION */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 2rem;
}

.hero-content {
    max-width: 800px;
}

.hero-logo {
    width: 80px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
    filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.4));
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 8vw, 8rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-tagline {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.hero-cta:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(217, 70, 239, 0.4);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 24px rgba(217, 70, 239, 0.15);
}

.hero-cta svg {
    color: #d946ef;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    opacity: 0.7;
    transition: opacity 0.3s ease;
    animation: bounce 2s infinite;
}

.scroll-indicator:hover {
    opacity: 1;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

/* PROJECTS SECTION */
.projects-section {
    padding: 6rem 0;
    min-height: 100vh;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Project Card */
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s ease, 
                box-shadow 0.4s ease,
                background 0.4s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--card-hover-border);
    background: var(--card-hover-bg);
    box-shadow: var(--card-hover-shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.project-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.live .status-dot { background: var(--status-live); box-shadow: 0 0 8px var(--status-live); }
.status-badge.beta .status-dot { background: var(--status-beta); box-shadow: 0 0 8px var(--status-beta); }
.status-badge.wip .status-dot { background: var(--status-wip); box-shadow: 0 0 8px var(--status-wip); }

.project-url {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-bottom: 1.5rem;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    flex-grow: 1;
    margin-bottom: 2rem;
}

.visit-btn {
    align-self: flex-start;
    padding: 0.75rem 1.5rem;
    background: var(--btn-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.visit-btn:hover {
    background: var(--btn-hover-bg);
    border-color: rgba(138, 43, 226, 0.4);
    transform: translateX(4px);
    box-shadow: 0 0 12px rgba(138, 43, 226, 0.2);
}

/* NOTICE SECTION */
.notice-section {
    padding-bottom: 6rem;
}

.notice-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: 800px;
    margin: 0 auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.notice-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(255, 255, 255, 0.15);
}

.notice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--status-beta) 0%, rgba(234, 179, 8, 0.1) 100%);
}

.notice-icon {
    flex-shrink: 0;
    color: var(--status-beta);
    background: rgba(234, 179, 8, 0.05);
    border: 1px solid rgba(234, 179, 8, 0.15);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notice-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.notice-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.notice-body p:last-child {
    margin-bottom: 0;
}

.notice-highlight {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--status-beta);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.25rem;
}

.notice-highlight .highlight-label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.notice-highlight p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.notice-solution strong {
    color: var(--text-primary);
}

/* FOOTER SECTION */
.site-footer {
    padding: 4rem 0;
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.bio {
    color: var(--text-secondary);
    max-width: 400px;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    color: var(--text-secondary);
    transition: color 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.875rem;
    opacity: 0.7;
    margin: 0;
}

.privacy-link {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.2);
    transition: color 0.2s ease;
}

.privacy-link:hover {
    color: var(--text-primary);
}

[data-theme="light"] .privacy-link {
    text-decoration-color: rgba(0, 0, 0, 0.2);
}

/* Notice Section Stack */
.notice-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Privacy Updated */
.privacy-updated {
    margin-top: 3rem;
    font-size: 0.9rem;
    opacity: 0.5;
}

/* Light Theme */
[data-theme="light"] {
    --bg-base: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.08);
    --card-hover-bg: rgba(255, 255, 255, 0.9);
    --card-hover-border: rgba(138, 43, 226, 0.5);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --card-hover-shadow: 0 12px 48px rgba(138, 43, 226, 0.1);
    
    --btn-bg: rgba(0, 0, 0, 0.05);
    --btn-hover-bg: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .page-wrapper::before {
    background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.05) 0%, rgba(217, 70, 239, 0.03) 30%, transparent 70%);
}

[data-theme="light"] .hero-cta {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .hero-cta:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .notice-highlight {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .navbar {
    background: rgba(248, 250, 252, 0.85);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .filter-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .filter-btn.active {
    background: rgba(138, 43, 226, 0.1);
    border-color: rgba(138, 43, 226, 0.3);
    color: #8a2be2;
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .back-to-top {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

[data-theme="light"] .toast {
    background: #0f172a;
    color: #f8fafc;
}

/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.75rem 2rem;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    transform: translateY(-100%);
    transition: transform 0.3s ease, background 0.3s ease;
}

.navbar.visible {
    transform: translateY(0);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--btn-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--btn-hover-bg);
}

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Card Icon */
.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Filter Bar */
.projects-header {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.375rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: var(--btn-bg);
}

.filter-btn.active {
    background: rgba(138, 43, 226, 0.15);
    border-color: rgba(138, 43, 226, 0.3);
    color: #d946ef;
}

.project-card.hidden {
    display: none;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 90;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    color: var(--text-primary);
    border-color: rgba(138, 43, 226, 0.4);
    box-shadow: 0 4px 16px rgba(138, 43, 226, 0.15);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 200;
    padding: 0.75rem 1.5rem;
    background: rgba(5, 5, 5, 0.95);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Scroll Reveal Utilities */
.reveal-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-scale-up {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal-scale-up.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.reveal-slide-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-slide-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-slide-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-slide-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggering for Project Cards */
.projects-grid .project-card:nth-child(1) { transition-delay: 0.1s; }
.projects-grid .project-card:nth-child(2) { transition-delay: 0.2s; }
.projects-grid .project-card:nth-child(3) { transition-delay: 0.3s; }
.projects-grid .project-card:nth-child(4) { transition-delay: 0.4s; }

/* Accessibility: Focus Styles */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
    outline: 2px solid #d946ef;
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
.visit-btn:focus-visible,
.scroll-indicator:focus-visible,
.social-icon:focus-visible {
    outline: 2px solid #d946ef;
    outline-offset: 3px;
    border-radius: 4px;
}

.project-card:focus-visible {
    outline: 2px solid #d946ef;
    outline-offset: 3px;
}

/* === EASTER EGG: ENTER ANIMATION === */
.glitch-active {
    animation: glitchIn 0.8s ease-out forwards;
    will-change: filter, transform;
}

@keyframes glitchIn {
    0%   { filter: none; opacity: 1; transform: translate3d(0,0,0); }
    8%   { filter: hue-rotate(90deg) saturate(3); transform: translate3d(4px,-3px,0) skewX(3deg); }
    16%  { filter: hue-rotate(-135deg) brightness(2); transform: translate3d(-6px,5px,0) skewX(-4deg); }
    24%  { filter: invert(1) hue-rotate(180deg) contrast(1.5); transform: translate3d(3px,-6px,0) skewX(2deg); }
    32%  { filter: hue-rotate(270deg) saturate(4) brightness(0.3); transform: translate3d(-5px,2px,0) skewX(-3deg); }
    40%  { filter: brightness(3) contrast(0.4); transform: translate3d(6px,-1px,0) skewX(5deg); }
    50%  { filter: hue-rotate(45deg) saturate(2) brightness(0.1); transform: translate3d(-2px,6px,0) skewX(-2deg); }
    65%  { filter: brightness(0.5) contrast(2) hue-rotate(300deg); transform: translate3d(3px,-4px,0); }
    80%  { filter: brightness(0.2); transform: translate3d(-1px,2px,0); }
    100% { filter: brightness(0); opacity: 0; transform: translate3d(0,0,0); }
}

/* Ferris wheel terminal entrance */
.terminal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.terminal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.terminal-window {
    width: 100%;
    max-width: 720px;
    background: #0d0d0d;
    border: 1px solid rgba(0, 255, 65, 0.15);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 255, 65, 0.05), 0 0 120px rgba(0, 255, 65, 0.02);
    transform: translateY(80px) rotateX(45deg) scale(0.5);
    opacity: 0;
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    will-change: transform;
}

.terminal-overlay.active .terminal-window {
    transform: translateY(0) rotateX(0deg) scale(1);
    opacity: 1;
    transition-delay: 0.25s;
}

/* === EASTER EGG: EXIT ANIMATION === */
.glitch-active-reverse {
    animation: glitchOut 0.6s ease-out forwards;
    will-change: filter, transform;
}

@keyframes glitchOut {
    0%   { filter: brightness(0); opacity: 0; transform: translate3d(0,0,0); }
    20%  { filter: brightness(2) contrast(0.4); transform: translate3d(-3px,2px,0) skewX(-2deg); }
    40%  { filter: hue-rotate(270deg) saturate(3) brightness(0.6); transform: translate3d(4px,-3px,0) skewX(3deg); }
    60%  { filter: invert(1) brightness(1.5); transform: translate3d(-2px,3px,0) skewX(-1deg); }
    80%  { filter: brightness(1.2); transform: translate3d(1px,-1px,0); }
    100% { filter: none; opacity: 1; transform: translate3d(0,0,0); }
}

/* Smooth terminal scale-out */
.terminal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.terminal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.terminal-overlay.closing {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.terminal-window {
    width: 100%;
    max-width: 720px;
    background: #0d0d0d;
    border: 1px solid rgba(0, 255, 65, 0.15);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 255, 65, 0.05), 0 0 120px rgba(0, 255, 65, 0.02);
    transform: translateY(80px) rotateX(45deg) scale(0.5);
    opacity: 0;
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
    will-change: transform;
}

.terminal-overlay.active .terminal-window {
    transform: translateY(0) rotateX(0deg) scale(1);
    opacity: 1;
    transition-delay: 0.25s;
}

.terminal-overlay.closing .terminal-window {
    transform: translateY(-60px) rotateX(-30deg) scale(0.6);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 1, 1), opacity 0.4s ease;
}

/* Smooth vignette wipe */
.vignette-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 0%, transparent 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease;
}

.vignette-overlay.active {
    opacity: 1;
    visibility: visible;
    background: radial-gradient(circle at center, transparent 0%, #000 100%);
}

/* Checkerboard transition overlay */
.checkerboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.checkerboard-overlay.active {
    opacity: 1;
    visibility: visible;
}

.checkerboard-overlay canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #111;
    border-bottom: 1px solid rgba(0, 255, 65, 0.1);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
    margin-left: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: rgba(0, 255, 65, 0.4);
}

.terminal-body {
    position: relative;
    padding: 1.25rem;
    min-height: 340px;
    max-height: 70vh;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #00ff41;
    cursor: text;
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 65, 0.15);
    border-radius: 3px;
}

.terminal-output {
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-output .line {
    margin-bottom: 2px;
}

.terminal-output .line.system {
    color: rgba(0, 255, 65, 0.6);
}

.terminal-output .line.success {
    color: #00ff41;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

.terminal-output .line.error {
    color: #ff5f57;
}

.terminal-output .line.info {
    color: #febc2e;
}

.terminal-output .line.ascii {
    color: rgba(0, 255, 65, 0.7);
    line-height: 1.15;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.terminal-prompt {
    color: #00ff41;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
    flex-shrink: 0;
}

.terminal-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #00ff41;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    caret-color: #00ff41;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #00ff41;
    animation: blink 1s step-end infinite;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(0, 255, 65, 0.5);
}

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

.terminal-input:focus ~ .terminal-cursor {
    animation: blink 1s step-end infinite;
}

/* Scanline overlay */
.terminal-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 65, 0.03) 0px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1;
}

/* Checkerboard exit transition */
.checkerboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.checkerboard-overlay.active {
    opacity: 1;
    visibility: visible;
}

.checkerboard-overlay canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Hub page reveal after checkerboard */
.hub-reveal {
    animation: hubReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hubReveal {
    0% { filter: brightness(0); transform: scale(1.03); }
    100% { filter: brightness(1); transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .projects-section {
        padding: 4rem 0;
    }
    .hero-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
    .hero-cta {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }
    .notice-section {
        padding-bottom: 4rem;
    }
    .notice-card {
        flex-direction: column;
        gap: 1.25rem;
        padding: 1.5rem;
    }
    .site-footer {
        padding: 2.5rem 0;
    }
    .navbar {
        padding: 0.75rem 1.25rem;
    }
    .nav-link {
        font-size: 0.8rem;
    }
    .nav-links {
        gap: 1rem;
    }
    .filter-bar {
        gap: 0.25rem;
        padding: 0.25rem;
    }
    .filter-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    .back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 40px;
        height: 40px;
    }
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .page-wrapper::before {
        animation: none;
    }
    
    .reveal-fade-up,
    .reveal-scale-up,
    .reveal-slide-left,
    .reveal-slide-right {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .glitch-active,
    .glitch-active-reverse {
        animation: none !important;
    }

    .terminal-cursor {
        animation: none !important;
        opacity: 1;
    }

    .terminal-overlay {
        transition: none !important;
    }

    .terminal-overlay.closing {
        transition: none !important;
        opacity: 0 !important;
    }

    .terminal-window {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .vignette-overlay {
        transition: none !important;
    }

    .checkerboard-overlay {
        transition: none !important;
    }

    .hub-reveal {
        animation: none !important;
        filter: none !important;
    }
}
