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

:root {
    --bg: #ffffff;
    --bg-muted: #f3f7ff;
    --bg-subtle: #fafcff;
    --border: #d8e2f2;
    --text: #09090b;
    --text-muted: #526075;
    --text-subtle: #7890ad;
    --cursor-bg: #18181b;
    --cursor-text: #fafafa;
    --cursor-meta: rgba(250, 250, 250, 0.55);
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: #dbeafe;
    --accent-glow: rgba(37, 99, 235, 0.18);
    --font: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "Fira Code", monospace;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Shell layout ── */

.shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ── Panels ── */

.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border);
}

.panel:last-child {
    border-right: none;
}

.panel-nav {
    width: 164px;
    flex-shrink: 0;
}

.panel-items {
    width: 256px;
    flex-shrink: 0;
}

.panel-preview {
    flex: 1;
    min-width: 0;
}

.panel-header {
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-muted);
    flex-shrink: 0;
}

.panel-title {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    user-select: none;
    font-family: var(--font-mono);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    list-style: none;
}

/* Scrollbar */
.panel-body::-webkit-scrollbar {
    width: 3px;
}
.panel-body::-webkit-scrollbar-track {
    background: transparent;
}
.panel-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ── Menu rows ── */

.menu-btn {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 6px 12px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    gap: 2px;
    border-left: 2px solid transparent;
}

.menu-btn:hover {
    background: var(--bg-muted);
}

.menu-btn.is-active {
    background: var(--bg-muted);
    color: var(--text);
    border-left-color: var(--accent);
}

.menu-btn.is-active .meta {
    color: var(--text-muted);
}

.panel-focused .menu-btn.is-active {
    background: var(--cursor-bg);
    color: var(--cursor-text);
    border-left-color: var(--cursor-bg);
}

.panel-focused .menu-btn.is-active .meta {
    color: var(--cursor-meta);
}

.menu-btn .main {
    font-weight: 500;
}

.menu-btn .meta {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Preview panel body ── */

#data-view {
    padding: 20px 24px;
    overflow-y: auto;
    height: 100%;
    color: var(--text-muted);
    font-size: 13px;
}

#data-view.detail-project--shots {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

#data-view.detail-project--shots .detail-title,
#data-view.detail-project--shots .detail-copy,
#data-view.detail-project--shots .tech-list {
    flex-shrink: 0;
}

#data-view.detail-project--shots .carousel-head {
    margin-top: 4px;
}

#data-view.detail-project--shots .shot {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: 8px;
}

#data-view::-webkit-scrollbar {
    width: 3px;
}
#data-view::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ── Detail content ── */

.detail-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.detail-copy {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 14px;
}

.detail-subtitle {
    font-size: 11px;
    color: var(--text-subtle);
    margin-top: 8px;
}

.project-actions,
.tech-list,
.tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.project-actions {
    gap: 8px;
    margin-bottom: 10px;
}

.tech-list {
    align-items: center;
    row-gap: 8px;
}

.tech-sep {
    width: 1px;
    height: 18px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 10px 0 8px;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-muted);
    color: var(--text);
    white-space: nowrap;
}

.badge.open {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--accent-strong);
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-family: var(--font);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        border-color 140ms ease,
        background-color 140ms ease;
}

.link-btn:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    box-shadow: 0 12px 26px var(--accent-glow);
}

.link-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.link-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.link-btn__icon svg {
    width: 13px;
    height: 13px;
}

.link-btn__label {
    line-height: 1;
}

.link-btn--live {
    background: linear-gradient(
        135deg,
        var(--accent) 0%,
        var(--accent-strong) 100%
    );
    border-color: var(--accent-strong);
    color: #ffffff;
    box-shadow: 0 14px 30px var(--accent-glow);
}

.link-btn--live:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    border-color: #1e40af;
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
}

.link-btn--github {
    background: linear-gradient(135deg, #111827 0%, #030712 100%);
    border-color: #09090b;
    color: #fafafa;
    box-shadow: 0 12px 24px rgba(3, 7, 18, 0.22);
}

.link-btn--github:hover {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-color: #111827;
    box-shadow: 0 18px 32px rgba(3, 7, 18, 0.28);
}

/* ── Screenshot carousel ── */

.carousel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.carousel-controls {
    display: flex;
    gap: 5px;
}

.control-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-family: var(--font);
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.control-btn:hover {
    background: var(--bg-muted);
}

.shot {
    margin: 0;
}

.shot img {
    width: 100%;
    flex: 1;
    min-height: 0;
    max-width: none;
    max-height: none;
    display: block;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    object-fit: contain;
}

.shot figcaption {
    font-size: 11px;
    color: var(--text-subtle);
    margin-top: 4px;
}

/* ── Experience ── */

.entry {
    margin-bottom: 18px;
}

.entry h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
}

.when {
    font-size: 11px;
    color: var(--text-subtle);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.entry ul {
    list-style: disc;
    padding-left: 18px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.9;
    margin-top: 6px;
}

/* ── About ── */

.about-block h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.about-section-heading {
    margin-top: 18px;
}

.contact-info {
    margin-bottom: 14px;
}

.contact-line {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

/* ── Status bar ── */

.statusbar {
    height: 26px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-top: 1px solid var(--border);
    background: var(--cursor-bg);
    color: var(--cursor-text);
    font-size: 11px;
    flex-shrink: 0;
    user-select: none;
}

.status-mode {
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.06em;
    color: #fafafa;
    font-family: var(--font-mono);
}

.status-sep {
    color: rgba(250, 250, 250, 0.25);
}

.status-spacer {
    flex: 1;
}

.status-hint {
    font-size: 10px;
    color: rgba(250, 250, 250, 0.45);
    font-family: var(--font-mono);
}

#status-text {
    font-size: 11px;
    color: rgba(250, 250, 250, 0.8);
    font-family: var(--font-mono);
}

#clock {
    font-size: 10px;
    color: rgba(250, 250, 250, 0.6);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ── Lightbox ── */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.88);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
}

.lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

.lightbox-img {
    max-width: 82vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid rgba(250, 250, 250, 0.1);
    display: block;
}

.lightbox-caption {
    font-size: 11px;
    color: rgba(250, 250, 250, 0.45);
    margin-top: 8px;
    text-align: center;
    font-family: var(--font-mono);
}

.lightbox-counter {
    font-size: 11px;
    color: rgba(250, 250, 250, 0.4);
    font-family: var(--font-mono);
    margin-top: 4px;
    text-align: center;
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    z-index: 1002;
}

.lightbox-close:hover {
    background: rgba(250, 250, 250, 0.1);
    color: #fafafa;
}

.lightbox-nav {
    background: none;
    border: 1px solid rgba(250, 250, 250, 0.2);
    color: rgba(250, 250, 250, 0.65);
    border-radius: 4px;
    width: 36px;
    height: 52px;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font);
    line-height: 1;
}

.lightbox-nav:hover {
    background: rgba(250, 250, 250, 0.1);
    color: #fafafa;
}

.lightbox-nav[hidden] {
    visibility: hidden;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}

/* ── Mobile Responsiveness ── */
@media (max-width: 768px) {
    .workspace {
        flex-direction: column;
    }

    .panel {
        width: 100% !important;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .panel:last-child {
        border-bottom: none;
    }

    .panel-nav,
    .panel-items {
        height: auto;
        flex-shrink: 0;
    }

    .panel-nav .panel-body,
    .panel-items .panel-body {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        -ms-overflow-style: none; /* IE and Edge */
        scrollbar-width: none; /* Firefox */
    }

    .panel-nav .panel-body::-webkit-scrollbar,
    .panel-items .panel-body::-webkit-scrollbar {
        display: none;
    }

    .panel-nav .menu-btn,
    .panel-items .menu-btn {
        width: auto;
        flex-shrink: 0;
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 10px 16px;
        white-space: nowrap;
    }

    .panel-items .menu-btn {
        max-width: 220px;
    }

    .panel-nav .menu-btn.is-active,
    .panel-items .menu-btn.is-active {
        border-left-color: transparent;
        border-bottom-color: var(--border);
    }

    .panel-focused .panel-nav .menu-btn.is-active,
    .panel-focused .panel-items .menu-btn.is-active {
        border-left-color: transparent;
        border-bottom-color: var(--cursor-bg);
    }

    .panel-preview {
        flex: 1;
        overflow: hidden;
    }

    .link-btn {
        padding: 6px 14px;
        font-size: 12px;
    }

    #data-view {
        padding: 16px;
    }

    .status-hint {
        display: none; /* Hide keyboard shortcuts hint on small screens */
    }

    .statusbar {
        padding: 0 8px;
        font-size: 10px;
    }

    #status-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    /* Adjust Lightbox for mobile */
    .lightbox-img {
        max-width: 100vw;
        max-height: 80vh;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.4);
        border: none;
        color: #fff;
        width: 44px;
        height: 60px;
        font-size: 28px;
    }

    .lightbox-nav:hover {
        background: rgba(0, 0, 0, 0.6);
    }

    .lightbox-prev {
        left: 4px;
    }

    .lightbox-next {
        right: 4px;
    }

    .lightbox-close {
        position: fixed;
        top: 16px;
        right: 16px;
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        border: none;
        z-index: 1002;
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 50%;
    }
}

// ...existing code...
.lightbox-close {
    padding: 6px 12px;
    font-size: 16px;
    font-family: var(--font);
    background: transparent;
    border: none;
    color: rgba(250, 250, 250, 0.6);
    cursor: pointer;
}

.lightbox-close:hover {
    color: #fafafa;
}

/* ── Boot screen ── */

.boot-screen {
    position: fixed;
    inset: 0;
    background: #18181b;
    color: #fafafa;
    font-family: var(--font-mono);
    font-size: 13px;
    z-index: 9999;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: opacity 0.3s ease-out;
}

.boot-screen.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.boot-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.boot-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.5;
}

.boot-cursor {
    display: inline-block;
    width: 10px;
    height: 16px;
    background: #fafafa;
    margin-top: 4px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}
