/* ============================================================
   Anvith S G — Portfolio
   Clean · sans-serif · content-driven · 2026
   ============================================================ */

:root,
[data-theme="light"] {
    --bg:           #fafaf9;
    --bg-soft:      #f4f3ef;
    --bg-card:      #ffffff;
    --ink:          #111111;
    --ink-2:        #2a2a28;
    --ink-soft:     #5a5a55;
    --ink-mute:     #8a8880;
    --hairline:     rgba(17, 17, 17, 0.10);
    --hairline-2:   rgba(17, 17, 17, 0.05);
    --accent:       #c0492b;
    --accent-soft:  rgba(192, 73, 43, 0.10);
    --green:        #16a34a;
    --bar-bg:       rgba(250, 250, 249, 0.85);
    --overlay-bg:   rgba(17, 17, 17, 0.55);
    --overlay-bg-soft: rgba(17, 17, 17, 0.45);
    --shadow-color: rgba(17, 17, 17, 0.30);

    --ff-sans:   'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --ff-mono:   'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --gutter:    clamp(20px, 4vw, 48px);
    --max:       1100px;
    --radius:    6px;

    --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
    --t-fast:    140ms var(--ease);
    --t-base:    220ms var(--ease);
}

/* ----- DARK THEME ----- */
[data-theme="dark"] {
    --bg:           #0b0b0a;
    --bg-soft:      #161614;
    --bg-card:      #1c1c1a;
    --ink:          #f5f5f3;
    --ink-2:        #d6d6d2;
    --ink-soft:     #a0a09a;
    --ink-mute:     #6a6a64;
    --hairline:     rgba(245, 245, 243, 0.12);
    --hairline-2:   rgba(245, 245, 243, 0.06);
    --accent:       #e57b54;
    --accent-soft:  rgba(229, 123, 84, 0.16);
    --green:        #22c55e;
    --bar-bg:       rgba(11, 11, 10, 0.78);
    --overlay-bg:   rgba(0, 0, 0, 0.65);
    --overlay-bg-soft: rgba(0, 0, 0, 0.55);
    --shadow-color: rgba(0, 0, 0, 0.55);
}

/* Smooth color transitions when toggling theme (skip transform/animations). */
html { color-scheme: light; }
[data-theme="dark"] html,
html[data-theme="dark"] { color-scheme: dark; }

body, .topbar, .colophon, .cmdk-panel, .testimonials-modal, .resume-modal,
.identity, .services li, .chip-list li, .btn, .topcta, .topnav-link,
.cmdk-trigger, .cmdk-kbd, .cmdk-item, .filter-list button, .colophon-mail,
.theme-toggle, .modal-close-btn, .pub-item, .timeline-item {
    transition-property: background-color, color, border-color;
    transition-duration: var(--t-fast);
}

/* ----- reset ----- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--ff-sans);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    font-feature-settings: "ss01", "cv11";
}
img { max-width: 100%; display: block; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

.muted { color: var(--ink-mute); font-size: 13px; }
.inline-link {
    color: var(--ink);
    border-bottom: 1px solid var(--ink-mute);
    transition: color var(--t-fast), border-color var(--t-fast);
}
.inline-link:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 14px var(--gutter);
    background: var(--bar-bg);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--hairline);
}

.brand {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.brand-mark {
    font-family: var(--ff-mono);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.brand-mark .dot { color: var(--accent); }

.topnav-list {
    display: flex;
    justify-content: center;
    gap: 2px;
    flex-wrap: wrap;
}
.topnav-link {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    transition: color var(--t-fast), background var(--t-fast);
    color: var(--ink-soft);
}
.topnav-link .nav-num {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--ink-mute);
    transition: color var(--t-fast);
}
.topnav-link .nav-label {
    font-family: var(--ff-sans);
    font-weight: 500;
    font-size: 13.5px;
    letter-spacing: -0.005em;
}
.topnav-link:hover { color: var(--ink); background: var(--hairline-2); }
.topnav-link.active { color: var(--ink); background: var(--bg-soft); }
.topnav-link.active .nav-num { color: var(--accent); }

.topbar-actions { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--ink-soft);
    transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
    flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); background: var(--bg); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.topcta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--ink);
    border-radius: 6px;
    font-family: var(--ff-sans);
    font-size: 13px;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
}
.topcta .arrow { transition: transform var(--t-fast); }
.topcta:hover { background: var(--ink); color: var(--bg); }
.topcta:hover .arrow { transform: translateX(3px); }

/* ---------- ⌘K trigger pill ---------- */
.cmdk-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 12px;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--ink-soft);
    font-family: var(--ff-sans);
    font-size: 13px;
    font-weight: 500;
    transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.cmdk-trigger:hover { border-color: var(--ink); color: var(--ink); background: var(--bg); }
.cmdk-trigger svg { color: var(--ink-mute); transition: color var(--t-fast); }
.cmdk-trigger:hover svg { color: var(--ink); }
.cmdk-trigger-label { padding-right: 4px; }

.cmdk-kbd {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    font-family: var(--ff-mono);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    background: var(--bg-soft);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    color: var(--ink-2);
    line-height: 1.2;
}
.cmdk-kbd.small { font-size: 10px; padding: 1px 5px; }

/* ============================================================
   MAIN CANVAS / PAGES
   ============================================================ */
.canvas {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(40px, 6vw, 64px) var(--gutter) 96px;
}
body { padding-bottom: 48px; }

.page { display: none; }
.page.active { display: block; }
/* Animate page entries only after the user actually navigates — the .nav-anim
   class is added by the inline nav handler. The initial page must NOT animate,
   so there is no layout-affecting transform on first paint. */
.page.active.nav-anim { animation: pageEnter 200ms var(--ease) both; }
@keyframes pageEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-bottom: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--hairline); }

.hero-top {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 56px);
    align-items: start;
}
.hero-text { min-width: 0; }
.identity { min-width: 0; max-width: 100%; }
.lede, .role { overflow-wrap: anywhere; word-break: break-word; }
.status { max-width: 100%; overflow: hidden; }
.status > span:not(.status-dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 10px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-family: var(--ff-mono);
    font-size: 11.5px;
    color: var(--ink-soft);
    background: var(--bg-card);
    margin-bottom: 24px;
}
.status-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.7; } }

.display {
    margin: 0;
    font-family: var(--ff-sans);
    font-weight: 700;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--ink);
}
.role {
    margin-top: 10px;
    font-size: 16px;
    color: var(--ink-soft);
    font-weight: 500;
}

.lede {
    margin-top: 22px;
    max-width: 60ch;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-2);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    font-family: var(--ff-sans);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    background: var(--bg-card);
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { border-color: var(--ink); background: var(--bg-soft); }
.btn-primary {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--bg); }

/* ----- IDENTITY card ----- */
.identity {
    padding: 22px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.portrait {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--hairline);
    background: var(--bg-soft);
}
.portrait img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--t-base);
}
.identity:hover .portrait img { transform: scale(1.05); }

.identity-summary { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.identity-summary strong { font-weight: 600; font-size: 15px; }
.identity-summary span { font-size: 13px; color: var(--ink-soft); }

.link-btn {
    align-self: flex-start;
    padding: 0;
    color: var(--ink-soft);
    font-family: var(--ff-mono);
    font-size: 11.5px;
    border-bottom: 1px solid var(--hairline);
    transition: color var(--t-fast), border-color var(--t-fast);
}
.link-btn:hover { color: var(--ink); border-color: var(--ink); }
.link-btn .toggle-off { display: none; }
.identity.active .link-btn .toggle-on { display: none; }
.identity.active .link-btn .toggle-off { display: inline; }

.identity-more {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height var(--t-base), opacity var(--t-fast), margin var(--t-fast);
}
.identity.active .identity-more {
    max-height: 600px;
    opacity: 1;
    margin-top: 4px;
}

.contact-list { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.contact-list li { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: baseline; font-size: 13px; }
.contact-list a { color: var(--ink); border-bottom: 1px solid transparent; transition: border-color var(--t-fast); }
.contact-list a:hover { border-color: var(--ink); }
.contact-list address { font-style: normal; color: var(--ink-2); }

.micro-label {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

/* ============================================================
   BLOCKS / SECTIONS
   ============================================================ */
.block { padding: clamp(36px, 5vw, 56px) 0; border-bottom: 1px solid var(--hairline); }
.block:last-of-type { border-bottom: none; padding-bottom: 0; }

.block-head {
    display: grid;
    grid-template-columns: 70px 1fr;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 28px;
}
.block-num {
    font-family: var(--ff-mono);
    font-size: 12px;
    color: var(--ink-mute);
    padding-top: 2px;
}
.block-title {
    font-family: var(--ff-sans);
    font-weight: 600;
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1.15;
    letter-spacing: -0.018em;
    color: var(--ink);
}
.block-deck {
    grid-column: 2 / -1;
    margin-top: 6px;
    font-size: 14.5px;
    color: var(--ink-soft);
    max-width: 60ch;
}

.page-head { padding-bottom: clamp(28px, 4vw, 40px); border-bottom: 1px solid var(--hairline); margin-bottom: 0; padding-top: 4px; }
.page-actions { grid-column: 2 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; }

/* ----- focus list (Now / Building / Learning) ----- */
.focus-list { display: grid; gap: 0; }
.focus-list li {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 18px;
    padding: 18px 0;
    border-top: 1px solid var(--hairline);
    align-items: baseline;
}
.focus-list li:last-child { border-bottom: 1px solid var(--hairline); }
.focus-list p { color: var(--ink-2); font-size: 15px; line-height: 1.6; max-width: 60ch; }
.focus-list strong { font-weight: 600; color: var(--ink); }

/* ----- services ----- */
.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.services li {
    padding: 20px 22px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: border-color var(--t-fast), transform var(--t-base);
}
.services li:hover { border-color: var(--ink); }
.services h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.005em;
}
.services p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-soft);
}

/* ----- timeline / experience / education ----- */
.timeline { display: grid; gap: 0; }
.timeline-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    padding: 22px 0;
    border-top: 1px solid var(--hairline);
}
.timeline-item:last-child { border-bottom: 1px solid var(--hairline); }

.timeline-when {
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}
.role-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    background: var(--ink);
    color: var(--bg);
    font-family: var(--ff-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 4px;
}
.role-tag::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.3);
    animation: pulse 2s ease-in-out infinite;
}
.timeline-what h4 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.3;
    margin-bottom: 4px;
}
.timeline-what .org {
    font-size: 13.5px;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.timeline-what .desc {
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.55;
    max-width: 60ch;
    margin-top: 2px;
}

/* ----- career timeline (visual journey) ----- */
.career-timeline {
    position: relative;
    margin-top: 4px;
}
.career-item {
    display: grid;
    grid-template-columns: 130px 28px 1fr;
    gap: 18px;
    padding-bottom: 28px;
    align-items: start;
}
.career-item:last-child { padding-bottom: 0; }
.career-when { padding-top: 4px; }

.career-marker {
    position: relative;
    height: 100%;
    display: flex;
    justify-content: center;
}
.career-marker::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 18px;
    bottom: -28px;
    width: 1px;
    background: var(--hairline);
    transform: translateX(-0.5px);
}
.career-item:last-child .career-marker::before { display: none; }

.career-dot {
    position: relative;
    z-index: 2;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--ink);
    margin-top: 7px;
    box-shadow: 0 0 0 4px var(--bg);
}
.career-dot.upcoming {
    background: var(--bg);
    border: 2px solid var(--ink-mute);
    width: 12px;
    height: 12px;
    margin-top: 6px;
}
.career-dot.current {
    background: var(--green);
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px rgba(34, 197, 94, 0.18);
    animation: pulse 2.4s ease-in-out infinite;
}

.career-what h4 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.005em;
    line-height: 1.35;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.career-what em {
    font-style: italic;
    font-weight: 400;
    color: var(--ink-2);
}
.career-what strong { font-weight: 600; color: var(--ink); }
.career-what p {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.55;
    max-width: 60ch;
}
.role-tag.inline {
    font-size: 9.5px;
    padding: 2px 7px;
}

/* ----- skills ----- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px 28px;
}
.skill-group h4 { margin-bottom: 10px; display: block; }
.chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.chip-list li {
    padding: 4px 10px;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    font-family: var(--ff-mono);
    font-size: 11.5px;
    color: var(--ink-2);
    background: var(--bg-card);
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.chip-list li:hover { border-color: var(--ink); color: var(--ink); }

/* ============================================================
   PROJECTS / FILTERS
   ============================================================ */
.filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
}
.filter-list button {
    padding: 6px 12px;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    font-family: var(--ff-sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--bg-card);
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.filter-list button:hover { color: var(--ink); border-color: var(--ink); }
.filter-list button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.filter-select-box { display: none; position: relative; margin-bottom: 20px; }
.filter-select {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    font-family: var(--ff-sans);
    font-size: 13px;
    background: var(--bg-card);
    color: var(--ink);
}
.select-icon { transition: transform var(--t-fast); }
.filter-select.active .select-icon { transform: rotate(180deg); }
.select-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    padding: 4px;
    display: none;
    z-index: 10;
    box-shadow: 0 12px 30px -12px rgba(17, 17, 17, 0.15);
}
.filter-select.active + .select-list { display: block; }
.select-list button {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--ink-soft);
    transition: background var(--t-fast), color var(--t-fast);
}
.select-list button:hover { background: var(--bg-soft); color: var(--ink); }

.project-list {
    display: grid;
    gap: 0;
}
.project-card {
    display: none;
    padding: 22px 0;
    border-top: 1px solid var(--hairline);
    transition: padding-left var(--t-base);
    position: relative;
}
.project-card.active { display: block; }
.project-list .project-card:last-child { border-bottom: 1px solid var(--hairline); }
.project-card::before {
    content: "";
    position: absolute;
    left: 0; top: 22px; bottom: 22px;
    width: 0;
    background: var(--ink);
    transition: width var(--t-base);
    border-radius: 2px;
}
.project-card:hover { padding-left: 16px; }
.project-card:hover::before { width: 3px; }

.project-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.project-index {
    font-family: var(--ff-mono);
    font-size: 12px;
    color: var(--ink-mute);
    flex-shrink: 0;
}
.project-name {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--ink);
    line-height: 1.2;
}
.project-tag {
    margin-left: auto;
    padding: 3px 9px;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    font-family: var(--ff-mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: var(--bg-card);
}
.project-desc {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink-2);
    max-width: 65ch;
    margin: 0 0 12px 0;
    padding-left: 28px;
}
.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
    padding-left: 28px;
}
.project-stack li {
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--bg-soft);
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--ink-soft);
}
.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding-left: 28px;
}
.aux-link {
    font-family: var(--ff-mono);
    font-size: 11.5px;
    color: var(--ink);
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 1px;
    transition: color var(--t-fast), border-color var(--t-fast);
}
.aux-link:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-list { display: grid; gap: 0; }
.pub-item {
    padding: 22px 0;
    border-top: 1px solid var(--hairline);
}
.pub-item:last-child { border-bottom: 1px solid var(--hairline); }
.pub-meta { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.pub-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.012em;
    line-height: 1.3;
    margin-bottom: 8px;
    max-width: 60ch;
}
.pub-venue {
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 14px;
    max-width: 70ch;
    line-height: 1.55;
}
.pub-links { display: flex; flex-wrap: wrap; gap: 14px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-container,
.resume-modal-container {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-container.active,
.resume-modal-container.active { display: flex; }

.overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 200ms ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.testimonials-modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    max-width: 900px;
    width: 100%;
    max-height: 86vh;
    overflow: auto;
    padding: 24px;
    box-shadow: 0 30px 60px -15px rgba(17, 17, 17, 0.3);
    animation: modalIn 240ms var(--ease) both;
}

.resume-modal {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    width: min(92vw, 880px);
    height: min(92vh, 1100px);
    overflow: hidden;
    padding: 0;
    box-shadow: 0 30px 60px -15px rgba(17, 17, 17, 0.4);
    animation: modalIn 240ms var(--ease) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.modal-close-btn {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: var(--bg);
    background: var(--ink);
    box-shadow: 0 4px 12px rgba(17, 17, 17, 0.25);
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
    z-index: 5;
}
.modal-close-btn:hover { background: var(--bg); color: var(--ink); transform: scale(1.05); }
.modal-close-btn::after {
    content: "esc";
    position: absolute;
    top: 50%; right: calc(100% + 8px);
    transform: translateY(-50%);
    font-family: var(--ff-mono);
    font-size: 10px;
    color: var(--bg);
    background: var(--ink);
    padding: 3px 7px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity var(--t-fast);
}
.modal-close-btn:hover::after { opacity: 1; }

.modal-img-wrapper { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.modal-avatar-box img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.modal-title { font-size: 18px; font-weight: 600; }

.resume-content {
    width: 100%;
    height: 100%;
}
.resume-content iframe {
    border: none;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    display: block;
}

/* ============================================================
   ⌘K / Ctrl+K COMMAND PALETTE
   ============================================================ */
.cmdk {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 20px 20px;
}
.cmdk.active { display: flex; }

.cmdk-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg-soft);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 180ms ease both;
}

.cmdk-panel {
    position: relative;
    width: 100%;
    max-width: 620px;
    max-height: 70vh;
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    box-shadow: 0 24px 60px -10px rgba(17, 17, 17, 0.35),
                0 8px 16px -4px rgba(17, 17, 17, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: cmdkIn 200ms var(--ease) both;
}
@keyframes cmdkIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.cmdk-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 18px;
    border-bottom: 1px solid var(--hairline);
}
.cmdk-input-wrap .cmdk-icon { color: var(--ink-mute); flex-shrink: 0; }
.cmdk-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--ff-sans);
    font-size: 15px;
    color: var(--ink);
    outline: none;
    padding: 2px 0;
    min-width: 0;
}
.cmdk-input-wrap input::placeholder { color: var(--ink-mute); }

.cmdk-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    margin: 0;
    list-style: none;
}
.cmdk-list::-webkit-scrollbar { width: 8px; }
.cmdk-list::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 4px; }
.cmdk-list::-webkit-scrollbar-track { background: transparent; }

.cmdk-item {
    display: grid;
    grid-template-columns: 84px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}
.cmdk-item.selected {
    background: var(--ink);
    color: var(--bg);
}
.cmdk-cat {
    font-family: var(--ff-mono);
    font-size: 10.5px;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color var(--t-fast);
}
.cmdk-item.selected .cmdk-cat { color: rgba(250, 250, 249, 0.65); }
.cmdk-label {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cmdk-meta {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--ink-mute);
    text-align: right;
    transition: color var(--t-fast);
}
.cmdk-item.selected .cmdk-meta { color: rgba(250, 250, 249, 0.55); }
.cmdk-arrow {
    font-family: var(--ff-mono);
    font-size: 13px;
    color: var(--ink-mute);
    width: 16px;
    text-align: center;
    transition: color var(--t-fast);
}
.cmdk-item.selected .cmdk-arrow { color: var(--bg); }

.cmdk-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--ink-mute);
    font-size: 14px;
}

.cmdk-footer {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 9px 16px;
    border-top: 1px solid var(--hairline);
    background: var(--bg-soft);
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--ink-mute);
}
.cmdk-footer span { display: inline-flex; align-items: center; gap: 4px; }
.cmdk-footer kbd {
    font-family: var(--ff-mono);
    background: var(--bg-card);
    border: 1px solid var(--hairline);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    color: var(--ink);
    line-height: 1.4;
    min-width: 16px;
    text-align: center;
}
.cmdk-footer-spacer { flex: 1; }
.cmdk-footer-meta { color: var(--ink-soft); }

@media (max-width: 680px) {
    .cmdk { padding: 6vh 12px 12px; }
    .cmdk-panel { max-height: 80vh; }
    .cmdk-item { grid-template-columns: 64px 1fr auto; }
    .cmdk-meta { display: none; }
    .cmdk-footer { font-size: 10px; gap: 10px; flex-wrap: wrap; }
    .cmdk-footer-meta { display: none; }
}

/* ============================================================
   COLOPHON / FOOTER  (fixed, mirrors the topbar)
   ============================================================ */
.colophon {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 12px var(--gutter);
    background: var(--bar-bg);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-top: 1px solid var(--hairline);
}
.colophon-copy {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--ink-mute);
    line-height: 1;
    white-space: nowrap;
}
.colophon-mid {
    font-family: var(--ff-mono);
    font-size: 11px;
    color: var(--ink-mute);
    text-align: center;
    line-height: 1;
}
.colophon-mail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    background: var(--bg-card);
    font-family: var(--ff-sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.colophon-mail .arrow { transition: transform var(--t-fast); }
.colophon-mail:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.colophon-mail:hover .arrow { transform: translate(2px, -2px); }

/* ============================================================
   REVEAL ANIMATIONS
   Pure opacity fade — no transform, so no scroll/layout shift on
   first paint when the IntersectionObserver fires.
   ============================================================ */
.reveal { opacity: 0; transition: opacity 360ms var(--ease); }
.reveal.visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ============================================================
   TOAST OVERRIDES
   ============================================================ */
.toastify {
    font-family: var(--ff-mono) !important;
    font-size: 12px !important;
    border-radius: 6px !important;
    background: var(--ink) !important;
    color: var(--bg) !important;
    border: 1px solid var(--ink) !important;
    box-shadow: 0 16px 30px -10px rgba(17, 17, 17, 0.4) !important;
    padding: 10px 16px !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .hero-top { grid-template-columns: 1fr; }
    .identity { max-width: 420px; }
    .topcta { display: none; }
    .cmdk-trigger-label { display: none; }
    .cmdk-trigger { padding: 7px 10px; }
    .cmdk-trigger .cmdk-kbd { display: none; }
    .colophon { grid-template-columns: auto 1fr auto; gap: 14px; padding: 10px var(--gutter); }
    .colophon-mid { display: none; }
}

@media (max-width: 680px) {
    .topbar {
        grid-template-columns: auto auto;
        grid-template-areas: "brand actions" "nav nav";
        padding: 10px var(--gutter);
        gap: 8px 10px;
    }
    .brand { grid-area: brand; }
    .topbar-actions { grid-area: actions; justify-self: end; }
    .topnav { grid-area: nav; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .topnav::-webkit-scrollbar { display: none; }
    .topnav-list { flex-wrap: nowrap; justify-content: flex-start; gap: 0; padding: 2px 0; }
    .topnav-link { padding: 7px 11px; flex-shrink: 0; }
    .topnav-link .nav-num { display: none; }

    .filter-list { display: none; }
    .filter-select-box { display: block; }

    .block-head { grid-template-columns: 1fr; gap: 8px; }
    .block-deck, .page-actions { grid-column: auto; }

    .timeline-item, .focus-list li { grid-template-columns: 1fr; gap: 6px; }
    .timeline-when { flex-direction: row; align-items: center; }

    .career-item { grid-template-columns: 80px 22px minmax(0, 1fr); gap: 10px; padding-bottom: 22px; }
    .career-marker::before { bottom: -22px; }

    .project-desc, .project-stack, .project-links { padding-left: 0; }
    .project-tag { margin-left: 0; }
}

@media (max-width: 480px) {
    :root { --gutter: 16px; }
    body { padding-bottom: 56px; }
    .display { font-size: 32px; line-height: 1.05; }
    .role { font-size: 14.5px; }
    .lede { font-size: 15px; }
    .hero-actions { gap: 6px; }
    .btn { padding: 8px 12px; font-size: 12.5px; }
    .colophon { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px var(--gutter); }
    .colophon-mid { display: none; }
    .colophon-mail { padding: 5px 10px; font-size: 12px; }
    .colophon-copy { font-size: 10px; }
    .career-item { grid-template-columns: 64px 20px minmax(0, 1fr); gap: 8px; }
    .career-when .micro-label { font-size: 10px; letter-spacing: 0.04em; }
    .career-what h4 { font-size: 15px; flex-wrap: wrap; gap: 6px; }
    .skills-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .project-name { font-size: 17px; }
    .project-head { flex-wrap: wrap; gap: 8px; }
    .timeline-item { grid-template-columns: 1fr; }
    .topnav-link { padding: 7px 9px; }
    .topnav-link .nav-label { font-size: 13px; }
    .theme-toggle, .cmdk-trigger { width: 36px; height: 36px; padding: 0; justify-content: center; }
    .cmdk-trigger svg { margin: 0; }
}
