:root {
    --page: #f5f5f7;
    --paper: #ffffff;
    --pearl: #fafafc;
    --ink: #1d1d1f;
    --ink-soft: #333333;
    --muted: #6e6e73;
    --muted-on-dark: #cccccc;
    --black: #000000;
    --tile-1: #272729;
    --tile-2: #2a2a2c;
    --tile-3: #252527;
    --line: #e0e0e0;
    --line-soft: rgba(0, 0, 0, 0.08);
    --line-on-dark: rgba(255, 255, 255, 0.16);
    --blue: #0066cc;
    --blue-on-dark: #2997ff;
    --focus: #0071e3;
    --good: #34c759;
    --product-shadow: 3px 5px 30px rgba(0, 0, 0, 0.22);
    --radius-lg: 18px;
    --radius-md: 11px;
    --radius-sm: 8px;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "PingFang SC", sans-serif;
    --font-mono: "SF Mono", Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-main);
    color: var(--ink);
    background: var(--page);
    line-height: 1.47;
    letter-spacing: -0.374px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

a {
    color: inherit;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
}

.skip-link:focus-visible {
    left: 14px;
    top: 14px;
    background: var(--blue);
    color: #ffffff;
    text-decoration: none;
    border-radius: 999px;
    padding: 11px 18px;
}

.site-shell {
    width: 100%;
    margin: 0;
    padding: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 max(22px, calc((100vw - 1240px) / 2));
    color: #f5f5f7;
    background: rgba(0, 0, 0, 0.86);
    backdrop-filter: saturate(180%) blur(20px);
    border: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: #1d1d1f;
    font-size: 0.86rem;
    font-weight: 600;
}

.brand strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.12px;
}

.brand span {
    display: block;
    margin-top: 3px;
    color: rgba(245, 245, 247, 0.68);
    font-size: 0.68rem;
    line-height: 1;
    letter-spacing: -0.08px;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 2px;
    flex-wrap: wrap;
}

.nav a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 13px;
    color: rgba(245, 245, 247, 0.76);
    text-decoration: none;
    font-size: 0.76rem;
    letter-spacing: -0.12px;
    border: 0;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.is-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.top-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.status-pill {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 7px 11px;
    color: rgba(245, 245, 247, 0.86);
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.72rem;
    letter-spacing: -0.12px;
    white-space: nowrap;
}

.status-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--good);
    animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.62;
        transform: scale(1.35);
    }
}

main {
    margin: 0;
}

.hero,
.section-grid,
.timeline,
.page-grid,
.project-grid,
.footer {
    position: relative;
    margin: 0;
    border: 0;
    box-shadow: none;
}

.hero {
    min-height: calc(100vh - 44px);
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 22px;
    padding: 88px max(24px, calc((100vw - 980px) / 2));
    text-align: center;
    color: #ffffff;
    background: var(--black);
}

body[data-page="about"] .hero,
body[data-page="projects"] .hero {
    min-height: 58vh;
    background: var(--tile-1);
}

.eyebrow {
    margin: 0;
    color: var(--blue-on-dark);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.29;
    letter-spacing: -0.224px;
}

.hero h1 {
    max-width: 920px;
    margin: 0;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 1.07;
    letter-spacing: -0.28px;
    text-wrap: balance;
}

body[data-page="home"] .hero h1 {
    font-size: 4.6rem;
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.subtitle {
    max-width: 760px;
    margin: 0;
    color: var(--muted-on-dark);
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.5;
    letter-spacing: 0;
    text-wrap: balance;
}

.ai-disclaimer {
    max-width: 820px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1px solid rgba(41, 151, 255, 0.5);
    border-radius: 18px;
    background: rgba(41, 151, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.96rem;
    line-height: 1.43;
    letter-spacing: -0.224px;
    text-align: left;
}

.ai-disclaimer strong {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--blue-on-dark);
    color: #000000;
    font-weight: 600;
    font-size: 0.82rem;
}

.tag-list,
.chip-wrap,
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.tag-list span,
.chip {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
    padding: 8px 14px;
    font-size: 0.82rem;
    letter-spacing: -0.224px;
}

.hero-cta {
    margin-top: 2px;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 11px 22px;
    border: 1px solid transparent;
    color: inherit;
    text-decoration: none;
    font-size: 1.02rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.374px;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--blue);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--focus);
    outline: none;
}

.btn-secondary {
    color: var(--blue-on-dark);
    border-color: var(--blue-on-dark);
    background: transparent;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    color: #ffffff;
    background: rgba(41, 151, 255, 0.16);
    outline: none;
}

.command-deck {
    width: min(760px, 100%);
    margin-top: 8px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #101111;
    box-shadow: var(--product-shadow);
    text-align: left;
}

.command-top {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(245, 245, 247, 0.62);
    font-size: 0.78rem;
}

.command-top span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(245, 245, 247, 0.26);
}

.command-top span:first-child {
    background: #ff5f57;
}

.command-top span:nth-child(2) {
    background: #ffbd2e;
}

.command-top span:nth-child(3) {
    background: #28c840;
}

.command-top strong {
    margin-left: 6px;
    font-weight: 600;
    letter-spacing: -0.224px;
}

.command-list {
    margin: 0;
    padding: 8px;
    list-style: none;
}

.command-list li {
    min-height: 44px;
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 11px;
    color: rgba(245, 245, 247, 0.78);
    font-size: 0.96rem;
    letter-spacing: -0.224px;
}

.command-list li.is-selected {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.command-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--blue-on-dark);
}

.command-list kbd {
    min-width: 44px;
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 245, 247, 0.68);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.metric-grid {
    width: min(860px, 100%);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.metric {
    min-height: 112px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    padding: 18px;
}

.metric strong {
    display: block;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 2.45rem;
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.metric span {
    margin-top: 8px;
    color: rgba(245, 245, 247, 0.68);
    font-size: 0.82rem;
    letter-spacing: -0.224px;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 80px max(24px, calc((100vw - 1180px) / 2));
    background: var(--page);
}

.panel,
.card,
.project-card,
.timeline-item {
    border: 1px solid var(--line-soft);
    background: var(--paper);
    color: var(--ink);
    box-shadow: none;
}

.panel,
.card,
.project-card {
    border-radius: 18px;
    padding: 28px;
}

.panel h2,
.timeline h2,
.card h3,
.project-card h3 {
    margin: 0;
    font-family: var(--font-display);
    color: inherit;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.panel h2,
.timeline h2 {
    font-size: 2.4rem;
}

.card h3,
.project-card h3 {
    font-size: 1.65rem;
}

.panel p,
.card p,
.project-card p,
.timeline-item p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.47;
    letter-spacing: -0.374px;
}

.chip-wrap {
    justify-content: flex-start;
    margin-top: 20px;
}

.panel .chip,
.card .chip,
.project-card .chip,
.list-clean li,
body:not([data-page="home"]) .tag-list span {
    border-color: var(--line);
    background: var(--pearl);
    color: var(--ink-soft);
}

.terminal {
    position: relative;
    min-height: 220px;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 18px;
    border: 0;
    background: #000000;
    color: #f5f5f7;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    box-shadow: var(--product-shadow);
    padding: 18px;
}

.terminal::before {
    content: "Live Ops Feed";
    position: absolute;
    right: 18px;
    top: 14px;
    color: rgba(245, 245, 247, 0.5);
    font-size: 0.72rem;
    letter-spacing: -0.12px;
}

.terminal-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.terminal-list li {
    margin: 0;
    padding: 4px 0;
    color: rgba(245, 245, 247, 0.74);
    white-space: pre-wrap;
}

.terminal-list .warn {
    color: #ffd60a;
}

.terminal-list .ok {
    color: #30d158;
}

.terminal-list .err {
    color: #ff453a;
}

.timeline {
    padding: 80px max(24px, calc((100vw - 980px) / 2));
    color: #ffffff;
    background: var(--tile-1);
}

.timeline-list {
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 18px;
    border-color: var(--line-on-dark);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border-radius: 18px;
    padding: 20px;
}

.time,
.project-meta {
    color: var(--blue-on-dark);
    font-size: 0.82rem;
    line-height: 1.29;
    letter-spacing: -0.224px;
}

.timeline-item strong {
    display: block;
    font-size: 1.08rem;
    font-weight: 600;
}

.timeline-item p {
    color: var(--muted-on-dark);
}

.page-grid,
.project-grid {
    display: grid;
    gap: 24px;
    padding: 80px max(24px, calc((100vw - 1180px) / 2));
    background: var(--page);
}

.page-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-4 {
    grid-column: span 4;
}

.span-5 {
    grid-column: span 5;
}

.span-6 {
    grid-column: span 6;
}

.span-7 {
    grid-column: span 7;
}

.span-8 {
    grid-column: span 8;
}

.span-12 {
    grid-column: span 12;
}

.list-clean {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.list-clean li {
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    padding: 13px 15px;
    color: var(--ink-soft);
    font-size: 0.98rem;
}

.project-card {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.project-card .btn {
    align-self: flex-start;
    margin-top: auto;
    color: var(--blue);
    border-color: var(--blue);
}

.project-card .btn:hover,
.project-card .btn:focus-visible {
    color: #ffffff;
    background: var(--blue);
}

.footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 48px max(24px, calc((100vw - 1180px) / 2));
    color: var(--muted);
    background: var(--page);
    border-top: 1px solid var(--line-soft);
    font-size: 0.75rem;
    letter-spacing: -0.12px;
}

.footer a {
    color: var(--blue);
    text-decoration: none;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

@media (max-width: 1080px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
        padding: 12px 18px;
    }

    .nav,
    .top-actions {
        justify-content: flex-start;
    }

    .hero {
        padding: 72px 24px;
    }

    .hero h1,
    body[data-page="home"] .hero h1 {
        font-size: 2.9rem;
        line-height: 1.08;
    }

    .subtitle {
        font-size: 1.25rem;
    }

    .section-grid,
    .project-grid {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8,
    .span-12 {
        grid-column: span 12;
    }
}

@media (max-width: 760px) {
    .topbar {
        position: relative;
    }

    .hero {
        min-height: auto;
        padding: 56px 18px;
    }

    body[data-page="about"] .hero,
    body[data-page="projects"] .hero {
        min-height: auto;
    }

    .hero h1,
    body[data-page="home"] .hero h1 {
        font-size: 2.15rem;
        letter-spacing: -0.035em;
    }

    .subtitle {
        font-size: 1.05rem;
    }

    .ai-disclaimer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        font-size: 0.9rem;
    }

    .command-list li {
        grid-template-columns: 16px 1fr;
    }

    .command-list kbd {
        display: none;
    }

    .section-grid,
    .timeline,
    .page-grid,
    .project-grid,
    .footer {
        padding: 48px 18px;
    }

    .panel h2,
    .timeline h2 {
        font-size: 1.9rem;
    }

    .card h3,
    .project-card h3 {
        font-size: 1.35rem;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }
}

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

    .reveal {
        opacity: 1;
        transform: none;
    }
}
