:root {
    --bar-h: 30px;
    --task-h: 44px;
    --status-h: 32px;            /* phone status bar */
    --nav-h: 28px;               /* phone gesture bar */
    --accent: #4df0f0;           /* the globe's cyan */
    --ink: #eef4f5;
    --muted: #93a5aa;
    --panel: rgba(9, 13, 15, 0.74);
    --edge: rgba(255, 255, 255, 0.14);
}

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

html, body {
    height: 100%;
    overflow: hidden;            /* a desktop doesn't scroll */
    background: #000;
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* Wallpaper: the globe fills the screen behind everything */
.canvas-holder { position: fixed; inset: 0; width: 100%; height: 100vh; background: #000; overflow: hidden; z-index: 0; }
.canvas-holder canvas { display: block; width: 100%; height: 100%; }

/* Top bar */
.menubar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--bar-h);
    display: flex; align-items: center; gap: 4px;
    padding: 0 92px 0 10px;      /* right padding keeps the clock clear of the GitHub corner */
    background: var(--panel);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    border-bottom: 1px solid var(--edge);
    font-size: 13px;
    z-index: 1000;
}
.menubar a { color: var(--ink); text-decoration: none; padding: 3px 10px; border-radius: 5px; }
.menubar a:hover, .menubar a:focus-visible { background: rgba(255, 255, 255, 0.14); outline: none; }
.brand { font-weight: 700; font-size: 15px; }
.tray { margin-left: auto; display: flex; gap: 14px; font-variant-numeric: tabular-nums; }
#clock-date { color: var(--muted); }
#clock-time { color: var(--accent); font-weight: 600; }

/* GitHub corner (kept) */
.github-corner { position: fixed; top: 0; right: 0; display: block; width: 80px; height: 80px; z-index: 2000; }
.github-corner svg { display: block; }
.github-corner { clip-path: polygon(0 0, 100% 0, 100% 100%); }   /* only the triangle is clickable */
.github-corner svg path { fill: #fff; }
.github-corner svg .octo-arm, .github-corner svg .octo-body { fill: #151513; }   /* the icon, set explicitly */

/* Desktop icons: js/desktop.js places them on a grid */
.icon {
    position: fixed; z-index: 1; width: 88px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 8px 4px 6px;
    color: var(--ink); font: inherit; font-size: 12.5px; line-height: 1.2; text-align: center;
    background: none; border: 1px solid transparent; border-radius: 8px; cursor: default;
    text-shadow: 0 1px 3px #000, 0 0 8px #000;
    touch-action: none; user-select: none; -webkit-user-select: none;
    transition: left 0.14s ease, top 0.14s ease;
}
.icon:hover { background: rgba(255, 255, 255, 0.08); }
.icon.selected { background: rgba(77, 240, 240, 0.18); border-color: rgba(77, 240, 240, 0.5); }
.icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon.dragging { z-index: 5; opacity: 0.85; cursor: grabbing; transition: none; }
.glyph {
    width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden;
    background: var(--panel); border: 1px solid var(--edge); border-radius: 12px;
}
.glyph svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.glyph img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }

/* Windows (built by the DeskWindow class in js/desktop.js) */
.window {
    position: fixed; z-index: 10; display: flex; flex-direction: column;
    background: rgba(20, 23, 26, 0.88);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--edge); border-radius: 10px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}
.window[hidden] { display: none; }
.window:not(.active) { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.window:not(.active) .wicon, .window:not(.active) .title, .window:not(.active) .cap { opacity: 0.6; }
.window.active { border-color: rgba(255, 255, 255, 0.24); }
.window.max { border-radius: 0; border-width: 0; }
.window.max .grip { display: none; }
.window.max .titlebar { padding-right: 52px; }   /* keep the buttons clear of the GitHub corner */
.titlebar {
    position: relative; flex: none; display: flex; align-items: center; gap: 8px; height: 32px; padding-left: 10px;
    background: rgba(255, 255, 255, 0.05); border-bottom: 1px solid var(--edge);
    cursor: default; touch-action: none; user-select: none; -webkit-user-select: none;
}
.wicon { flex: none; width: 16px; height: 16px; display: grid; place-items: center; }
.wicon svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wicon img { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; pointer-events: none; }
.title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink); pointer-events: none; }
.caption { align-self: stretch; display: flex; }
.cap { width: 46px; display: grid; place-items: center; color: var(--ink); background: transparent; border: 0; cursor: default; }
.cap svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1; }
.cap .i-back { display: none; }
.cap:hover { background: rgba(255, 255, 255, 0.12); }
.cap.close:hover { background: #c42b1c; color: #fff; }
.cap:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cap.max .i-restore { display: none; }
.window.max .cap.max .i-max { display: none; }
.window.max .cap.max .i-restore { display: block; }
.win-body { position: relative; flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.28) transparent; }
.grip {
    position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none;
    background: linear-gradient(135deg, transparent 52%, rgba(255, 255, 255, 0.35) 52% 60%, transparent 60% 72%, rgba(255, 255, 255, 0.35) 72% 80%, transparent 80%);
}

/* Window contents */
.about { padding: 28px 32px 34px; }
.about h1 { font-size: 3rem; line-height: 1; letter-spacing: -0.02em; }
.about .subtitle { margin-top: 10px; font-size: 1.1rem; color: var(--muted); }
.about h2 { margin-top: 26px; font-size: 1.15rem; color: var(--accent); }
.about p:last-child { margin-top: 8px; font-size: 1rem; line-height: 1.6; max-width: 62ch; }
.viewer { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

/* Project window */
.projects { padding: 22px 24px 26px; }
.projects h1 { font-size: 1.9rem; line-height: 1.1; letter-spacing: -0.02em; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 18px; }
.filter {
    font: inherit; font-size: 13px; color: var(--muted); cursor: pointer;
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--edge); border-radius: 999px; padding: 5px 14px;
}
.filter:hover { color: var(--ink); background: rgba(255, 255, 255, 0.12); }
.filter.on { color: var(--accent); background: rgba(77, 240, 240, 0.14); border-color: rgba(77, 240, 240, 0.5); }
.filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plist { list-style: none; display: grid; gap: 10px; }
.proj { padding: 14px 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge); border-radius: 8px; }
.proj[hidden] { display: none; }
.proj-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.proj h3 { font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.chip { flex: none; font-size: 11.5px; color: var(--accent); border: 1px solid rgba(77, 240, 240, 0.4); border-radius: 999px; padding: 1px 9px; }
.proj p { margin-top: 6px; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.proj iframe { display: block; max-width: 100%; margin-top: 10px; border: 0; }
.empty { color: var(--muted); }

/* Taskbar */
.taskbar {
    position: fixed; left: 0; right: 0; bottom: 0; height: var(--task-h);
    display: flex; align-items: center; gap: 4px; padding: 0 8px;
    background: var(--panel);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    border-top: 1px solid var(--edge);
    z-index: 1000;
}
.tb-item {
    position: relative; display: flex; align-items: center; gap: 8px;
    flex: 0 1 168px; min-width: 40px; height: 34px; padding: 0 12px;
    color: var(--ink); font: inherit; font-size: 12.5px; cursor: default;
    background: transparent; border: 1px solid transparent; border-radius: 6px;
}
.tb-item:hover { background: rgba(255, 255, 255, 0.1); }
.tb-item.active { background: rgba(255, 255, 255, 0.14); border-color: var(--edge); }
.tb-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tb-item::after {
    content: ""; position: absolute; left: 50%; bottom: 2px; width: 10px; height: 3px; margin-left: -5px;
    border-radius: 2px; background: var(--muted); transition: width 0.15s, margin-left 0.15s;
}
.tb-item.active::after { width: 18px; margin-left: -9px; background: var(--accent); }
.tb-item.min::after { opacity: 0.45; }
.tb-icon { flex: none; width: 20px; height: 20px; display: grid; place-items: center; }
.tb-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tb-icon img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; pointer-events: none; }
.tb-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn_link {background-color: white; color: rgb(0, 0, 0); padding: 8px 12px; text-decoration: none; border-radius: 4px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin-top: 8px; transition: background-color 0.2s, color 0.2s;}
.btn_link img {width: 16px; height: 16px; object-fit: contain; }

/* Phone UI: Android 14-style home screen (small screens only; keep 700px in sync with js/desktop.js) */
.statusbar, .glance, .navbar { display: none; }

@keyframes appopen { from { transform: scale(0.92); opacity: 0; } }

@media (max-width: 700px) {
    .menubar, .taskbar { display: none; }

    .statusbar {
        position: fixed; top: 0; left: 0; right: 0; height: var(--status-h); z-index: 1000; pointer-events: none;
        display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
        font-size: 14px; font-weight: 500; letter-spacing: 0.01em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }
    .status-icons { display: flex; align-items: center; gap: 6px; }
    .status-icons svg { width: 16px; height: 16px; fill: #fff; }

    .glance { display: block; position: fixed; top: calc(var(--status-h) + 18px); left: 24px; z-index: 1; pointer-events: none; }
    .glance-date { font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; }
    .glance-sub { margin-top: 4px; font-size: 14px; color: rgba(255, 255, 255, 0.8); }

    #desktop {
        position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 28px); z-index: 1;
        display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 0; padding: 0 12px;
    }
    .icon, .icon:hover, .icon.selected {
        position: static; width: auto; padding: 0; gap: 8px;
        background: none; border-color: transparent; touch-action: manipulation;
    }
    .icon .glyph { width: 58px; height: 58px; border-radius: 50%; transition: transform 0.12s; }
    .icon:active .glyph { transform: scale(0.92); }
    .glyph svg { width: 28px; height: 28px; }
    .label { font-size: 12px; }

    .window {
        inset: 0 !important; width: 100% !important; height: 100% !important;
        border: 0; border-radius: 0; box-shadow: none; background: #131417;
        -webkit-backdrop-filter: none; backdrop-filter: none;
        animation: appopen 0.2s ease-out;
    }
    .window:not(.active) { box-shadow: none; }
    .titlebar { height: 56px; margin-top: var(--status-h); padding: 0 8px 0 4px; gap: 4px; background: transparent; border-bottom: 0; }
    .caption { order: -1; }
    .cap.min, .cap.max, .wicon, .grip { display: none; }
    .cap.close { width: 48px; height: 48px; border-radius: 50%; }
    .cap.close .i-x { display: none; }
    .cap.close .i-back { display: block; width: 24px; height: 24px; fill: currentColor; stroke: none; }
    .title { font-size: 20px; font-weight: 500; }
    .win-body { padding-bottom: var(--nav-h); }

    .github-corner { top: var(--status-h); width: 56px; height: 56px; }
    .github-corner svg { width: 100%; height: 100%; }

    .navbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); z-index: 1000; justify-content: center; align-items: center; pointer-events: none; }
    .navpill { position: relative; width: 160px; height: 100%; border: 0; background: none; touch-action: none; cursor: pointer; pointer-events: auto; }
    .navpill::before { content: ""; position: absolute; left: 50%; top: 50%; width: 108px; height: 4px; margin: -2px 0 0 -54px; border-radius: 2px; background: rgba(255, 255, 255, 0.92); }

}
