/* =========================================================
   Abhishek Dhiman — Personal Website
   Faithfully built on the design foundation of pronskiy.com
   A calm archive. Hand-written stylesheet, no build step.
   ========================================================= */

:root {
    --paper:   #18181b;
    --paper-card: #212126;
    --ink:     #f4f4f5;
    --ink-70:  rgba(244, 244, 245, 0.75);
    --ink-60:  rgba(244, 244, 245, 0.60);
    --ink-20:  rgba(244, 244, 245, 0.20);
    --ink-12:  rgba(244, 244, 245, 0.14);
    --ink-06:  rgba(244, 244, 245, 0.07);
    --line:    var(--ink-12);   /* the only rule weight on the site */
    --link:    #a78bfa;         /* Dracula violet */
    --link-30: rgba(167, 139, 250, 0.30);
    --icon-sun:  none;
    --icon-moon: block;
    --icon-neon: none;

    --display: 'Host Grotesk', system-ui, sans-serif;
    --body:    'Host Grotesk', system-ui, sans-serif;
    --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --container: 880px;    /* the index */
    --measure:   680px;    /* anything you actually read */
    --gutter:    2rem;
    --radius:    8px;      /* thumbnails, row hover, code blocks */
    --radius-lg: 12px;     /* project cards */
    color-scheme: dark;
}

/* 1. Light Theme */
:root[data-theme="light"] {
    --paper:   #ffffff;
    --paper-card: #f8f9fa;
    --ink:     #111111;
    --ink-70:  rgba(17, 17, 17, 0.70);
    --ink-60:  rgba(17, 17, 17, 0.60);
    --ink-20:  rgba(17, 17, 17, 0.20);
    --ink-12:  rgba(17, 17, 17, 0.12);
    --ink-06:  rgba(17, 17, 17, 0.06);
    --line:    var(--ink-12);
    --link:    #205ea6;
    --link-30: rgba(32, 94, 166, 0.30);
    --icon-sun:  block;
    --icon-moon: none;
    --icon-neon: none;
    color-scheme: light;
}

/* 2. Dracula Theme (Signature Dark) */
:root[data-theme="dracula"],
:root[data-theme="dark"] {
    --paper:   #18181b;
    --paper-card: #212126;
    --ink:     #f4f4f5;
    --ink-70:  rgba(244, 244, 245, 0.75);
    --ink-60:  rgba(244, 244, 245, 0.60);
    --ink-20:  rgba(244, 244, 245, 0.20);
    --ink-12:  rgba(244, 244, 245, 0.14);
    --ink-06:  rgba(244, 244, 245, 0.07);
    --line:    var(--ink-12);
    --link:    #a78bfa;
    --link-30: rgba(167, 139, 250, 0.30);
    --icon-sun:  none;
    --icon-moon: block;
    --icon-neon: none;
    color-scheme: dark;
}

/* 3. Neon Electric Lime Theme */
:root[data-theme="neon"] {
    --paper:      #080c05;
    --paper-card: #0f150a;
    --ink:        #f4ffe0;
    --ink-70:     rgba(244, 255, 224, 0.78);
    --ink-60:     rgba(244, 255, 224, 0.62);
    --ink-20:     rgba(204, 255, 0, 0.22);
    --ink-12:     rgba(204, 255, 0, 0.14);
    --ink-06:     rgba(204, 255, 0, 0.07);
    --line:       rgba(204, 255, 0, 0.20);
    --link:       #ccff00;
    --link-30:    rgba(204, 255, 0, 0.35);
    --icon-sun:   none;
    --icon-moon:  none;
    --icon-neon:  block;
    color-scheme: dark;
}
:root[data-theme="neon"] .brand,
:root[data-theme="neon"] .profile-name,
:root[data-theme="neon"] .page-header h1 {
    color: #ccff00;
    text-shadow: 0 0 14px rgba(204, 255, 0, 0.30);
}
:root[data-theme="neon"] .tag-pill {
    border-color: rgba(204, 255, 0, 0.30);
    color: #ccff00;
    background: rgba(204, 255, 0, 0.06);
}
:root[data-theme="neon"] .tag-pill:hover {
    border-color: #ccff00;
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.35);
}
:root[data-theme="neon"] .project-card:hover {
    border-color: #ccff00;
    box-shadow: 0 0 16px rgba(204, 255, 0, 0.20);
}
:root[data-theme="neon"] .filter-chip.is-active,
:root[data-theme="neon"] .archive-filter-btn.is-active {
    background: #ccff00;
    color: #080c05;
    border-color: #ccff00;
    box-shadow: 0 0 10px rgba(204, 255, 0, 0.35);
}
:root[data-theme="neon"] .status-dot {
    background: #ccff00;
    box-shadow: 0 0 8px #ccff00;
}

/* ---------- reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
img, svg, video, iframe { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:target { scroll-margin-top: 3rem; }

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a { color: inherit; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, summary:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
    border-radius: 4px;
}
.skip-link {
    position: absolute;
    top: 0.5rem;
    left: var(--gutter);
    z-index: 40;
    padding: 0.75rem 1rem;
    background: var(--paper);
    color: var(--ink);
    transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }
#main-content:focus { outline: none; }

/* ---------- nav ---------- */
.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.5rem var(--gutter) 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
nav.site-nav .brand { font-weight: 600; text-decoration: none; white-space: nowrap; }
nav.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    list-style: none;
    margin-left: auto;
}
nav.site-nav a {
    color: var(--ink-70);
    text-decoration: none;
    transition: color .15s;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
nav.site-nav a:hover, nav.site-nav a[aria-current] { color: var(--ink); }
nav.site-nav a[aria-current] { font-weight: 600; }

/* Navigation CV dropdown */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-btn {
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink-70);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 44px;
    transition: color .15s ease;
}
.nav-dropdown-btn:hover, .nav-dropdown.is-open .nav-dropdown-btn {
    color: var(--ink);
}
.nav-dropdown-arrow {
    width: 11px;
    height: 11px;
    transition: transform .2s ease;
}
.nav-dropdown.is-open .nav-dropdown-arrow {
    transform: rotate(180deg);
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% - 4px);
    right: 0;
    min-width: 220px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 0.4rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
}
.nav-dropdown.is-open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-item {
    display: flex !important;
    align-items: center !important;
    padding: 0.55rem 0.85rem !important;
    min-height: auto !important;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink) !important;
    font-size: 0.875rem;
    font-weight: 550;
    transition: background-color .15s ease;
}
.nav-dropdown-item:hover {
    background: var(--ink-06);
}
.dropdown-item-title {
    font-size: 0.875rem;
    font-weight: 550;
    color: var(--ink);
    line-height: 1.3;
}

/* ---------- masthead: profile header ---------- */
.masthead {
    max-width: var(--container);
    margin: 0 auto;
    padding: 3rem var(--gutter) 0;
}
.profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.profile-photo-link { flex: 0 0 auto; display: block; border-radius: 50%; }
.profile-photo {
    width: 112px; height: 112px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    border: 1px solid var(--line);
    background: var(--ink-06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.profile-photo:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.profile-body { min-width: 0; }
.profile-name {
    font-family: var(--display);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 700;
}

/* Tooltip standard matching Roman's site */
[data-tip] { position: relative; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translate(-50%, 4px);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.4;
    white-space: nowrap;
    color: var(--paper);
    background: var(--ink);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
    z-index: 2;
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

.contacts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 0.125rem;
    margin-top: 0.5rem;
}
.contacts a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: var(--ink-60);
    text-decoration: none;
    transition: color .15s;
}
.contacts a:hover { color: var(--ink); }
.contacts .contacts-email { color: var(--ink); font-weight: 600; margin-right: 0.5rem; }
.contacts li { display: flex; align-items: center; }
.contacts svg { width: 18px; height: 18px; transform: translateY(1px); }

.contacts li:last-child [data-tip]::after,
.theme-toggle[data-tip]::after { left: auto; right: 0; transform: translate(0, 4px); }
.contacts li:last-child [data-tip]:hover::after,
.contacts li:last-child [data-tip]:focus-visible::after,
.theme-toggle[data-tip]:hover::after,
.theme-toggle[data-tip]:focus-visible::after { transform: translate(0, 0); }
.theme-toggle[data-tip]::after { bottom: auto; top: calc(100% + 2px); transform: translate(0, -4px); }

.masthead-intro {
    margin-top: 2rem;
    max-width: 56ch;
    font-size: 1.0625rem;
    line-height: 1.5;
    text-wrap: pretty;
}
.masthead-intro + .masthead-intro { margin-top: 0.75rem; }
.place { white-space: nowrap; }
.place svg { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; margin-right: 0.2em; }
.masthead-intro a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--link-30); }
.masthead-intro a:hover { text-decoration-color: var(--link); }

/* ---------- blocks ---------- */
.block {
    max-width: var(--container);
    margin: 0 auto;
    padding: 2.5rem var(--gutter) 0;
}
.block-head {
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink-60);
    padding-top: 2rem;
    border-top: 1px solid var(--line);
    margin-bottom: 0.25rem;
}

/* ---------- video strip ---------- */
@property --fade-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --fade-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
.reel-strip {
    --fade-l: 0px;
    --fade-r: 4rem;
    --inset: 0.5rem;
    margin: 1.25rem calc(-1 * var(--inset)) 0;
    list-style: none;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: var(--inset);
    scrollbar-width: thin;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
    mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
    transition: --fade-l .2s ease, --fade-r .2s ease;
}
.reel-strip.is-scrolled { --fade-l: 3rem; }
.reel-strip.is-at-end  { --fade-r: 0px; }
.reel-strip li { flex: 0 0 auto; width: 280px; }
.reel-strip a {
    display: block;
    position: relative;
    padding: var(--inset);
    margin: calc(-1 * var(--inset));
    border-radius: calc(var(--radius) + var(--inset));
    text-decoration: none;
    transition: background-color .12s ease;
}
.reel-strip a:hover { background: var(--ink-06); }
.reel-strip img {
    width: 280px; height: 158px;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--ink-06);
    border: 1px solid var(--line);
    transition: transform 0.2s ease;
}
.reel-strip a:hover img {
    transform: scale(1.02);
}
.reel-time {
    position: absolute;
    top: calc(158px + var(--inset)); right: calc(8px + var(--inset));
    transform: translateY(-100%) translateY(-8px);
    font-size: 0.75rem;
    font-weight: 550;
    line-height: 1.3;
    background: rgba(0, 0, 0, 0.76);
    color: #fff;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}
.reel-title {
    display: block;
    margin-top: 0.65rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ink-70);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.reel-strip a:hover .reel-title { color: var(--ink); }

/* ---------- the index ---------- */
.index, .index-fold { --cols: 4.5rem minmax(0, 1fr); }
.index { list-style: none; }
.index-row {
    display: grid;
    grid-template-columns: var(--cols);
    gap: 1.5rem;
    align-items: baseline;
    padding: 0.3rem 0.75rem;
    margin: 0 -0.75rem;
    border-radius: var(--radius);
    color: inherit;
    text-decoration: none;
    transition: background-color .12s ease;
}
.index-row.is-year-start { padding-top: 1.5rem; }
.index-year {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--ink-60);
}
.index-title {
    font-size: 1rem;
    line-height: 1.5;
}
.index-row--post .index-title { font-family: var(--display); font-weight: 650; }
.index-note {
    margin-left: 0.15em;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--ink-60);
}
.index-row:hover { background: var(--ink-06); }

/* ---------- projects: preview cards ---------- */
.projects {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.5rem;
    padding-top: 1.25rem;
}
.project-card {
    display: block;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: calc(var(--radius-lg) + 0.5rem);
    text-decoration: none;
    transition: background-color .12s ease;
}
.project-card:hover { background: var(--ink-06); }
.project-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1.9 / 1;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--ink-06);
}
.project-name {
    display: block;
    margin-top: 0.75rem;
    font-weight: 650;
    font-size: 1rem;
    line-height: 1.4;
}
.project-desc {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ink-70);
}

.projects--featured { grid-template-columns: 1.1fr 1fr; gap: 1.5rem 2rem; }
.projects--featured .project:first-child { grid-row: span 2; }
.projects--featured .project:not(:first-child) .project-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.projects--featured .project:not(:first-child) .project-image {
    aspect-ratio: 1;
    object-fit: cover;
}
.projects--featured .project:not(:first-child) .project-name { margin-top: 0; }
.project-copy { display: block; min-width: 0; }

/* ---------- Community & Partners ---------- */
.community-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
    list-style: none;
}
.community-card {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    transition: background-color .15s;
    display: flex;
    flex-direction: column;
}
.community-card:hover { background: var(--ink-06); }
.community-card-role {
    font-size: 0.8125rem;
    font-weight: 550;
    color: var(--ink-60);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.community-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0.25rem;
    color: var(--ink);
}
.community-card-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ink-70);
    margin-top: 0.5rem;
    flex: 1;
}
.community-card-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--line);
    font-size: 0.8125rem;
    color: var(--ink-60);
}
.community-card-stats strong { color: var(--ink); font-weight: 600; }

.partner-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--ink-06);
    font-size: 0.85rem;
    color: var(--ink-70);
}
.partner-logos span { font-weight: 600; color: var(--ink); }

/* ---------- Professional experience ---------- */
.exp-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}
.exp-item:last-child { border-bottom: 0; }
.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.exp-title { font-weight: 700; font-size: 1.15rem; }
.exp-meta { font-size: 0.875rem; color: var(--ink-60); font-family: var(--mono); }
.exp-company { font-weight: 550; color: var(--ink-70); margin-top: 0.15rem; font-size: 0.95rem; }
.exp-points {
    margin-top: 0.75rem;
    margin-left: 1.25rem;
    list-style: disc;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--ink-70);
}
.exp-points li { margin-bottom: 0.4rem; }
.exp-points strong { color: var(--ink); }

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--ink-70);
    text-decoration: none;
    transition: color .15s;
}
.section-link:hover { color: var(--ink); }

/* ---------- footer ---------- */
.site-footer {
    max-width: var(--container);
    margin: 2.5rem auto 0;
    padding: 0 var(--gutter) 3rem;
}
.site-footer-inner {
    padding-top: 1.75rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.875rem;
    color: var(--ink-60);
}
.site-footer a { color: inherit; text-decoration: none; transition: color .15s; }
.site-footer a:hover { color: var(--ink); }
.site-footer-right { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-footer-right a { display: inline-flex; align-items: center; min-height: 44px; }

/* Theme toggle button in nav */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 0;
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    color: var(--ink-70);
    cursor: pointer;
    transition: color .15s;
}
nav.site-nav .nav-toggle { display: flex; align-items: center; margin-right: -13px; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: var(--icon-sun); }
.theme-toggle .icon-moon { display: var(--icon-moon); }
.theme-toggle .icon-neon { display: var(--icon-neon); }

/* Live time & status */
.live-time-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--mono);
    font-size: 0.8125rem;
    color: var(--ink-70);
    background: var(--ink-06);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    margin-left: 0.35rem;
    vertical-align: middle;
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: status-pulse 2.5s infinite ease-in-out;
}
@keyframes status-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

/* CV download action buttons */
.cv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 1.25rem;
}
.btn-cv {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 550;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.45rem 0.875rem;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-cv:hover {
    background: var(--ink-06);
    border-color: var(--ink-20);
    color: var(--ink);
}
.btn-cv svg {
    width: 15px;
    height: 15px;
    color: var(--ink-70);
}

/* Contacts email copy feedback */
.contacts-email { position: relative; }
.contacts-email.is-copied::after {
    content: "Copied!";
    position: absolute;
    top: -24px;
    left: 0;
    font-size: 0.75rem;
    font-family: var(--mono);
    background: var(--ink);
    color: var(--paper);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    animation: fade-out 1.6s forwards;
}
@keyframes fade-out {
    0% { opacity: 1; transform: translateY(0); }
    70% { opacity: 1; transform: translateY(-2px); }
    100% { opacity: 0; transform: translateY(-6px); }
}

/* ---------- Technical Skills & Toolchain ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}
.skill-category {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease;
}
.skill-category:hover {
    border-color: var(--ink-20);
}
.skill-cat-title {
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--ink);
    margin: 0 0 0.65rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
    letter-spacing: -0.01em;
}
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.tag-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    font-family: var(--mono);
    color: var(--ink-70);
    background: var(--ink-06);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.25rem 0.6rem;
    white-space: nowrap;
    line-height: 1.25;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.tag-pill:hover {
    background: var(--ink-12);
    color: var(--ink);
    border-color: var(--ink-20);
    transform: translateY(-1px);
}

/* Skills Definition Rows (Clean Editorial Matrix Layout) */
.skills-matrix {
    display: flex;
    flex-direction: column;
    margin-top: 1.25rem;
}
.skill-row {
    display: grid;
    grid-template-columns: 13.5rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: baseline;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--line);
}
.skill-row:first-child {
    padding-top: 0;
}
.skill-row:last-child {
    border-bottom: 0;
}
.skill-row-title {
    font-size: 0.875rem;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.skill-row-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* ---------- Subpage Header & Layout Standard ---------- */
.page {
    max-width: var(--container);
    margin: 0 auto;
    padding: 2rem var(--gutter) 4rem;
}
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}
.page-header h1 {
    font-family: var(--display);
    font-size: clamp(2rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--ink);
    margin: 0;
}
.page-header .subtitle {
    font-size: 1.0625rem;
    color: var(--ink-70);
    line-height: 1.6;
    margin-top: 0.75rem;
    max-width: 46rem;
}

/* Filter Bar & Archive Filters (Option 4) */
.filter-bar, .archive-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    list-style: none;
    padding: 0;
}
.filter-chip, .archive-filter-btn {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink-70);
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all .15s ease;
    line-height: 1.4;
}
.filter-chip:hover, .archive-filter-btn:hover {
    color: var(--ink);
    background: var(--ink-06);
    border-color: var(--ink-20);
}
.filter-chip.is-active,
.filter-chip[aria-pressed="true"],
.archive-filter-btn.is-active,
.archive-filter-btn[aria-pressed="true"] {
    color: var(--paper);
    background: var(--ink);
    border-color: var(--ink);
    font-weight: 600;
}

/* Prose Typography in Subpages */
.prose {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--ink-70);
}
.prose h2 {
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: -0.015em;
    margin-top: 2.5rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
}
.prose h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink);
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
}
.prose p {
    margin-top: 0.5rem;
    margin-bottom: 0.875rem;
    color: var(--ink-70);
}
.prose ul, .prose ol {
    margin: 0.5rem 0 1.25rem 1.25rem;
    padding: 0;
}
.prose li {
    margin-bottom: 0.4rem;
    color: var(--ink-70);
}
.prose strong {
    color: var(--ink);
    font-weight: 600;
}
.prose a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.prose a:hover {
    color: var(--ink);
}

/* ---------- View Type Switcher (Windows-style toggle) ---------- */
.section-head-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.section-head-bar .block-head,
.section-head-bar h2 {
    margin: 0;
}
.page-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}
.view-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--ink-06);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
}
.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border: 0;
    background: transparent;
    border-radius: calc(var(--radius) - 2px);
    color: var(--ink-70);
    font-size: 0.75rem;
    font-weight: 550;
    cursor: pointer;
    line-height: 1;
    transition: background-color .15s ease, color .15s ease;
}
.view-btn:hover {
    color: var(--ink);
    background: var(--ink-12);
}
.view-btn.is-active {
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.view-icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex-shrink: 0;
}
.view-text {
    font-size: 0.75rem;
    letter-spacing: 0.01em;
}

/* Homepage Talks Reel View Transitions */
.reel-strip.view-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1.25rem !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
    scroll-snap-type: none !important;
}
.reel-strip.view-grid li {
    flex: none !important;
    width: 100% !important;
    scroll-snap-align: none !important;
}
.reel-strip.view-grid a {
    display: flex;
    flex-direction: column;
}
.reel-strip.view-grid img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius);
}

.reel-strip.view-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.625rem !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
    scroll-snap-type: none !important;
}
.reel-strip.view-list li {
    flex: none !important;
    width: 100% !important;
    scroll-snap-align: none !important;
}
.reel-strip.view-list a {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.reel-strip.view-list a:hover {
    background: var(--ink-06);
    border-color: var(--ink-20);
    transform: translateX(2px);
}
.reel-strip.view-list img {
    width: 110px !important;
    height: 62px !important;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px);
}
.reel-strip.view-list .reel-time {
    position: static !important;
    display: inline-block;
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
}
.reel-strip.view-list .reel-title {
    margin-top: 0 !important;
    font-size: 0.9375rem !important;
    font-weight: 550;
    color: var(--ink);
}

/* Talks Subpage Layout Views */
.talks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}
.talk-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.talk-card:hover {
    background: var(--ink-06);
    border-color: var(--ink-20);
}
.talk-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--ink-06);
}
.talk-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.talk-card-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--mono);
    color: #ffffff;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.talk-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-top: 0.85rem;
}
.talk-card-title {
    font-size: 1.1rem;
    font-weight: 650;
    color: var(--ink);
    line-height: 1.35;
    margin: 0;
}
.talk-card-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ink-70);
    margin-top: 0.5rem;
    flex: 1;
}
.talk-card-links {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    font-weight: 550;
}
.talk-card-links a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}
.talk-card-links a:hover {
    color: var(--ink);
}

/* 1. Grid View */
.talks-page-content.view-grid .talks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* 2. List View (Full width horizontal rows) */
.talks-page-content.view-list .talks-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.talks-page-content.view-list .talk-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.25rem;
    align-items: center;
    padding: 1rem;
}
.talks-page-content.view-list .talk-card-content {
    margin-top: 0;
}

/* 3. Compact View (Minimal Index Row) */
.talks-page-content.view-compact .talks-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.talks-page-content.view-compact .talk-card {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
}
.talks-page-content.view-compact .talk-card-media,
.talks-page-content.view-compact .talk-card-desc {
    display: none;
}
.talks-page-content.view-compact .talk-card-content {
    margin-top: 0;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}
.talks-page-content.view-compact .talk-card-title {
    font-size: 0.9375rem;
    font-weight: 550;
}
.talks-page-content.view-compact .talk-card-links {
    margin-top: 0;
    flex-shrink: 0;
}

@media (max-width: 680px) {
    .talks-page-content.view-list .talk-card {
        grid-template-columns: 1fr;
    }
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
    .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    :root { --gutter: 1.25rem; }
    .nav-inner { flex-direction: column; align-items: flex-start; gap: 0.25rem; padding-top: 0.75rem; }
    nav.site-nav ul { margin-left: 0; gap: 0 0.5rem; width: 100%; justify-content: space-between; }
    .masthead { padding-top: 2rem; }
    .site-footer-right { gap: 0.25rem 0.75rem; }
    .projects--featured .project:first-child { grid-row: auto; }
    .projects--featured .project:first-child .project-image { max-height: 176px; object-fit: cover; }
    .projects--featured .project:not(:first-child) .project-card { grid-template-columns: 80px minmax(0, 1fr); }
    .community-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }
    .skill-row { grid-template-columns: 1fr; gap: 0.5rem; padding: 0.85rem 0; }

    .index, .index-fold { --cols: 1fr; }
    .index-row { gap: 0.15rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }
    .index-row.is-year-start { padding-top: 1.25rem; }
    .index-row:not(.is-year-start) .index-year { display: none; }
    .projects { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .profile { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .profile-photo { width: 72px; height: 72px; }
    .profile-body { width: 100%; }
    .contacts { column-gap: 0; }
    .contacts li:first-child { flex-basis: 100%; }
    .contacts li:nth-child(2) { margin-left: -13px; }
    .masthead-intro { margin-top: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
