/* =========================================================
   Portfolio stylesheet — minimal Y2K theme
   Chrome type, pixel labels, glossy buttons, retro windows.
   Light + dark mode, no build step.
   ========================================================= */
:root {
    --bg: #e9ecf1;
    --panel: #f7f8fa;
    --ink: #0c0d14;
    --muted: #454a59;
    --line: rgba(12, 13, 20, .16);
    --dot: rgba(12, 13, 20, .07);
    --blue: #1f3bff;
    --green: #22d36b;
    --shadow-c: #0c0d14;
    --titlebar: linear-gradient(90deg, #dde3ff, #efe5ff 50%, #def5ff);
    --holo: linear-gradient(125deg, #ffc2ef 0%, #cdbcff 30%, #a6ecff 62%, #d2ffe9 100%);
    --chrome: linear-gradient(180deg, #0c0d14 0%, #3d4354 32%, #a3aabd 47%, #555c70 54%, #0f1119 80%, #3a4050 100%);
    --glow-opacity: .55;

    --display: 'Michroma', 'Arial Black', sans-serif;
    --sans: 'Manrope', system-ui, sans-serif;
    --pixel: 'Space Mono', ui-monospace, monospace;

    --gutter: clamp(18px, 4vw, 48px);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --ease: cubic-bezier(.16, 1, .3, 1);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #07080c; --panel: #10121a; --ink: #e7e9f1; --muted: #a9afc0; --line: rgba(231, 233, 241, .16); --dot: rgba(231, 233, 241, .05);
        --blue: #5468ff; --shadow-c: #5468ff;
        --titlebar: linear-gradient(90deg, #1b2050, #2b1b45 50%, #133240);
        --chrome: linear-gradient(180deg, #ffffff 0%, #c2c8d8 38%, #ffffff 48%, #6c738a 55%, #d9deeb 80%, #9aa1b6 100%);
        --glow-opacity: .22; color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #07080c; --panel: #10121a; --ink: #e7e9f1; --muted: #a9afc0; --line: rgba(231, 233, 241, .16); --dot: rgba(231, 233, 241, .05);
    --blue: #5468ff; --shadow-c: #5468ff;
    --titlebar: linear-gradient(90deg, #1b2050, #2b1b45 50%, #133240);
    --chrome: linear-gradient(180deg, #ffffff 0%, #c2c8d8 38%, #ffffff 48%, #6c738a 55%, #d9deeb 80%, #9aa1b6 100%);
    --glow-opacity: .22; color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
    font-family: var(--sans);
    color: var(--ink);
    background-color: var(--bg);
    background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
    background-size: 22px 22px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--blue); color: #fff; }

.pixel { font-family: var(--pixel); font-size: .78rem; letter-spacing: .01em; }
.chrome {
    font-family: var(--display); font-weight: 400; text-transform: uppercase;
    background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.bg-glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; opacity: var(--glow-opacity); }
.bg-glow::before, .bg-glow::after { content: ''; position: absolute; border-radius: 50%; filter: blur(90px); background: var(--holo); }
.bg-glow::before { width: 560px; height: 560px; top: -180px; right: -140px; }
.bg-glow::after { width: 420px; height: 420px; bottom: -160px; left: -120px; }

/* ---------- Sparkles ---------- */
.spark { position: absolute; color: var(--ink); pointer-events: none; animation: spin 14s linear infinite; }
.s1 { width: 44px; height: 44px; top: 18%; left: 50%; }
.s2 { width: 26px; height: 26px; bottom: 16%; left: 4%; animation-duration: 9s; animation-direction: reverse; }
.s3 { width: 32px; height: 32px; top: 13%; right: 5%; animation-duration: 11s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Menubar ---------- */
.menubar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 52px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--gutter);
    background: color-mix(in srgb, var(--bg) 86%, transparent); border-bottom: 1.5px solid var(--ink);
}
.brand { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: .72rem; }
.brand-spark { width: 18px; height: 18px; color: var(--ink); animation: spin 8s linear infinite; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { display: block; padding: 5px 14px; border: 1.5px solid transparent; border-radius: 999px; font-weight: 600; font-size: .9rem; transition: border-color .2s, background .2s, color .2s; }
.nav-links a:hover { border-color: var(--ink); }
.nav-links a.active { background: var(--ink); color: var(--bg); }
.header-actions { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.clock { color: var(--muted); }
.theme-toggle { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--ink); transition: transform .6s var(--spring); }
.theme-toggle span { position: absolute; inset: 4px; border-radius: 50%; background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
.theme-toggle:hover { transform: rotate(180deg); }
.menu-toggle { display: none; position: relative; width: 32px; height: 32px; border: 1.5px solid var(--ink); border-radius: 8px; }
.menu-toggle span { position: absolute; left: 7px; right: 7px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease), top .3s var(--ease); }
.menu-toggle span:first-child { top: 11px; }
.menu-toggle span:last-child { top: 18px; }

/* ---------- Buttons ---------- */
.aqua-btn {
    position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
    padding: 13px 28px; border-radius: 999px; font-weight: 700; font-size: .95rem; color: #fff;
    background: linear-gradient(180deg, #7d91ff 0%, #2a46ff 48%, #1a2fd8 100%);
    border: 1.5px solid #0f1fa8;
    box-shadow: inset 0 -3px 8px rgba(0, 0, 40, .25), 0 6px 18px -4px rgba(31, 59, 255, .55);
    text-shadow: 0 1px 1px rgba(0, 0, 60, .35);
    transition: transform .4s var(--spring), box-shadow .3s;
}
.aqua-btn::before {
    content: ''; position: absolute; top: 2px; left: 10%; right: 10%; height: 45%;
    border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.04));
    pointer-events: none; z-index: -1;
}
.aqua-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: inset 0 -3px 8px rgba(0, 0, 40, .25), 0 10px 26px -4px rgba(31, 59, 255, .7); }
.icon-btn { width: 68px; height: 68px; padding: 0; }
.icon-btn svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0, 0, 60, .35)); }
.ghost-btn {
    display: inline-flex; align-items: center; padding: 13px 26px; border-radius: 999px;
    border: 1.5px solid var(--ink); font-weight: 700; font-size: .95rem; transition: background .2s, color .2s;
}
.ghost-btn:hover { background: var(--ink); color: var(--bg); }

/* ---------- Windows ---------- */
.window { background: var(--panel); border: 1.5px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: 5px 5px 0 var(--shadow-c); }
.titlebar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    height: 32px; padding: 0 8px 0 12px; background: var(--titlebar); border-bottom: 1.5px solid var(--ink);
}
.tb-btns { display: flex; gap: 5px; }
.tb-btns i { width: 11px; height: 11px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--panel); }
.tb-btns i:last-child { background: var(--ink); }
.tb-close {
    width: 22px; height: 22px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 5px;
    background: var(--panel); font-size: 15px; line-height: 1; transition: background .2s, color .2s;
}
.tb-close:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.draggable .titlebar { cursor: grab; touch-action: none; }
.draggable.dragging .titlebar { cursor: grabbing; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 100px var(--gutter) 70px; }
.hero-grid { width: 100%; max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.greeting { margin: 0 0 10px; font-weight: 600; font-size: 1.05rem; color: var(--muted); }
.hero-name { font-size: clamp(1.7rem, 5vw, 4.6rem); line-height: 1.08; letter-spacing: -.01em; filter: drop-shadow(0 8px 14px rgba(20, 30, 90, .14)); }
.hero-name span { display: block; }
.role-chip {
    display: inline-block; margin: 22px 0 18px; padding: 6px 16px; border: 1.5px solid var(--ink); border-radius: 999px;
    background: var(--holo); color: #0c0d14; font-weight: 700; font-size: .9rem;
}
.hero-lead { max-width: 520px; color: var(--muted); font-size: 1.06rem; line-height: 1.7; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-windows { display: flex; justify-content: center; align-items: center; }
.stats-window { position: relative; width: min(380px, 100%); z-index: 3; }
.draggable { transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--rot, 0deg)); }
.stats-body { padding: 20px 22px 22px; }
.stats-body li { display: flex; align-items: baseline; gap: 10px; font-weight: 600; font-size: 1.1rem; }
.stats-body li + li { margin-top: 14px; }
.stats-body .dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.stats-body b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--blue); }

/* ---------- Sections ---------- */
.section { max-width: calc(1240px + var(--gutter) * 2); margin: 0 auto; padding: clamp(80px, 11vw, 130px) var(--gutter) 0; }
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 44px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.8rem); line-height: 1.1; }
.sec-head h2.chrome { background: none; color: var(--ink); }
.sec-rule { flex: 1; height: 1.5px; background: var(--ink); }
.sec-note { color: var(--muted); }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about-role { color: var(--blue); margin-bottom: 14px; }
.statement { font-weight: 500; font-size: clamp(1.25rem, 1.9vw, 1.6rem); line-height: 1.5; letter-spacing: -.01em; white-space: pre-line; }
.skill-group + .skill-group { margin-top: 26px; }
.skill-group > .pixel { margin-bottom: 12px; }
.skill-group > .pixel span { color: var(--muted); }
.bubbles { display: flex; flex-wrap: wrap; gap: 8px; }
.bubbles li {
    position: relative; overflow: hidden; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem;
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 100%, #fff 60%), color-mix(in srgb, var(--panel) 85%, var(--ink) 8%));
    border: 1.5px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
    transition: transform .4s var(--spring), background .2s, color .2s, border-color .2s;
}
.bubbles li:hover { transform: translateY(-3px) scale(1.05); color: #fff; border-color: #0f1fa8; background: linear-gradient(180deg, #7d91ff, #2a46ff 50%, #1a2fd8); }

/* Experience */
.log-body { padding: 4px 26px; }
.log-entry { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 24px 0; border-bottom: 1.5px dashed var(--line); }
.log-entry:last-child { border-bottom: none; }
.log-date { color: var(--blue); padding-top: 4px; }
.log-main h3 { font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; }
.log-company { margin: 4px 0 12px; font-weight: 600; color: var(--muted); }
.log-points li { position: relative; padding-left: 18px; margin-bottom: 8px; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
.log-points li::before { content: '›'; position: absolute; left: 2px; color: var(--blue); font-weight: 700; }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 28px; }
.project-card { display: flex; flex-direction: column; cursor: pointer; transition: transform .35s var(--spring), box-shadow .35s var(--spring), opacity .8s var(--ease); }
.project-card:hover, .js .project-card.reveal.in:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--shadow-c); }
.card-image { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1.5px solid var(--ink); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.project-card:hover .card-image img { transform: scale(1.05); }
.image-placeholder {
    width: 100%; height: 100%; display: grid; place-items: center;
    background: radial-gradient(rgba(12,13,20,.12) 1px, transparent 1.3px) 0 0 / 10px 10px, var(--holo);
}
.image-placeholder .chrome {
    font-size: 4.4rem; line-height: 1;
    background: linear-gradient(180deg, #1a1d27 0%, #6d748a 30%, #ffffff 48%, #8d94a9 53%, #2a2e3a 78%, #5e657a 100%);
    -webkit-background-clip: text; background-clip: text;
    filter: drop-shadow(0 6px 10px rgba(20,30,90,.25)); transition: transform .5s var(--spring);
}
.project-card:hover .image-placeholder .chrome { transform: scale(1.12) rotate(-6deg); }
.card-info { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 20px; }
.card-info .category { color: var(--blue); }
.card-info h3 { font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; margin: 6px 0 8px; }
.card-info .excerpt { flex: 1; color: var(--muted); font-size: 1rem; line-height: 1.6; margin-bottom: 18px; }
.read-more {
    align-self: flex-start; padding: 6px 16px; border: 1.5px solid var(--ink); border-radius: 999px; font-weight: 700; font-size: .85rem;
    transition: background .2s, color .2s, border-color .2s;
}
.project-card:hover .read-more { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Contact */
.contact { padding-bottom: 90px; }
.contact-inner { max-width: 780px; margin: 0 auto; text-align: center; }
.contact-spark { position: relative; display: block; width: 60px; height: 60px; margin: 0 auto 18px; }
.contact-inner > .pixel { color: var(--muted); }
.contact-title { font-size: clamp(2rem, 6vw, 4.6rem); line-height: 1.1; margin: 12px 0 14px; filter: drop-shadow(0 8px 14px rgba(20,30,90,.14)); }
.contact-sub { color: var(--muted); font-size: 1.05rem; }
.contact-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin: 30px 0 20px; }
.contact-mail { color: var(--muted); transition: color .2s; }
.contact-mail:hover { color: var(--blue); }

/* ---------- Footer ---------- */
.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px var(--gutter) 26px; border-top: 1.5px solid var(--ink); color: var(--muted); }
.back-to-top:hover { color: var(--blue); }

/* ---------- Project pop-up ---------- */
.project-modal {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(8, 10, 30, .35); visibility: hidden; opacity: 0; transition: opacity .3s, visibility .3s;
}
.project-modal.open { visibility: visible; opacity: 1; }
.modal-content {
    width: min(720px, 100%); max-height: 86vh; display: flex; flex-direction: column;
    transform: scale(.9) translateY(12px); transition: transform .45s var(--spring);
}
.project-modal.open .modal-content { transform: none; }
.modal-body-scroll { overflow-y: auto; padding: 26px 28px 30px; }
.modal-body-scroll h2 { font-size: clamp(1.5rem, 3.6vw, 2.4rem); line-height: 1.15; margin-bottom: 16px; }
#modal-desc { color: var(--muted); line-height: 1.75; white-space: pre-line; }
.modal-gallery { display: grid; gap: 12px; margin-top: 24px; }
.modal-gallery img { width: 100%; border: 1.5px solid var(--ink); border-radius: 8px; cursor: zoom-in; }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
    background: rgba(5, 6, 14, .92); visibility: hidden; opacity: 0; transition: opacity .3s, visibility .3s;
}
.lightbox.open { visibility: visible; opacity: 1; }
.lightbox-content { max-width: 90%; max-height: 86%; border: 1.5px solid #fff; border-radius: 8px; }
.close-lightbox { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; font-size: 20px; background: #fff; color: #0c0d14; border-color: #fff; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
.js .draggable.reveal, .js .draggable.reveal.in { transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--rot, 0deg)); transition: opacity .8s var(--ease); }
.js .stats-window.reveal { transition-delay: .25s; }
.draggable.dragging { transition: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .menu-toggle { display: block; }
    .navigation-bar {
        position: fixed; top: 52px; left: 0; right: 0; bottom: 0; z-index: 1;
        display: flex; align-items: flex-start; padding: 28px var(--gutter);
        background: var(--bg); visibility: hidden; opacity: 0; transition: opacity .3s, visibility .3s;
    }
    .navigation-bar.open { visibility: visible; opacity: 1; }
    .navigation-bar.open ~ .header-actions .menu-toggle span:first-child { top: 14.5px; transform: rotate(45deg); }
    .navigation-bar.open ~ .header-actions .menu-toggle span:last-child { top: 14.5px; transform: rotate(-45deg); }
    .nav-links { flex-direction: column; gap: 10px; width: 100%; }
    .nav-links a { font-family: var(--display); font-weight: 400; font-size: 1.5rem; text-transform: uppercase; padding: 12px 18px; border-color: var(--ink); }

    .hero { padding-top: 84px; }
    .hero-grid { grid-template-columns: 1fr; gap: 28px; }
    .hero-name { font-size: clamp(1.7rem, 8vw, 3.6rem); }
    .hero-windows { padding: 10px 0 20px; }
    .s1 { top: 9%; left: auto; right: 8%; }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .log-body { padding: 4px 18px; }
    .log-entry { grid-template-columns: 1fr; gap: 8px; }
    .sec-note { display: none; }
}
@media (max-width: 520px) {
    .clock { display: none; }
    .modal-body-scroll { padding: 20px 18px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .js .reveal { opacity: 1; transform: none; }
}
