/* ============================================================
   Chris Gal — VS Code style portfolio
   Recreated from the Claude Design handoff (desktop + mobile).
   Colors/sizes match the prototype; accent is themeable via --accent.
   ============================================================ */

:root {
    --accent: #007acc;
    --bg: #1e1e1e;
    --titlebar: #323233;
    --activity: #333333;
    --sidebar: #252526;
    --tab-inactive: #2d2d2d;
    --terminal: #181818;
    --border: #1b1b1b;
    --text: #cccccc;
    --text-bright: #d4d4d4;
    --muted: #6f6f6f;
    --muted2: #858585;
    --gutter: #5a5a5a;
    /* syntax */
    --kw: #569cd6;
    --green: #6a9955;
    --prop: #9cdcfe;
    --str: #ce9178;
    --type: #4ec9b0;
    --purple: #c586c0;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --ui: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--ui);
    overflow: hidden;
}
a {
    color: inherit;
}
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
@keyframes blink {
    0%,
    49% {
        opacity: 1;
    }
    50%,
    100% {
        opacity: 0;
    }
}

.app {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* ===== TITLE BAR (desktop) ===== */
.titlebar {
    height: 36px;
    flex: none;
    display: flex;
    align-items: center;
    background: var(--titlebar);
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
}
.dots {
    display: flex;
    gap: 8px;
    align-items: center;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot--r {
    background: #ff5f56;
}
.dot--y {
    background: #ffbd2e;
}
.dot--g {
    background: #27c93f;
}
.titlebar__title {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: #9d9d9d;
    font-family: var(--mono);
}
.titlebar__spacer {
    width: 60px;
}

/* ===== TOP BAR (mobile) ===== */
.topbar {
    display: none;
    height: 42px;
    flex: none;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    background: var(--titlebar);
    border-bottom: 1px solid var(--border);
}
.topbar__btn,
.topbar__link {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text);
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.topbar__link {
    color: #9d9d9d;
    font-size: 16px;
}
.topbar__title {
    flex: 1;
    text-align: center;
    font-size: 13px;
    color: #cfcfcf;
    font-family: var(--mono);
}

/* ===== MIDDLE ===== */
.main {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* activity bar */
.activitybar {
    width: 50px;
    flex: none;
    background: var(--activity);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 12px;
    gap: 20px;
}
.activitybar__icon {
    font-size: 21px;
    color: var(--muted2);
    line-height: 1;
}
.activitybar__icon--active {
    font-size: 22px;
    color: #fff;
    border-left: 2px solid var(--accent);
    width: 100%;
    text-align: center;
}
.activitybar__bottom {
    margin-top: auto;
    padding-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

/* sidebar / explorer */
.sidebar {
    width: 230px;
    flex: none;
    background: var(--sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}
.sidebar__title {
    padding: 12px 18px 8px;
    font-size: 11px;
    letter-spacing: 1px;
    color: #bbb;
}
.explorer {
    padding: 4px 0;
    font-size: 13px;
    font-family: var(--mono);
    flex: 1;
    overflow: auto;
}
.explorer__root {
    padding: 3px 14px;
    color: var(--text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}
.explorer__item {
    padding: 4px 14px 4px 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text);
    background: transparent;
}
.explorer__item:hover {
    background: #2a2d2e;
}
.explorer__item.is-active {
    background: #37373d;
}
.explorer__ico {
    font-size: 10px;
    font-weight: 700;
}
.ico--blue {
    color: #519aba;
}
.ico--yellow {
    color: #cbcb41;
}
.ico--red {
    color: #cc3e44;
}
.sidebar__footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 11px;
}
.sidebar__footer a {
    color: #6f9bd1;
    text-decoration: none;
}
.drawer-handle,
.sheet-handle {
    display: none;
}

/* editor column */
.editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

/* tabs */
.tabs {
    height: 36px;
    flex: none;
    display: flex;
    background: var(--sidebar);
    overflow-x: auto;
}
.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px 0 14px;
    height: 36px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--mono);
    white-space: nowrap;
    color: #9d9d9d;
    background: var(--tab-inactive);
    border-top: 2px solid transparent;
    border-right: 1px solid var(--border);
}
.tab.is-active {
    color: #fff;
    background: var(--bg);
    border-top-color: var(--accent);
}
.tab__ico {
    font-size: 9px;
    font-weight: 700;
}
.tab__close {
    margin-left: 6px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 14px;
    color: #9d9d9d;
}
.tab__close:hover {
    background: #ffffff22;
}

/* editor body */
.editor-body {
    flex: 1;
    overflow: auto;
    min-height: 0;
}
.panel {
    display: none;
    height: 100%;
    min-height: 100%;
}
.panel.is-active {
    display: block;
}

/* welcome */
.welcome {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--muted);
    font-family: var(--mono);
    text-align: center;
    padding: 0 24px;
}
.welcome__logo {
    font-size: 64px;
    color: #37373d;
    font-weight: 700;
}
.welcome__hint {
    font-size: 12px;
    color: var(--gutter);
}
.welcome__hint .kw {
    color: var(--accent);
}

/* code views */
.code {
    display: flex;
    height: fit-content;
    min-height: 100%;
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 23px;
    overflow-x: auto;
}
.code__gutter {
    color: var(--gutter);
    text-align: right;
    padding: 14px 16px 14px 22px;
    user-select: none;
    white-space: pre;
    flex: none;
}
.code__body {
    padding: 14px 24px;
    height: 100%;
    color: var(--text-bright);
    flex: 1;
    min-width: 0;
}
/* keep one logical line = one visual line so gutter numbers stay aligned */
.code__body > div {
    white-space: nowrap;
}
/* code-line indentation via padding (replaces leading whitespace) */
.code__body .il1 {
    padding-left: 2ch;
}
.code__body .il2 {
    padding-left: 4ch;
}
.code__body a {
    text-decoration: none;
}
.code__body .spacer {
    color: transparent;
    user-select: none;
}
.kw {
    color: var(--kw);
}
.kw-b {
    color: var(--kw);
    font-weight: 700;
}
.cmt {
    color: var(--green);
    font-style: italic;
}
.prop {
    color: var(--prop);
}
.str {
    color: var(--str);
}
.type {
    color: var(--type);
}
.bullet {
    color: var(--purple);
}

/* contact form */
.cform {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 6px 24px 0;
    font-family: var(--mono);
}
.cform__comment {
    color: var(--green);
    font-size: 13px;
}
.cform__row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.cform label {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cform label.full {
    flex-basis: 100%;
}
.cform__lbl {
    font-size: 12px;
    color: var(--prop);
}
.cform input,
.cform textarea {
    background: #2d2d2d;
    border: 1px solid #3c3c3c;
    border-radius: 5px;
    padding: 9px 11px;
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
}
.cform textarea {
    resize: vertical;
    min-height: 92px;
}
.cform input:focus,
.cform textarea:focus {
    border-color: var(--accent);
}
.cform input::placeholder,
.cform textarea::placeholder {
    color: var(--gutter);
}
.cform__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-family: var(--mono);
    font-size: 13px;
    cursor: pointer;
}
.btn:hover {
    filter: brightness(1.12);
}
.cform__sent {
    color: var(--green);
    font-size: 12px;
}
[hidden] {
    display: none !important;
}

/* resume */
.resume {
    position: relative;
}
.resume__dl {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 16px;
    font-size: 12px;
    font-family: var(--mono);
    cursor: pointer;
}
.resume__dl:hover {
    filter: brightness(1.1);
}
/* mobile fallback (mobile browsers can't render inline PDFs) */
.resume__mobile {
    display: none;
}

/* ===== TERMINAL ===== */
.terminal {
    height: 200px;
    flex: none;
    background: var(--terminal);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.terminal__tabs {
    display: flex;
    gap: 18px;
    padding: 7px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    letter-spacing: 0.5px;
}
.terminal__tab {
    color: var(--muted);
}
.terminal__tab--active {
    color: var(--text);
    border-bottom: 1px solid var(--accent);
    padding-bottom: 4px;
}
.terminal__shell {
    margin-left: auto;
    color: var(--muted);
    font-family: var(--mono);
}
.terminal__close {
    display: none;
}
.terminal__body {
    flex: 1;
    overflow: auto;
    padding: 10px 16px;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.65;
}
.term-line {
    white-space: pre-wrap;
}
.term-line--out {
    color: #9aa0a6;
}
.term-line--accent {
    color: #7fd0ff;
}
.term-line--list {
    color: #6a9955;
}
.term-line--err {
    color: #e06c75;
}
.term-line--sys {
    color: var(--muted);
}
.term-line--link a {
    color: #7fd0ff;
}
.term-cmd {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}
.term-prompt-user {
    color: #27c93f;
    font-weight: 700;
}
.term-prompt-colon {
    color: var(--muted);
}
.term-prompt-tilde {
    color: var(--accent);
}
.term-prompt-dollar {
    color: var(--text-bright);
}
.terminal__input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}
.terminal__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-bright);
    font-family: var(--mono);
    font-size: 13px;
    caret-color: var(--accent);
}
.terminal__input::placeholder {
    color: var(--gutter);
}

/* ===== STATUS BAR ===== */
.statusbar {
    height: 24px;
    flex: none;
    background: var(--accent);
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 12px;
    color: #fff;
    font-family: var(--mono);
    gap: 16px;
}
.statusbar a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}
.statusbar span {
    opacity: 0.9;
}
.statusbar__lang {
    margin-left: auto;
}

/* language switch */
.lang-switch {
    display: flex;
    gap: 4px;
    align-items: center;
}
.lang-switch a {
    padding: 0 2px;
    opacity: 0.65;
}
.lang-switch a.is-active {
    opacity: 1;
    text-decoration: underline;
}

/* ===== MOBILE BOTTOM TOOLBAR ===== */
.toolbar {
    display: none;
    height: 46px;
    flex: none;
    background: var(--sidebar);
    border-top: 1px solid var(--border);
}
.toolbar__btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #cfcfcf;
    font-family: var(--mono);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.toolbar__btn span:first-child {
    font-size: 16px;
}
.toolbar__btn span:last-child {
    font-size: 9px;
}

.scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
}
.scrim.is-open {
    display: block;
}

/* ============================================================
   RESPONSIVE — mobile layout (<= 820px)
   ============================================================ */
@media (max-width: 820px) {
    .titlebar {
        display: none;
    }
    .topbar {
        display: flex;
    }
    .activitybar {
        display: none;
    }
    .toolbar {
        display: flex;
    }

    /* hide tabs scrollbar on mobile */
    .tabs {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .tabs::-webkit-scrollbar {
        display: none;
    }

    /* sidebar becomes a bottom drawer */
    .sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        z-index: 41;
        max-height: 72%;
        border-right: none;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
        transform: translateY(110%);
        transition: transform 0.25s ease;
    }
    .sidebar.is-open {
        transform: translateY(0);
    }
    .drawer-handle {
        display: block;
        width: 38px;
        height: 4px;
        border-radius: 2px;
        background: #555;
        margin: 8px auto 12px;
    }
    .sidebar__footer {
        display: none;
    }
    .explorer__item {
        padding: 11px 20px;
        font-size: 14px;
        gap: 12px;
    }

    /* terminal becomes a bottom sheet */
    .terminal {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 64%;
        z-index: 41;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
        transform: translateY(110%);
        transition: transform 0.25s ease;
    }
    .terminal.is-open {
        transform: translateY(0);
    }
    .terminal__shell {
        display: none;
    }
    .terminal__close {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        width: 26px;
        height: 26px;
        border-radius: 6px;
        font-size: 18px;
        color: #9d9d9d;
        background: none;
        border: none;
        cursor: pointer;
    }
    .terminal__tab--active {
        margin-top: 0;
    }

    .statusbar__hide-mobile {
        display: none;
    }
    .resume {
        padding: 16px 14px 28px;
    }
    .resume__paper {
        padding: 26px 22px;
    }
    .resume__embed {
        display: none;
    }
    .resume__mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        margin: 40px auto;
        max-width: 320px;
        padding: 32px 24px;
        background: var(--sidebar);
        border: 1px solid var(--border);
        border-radius: 12px;
        text-decoration: none;
        color: var(--text-bright);
        font-family: var(--mono);
        text-align: center;
    }
    .resume__mobile-ico {
        color: var(--accent);
        line-height: 0;
    }
    .resume__mobile-title {
        font-size: 14px;
        color: var(--muted);
    }
    .resume__mobile-btn {
        background: var(--accent);
        color: #fff;
        border-radius: 6px;
        padding: 10px 22px;
        font-size: 13px;
    }
    .code {
        font-size: 12.5px;
        line-height: 21px;
    }
}
