/* Drawer/hamburger rules live in drawer.css */

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

:root {
    --white:      #ffffff;
    --off-white:  #f3f1ee;
    --off-off-white:  #c4c2c0;
    --grey:  #9b9a9a;
    --dark-grey:        #434343;
    --dark-background: #242526;
    --ink:        #1a1a1a;
    --muted:      #888;
    --border:     rgba(0,0,0,0.08);
    --light-border:     rgba(255, 255, 255, 0.08);
    --header-h:   52px;
}

html, body {
    min-height: 100%;
    overflow-x: hidden; /* prevents horizontal scroll only */
    overflow-y: auto;   /* allow vertical scroll */
    scroll-behavior: smooth;
    background: var(--off-white);
    color: var(--ink);
    font-family: 'Figtree', sans-serif;
    font-weight: 300;
}

header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: rgba(247, 245, 242, 0.85);
    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;
}

.header-logo {
    font-size: 1rem;
    text-decoration: none;
    color: var(--muted);
    letter-spacing: 0.01em;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.1s forwards;
}
.header-logo:hover { color: var(--ink); }

.header-title {
    text-align: center;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--muted);
    letter-spacing: 0.1em;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.2s forwards;
}

nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav a {
    font-family: 'Figtree', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}
nav a:nth-child(1) { animation-delay: 0.15s; }
nav a:nth-child(2) { animation-delay: 0.22s; }
nav a:nth-child(3) { animation-delay: 0.29s; }
nav a:nth-child(4) { animation-delay: 0.36s; }
nav a:hover { color: var(--ink); }

main {
    min-height: 100vh;
    padding-top: var(--header-h);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3rem 3rem 4rem;
    opacity: 0;
    animation: fadeUp 0.7s ease 0.3s forwards;
}

.eyebrow {
    font-family: 'retro', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

h1 {
    font-family: 'gloudy';
    font-size: clamp(3rem, 4vw, 5rem);
    font-weight: 300;
    line-height: 1.1;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-family: 'Figtree', serif;
    font-size: clamp(1rem, 1.1vw, 1.25rem);
    font-weight: 300;
    color: var(--muted);
    margin-bottom: 2.5rem;
    letter-spacing: 0.02em;
}

.links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.links-list li {
    border-top: 1px solid var(--border);
}
.links-list li:last-child {
    border-bottom: 1px solid var(--border);
}

.links-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    font-family: 'Figtree', serif;
    font-size: clamp(0.85rem, 0.85vw, 0.85rem);
    font-weight: 100;
    color: var(--ink);
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}

.links-list a:hover {
    color: var(--muted);
    padding-left: 0.5rem;
}

.links-list a .arrow {
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.links-list a:hover .arrow {
    opacity: 1;
}

.tag {
    font-family: 'retro';
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--border);
    padding: 2px 6px;
    border-radius: 2px;
}

/* ── RIGHT PANEL ─────────────────────────────────────── */
.right {
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.9s ease 0.5s forwards;
}

.gradient-blob {
    position: absolute;
    inset: 1.5rem;
    border-radius: 4px;
    background: 
        conic-gradient(from 200deg at 40% 60%,
            #a8edcc 0deg,
            #f9e070 60deg,
            #f7a541 120deg,
            #f06b8a 180deg,
            #c96ddb 240deg,
            #7b9ef7 300deg,
            #a8edcc 360deg
        );
    filter: blur(0px);
    animation: hueShift 12s linear infinite;
}

@keyframes hueShift {
    from { filter: hue-rotate(0deg); }
    to   { filter: hue-rotate(360deg); }
}

/* subtle grain overlay on gradient */
.gradient-blob::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 150px 150px;
    opacity: 0.4;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.footer-strip {
    font-family: 'Figtree', sans-serif;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--muted);
    background: rgba(247, 245, 242, 0.7);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    z-index: 100;
}

.mobile-popup {
    display: none; /* shown via JS */
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: min(90vw, 380px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    animation: slideUp 0.4s ease forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

.mobile-popup.hiding {
    animation: fadeOut 0.4s ease forwards;
}

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

.popup-title {
    font-family: 'retro';
    font-size: 1rem;
    font-weight: 400;
}

.popup-close {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'retro';
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    cursor: pointer;
    padding: 3px 10px;
    transition: color 0.2s, border-color 0.2s;
}
.popup-close:hover { color: var(--ink); border-color: var(--ink); }

.popup-body p {
    font-family: 'retro';
    font-size: 0.78rem;
    font-weight: 300;
    color: var(--muted);
    line-height: 1.6;
}

.end-of-page { 
    text-align: center; 
    margin-top: 0px;
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.45s forwards;
}

.end-of-page a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (max-width: 1024px) {
    nav { display: none; }
    .hamburger { display: flex; }
}

@media (max-width: 768px) {
    html, body {
        overflow: auto;
        height: auto;
    }

    main {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        min-height: unset;
        padding-top: var(--header-h);
        padding-bottom: 40px;
    }

    .left {
        padding: 2rem 1.5rem 3rem;
        order: 1;
    }

    .header-title {
        font-size: 0.75rem;
    }

    .right {
        order: 0;
        height: 55vw;
        min-height: 200px;
        max-height: 340px;
    }

    .gradient-blob { inset: 0; border-radius: 0; }

    nav { display: none; }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 0.6rem;
    }
}

@font-face {
    font-family: 'retro';
    src: url('./assets/fonts/Retro-Gaming.ttf') format('truetype');
}
.retro-text { font-family: 'retro'; }

@font-face {
    font-family: 'bmspa';
    src: url('./assets/fonts/BMSPA___.TTF') format('truetype');
}
.bmspa-text { font-family: 'bmspa'; }

@font-face {
    font-family: '04b03';
    src: url('./assets/fonts/04B_03__.TTF') format('truetype');
}
.b03-text { font-family: '04b03'; }

@font-face {
    font-family: 'blacksignature';
    src: url('./assets/fonts/BlackSignature.otf') format('opentype');
}
.blacksignature-text { font-family: 'blacksignature'; }

@font-face {
    font-family: 'mondwest';
    src: url('./assets/fonts/ppmondwest-regular.otf') format('opentype');
}
.mondwest-text { font-family: 'mondwest'; }

@font-face {
    font-family: 'gloudy';
    src: url('./assets/fonts/GloudyPixel-Regular.otf') format('opentype');
}
.gloudy-text { font-family: 'gloudy'; }

/* ── DARK MODE ───────────────────────────────────────── */
html.dark, body.dark {
    background-color: var(--dark-background);
}

body.dark main, body.dark #main {
    background-color:var(--dark-background);
}

body.dark main a {
    color: var(--off-white);
}

body.dark h1, body.dark h3 {
    color: var(--white);
}

body.dark .subtitle {
    color: var(--off-off-white);
}

body.dark .eyebrow {
    color: var(--off-off-white);
}

body.dark .links-list a {
    color: var(--off-off-white);
}

body.dark .links-list a:hover {
    color: var(--white);
}

body.dark .links-list li {
    border-top: 1px solid var(--light-border);
}

body.dark .links-list li:last-child {
    border-bottom: 1px solid var(--light-border);
}

body.dark .filter-btn {
    color: var(--off-white);
    border: 1px solid var(--light-border);
}

body.dark .filter-btn:hover,
body.dark .filter-btn.active {
    color: var(--white);
    border-color: var(--off-off-white);
    background: var(--dark-grey);
}

body.dark .project-card {
    background: var(--dark-background);
    border: 1px solid var(--light-border);
}

body.dark .project-card::after {
    color: var(--off-off-white);
}

body.dark .project-card:hover {
    background: var(--ink);
}

body.dark .card-name {
    color: var(--off-white);
}

body.dark .card-tag {
    color: var(--off-off-white);
    background: var(--light-border);
}

body.dark header {
    z-index: 200;
    background: rgba(18, 18, 20, 0.55) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark header .header-logo,
body.dark header nav a {
    color: var(--muted);
}

body.dark header .header-logo:hover,
body.dark header nav a:hover {
    color: var(--white);
}

body.dark .hamburger span {
    background: rgba(200, 200, 205, 0.75);
}

body.dark .mobile-drawer {
    background: rgba(18, 18, 20) !important;
    border-left-color: rgba(255, 255, 255, 0.08) !important;
    z-index: 300 !important;
}

body.dark .mobile-drawer a { color: rgba(200, 200, 205) !important; }
body.dark .mobile-drawer a:hover { color: var(--white) !important; }

body.dark .drawer-scrim { z-index: 250 !important; }

body.dark .footer-strip {
    background: rgba(18, 18, 20, 0.55) !important;
    border-top-color: rgba(255, 255, 255, 0.08) !important;
    color: rgba(200, 200, 205, 0.5);
}

body.dark .mobile-popup {
    background: rgba(18, 18, 20, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

body.dark .popup-title { color: var(--off-white); }
body.dark .popup-close {
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

body.dark .popup-close:hover {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

body.dark .popup-body p { color: var(--muted); }