/* ==========================================================================
   FUAD-OS — "Developer OS" design layer (see js/fx/os.js)
   Menu bar · boot screen · app windows · code-editor hero · dock ·
   spotlight · context menu · notifications · wallpaper
   ========================================================================== */

:root {
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --os-radius: 14px;
    --os-bar-h: 38px;
    --win-bg: rgba(255, 255, 255, 0.9);
    --win-border: rgba(15, 23, 42, 0.10);
    --win-title-bg: rgba(241, 245, 249, 0.92);
    --win-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 24px 60px -20px rgba(15, 23, 42, 0.25), 0 2px 8px rgba(15, 23, 42, 0.06);
    --menubar-bg: rgba(255, 255, 255, 0.78);
    --tok-key: #7c3aed;
    --tok-str: #059669;
    --tok-fn: #2563eb;
    --tok-num: #d97706;
    --tok-com: #94a3b8;
    --tok-prop: #db2777;
}
body.dark-theme {
    --win-bg: rgba(15, 23, 42, 0.88);
    --win-border: rgba(148, 163, 184, 0.14);
    --win-title-bg: rgba(30, 41, 59, 0.92);
    --win-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 30px 70px -20px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.3);
    --menubar-bg: rgba(11, 17, 32, 0.78);
    --tok-key: #c084fc;
    --tok-str: #4ade80;
    --tok-fn: #60a5fa;
    --tok-num: #fbbf24;
    --tok-com: #64748b;
    --tok-prop: #f472b6;
}

/* ---------- Wallpaper (changes with time of day) ---------- */
.os-wallpaper {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(60% 50% at 15% 10%, rgba(147, 197, 253, .55), transparent 70%),
        radial-gradient(50% 45% at 90% 20%, rgba(196, 181, 253, .55), transparent 70%),
        radial-gradient(60% 50% at 70% 95%, rgba(253, 186, 116, .35), transparent 70%),
        linear-gradient(180deg, #eef4ff, #f8fafc 60%, #fdf4ff);
    transition: opacity 1s ease;
}
body.tod-dawn .os-wallpaper {
    background:
        radial-gradient(60% 50% at 20% 0%, rgba(253, 186, 116, .6), transparent 70%),
        radial-gradient(50% 45% at 85% 15%, rgba(244, 114, 182, .4), transparent 70%),
        linear-gradient(180deg, #fff1e6, #f8fafc 65%);
}
body.tod-dusk .os-wallpaper {
    background:
        radial-gradient(60% 50% at 80% 5%, rgba(251, 146, 60, .55), transparent 70%),
        radial-gradient(55% 45% at 15% 25%, rgba(167, 139, 250, .5), transparent 70%),
        linear-gradient(180deg, #fde7d9, #f5f3ff 65%);
}
body.dark-theme .os-wallpaper {
    background:
        radial-gradient(55% 45% at 15% 5%, rgba(59, 130, 246, .28), transparent 70%),
        radial-gradient(50% 45% at 90% 25%, rgba(139, 92, 246, .26), transparent 70%),
        radial-gradient(60% 40% at 50% 100%, rgba(14, 165, 233, .16), transparent 70%),
        linear-gradient(180deg, #060a16, #0b1120 60%, #0a0f1f);
}
body.dark-theme.tod-dusk .os-wallpaper {
    background:
        radial-gradient(60% 50% at 80% 0%, rgba(249, 115, 22, .25), transparent 70%),
        radial-gradient(55% 45% at 15% 25%, rgba(139, 92, 246, .28), transparent 70%),
        linear-gradient(180deg, #120c1c, #0b1120 60%);
}
body { background-color: transparent; }
html { background: #f8fafc; }
html:has(body.dark-theme) { background: #0b1120; }
#about-window { margin: 3.5rem 0 0; }
.os-flash { animation: osFlash 1.6s ease; }
@keyframes osFlash { 0%, 40% { box-shadow: 0 0 0 3px var(--primary-color), 0 0 40px var(--glow-primary); } }

/* ---------- Boot screen ---------- */
.loader-wrapper { background: #05070d !important; }
.loader-wrapper .os-boot {
    width: min(620px, calc(100vw - 32px));
    font: 13px/1.7 var(--font-mono);
    color: #9ca3af;
    text-align: left;
}
.os-boot .boot-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    color: #e5e7eb;
    font-size: 15px;
}
.os-boot .boot-logo img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; border: 1px solid #1f2937; }
.os-boot .boot-logo b { display: block; font-size: 18px; color: #fff; }
.os-boot .boot-line { opacity: 0; transform: translateY(4px); animation: bootLine .25s ease forwards; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-boot .ok { color: #4ade80; }
.os-boot .hl { color: #60a5fa; }
.os-boot .boot-bar { margin-top: 16px; height: 4px; border-radius: 4px; background: #111827; overflow: hidden; }
.os-boot .boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2563eb, #7c3aed, #0ea5e9); animation: bootBar 1.9s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes bootLine { to { opacity: 1; transform: none; } }
@keyframes bootBar { to { width: 100%; } }

/* ---------- Menu bar (restyled navbar) ---------- */
.navbar, .navbar.scrolled {
    height: var(--os-bar-h);
    padding: 0 14px !important;
    background: var(--menubar-bg) !important;
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--win-border) !important;
    box-shadow: none !important;
    font-family: var(--font-primary);
}
.navbar .logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.navbar .logo img { width: 22px !important; height: 22px !important; border-width: 1px !important; }
.navbar .logo::after {
    content: 'fuad-os';
    font: 700 13px var(--font-mono);
    color: var(--heading-color);
    letter-spacing: -0.02em;
}
.navbar .logo:hover img { transform: rotate(-8deg) scale(1.08); }
.menu-list { gap: 2px !important; margin-left: 18px; margin-right: auto; }
.menu-list li a {
    display: block;
    padding: 4px 10px !important;
    border-radius: 6px;
    font-size: 13px !important;
    font-weight: 500;
    color: var(--navbar-text);
}
.menu-list li a i { display: none; }
.menu-list li a::after { display: none; }
.menu-list li a:hover, .menu-list li a.active { background: rgba(37, 99, 235, .12); color: var(--primary-color); }
.nav-actions { gap: 6px !important; }
.navbar .theme-toggle, .navbar .fx-nav-btn {
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 7px;
    border: 0;
    background: transparent;
    font-size: 13px;
    color: var(--navbar-text);
}
.navbar .theme-toggle:hover, .navbar .fx-nav-btn:hover { background: rgba(127, 127, 127, .16); color: var(--navbar-text); transform: none; }
.navbar .theme-auto-dot { width: 12px; height: 12px; font-size: 7px; line-height: 12px; right: -2px; bottom: -2px; }
.os-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 6px;
    font: 500 12.5px var(--font-primary);
    color: var(--navbar-text);
    white-space: nowrap;
}
.os-status .os-batt { display: inline-flex; align-items: center; gap: 4px; }
.os-status .os-batt i.cell {
    position: relative;
    width: 22px;
    height: 11px;
    border: 1px solid currentColor;
    border-radius: 3px;
    opacity: .85;
}
.os-status .os-batt i.cell::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 3px;
    width: 2px;
    height: 4px;
    border-radius: 0 1px 1px 0;
    background: currentColor;
}
.os-status .os-batt i.cell b {
    position: absolute;
    left: 1px;
    top: 1px;
    bottom: 1px;
    border-radius: 1px;
    background: currentColor;
}
.os-status .os-search {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    font: inherit;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.os-status .os-search:hover { background: rgba(127, 127, 127, .16); }
.os-status kbd { font: 600 10px var(--font-mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--win-border); opacity: .8; }
@media (max-width: 1100px) { .os-status .os-date, .os-status .os-wifi { display: none; } }
@media (max-width: 768px) {
    .os-status .os-batt, .os-status kbd { display: none; }
    .menu-list { margin: 0; }
    .menu-list li a { font-size: 1.1rem !important; padding: 10px 18px !important; }
    .menu-list { top: var(--os-bar-h) !important; height: calc(100vh - var(--os-bar-h)) !important; background: var(--win-bg) !important; backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); }
    .icon-bars { font-size: 1.1rem !important; margin-left: 4px; }
}

/* ---------- App windows ---------- */
.os-window {
    position: relative;
    background: var(--win-bg);
    border: 1px solid var(--win-border);
    border-radius: var(--os-radius);
    box-shadow: var(--win-shadow);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    overflow: hidden;
    transition: max-width .45s cubic-bezier(.2, .8, .2, 1), margin .45s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}
main > section.os-window { padding: 0 !important; margin: 3.5rem auto; overflow: hidden; }
.os-titlebar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 14px;
    background: var(--win-title-bg);
    border-bottom: 1px solid var(--win-border);
    font: 500 12.5px var(--font-mono);
    color: var(--text-muted);
    user-select: none;
}
.os-lights { display: flex; gap: 8px; flex: none; }
.os-lights button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .2);
}
.os-lights .l-close { background: #ff5f57; }
.os-lights .l-min { background: #febc2e; }
.os-lights .l-max { background: #28c840; }
.os-lights button::after {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font: 700 9px/12px system-ui, sans-serif;
    color: rgba(0, 0, 0, .55);
    opacity: 0;
}
.os-lights:hover button::after { opacity: 1; }
.os-lights .l-close::after { content: '×'; }
.os-lights .l-min::after { content: '−'; }
.os-lights .l-max::after { content: '+'; }
.os-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--heading-color);
    max-width: 60%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.os-title i { color: var(--primary-color); }
.os-title .dim { color: var(--text-muted); }
.os-meta { margin-left: auto; font-size: 11.5px; opacity: .8; white-space: nowrap; }
.os-body { padding: 2.5rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.os-window.is-min .os-body { display: none; }
.os-window.is-min { cursor: pointer; }
.os-window.is-min .os-titlebar { border-bottom: 0; }
.os-window.is-min .os-meta::after { content: ' · minimized — click to open'; }
main > section.os-window.is-max { max-width: none; margin-inline: calc(50% - 50vw + 16px); }
@media (max-width: 768px) {
    .os-title { position: static; transform: none; max-width: none; flex: 1; font-size: 12px; }
    .os-meta { display: none; }
    main > section.os-window { margin: 2rem auto; }
    main > section.os-window.is-max { margin-inline: 0; }
}

/* section headings inside windows: markdown flavour */
.os-window .section-title { margin-bottom: 2.5rem; }
.os-window .section-title h1::before {
    content: '# ';
    color: var(--primary-color);
    font-family: var(--font-mono);
    font-weight: 600;
    opacity: .7;
}
.os-window .section-title .eyebrow { font-family: var(--font-mono); letter-spacing: .08em; text-transform: none; }
.os-window .section-title .eyebrow::before, .os-window .section-title .eyebrow::after { display: none; }
.os-window .section-title .eyebrow { opacity: .85; }
.os-window .section-title .eyebrow::first-letter { text-transform: none; }

/* ---------- Hero: desktop with editor + preview windows ---------- */
#home { padding-top: calc(var(--os-bar-h) + 2.5rem); min-height: 100vh; }
#home .home-content { gap: 2rem; align-items: stretch; }
.os-editor { flex: 1.35; display: flex; flex-direction: column; min-width: 0; }
.os-editor .os-titlebar { gap: 0; padding-right: 0; }
.os-tabs { display: flex; height: 100%; margin-left: 14px; overflow-x: auto; scrollbar-width: none; }
.os-tabs::-webkit-scrollbar { display: none; }
.os-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    border: 0;
    border-right: 1px solid var(--win-border);
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.os-tab:first-child { border-left: 1px solid var(--win-border); }
.os-tab.active { background: var(--win-bg); color: var(--heading-color); box-shadow: inset 0 2px 0 var(--primary-color); }
.os-tab i { font-size: 11px; }
.os-tab .fa-js, .os-tab .ts { color: #3178c6; font: 700 10px var(--font-mono); }
.os-editor-main { display: flex; flex: 1; min-height: 0; }
.os-explorer {
    width: 190px;
    flex: none;
    padding: 14px 0;
    border-right: 1px solid var(--win-border);
    font: 12.5px/1.9 var(--font-mono);
    color: var(--text-muted);
    background: rgba(127, 127, 127, .04);
}
.os-explorer h6 { margin: 0 14px 6px; font: 700 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.os-explorer a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 0 calc(14px + var(--d, 0) * 14px);
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.os-explorer a:hover { background: rgba(37, 99, 235, .08); color: var(--heading-color); }
.os-explorer a.active { background: rgba(37, 99, 235, .14); color: var(--primary-color); }
.os-explorer i { width: 14px; text-align: center; font-size: 12px; }
.os-explorer .fa-folder, .os-explorer .fa-folder-open { color: #f59e0b; }
.os-explorer .f-ts { color: #3178c6; }
.os-explorer .f-md { color: #64748b; }
.os-explorer .f-json { color: #eab308; }
.os-explorer .f-pdf { color: #ef4444; }
.os-code {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 18px 22px 22px 64px;
    counter-reset: ln;
}
.os-gutter {
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 0;
    width: 46px;
    text-align: right;
    font: 12.5px/1.9 var(--font-mono);
    color: var(--tok-com);
    opacity: .7;
    user-select: none;
    overflow: hidden;
}
.os-gutter span { display: block; padding-right: 10px; }
.os-gutter span.cur { color: var(--heading-color); opacity: 1; }
.code-line {
    font: 13.5px/1.9 var(--font-mono);
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
}
.tok-k { color: var(--tok-key); }
.tok-s { color: var(--tok-str); }
.tok-f { color: var(--tok-fn); }
.tok-n { color: var(--tok-num); }
.tok-c { color: var(--tok-com); font-style: italic; }
.tok-p { color: var(--tok-prop); }
.os-caret { display: inline-block; width: 8px; height: 1.1em; vertical-align: -2px; background: var(--primary-color); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* the original hero text, now living inside the editor */
.os-code .text-section { padding: .4rem 0 .6rem; }
.os-code .tod-badge { font-family: var(--font-mono); font-size: 11.5px; }
.os-code .intro { font: 500 13.5px var(--font-mono) !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--tok-com) !important; font-style: italic; margin: .6rem 0 .2rem !important; }
.os-code .intro::before { content: '// '; }
.os-code .name { font-size: clamp(2.1rem, 3.7vw, 3.3rem) !important; line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 .6rem; }
.os-code .role-container { min-height: 2.2em; }
.os-code .role { font: 600 clamp(1rem, 2vw, 1.3rem) var(--font-mono) !important; color: var(--tok-str) !important; }
.os-code .role::before { content: '"'; opacity: .7; }
.os-code .bio { font-size: 1rem; color: var(--text-muted); max-width: 54ch; margin: .8rem 0 1.4rem; }
.os-code .cta-buttons .btn { font-family: var(--font-mono); font-size: 13.5px; padding: .7rem 1.3rem; border-radius: 10px; }

.os-statusbar {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 26px;
    padding: 0 12px;
    background: var(--primary-color);
    color: #fff;
    font: 500 11.5px var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
}
.os-statusbar .sp { margin-left: auto; }
.os-statusbar .live { display: inline-flex; align-items: center; gap: 6px; }
.os-statusbar .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .3); animation: livePulse 2s infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); } }

.os-preview { flex: .85; display: flex; flex-direction: column; min-width: 0; background: transparent; }
.os-preview .os-body { flex: 1; display: grid; place-items: center; padding: 1rem; background: transparent; }
.os-preview .image-section { width: 100%; }
/* let the 3D portrait (drawn on the canvas behind) show through */

@media (max-width: 1100px) { .os-explorer { display: none; } }
@media (max-width: 991px) {
    #home .home-content { flex-direction: column; }
    .os-preview { min-height: 340px; }
}
@media (max-width: 600px) {
    .os-code { padding: 14px 14px 18px 40px; }
    .os-gutter { width: 30px; font-size: 11px; }
    .os-gutter span { padding-right: 6px; }
    .code-line { font-size: 12px; }
    .os-statusbar .hide-sm { display: none; }
}

/* ---------- Desktop sticky note (lives in the preview window) ---------- */
.os-preview { position: relative; }
.os-note {
    position: absolute;
    z-index: 4;
    left: 16px;
    top: 58px;
    width: 190px;
    padding: 30px 16px 14px;
    background: #fef08a;
    color: #422006;
    border-radius: 4px 4px 4px 18px;
    box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .35);
    font: 500 13px/1.6 var(--font-mono);
    transform: rotate(-3deg);
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.os-note:active { cursor: grabbing; }
.os-note::before {
    content: 'TODO.txt';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    padding: 4px 10px;
    background: rgba(0, 0, 0, .06);
    font: 700 10.5px var(--font-mono);
    letter-spacing: .06em;
}
.os-note a { color: #9a3412; font-weight: 700; }
@media (max-width: 991px) { .os-note { display: none; } }
body.fuad-os .sky-clock { display: none; }

/* ---------- Dock ---------- */
.os-dock {
    position: fixed;
    left: 50%;
    bottom: 12px;
    z-index: 1000;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 64px;
    padding: 8px 10px;
    border-radius: 20px;
    background: var(--menubar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--win-border);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .35);
    max-width: calc(100vw - 24px);
}
.dock-item {
    position: relative;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: #fff;
    font-size: 19px;
    text-decoration: none;
    background: var(--c, linear-gradient(135deg, #3b82f6, #6366f1));
    box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
    transform-origin: bottom center;
    transition: transform .18s ease-out, margin .18s ease-out;
    will-change: transform;
}
.dock-item::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: var(--heading-color);
    opacity: 0;
    transition: opacity .2s;
}
.dock-item.active::after { opacity: .8; }
.dock-item .tip {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 7px;
    background: rgba(15, 23, 42, .88);
    color: #fff;
    font: 500 12px var(--font-primary);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}
.dock-item:hover .tip, .dock-item:focus-visible .tip { opacity: 1; }
.dock-sep { width: 1px; height: 40px; align-self: center; background: var(--win-border); margin: 0 2px; }
.scroll-up, .fx-term-hint { display: none !important; }
body { padding-bottom: 90px; }
@media (max-width: 768px) {
    .os-dock { gap: 6px; height: 56px; padding: 6px 8px; bottom: 8px; border-radius: 18px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
    .os-dock::-webkit-scrollbar { display: none; }
    .dock-item { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
    .dock-item[data-go="#home"], .dock-item[data-act="spot"], .dock-sep { display: none; }
    .os-dock { gap: 4px; height: 50px; left: 12px; right: 12px; transform: none; justify-content: space-between; max-width: none; }
    .dock-item { width: 34px; height: 34px; }
    .os-code .text-section, .os-code .code-line, .os-code .bio, .os-code .intro { text-align: left !important; }
    .os-code .bio { margin-inline: 0 !important; }
    .os-code .cta-buttons { justify-content: flex-start !important; flex-wrap: wrap; }
    .os-code .cta-buttons .btn { white-space: nowrap; }
    .dock-item .tip { display: none; }
    .dock-sep { height: 32px; }
}

/* ---------- Spotlight ---------- */
.os-spotlight {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 14vh 16px 16px;
    background: rgba(2, 6, 23, .35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.os-spotlight.open { display: flex; animation: fxTermIn .18s ease both; }
.spot-box {
    width: min(640px, 100%);
    border-radius: 16px;
    background: var(--win-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid var(--win-border);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .5);
    overflow: hidden;
}
.spot-input-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--win-border); }
.spot-input-row i { color: var(--text-muted); font-size: 18px; }
.spot-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--heading-color);
    font: 400 20px var(--font-primary);
}
.spot-list { max-height: min(52vh, 420px); overflow-y: auto; padding: 6px; }
.spot-group { padding: 8px 12px 4px; font: 700 10.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.spot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);
    font: 500 14px var(--font-primary);
    text-align: left;
    cursor: pointer;
}
.spot-item .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--c, #3b82f6); flex: none; font-size: 13px; }
.spot-item small { display: block; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.spot-item .kb { margin-left: auto; font: 11px var(--font-mono); color: var(--text-muted); }
.spot-item.sel { background: var(--primary-color); color: #fff; }
.spot-item.sel small, .spot-item.sel .kb { color: rgba(255, 255, 255, .8); }
.spot-empty { padding: 24px; text-align: center; color: var(--text-muted); }
.spot-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--win-border); font: 11px var(--font-mono); color: var(--text-muted); }

/* ---------- Context menu ---------- */
.os-ctx {
    position: fixed;
    z-index: 9200;
    min-width: 230px;
    padding: 5px;
    border-radius: 10px;
    background: var(--win-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--win-border);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .4);
    font: 13px var(--font-primary);
    display: none;
}
.os-ctx.open { display: block; animation: fxTermIn .12s ease both; }
.os-ctx button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.os-ctx button i { width: 16px; text-align: center; color: var(--text-muted); }
.os-ctx button span { margin-left: auto; font: 11px var(--font-mono); color: var(--text-muted); }
.os-ctx button:hover { background: var(--primary-color); color: #fff; }
.os-ctx button:hover i, .os-ctx button:hover span { color: #fff; }
.os-ctx hr { border: 0; border-top: 1px solid var(--win-border); margin: 4px 6px; }

/* ---------- Notification ---------- */
.os-notify {
    position: fixed;
    top: calc(var(--os-bar-h) + 12px);
    right: 14px;
    z-index: 9300;
    width: min(350px, calc(100vw - 28px));
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--win-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--win-border);
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .35);
    font: 13px/1.45 var(--font-primary);
    color: var(--text-main);
    transform: translateX(120%);
    transition: transform .5s cubic-bezier(.2, .9, .2, 1.1);
}
.os-notify.show { transform: none; }
.os-notify img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: none; }
.os-notify b { color: var(--heading-color); }
.os-notify .when { float: right; font-size: 11px; color: var(--text-muted); }
.os-notify .x { position: absolute; top: -7px; left: -7px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--win-border); background: var(--win-bg); color: var(--text-muted); font-size: 11px; cursor: pointer; opacity: 0; transition: opacity .2s; }
.os-notify:hover .x { opacity: 1; }
.os-notify kbd { font: 600 11px var(--font-mono); padding: 0 5px; border: 1px solid var(--win-border); border-radius: 4px; }

/* ---------- Misc restyles to match the OS ---------- */
.marquee { margin-top: 0; }
.footer { background: transparent; border-top: 0; }
.fx-toast { top: calc(var(--os-bar-h) + 12px); bottom: auto; left: auto; right: 14px; transform: translateX(120%); border-radius: 14px; background: var(--win-bg); color: var(--heading-color); border: 1px solid var(--win-border); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); }
.fx-toast.show { transform: none; }
.scroll-progress { top: var(--os-bar-h); height: 2px; }
.project-item, .experience-item, .contact-card, .skill-category, .academy-content, .journey-stop { border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
    .os-boot .boot-line, .os-boot .boot-bar i { animation-duration: .01s; }
    .dock-item { transition: none; }
}

/* ==========================================================================
   APPS (js/fx/apps.js)
   ========================================================================== */

/* ---------- Floating windows ---------- */
.os-float {
    position: fixed;
    z-index: 9050;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(.94) translateY(10px);
    transition: opacity .2s ease, transform .22s cubic-bezier(.2, .9, .3, 1.2), box-shadow .2s;
    backdrop-filter: blur(26px) saturate(170%);
    -webkit-backdrop-filter: blur(26px) saturate(170%);
}
.os-float.in { opacity: 1; transform: none; }
.os-float.focused { box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .45), 0 0 0 1px var(--win-border); }
.os-float:not(.focused) .os-lights button { background: #c5c9cf; }
body.dark-theme .os-float:not(.focused) .os-lights button { background: #475569; }
.os-float .os-titlebar { cursor: grab; flex: none; }
.os-float.dragging { transition: none; }
.os-float.dragging .os-titlebar { cursor: grabbing; }
.os-float.zoomed { left: 12px !important; top: calc(var(--os-bar-h) + 10px) !important; width: calc(100vw - 24px) !important; max-height: calc(100vh - var(--os-bar-h) - 110px); }
.os-float-body { overflow: auto; flex: 1; min-height: 0; }
@media (max-width: 600px) {
    .os-float { left: 12px !important; width: calc(100vw - 24px) !important; top: calc(var(--os-bar-h) + 10px) !important; max-height: calc(100vh - var(--os-bar-h) - 90px); }
}

/* ---------- Project window ---------- */
.pw { padding: 1.4rem 1.5rem 1.6rem; }
.pw-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 1rem; }
.pw-num { font: 800 2.6rem/1 var(--font-heading); color: transparent; -webkit-text-stroke: 1.5px var(--primary-color); }
.pw-head h3 { font-size: 1.5rem; color: var(--heading-color); letter-spacing: -0.02em; margin: 0 0 .5rem; }
.pw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.pw-tags span { padding: 2px 10px; border-radius: 999px; font: 600 .72rem var(--font-primary); background: rgba(37, 99, 235, .1); color: var(--primary-color); }
.pw-desc { color: var(--text-main); line-height: 1.7; margin: 0 0 1rem; }
.pw-json {
    margin: 0 0 1.2rem;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(127, 127, 127, .07);
    border: 1px solid var(--win-border);
    font: 12.5px/1.65 var(--font-mono);
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
}
.pw-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pw-actions .btn { font-size: .9rem; padding: .65rem 1.2rem; }
.pw-rel { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--win-border); }
.pw-rel h6 { font: 700 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 .6rem; }
.pw-rel button { margin: 0 6px 6px 0; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--win-border); background: transparent; color: var(--text-main); font: 500 .85rem var(--font-primary); cursor: pointer; }
.pw-rel button i { color: #f59e0b; margin-right: 4px; }
.pw-rel button:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* ---------- Finder ---------- */
.finder {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 0;
    border: 1px solid var(--win-border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(127, 127, 127, .03);
}
.finder-side {
    padding: 14px 8px;
    border-right: 1px solid var(--win-border);
    background: rgba(127, 127, 127, .05);
}
.finder-side h6 { margin: 0 10px 8px; font: 700 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.finder-cat {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-main);
    font: 500 13.5px var(--font-primary);
    text-align: left;
    cursor: pointer;
}
.finder-cat i { width: 16px; text-align: center; color: var(--primary-color); }
.finder-cat b { margin-left: auto; font: 600 11px var(--font-mono); color: var(--text-muted); }
.finder-cat:hover { background: rgba(127, 127, 127, .12); }
.finder-cat.active { background: var(--primary-color); color: #fff; }
.finder-cat.active i, .finder-cat.active b { color: #fff; }
.finder-main { padding: 14px 18px 22px; min-width: 0; }
.finder-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.finder-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 36px; border-radius: 9px; border: 1px solid var(--win-border); background: var(--win-bg); }
.finder-search i { color: var(--text-muted); font-size: 13px; }
.finder-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--heading-color); font: 14px var(--font-primary); }
.finder-search:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.finder-view { display: flex; border: 1px solid var(--win-border); border-radius: 9px; overflow: hidden; }
.finder-view button { width: 38px; height: 34px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.finder-view button.active { background: rgba(37, 99, 235, .14); color: var(--primary-color); }
.finder-crumb { font: 12px var(--font-mono); color: var(--text-muted); margin: 6px 2px 18px; }
.finder-crumb i { color: #f59e0b; }
.finder-crumb .crumb-cat { color: var(--heading-color); }
.finder-empty { padding: 40px 10px; text-align: center; color: var(--text-muted); }
.project-item { cursor: pointer; }
.project-item.f-out { display: none !important; }
.projects-content-box.f-active .project-item.hidden { display: flex; }
.projects-content-box { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; gap: 1.4rem !important; }
.projects-content-box.is-list { grid-template-columns: 1fr !important; gap: .6rem !important; }
.projects-content-box.is-list .project-item { flex-direction: row; align-items: center; }
.projects-content-box.is-list .project-details { flex-direction: row; align-items: center; gap: 1.2rem; padding: .8rem 1.2rem; }
.projects-content-box.is-list .project-details h3 { margin: 0; min-width: 180px; padding-right: 0; font-size: 1.05rem; }
.projects-content-box.is-list .project-details p { margin: 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-size: .9rem; }
.projects-content-box.is-list .project-tech { display: none; }
.projects-content-box.is-list .project-num { position: static; font-size: 1.2rem; margin-left: 1rem; }
.projects-content-box.is-list .project-footer { padding: 0 1rem 0 0; flex: none; }
.projects-content-box.is-list .btn-demo { width: auto; padding: .45rem 1rem; }
@media (max-width: 860px) {
    .finder { grid-template-columns: minmax(0, 1fr); }
    .finder-side { min-width: 0; }
    .projects-content-box { grid-template-columns: minmax(0, 1fr) !important; }
    .finder-side { display: flex; gap: 6px; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--win-border); scrollbar-width: none; }
    .finder-side::-webkit-scrollbar { display: none; }
    .finder-side h6 { display: none; }
    .finder-cat { width: auto; flex: none; white-space: nowrap; }
    .finder-main { padding: 12px; }
    .projects-content-box.is-list .project-details { flex-direction: column; align-items: flex-start; gap: .3rem; }
    .projects-content-box.is-list .project-details h3 { min-width: 0; }
    .projects-content-box.is-list .project-num { display: none; }
}

/* ---------- GitHub app ---------- */
.gh-grid { display: grid; grid-template-columns: 280px 1fr; grid-template-rows: auto 1fr; gap: 1.2rem; }
.gh-card { padding: 1.3rem; border-radius: 12px; border: 1px solid var(--win-border); background: rgba(127, 127, 127, .04); min-width: 0; }
.gh-card h6 { margin: 0 0 .9rem; font: 700 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.gh-profile { grid-row: span 2; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.gh-profile img { width: 88px; height: 88px; border-radius: 50%; border: 3px solid var(--primary-color); margin-bottom: .4rem; }
.gh-profile h3 { margin: 0; font-size: 1.2rem; color: var(--heading-color); }
.gh-login { margin: 0; font: 13px var(--font-mono); color: var(--text-muted); }
.gh-bio { font-size: .9rem; color: var(--text-main); margin: .4rem 0; }
.gh-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: .6rem 0 1rem; font-size: .82rem; color: var(--text-muted); }
.gh-stats b { color: var(--heading-color); font-size: 1rem; display: block; }
.gh-profile .btn { font-size: .85rem; padding: .55rem 1.1rem; }
.gh-heat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: .75rem; }
.gh-heat-head h6 { margin: 0; }
.gh-ghlink { font: 600 11px var(--font-mono); color: var(--text-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; transition: color .2s; }
.gh-ghlink:hover { color: var(--primary-color); }
.gh-heat-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 86px; gap: 12px; align-items: start; }
.gh-cal-box { min-width: 0; border: 1px solid var(--win-border); border-radius: 10px; padding: .75rem .85rem; background: rgba(127, 127, 127, .03); }
.gh-heat-scroll { overflow-x: auto; padding-bottom: 4px; }
.gh-cal { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 7px; row-gap: 5px; }
.gh-months { display: grid; grid-template-columns: repeat(var(--gh-weeks, 53), minmax(9px, 1fr)); gap: 3px; font: 600 10px/1 var(--font-mono); color: var(--text-muted); }
.gh-months span { white-space: nowrap; overflow: visible; }
.gh-weekdays { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; align-items: center; font: 600 10px/1 var(--font-mono); color: var(--text-muted); text-align: left; user-select: none; }
.gh-weekdays span { display: flex; align-items: center; height: 100%; }
.gh-heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); grid-template-columns: repeat(var(--gh-weeks, 53), minmax(9px, 1fr)); gap: 3px; }
.gh-heatmap i { width: 100%; min-width: 9px; aspect-ratio: 1; border-radius: 2.5px; display: block; }
.gh-heatmap i.gh-pad { background: transparent; pointer-events: none; }
.l0 { background: rgba(127, 127, 127, .15); }
.l1 { background: #9be9a8; }
.l2 { background: #40c463; }
.l3 { background: #30a14e; }
.l4 { background: #216e39; }
body.dark-theme .l1 { background: #0e4429; }
body.dark-theme .l2 { background: #006d32; }
body.dark-theme .l3 { background: #26a641; }
body.dark-theme .l4 { background: #39d353; }
.gh-heat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: .65rem; }
.gh-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }
.gh-legend i { width: 11px; height: 11px; border-radius: 3px; display: block; }
.gh-note { font: 500 11px var(--font-mono); color: var(--text-muted); text-decoration: none; opacity: .85; transition: color .2s, opacity .2s; }
.gh-note:hover { color: var(--primary-color); opacity: 1; }
.gh-years { display: flex; flex-direction: column; gap: 4px; }
.gh-year-btn {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: 600 12px var(--font-mono);
    text-align: left;
    padding: 7px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .18s, color .18s;
}
.gh-year-btn:hover { background: rgba(127, 127, 127, .1); color: var(--heading-color); }
.gh-year-btn.is-active { background: var(--primary-color); color: #fff; }
@media (max-width: 960px) {
    .gh-heat-wrap { grid-template-columns: 1fr; }
    .gh-years { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .gh-year-btn { padding: 5px 10px; }
}
.gh-repo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.gh-repo {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: .8rem .9rem;
    border-radius: 10px;
    border: 1px solid var(--win-border);
    background: var(--win-bg);
    text-decoration: none;
    color: var(--text-main);
    transition: border-color .2s, transform .2s;
}
.gh-repo:hover { border-color: var(--primary-color); transform: translateY(-2px); }
.gh-repo-name { font: 600 13.5px var(--font-mono); color: var(--primary-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-repo-desc { font-size: .82rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gh-repo-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .75rem; color: var(--text-muted); margin-top: auto; }
.gh-repo-meta .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.gh-skel { height: 70px; border-radius: 10px; background: linear-gradient(90deg, rgba(127, 127, 127, .08), rgba(127, 127, 127, .18), rgba(127, 127, 127, .08)); background-size: 200% 100%; animation: skel 1.4s infinite; width: 100%; }
.gh-profile .gh-skel { height: 260px; }
@keyframes skel { to { background-position: -200% 0; } }
.gh-fail { color: var(--text-muted); font-size: .9rem; }
@media (max-width: 860px) { .gh-grid { grid-template-columns: 1fr; } .gh-profile { grid-row: auto; } }

/* ---------- Lock screen ---------- */
.os-lock {
    position: fixed;
    inset: 0;
    z-index: 9800;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 12vh 16px 10vh;
    color: #fff;
    background: rgba(2, 6, 23, .35);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    opacity: 0;
    transition: opacity .5s ease, transform .6s cubic-bezier(.6, 0, .3, 1);
    cursor: pointer;
    text-shadow: 0 2px 20px rgba(0, 0, 0, .35);
}
.os-lock.in { opacity: 1; }
.os-lock.out { transform: translateY(-100%); opacity: 1; }
.lock-clock { text-align: center; }
.lock-date { font: 600 1.3rem var(--font-primary); opacity: .9; }
.lock-time { font: 700 clamp(5rem, 14vw, 9rem)/1 var(--font-heading); letter-spacing: -0.04em; }
.lock-user { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lock-user img { width: 84px; height: 84px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); }
.lock-user b { font-size: 1.15rem; }
.lock-user span { font-size: .85rem; opacity: .8; animation: lockHint 2.4s ease-in-out infinite; }
@keyframes lockHint { 50% { opacity: .35; } }

/* ---------- Notes ---------- */
.notes-app { display: flex; flex-direction: column; height: 340px; background: #fefce8; }
body.dark-theme .notes-app { background: #1c1a0f; }
.notes-app textarea { flex: 1; padding: 16px 18px; border: 0; outline: 0; resize: none; background: transparent; color: #422006; font: 14px/1.7 var(--font-mono); }
body.dark-theme .notes-app textarea { color: #fef3c7; }
.notes-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 1px solid rgba(0, 0, 0, .08); }
.notes-state { font: 11.5px var(--font-mono); color: #a16207; }
.notes-foot .btn { font-size: .8rem; padding: .45rem .9rem; }

/* ---------- Calculator ---------- */
.calc { padding: 12px; background: #1c1c1e; outline: 0; }
.calc-screen { display: flex; flex-direction: column; align-items: flex-end; padding: 8px 8px 14px; color: #fff; min-height: 92px; justify-content: flex-end; }
.calc-expr { font: 13px var(--font-mono); color: #8e8e93; }
.calc-out { font: 300 2.8rem/1.1 var(--font-primary); overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.calc-keys button { aspect-ratio: 1; border: 0; border-radius: 50%; background: #3a3a3c; color: #fff; font: 500 1.25rem var(--font-primary); cursor: pointer; transition: filter .1s; }
.calc-keys button:active { filter: brightness(1.4); }
.calc-keys .fn { background: #a5a5aa; color: #000; }
.calc-keys .op { background: #ff9f0a; }
.calc-keys .op.on { background: #fff; color: #ff9f0a; }
.calc-keys .zero { grid-column: span 2; aspect-ratio: auto; border-radius: 999px; text-align: left; padding-left: 26px; }
.calc:focus-visible { box-shadow: inset 0 0 0 2px var(--primary-color); }

@media (max-width: 768px) {
    .dock-item[data-act="notes"], .dock-item[data-act="calc"] { display: none; }
}
