/* =====================================================================
   DEFAULT GUI WINDOW LAYOUT  —  edit the numbers on these two lines.
   Values are % of the desktop (the whole viewport):
     left / top      = where the window's top-left corner starts
     width / height   = the window's size
   JS reads these once on load and converts them to pixels, after which
   the window drags / resizes freely.  (Applied only above 900px wide.)

   KEEP the leading "#"  —  in CSS it is the id selector, not a comment.
   ===================================================================== */
#winProjects { left: 2.5%; top: 3%;  width: 77%; height: 88%; }   /* left "browser" window  */
#winAbout   { left: 53%;  top: 44%; width: 44%; height: 54%; }   /* right "editor" window  */

.win-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    cursor: grab;
    user-select: none;
}
.win-bar:active { cursor: grabbing; }

.win-lights { display: flex; gap: 0.5rem; flex-shrink: 0; }
.l-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.l-dot:hover { filter: brightness(0.85); }
.l-close { background: #ff5f56; }   /* → minimize */
.l-min { background: #ffbd2e; }     /* → minimize */
.l-max { background: #27c93f; }     /* → maximize */

/* sidebar toggle, shared by the editor (About) and Settings windows */
.ed-toggle, .set-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 22px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
}
.ed-toggle:hover, .set-toggle:hover { color: var(--text-primary); background: var(--bg-secondary); }
.win--editor.ed-collapsed .ed-files { display: none; }
.win--settings.set-collapsed .set-nav { display: none; }

.win-name {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.win-body {
    flex: 1;
    overflow: auto;
    background: var(--bg-card);
}

/* --- invisible resize zones on every edge + corner --- */
.win-rz { position: absolute; z-index: 12; }
.win-rz--n  { top: -4px;    left: 10px;  right: 10px; height: 12px;  cursor: ns-resize; }
.win-rz--s  { bottom: -4px; left: 10px;  right: 10px; height: 12px;  cursor: ns-resize; }
.win-rz--e  { right: -4px;  top: 10px;   bottom: 10px; width: 12px;  cursor: ew-resize; }
.win-rz--w  { left: -4px;   top: 10px;   bottom: 10px; width: 12px;  cursor: ew-resize; }
.win-rz--ne { top: -5px;    right: -5px; width: 18px;  height: 18px; cursor: nesw-resize; }
.win-rz--nw { top: -5px;    left: -5px;  width: 18px;  height: 18px; cursor: nwse-resize; }
.win-rz--se { bottom: -5px; right: -5px; width: 18px;  height: 18px; cursor: nwse-resize; }
.win-rz--sw { bottom: -5px; left: -5px;  width: 18px;  height: 18px; cursor: nesw-resize; }

/* --- browser window: working nav bar --- */
.browser-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.7rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}
.bb-nav {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
}
.bb-nav svg { width: 15px; height: 15px; }
.bb-nav:hover:not(:disabled) { background: var(--bg-card); color: var(--text-primary); }
.bb-nav:disabled { opacity: 0.3; cursor: default; }
.bb-url {
    flex: 1;
    min-width: 0;
    margin-left: 0.3rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.3rem 0.95rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
    outline: none;
}
.bb-url:focus { border-color: var(--text-secondary); }

.site {
    font-family: 'Newsreader', Georgia, 'Times New Roman', 'Songti SC', 'Songti TC', 'Noto Serif CJK SC', 'Noto Serif CJK TC', serif;
    color: var(--text-primary);
    padding: 3rem clamp(1.5rem, 5%, 4rem) 4rem;
    /* fills the Portfolio window at every width. Put e.g. `max-width: 1080px`
       back here if the intro lines ever feel too long on a huge window. */
    max-width: none;
}
.site-name {
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
}
.site-lead {
    font-size: clamp(1.05rem, 2.4vw, 1.3rem);
    line-height: 1.6;
    margin-bottom: 1.1rem;
    color: var(--text-primary);
}
.site-lead--quiet { color: var(--text-secondary); }

.site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0 2.75rem;
}
.site-link {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.02rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.site-link:hover { background: var(--bg-tertiary); transform: translateY(-1px); }

/* --- the ORIGINAL tabbed projects box, dropped inside the browser window --- */
.win--browser .projects-tabbed-box {
    margin-top: 1.75rem;
    /* original look = sans-serif, even though the header above stays serif */
    font-family: var(--font-sans);
}
.win--browser .projects-tabbed-box * { font-family: inherit; }
.win--browser .projects-tab-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
}
.win--browser .projects-tab-content {
    padding: 2.25rem;
    min-height: 0;
}
.win--browser .project-panel-title { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.win--browser .project-link {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

/* --- phones only: the browser-window project box collapses into a v1-style
       vertical accordion (tabs become stacked headers, one panel open) --- */
@media (max-width: 600px) {
    .win--browser .projects-tabbed-box.pj-accordion .projects-tab-bar {
        flex-direction: column;
        flex-wrap: nowrap;
        overflow-x: visible;
    }
    .win--browser .pj-accordion .project-tab {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        justify-content: space-between;
        padding: 0.95rem 1.15rem;
    }
    .win--browser .pj-accordion .project-tab:last-of-type {
        border-bottom: none;
    }
    .win--browser .pj-accordion .project-tab.active {
        border-bottom: 2px solid var(--pill-home);
    }
    .win--browser .pj-accordion .projects-tab-content {
        display: none;
    }
    .win--browser .pj-accordion .project-panel {
        width: 100%;
        padding: 1.25rem 1.15rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-primary);
    }
    .win--browser .pj-accordion .project-panel:last-child {
        border-bottom: none;
    }
}

/* --- a résumé file opened as a "page" in the browser window --- */
.doc-page {
    font-family: var(--font-sans);
    padding: 2.4rem clamp(1.5rem, 5%, 3.5rem) 3rem;
    max-width: none;
}
.doc-page-path {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1.6rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}
.doc-404 {
    font-family: var(--font-sans);
    padding: 3rem clamp(1.5rem, 5%, 3.5rem);
    color: var(--text-secondary);
}
.doc-404 h2 { color: var(--text-primary); font-size: 1.3rem; margin-bottom: 1rem; }
.doc-404 code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.08rem 0.4rem;
}
.doc-404 ul { margin: 0.9rem 0 1.4rem; padding-left: 1.3rem; display: grid; gap: 0.4rem; }
.doc-link {
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
}
.doc-link:hover { text-decoration: underline; }

/* --- editor window (about / education / awards / leadership / skills) --- */
.win-body--editor { display: flex; overflow: hidden; }

.ed-files {
    flex-shrink: 0;
    width: 9.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    padding: 0.6rem 0.5rem;
    overflow-y: auto;
}
.ed-file {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.ed-file:hover { color: var(--text-primary); background: var(--bg-secondary); }
.ed-file.is-active {
    color: var(--text-primary);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.ed-main {
    flex: 1;
    overflow: auto;
    padding: 1.4rem 1.6rem 2rem;
}
.ed-code {
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.65;
    white-space: pre;
    overflow-x: auto;
    color: var(--text-primary);
}

.md { color: var(--text-primary); }
.md-h {
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 1rem;
}
.md-h2 {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    margin: 1.1rem 0 0.35rem;
}
.md-p { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6; }
.md-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.md-list li {
    position: relative;
    padding-left: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.95rem;
}
.md-list li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: 'Fira Code', monospace;
}
