/* ==========================================================================
   viralvaghela.com — shared styles
   Apple-style: system type, generous space, rounded image cards.
   Light/dark follow the system setting (no in-page toggle).
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    color-scheme: light dark;

    --bg: #ffffff;
    --bg-alt: #f5f5f7;
    --card: #ffffff;
    --ink: #1d1d1f;
    --ink-2: #424245;
    --ink-3: #6e6e73;
    --line: #d2d2d7;
    --line-soft: #e8e8ed;
    --link: #0066cc;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --focus: #0071e3;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 10px rgba(0, 0, 0, 0.06), 0 20px 44px rgba(0, 0, 0, 0.12);
    --nav-bg: rgba(255, 255, 255, 0.78);

    /* Severity marks (validated for CVD + contrast). Text never uses these. */
    --critical: #c4262e;
    --high: #c27c00;
    --moderate: #7a6ff0;
    --critical-bg: #fdecec;
    --high-bg: #fdf3e1;
    --moderate-bg: #efedfd;

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

    --wrap: 1120px;
    --gutter: 22px;
    --radius-lg: 26px;
    --radius: 18px;
    --nav-h: 52px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #000000;
        --bg-alt: #161617;
        --card: #1d1d1f;
        --ink: #f5f5f7;
        --ink-2: #d2d2d7;
        --ink-3: #a1a1a6;
        --line: #424245;
        --line-soft: #2c2c2e;
        --link: #2997ff;
        --focus: #2997ff;
        --shadow: none;
        --shadow-hover: none;
        --nav-bg: rgba(22, 22, 23, 0.8);
        --critical: #c8363f;
        --high: #b8891a;
        --moderate: #7a6ff0;
        --critical-bg: #3a1618;
        --high-bg: #33270d;
        --moderate-bg: #24213f;
    }
}

:root[data-theme="dark"] {
    --bg: #000000;
    --bg-alt: #161617;
    --card: #1d1d1f;
    --ink: #f5f5f7;
    --ink-2: #d2d2d7;
    --ink-3: #a1a1a6;
    --line: #424245;
    --line-soft: #2c2c2e;
    --link: #2997ff;
    --focus: #2997ff;
    --shadow: none;
    --shadow-hover: none;
    --nav-bg: rgba(22, 22, 23, 0.8);
    --critical: #c8363f;
    --high: #b8891a;
    --moderate: #7a6ff0;
    --critical-bg: #3a1618;
    --high-bg: #33270d;
    --moderate-bg: #24213f;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 20px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink-2);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.53;
    letter-spacing: -0.012em;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
}

p,
figure {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 6px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 980px;
    background: var(--ink);
    color: var(--bg);
}

.skip-link:focus {
    top: 10px;
}

.wrap {
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.wrap-narrow {
    max-width: 760px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.mono {
    font-family: var(--font-mono);
    letter-spacing: 0;
}

/* ---------- Global nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: saturate(1.8) blur(20px);
    -webkit-backdrop-filter: saturate(1.8) blur(20px);
    border-bottom: 1px solid var(--line-soft);
}

@media (prefers-reduced-transparency: reduce) {
    .nav {
        background: var(--bg);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

.nav-inner {
    display: flex;
    align-items: center;
    height: var(--nav-h);
}

.nav-inner nav {
    margin-left: auto;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ink);
    font-weight: 600;
    font-size: 1.0625rem;
}

.nav-brand:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 10px;
    color: var(--ink-2);
    font-size: 0.875rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.nav-links a[aria-current="location"] {
    color: var(--ink);
    text-decoration: none;
}

.nav-links a[aria-current="page"] {
    font-weight: 600;
}

.nav-links .nav-cta {
    margin-left: 8px;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 980px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 500;
}

.nav-links .nav-cta:hover {
    color: #ffffff;
    background: var(--accent-hover);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.nav-toggle svg {
    width: 22px;
    height: 22px;
    margin: auto;
}

@media (max-width: 820px) {
    .nav-toggle {
        display: grid;
        margin-left: auto;
    }

    .nav-inner nav {
        margin-left: 0;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter) 20px;
        background: var(--bg);
        border-bottom: 1px solid var(--line-soft);
    }

    .nav[data-open="true"] .nav-links {
        display: flex;
    }

    .nav-links a {
        display: flex;
        min-height: 48px;
        padding: 0;
        font-size: 1.1875rem;
        font-weight: 600;
        color: var(--ink);
        border-bottom: 1px solid var(--line-soft);
    }

    .nav-links .nav-cta {
        margin: 16px 0 0;
        min-height: 48px;
        justify-content: center;
        border-bottom: 0;
    }
}

/* ---------- Buttons & links ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 980px;
    font: 500 1.0625rem/1 var(--font);
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--link);
    border-color: var(--link);
}

.btn-secondary:hover {
    background: var(--link);
    color: var(--bg);
}

.btn-small {
    min-height: 40px;
    padding: 0 18px;
    font-size: 0.9375rem;
}

.more {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 44px;
    font-size: 1.0625rem;
}

.more::after {
    content: "\203A";
    font-size: 1.35em;
    line-height: 1;
    margin-left: 4px;
    transform: translateY(-1px);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

/* ---------- Sections ---------- */
.section {
    padding-block: 88px;
}

.section-alt {
    background: var(--bg-alt);
}

@media (max-width: 734px) {
    .section {
        padding-block: 64px;
    }
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 32px;
    margin-bottom: 40px;
}

.section-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.07;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.section-intro {
    margin-top: 12px;
    max-width: 40em;
    font-size: 1.1875rem;
    line-height: 1.45;
    color: var(--ink-3);
}

.eyebrow {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink-3);
    letter-spacing: -0.01em;
}

/* ---------- Hero ---------- */
.hero {
    padding-block: 96px 72px;
}

@media (max-width: 734px) {
    .hero {
        padding-block: 56px 48px;
    }
}

.hero h1 {
    margin-top: 10px;
    max-width: 12em;
    font-size: clamp(3rem, 8.4vw, 6rem);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.hero .lede {
    margin-top: 24px;
    max-width: 34em;
    font-size: clamp(1.1875rem, 2.2vw, 1.5rem);
    line-height: 1.4;
    color: var(--ink-3);
    letter-spacing: -0.015em;
}

.hero .actions {
    margin-top: 36px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--line-soft);
}

@media (min-width: 735px) {
    .stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.stats dt {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.stats dd {
    margin: 8px 0 0;
    font-size: 0.9375rem;
    line-height: 1.35;
    color: var(--ink-3);
}

/* ---------- Severity chip ---------- */
.sev {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px 4px 9px;
    border-radius: 980px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    white-space: nowrap;
}

.sev::before {
    content: "";
    flex-shrink: 0;
}

.sev-critical {
    background: var(--critical-bg);
}

.sev-critical::before {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--critical);
}

.sev-high {
    background: var(--high-bg);
}

.sev-high::before {
    width: 8px;
    height: 8px;
    border-radius: 1px;
    background: var(--high);
    transform: rotate(45deg);
}

.sev-moderate {
    background: var(--moderate-bg);
}

.sev-moderate::before {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 9px solid var(--moderate);
}

/* ---------- Research cards ---------- */
.card-grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 735px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1069px) {
    .card-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.rcard {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.section-alt .rcard {
    background: var(--card);
}

.section:not(.section-alt) .rcard {
    border: 1px solid var(--line-soft);
}

.rcard:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.rcard-cover {
    aspect-ratio: 16 / 10;
    width: 100%;
    object-fit: cover;
    background: #111;
}

.rcard-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    padding: 24px 26px 26px;
}

.rcard .rcard-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: 0.875rem;
    color: var(--ink-3);
}

.rcard h3 {
    font-size: 1.375rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Whole card is one link; the title carries it */
.rcard h3 a {
    color: var(--ink);
}

.rcard h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.rcard h3 a:hover {
    text-decoration: none;
}

.rcard h3 a:focus-visible {
    outline: none;
}

.rcard:has(h3 a:focus-visible) {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.rcard p {
    font-size: 1rem;
    line-height: 1.47;
    color: var(--ink-3);
}

.rcard .rcard-foot {
    margin-top: auto;
    padding-top: 6px;
    font-size: 0.9375rem;
    color: var(--link);
}

.rcard-locked .rcard-foot,
.rcard-locked p.rcard-foot {
    color: var(--ink-3);
}

/* Featured (large) card */
@media (min-width: 735px) {
    .rcard-feature {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1069px) {
    .rcard-feature {
        flex-direction: row;
    }

    .rcard-feature .rcard-cover {
        width: 58%;
        aspect-ratio: auto;
        min-height: 400px;
    }

    .rcard-feature .rcard-body {
        justify-content: center;
        padding: 48px;
        gap: 14px;
    }

    .rcard-feature h3 {
        font-size: 2.25rem;
        line-height: 1.1;
        letter-spacing: -0.03em;
    }

    .rcard-feature p {
        font-size: 1.1875rem;
    }

    .rcard-feature p.rcard-foot {
        margin-top: 12px;
    }
}

/* ---------- Filters ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 32px;
}

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    padding: 3px;
    border-radius: 980px;
    background: var(--line-soft);
}

.segmented button {
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 980px;
    background: transparent;
    color: var(--ink-2);
    font: 500 0.9375rem/1 var(--font);
    cursor: pointer;
}

.segmented button[aria-pressed="true"] {
    background: var(--card);
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.segmented .count {
    margin-left: 6px;
    color: var(--ink-2);
}

.search {
    position: relative;
    flex: 1 1 240px;
    max-width: 320px;
}

.search .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-3);
    pointer-events: none;
}

.search input {
    width: 100%;
    min-height: 46px;
    padding: 0 16px 0 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
    font: 400 1rem/1 var(--font);
}

.search input::placeholder {
    color: var(--ink-3);
}

.empty {
    padding: 56px 0;
    text-align: center;
}

.empty p {
    margin-bottom: 18px;
    font-size: 1.1875rem;
    color: var(--ink-3);
}

/* ---------- About ---------- */
.about {
    display: grid;
    gap: 40px;
    align-items: center;
}

@media (min-width: 835px) {
    .about {
        grid-template-columns: 340px 1fr;
        gap: 64px;
    }
}

.portrait {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.about-copy p {
    max-width: 36em;
    font-size: 1.1875rem;
    line-height: 1.5;
}

.about-copy p+p {
    margin-top: 18px;
}

/* ---------- Experience ---------- */
.jobs {
    display: grid;
    gap: 20px;
}

.job {
    display: grid;
    gap: 6px 40px;
    padding: 32px;
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
}

@media (min-width: 835px) {
    .job {
        grid-template-columns: 220px 1fr;
        padding: 40px;
    }
}

.section:not(.section-alt) .job {
    border: 1px solid var(--line-soft);
}

.job-side .job-company {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.job-side p {
    font-size: 0.9375rem;
    color: var(--ink-3);
}

.job-current {
    display: inline-block;
    margin-top: 10px;
    padding: 3px 10px;
    border-radius: 980px;
    background: var(--bg-alt);
    color: var(--ink-2) !important;
    font-size: 0.8125rem !important;
    font-weight: 600;
}

.section-alt .job-current {
    background: var(--line-soft);
}

.role+.role {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--line-soft);
}

.role-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 16px;
}

.role h3 {
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.role-when {
    font-size: 0.9375rem;
    color: var(--ink-3);
}

.role ul {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.role li {
    position: relative;
    padding-left: 18px;
    max-width: 44em;
}

.role li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.68em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink-3);
}

.role>p {
    margin-top: 10px;
    max-width: 44em;
}

.ack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ack li {
    padding: 6px 14px;
    border-radius: 980px;
    background: var(--bg-alt);
    font-size: 0.9375rem;
    color: var(--ink);
}

.ack li::before {
    display: none;
}

.ack-label {
    margin-top: 22px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
}

/* ---------- Projects ---------- */
.tiles {
    display: grid;
    gap: 20px;
}

@media (min-width: 735px) {
    .tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 30px;
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
}

.section:not(.section-alt) .tile {
    border: 1px solid var(--line-soft);
}

.tile-kicker {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-3);
}

.tile h3 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tile p {
    flex-grow: 1;
}

.tile-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 20px;
    margin-top: 8px;
}

.tile-stat {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--ink-3);
}

/* ---------- Writing ---------- */
.posts {
    border-top: 1px solid var(--line);
}

.posts li {
    display: grid;
    gap: 4px 40px;
    padding-block: 28px;
    border-bottom: 1px solid var(--line);
}

@media (min-width: 835px) {
    .posts li {
        grid-template-columns: 220px 1fr;
    }
}

.posts .post-topic {
    font-size: 0.9375rem;
    color: var(--ink-3);
}

.posts h3 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.posts h3 a {
    color: var(--ink);
    padding-block: 8px;
}

.posts p {
    margin-top: 4px;
    max-width: 40em;
    color: var(--ink-3);
}

/* ---------- Skills ---------- */
.skills {
    display: grid;
    gap: 20px;
}

@media (min-width: 735px) {
    .skills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.skills div {
    padding: 26px 28px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}

.section:not(.section-alt) .skills div {
    border: 1px solid var(--line-soft);
}

.skills dt {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--ink);
}

.skills dd {
    margin: 6px 0 0;
    color: var(--ink-3);
}

.badge {
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 980px;
    background: var(--bg-alt);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-2);
    vertical-align: 2px;
}

/* ---------- Contact ---------- */
.contact {
    text-align: center;
}

.contact .section-title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
}

.contact .section-intro {
    margin-inline: auto;
}

.contact .actions {
    justify-content: center;
    margin-top: 32px;
}

.status {
    min-height: 1.6em;
    margin-top: 14px;
    font-size: 0.9375rem;
    color: var(--ink-3);
}

.social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 28px;
    margin-top: 24px;
}

.social a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

/* ---------- Footer ---------- */
.footer {
    padding-block: 28px 40px;
    background: var(--bg-alt);
    border-top: 1px solid var(--line-soft);
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
}

.footer a {
    color: var(--ink-2);
}

/* ---------- Finding (article) page ---------- */
.crumbs {
    padding-top: 28px;
    font-size: 0.9375rem;
}

.crumbs a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
}

.crumbs a::before {
    content: "\2039";
    font-size: 1.35em;
    line-height: 1;
    margin-right: 4px;
    transform: translateY(-1px);
}

.article-head {
    padding-block: 20px 40px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    font-size: 0.9375rem;
    color: var(--ink-3);
}

.article-head h1 {
    margin-top: 18px;
    font-size: clamp(2.25rem, 5.6vw, 3.75rem);
    line-height: 1.06;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.article-head .dek {
    margin-top: 18px;
    font-size: clamp(1.1875rem, 2.2vw, 1.5rem);
    line-height: 1.4;
    color: var(--ink-3);
}

.article-cover {
    max-width: 1120px;
    margin: 0 auto;
    padding-inline: var(--gutter);
}

.article-cover img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.facts-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
    margin-top: 48px;
    padding: 28px;
    border-radius: var(--radius);
    background: var(--bg-alt);
}

@media (min-width: 735px) {
    .facts-card {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.facts-card dt {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-3);
}

/* Keep IDs like GHSA-…-4x84-… literal (Inter would render 4×84) */
.facts-card dd,
.refs a {
    font-feature-settings: "calt" 0;
}

.facts-card dd {
    margin: 4px 0 0;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.prose {
    padding-block: 8px 24px;
}

.prose h2 {
    margin-top: 48px;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.prose p,
.prose ul {
    margin-top: 16px;
    font-size: 1.1875rem;
    line-height: 1.6;
    color: var(--ink-2);
}

.prose ul {
    display: grid;
    gap: 10px;
}

.prose ul li {
    position: relative;
    padding-left: 20px;
}

.prose ul li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink-3);
}

.prose code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--bg-alt);
    font-family: var(--font-mono);
    font-size: 0.88em;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.prose pre {
    margin-top: 16px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: var(--bg-alt);
    overflow-x: auto;
}

.prose pre code {
    padding: 0;
    background: none;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-wrap: normal;
}

.callout {
    margin-top: 24px;
    padding: 20px 24px;
    border-radius: var(--radius);
    background: var(--bg-alt);
    font-size: 1.0625rem;
    line-height: 1.55;
}

.callout strong {
    color: var(--ink);
}

.timeline {
    margin-top: 20px;
    border-left: 2px solid var(--line);
}

.timeline li {
    position: relative;
    padding: 0 0 22px 24px;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 0.45em;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--ink-3);
}

.timeline li:last-child {
    padding-bottom: 0;
}

.timeline time {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
}

.timeline p {
    margin-top: 2px;
    font-size: 1.0625rem;
    line-height: 1.5;
}

.refs {
    margin-top: 16px;
    border-top: 1px solid var(--line);
}

.refs li {
    border-bottom: 1px solid var(--line);
}

.refs a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    padding-block: 10px;
    font-size: 1.0625rem;
}

.refs a span:last-child {
    font-size: 0.875rem;
    color: var(--ink-3);
    white-space: nowrap;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    .rcard:hover {
        transform: none;
    }
}

/* ==========================================================================
   Portfolio signature: dark "pro" hero, method, CVEs, numbers, recognition
   ========================================================================== */

/* Dark nav for pages that open on a dark hero */
.nav-dark {
    --nav-bg: rgba(22, 22, 23, 0.82);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.nav-dark .nav-brand {
    color: #f5f5f7;
}

.nav-dark .nav-links a {
    color: #d2d2d7;
}

.nav-dark .nav-links a:hover,
.nav-dark .nav-links a[aria-current="page"],
.nav-dark .nav-links a[aria-current="location"] {
    color: #ffffff;
}

.nav-dark .nav-links .nav-cta {
    color: #ffffff;
}

.nav-dark .nav-toggle {
    color: #f5f5f7;
}

@media (max-width: 820px) {
    .nav-dark .nav-links {
        background: #161617;
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .nav-dark .nav-links a {
        color: #f5f5f7;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .nav-dark {
        background: #161617;
    }
}

/* Dark band: always dark, regardless of system appearance */
.band-dark {
    --bg: #000000;
    --ink: #f5f5f7;
    --ink-2: #d2d2d7;
    --ink-3: #a1a1a6;
    --line: #424245;
    --line-soft: #2c2c2e;
    --link: #2997ff;
    --focus: #2997ff;
    --card: #1d1d1f;
    --bg-alt: #1d1d1f;
    background: #000000;
    color: var(--ink-2);
}

.grad {
    background: linear-gradient(92deg, #ff6b6b 0%, #c86bfa 48%, #4fa3ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (forced-colors: active) {
    .grad {
        color: CanvasText;
        background: none;
    }
}

/* Hero */
.hero-pro {
    position: relative;
    overflow: hidden;
    padding-block: 88px 0;
}

.hero-pro::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto auto;
    width: 900px;
    height: 900px;
    background: radial-gradient(closest-side, rgba(122, 111, 240, 0.28), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.hero-grid {
    position: relative;
    display: grid;
    gap: 48px;
    align-items: center;
}

@media (min-width: 1069px) {
    .hero-grid {
        grid-template-columns: 1.05fr 0.95fr;
        gap: 32px;
    }
}

.hero-pro h1 {
    margin-top: 14px;
    font-size: clamp(3rem, 7.2vw, 5.75rem);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.hero-pro .lede {
    margin-top: 24px;
    max-width: 32em;
    font-size: clamp(1.1875rem, 2vw, 1.4375rem);
    line-height: 1.42;
    color: var(--ink-3);
}

.hero-pro .actions {
    margin-top: 36px;
}

/* Stack of finding covers in perspective */
.stack {
    position: relative;
    height: clamp(300px, 46vw, 520px);
    perspective: 1600px;
}

.stack-card {
    position: absolute;
    width: 74%;
    aspect-ratio: 16 / 10;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform-style: preserve-3d;
}

.stack-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stack-card:nth-child(1) {
    top: 2%;
    left: 22%;
    transform: rotateY(-22deg) rotateX(8deg) rotateZ(4deg) scale(0.86);
    opacity: 0.75;
}

.stack-card:nth-child(2) {
    top: 18%;
    left: 12%;
    transform: rotateY(-20deg) rotateX(8deg) rotateZ(1deg) scale(0.93);
    opacity: 0.9;
}

.stack-card:nth-child(3) {
    top: 34%;
    left: 2%;
    transform: rotateY(-18deg) rotateX(8deg) rotateZ(-2deg);
}

.float-chip {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 980px;
    background: rgba(29, 29, 31, 0.78);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    color: #f5f5f7;
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
}

.float-chip .mono {
    font-weight: 500;
    color: #d2d2d7;
}

.float-chip .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff5a5f;
    box-shadow: 0 0 0 4px rgba(255, 90, 95, 0.25);
}

.float-chip-a {
    top: 8%;
    right: 2%;
}

.float-chip-b {
    bottom: 8%;
    right: 6%;
}

@media (max-width: 734px) {
    .float-chip {
        font-size: 0.8125rem;
        padding: 8px 12px;
    }

    .float-chip-a {
        top: 0;
        right: 0;
    }

    .float-chip-b {
        bottom: 2%;
        right: 0;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .float-chip {
        background: #1d1d1f;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Press strip */
.press {
    position: relative;
    margin-top: 72px;
    padding-block: 28px 36px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.press-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-3);
}

.press ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 36px;
    margin-top: 10px;
}

.press a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #d2d2d7;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.press a:hover {
    color: #ffffff;
    text-decoration: none;
}

.press .serif {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    letter-spacing: 0;
}

/* Method */
.method {
    display: grid;
    gap: 20px;
    counter-reset: step;
}

@media (min-width: 735px) {
    .method {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1069px) {
    .method {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.method li {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 30px 28px 32px;
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
}

.section:not(.section-alt) .method li {
    border: 1px solid var(--line-soft);
}

.method-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1d1d1f, #3a3a3c);
    color: #ffffff;
}

.method-icon svg {
    width: 26px;
    height: 26px;
}

.method-step {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-3);
}

.method h3 {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.method p {
    color: var(--ink-3);
}

/* Published CVEs */
.cves {
    display: grid;
    gap: 12px;
    margin-top: 32px;
}

@media (min-width: 640px) {
    .cves {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cve {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.cve:hover {
    text-decoration: none;
    box-shadow: var(--shadow-hover);
}

.cve-id {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0;
}

.cve-pkg {
    display: block;
    margin-top: 2px;
    font-size: 0.875rem;
    color: var(--ink-3);
}

.cves-label {
    margin-top: 48px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--ink);
}

.cves-label+.cves {
    margin-top: 14px;
}

/* By the numbers */
.numbers {
    display: grid;
    gap: 40px 32px;
}

@media (min-width: 735px) {
    .numbers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1069px) {
    .numbers {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.numbers dt {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.045em;
}

.numbers dd {
    margin: 12px 0 0;
    max-width: 16em;
    font-size: 1.0625rem;
    line-height: 1.4;
    color: var(--ink-3);
}

.numbers dd strong {
    color: var(--ink);
    font-weight: 600;
}

/* Recognition */
.recog {
    display: grid;
    gap: 20px;
}

@media (min-width: 835px) {
    .recog {
        grid-template-columns: 1.4fr 1fr;
    }
}

.recog-card {
    padding: 32px;
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
}

.section:not(.section-alt) .recog-card {
    border: 1px solid var(--line-soft);
}

.recog-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.recog-card>p {
    margin-top: 6px;
    color: var(--ink-3);
}

.wordmarks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

@media (min-width: 560px) {
    .wordmarks {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.wordmarks li {
    display: grid;
    place-items: center;
    min-height: 72px;
    padding: 12px;
    border-radius: 14px;
    background: var(--bg-alt);
    color: var(--ink);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
}

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

/* Page hero for /research */
.page-hero {
    position: relative;
    overflow: hidden;
    padding-block: 80px 64px;
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: -30% -10% auto auto;
    width: 760px;
    height: 760px;
    background: radial-gradient(closest-side, rgba(122, 111, 240, 0.26), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.page-hero .wrap {
    position: relative;
}

.page-hero h1 {
    margin-top: 10px;
    font-size: clamp(3rem, 7vw, 5.25rem);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.page-hero .section-intro {
    color: var(--ink-3);
}

.page-hero .numbers {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--line-soft);
}

.page-hero .numbers dt {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

/* ==========================================================================
   Craft layer: motion, anatomy story, command palette, CVSS, TOC, progress
   ========================================================================== */

/* Cover zoom on hover */
.rcard-cover {
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.rcard:hover .rcard-cover {
    transform: scale(1.04);
}

/* Scroll reveal (only when JS runs and motion is allowed) */
.motion .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--delay, 0s);
}

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

/* Hero stack: entrance + pointer tilt */
.stack-tilt {
    position: absolute;
    inset: 0;
    transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.motion .stack-card {
    animation: stack-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.motion .stack-card:nth-child(1) {
    animation-delay: 0.05s;
}

.motion .stack-card:nth-child(2) {
    animation-delay: 0.18s;
}

.motion .stack-card:nth-child(3) {
    animation-delay: 0.31s;
}

.motion .float-chip {
    animation: chip-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.7s both;
}

@keyframes stack-in {
    from {
        opacity: 0;
        translate: 60px 40px;
    }
}

@keyframes chip-in {
    from {
        opacity: 0;
        translate: 0 12px;
    }
}

/* Nav search button */
.nav-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin-left: 6px;
    padding: 0 10px 0 12px;
    border: 1px solid var(--line);
    border-radius: 980px;
    background: transparent;
    color: var(--ink-3);
    font: 400 0.8125rem/1 var(--font);
    cursor: pointer;
}

.nav-search svg {
    width: 14px;
    height: 14px;
}

.nav-search kbd {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--line-soft);
    font: 500 0.75rem/1.2 var(--font);
    color: var(--ink-2);
}

.nav-dark .nav-search {
    border-color: rgba(255, 255, 255, 0.18);
    color: #a1a1a6;
}

.nav-dark .nav-search kbd {
    background: rgba(255, 255, 255, 0.12);
    color: #d2d2d7;
}

.nav-search-mobile {
    display: none;
}

@media (max-width: 820px) {
    .nav-search {
        display: none;
    }

    .nav-search-mobile {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        margin-left: auto;
        padding: 0;
        border: 0;
        background: transparent;
        color: inherit;
        cursor: pointer;
    }

    .nav-search-mobile svg {
        width: 20px;
        height: 20px;
    }

    .nav-dark .nav-search-mobile {
        color: #f5f5f7;
    }

    .nav-search-mobile+.nav-toggle {
        margin-left: 0;
    }
}

/* Command palette */
.palette {
    width: min(640px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 120px));
    margin: 12vh auto auto;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: var(--card);
    color: var(--ink);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--line-soft);
    overflow: hidden;
}

.palette::backdrop {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.palette-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line-soft);
}

.palette-field svg {
    width: 20px;
    height: 20px;
    color: var(--ink-3);
    flex-shrink: 0;
}

.palette-field input {
    flex: 1;
    min-height: 60px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: 400 1.1875rem/1 var(--font);
}

.palette-field kbd {
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-alt);
    color: var(--ink-3);
    font: 500 0.75rem/1.2 var(--font);
}

.palette-list {
    max-height: 440px;
    overflow-y: auto;
    padding: 8px;
}

.palette-group {
    padding: 12px 12px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--ink);
    cursor: pointer;
}

.palette-item[aria-selected="true"] {
    background: var(--accent);
    color: #ffffff;
}

.palette-item[aria-selected="true"] .palette-hint {
    color: rgba(255, 255, 255, 0.85);
}

.palette-hint {
    font-size: 0.8125rem;
    color: var(--ink-3);
    white-space: nowrap;
}

.palette-empty {
    padding: 28px 12px;
    text-align: center;
    color: var(--ink-3);
}

/* Anatomy of a disclosure (scroll story) */
.anatomy {
    display: grid;
    gap: 32px;
}

@media (min-width: 1000px) {
    .anatomy {
        grid-template-columns: 0.9fr 1.1fr;
        gap: 64px;
        align-items: start;
    }
}

.anatomy-steps li {
    padding-block: 28px;
    transition: opacity 0.4s ease;
}

.js .anatomy-steps li {
    opacity: 0.35;
}

@media (min-width: 1000px) {
    .anatomy-steps li {
        min-height: 62vh;
        padding-block: 18vh;
    }

    .anatomy-steps li:first-child {
        padding-top: 4vh;
    }

    .anatomy-steps li:last-child {
        min-height: 50vh;
    }
}

.js .anatomy-steps li.is-active {
    opacity: 1;
}

.anatomy-steps .step-n {
    font: 600 0.875rem/1 var(--font-mono);
    color: var(--ink-3);
    letter-spacing: 0;
}

.anatomy-steps h3 {
    margin-top: 12px;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.anatomy-steps p {
    margin-top: 12px;
    max-width: 30em;
    font-size: 1.1875rem;
    line-height: 1.5;
    color: var(--ink-3);
}

.anatomy-visual {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    z-index: 1;
}

@media (max-width: 999px) {
    .anatomy-visual {
        order: -1;
        top: var(--nav-h);
        padding-block: 8px;
        background: var(--bg);
    }

    .anatomy-steps li {
        padding-block: 40px;
    }
}

.console {
    border-radius: 22px;
    background: linear-gradient(180deg, #16161a, #0b0b0e);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.09);
    color: #d2d2d7;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    letter-spacing: 0;
    overflow: hidden;
}

@media (max-width: 734px) {
    .console {
        font-size: 0.8125rem;
    }
}

.console-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--font);
    font-size: 0.8125rem;
    color: #a1a1a6;
}

.console-bar i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #3a3a3c;
}

.console-bar span {
    margin-left: auto;
}

.console-body {
    padding: 20px 22px 24px;
}

.c-label {
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 600;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.c-req,
.c-res {
    margin-top: 8px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.c-res-wrap {
    margin-top: 18px;
}

.c-method {
    color: #5cf2a4;
    font-weight: 600;
}

.c-key {
    color: #8e8e93;
}

.c-val {
    padding: 1px 6px;
    border-radius: 6px;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.c-status {
    font-weight: 600;
}

.c-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.c-row span {
    white-space: nowrap;
}

.c-row b {
    font-weight: 500;
    color: #f5f5f7;
    text-align: right;
}

/* Compact console on phones so the step text stays visible below it */
@media (max-width: 999px) {
    .console {
        font-size: 0.75rem;
        border-radius: 16px;
    }

    .console-bar {
        padding: 9px 14px;
    }

    .console-body {
        padding: 12px 14px 14px;
    }

    .c-req,
    .c-res {
        margin-top: 6px;
        padding: 8px 12px;
        line-height: 1.55;
    }

    .c-res-wrap {
        margin-top: 10px;
    }

    .c-badge {
        margin-top: 8px;
        padding: 3px 10px;
    }

    .c-note {
        margin-top: 8px;
    }
}

.c-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 5px 12px;
    border-radius: 980px;
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Console states, driven by data-step on .console */
.console [data-show] {
    display: none;
}

.console[data-step="1"] [data-show~="1"],
.console[data-step="2"] [data-show~="2"],
.console[data-step="3"] [data-show~="3"],
.console[data-step="4"] [data-show~="4"] {
    display: block;
}

.console[data-step="1"] .c-row[data-show~="1"],
.console[data-step="2"] .c-row[data-show~="2"],
.console[data-step="3"] .c-row[data-show~="3"],
.console[data-step="4"] .c-row[data-show~="4"] {
    display: flex;
}

.console[data-step="1"] .c-badge[data-show~="1"],
.console[data-step="2"] .c-badge[data-show~="2"],
.console[data-step="3"] .c-badge[data-show~="3"],
.console[data-step="4"] .c-badge[data-show~="4"],
.console[data-step="1"] span[data-show~="1"],
.console[data-step="2"] span[data-show~="2"],
.console[data-step="3"] span[data-show~="3"],
.console[data-step="4"] span[data-show~="4"] {
    display: inline-flex;
}

.console[data-step="2"] .c-pan,
.console[data-step="3"] .c-pan {
    background: rgba(255, 90, 110, 0.22);
    color: #ff8a98;
}

.console[data-step="4"] .c-pan {
    background: rgba(255, 255, 255, 0.08);
    color: #d2d2d7;
}

.c-bad {
    background: rgba(255, 90, 110, 0.16);
    color: #ff8a98;
}

.c-good {
    background: rgba(92, 242, 164, 0.14);
    color: #7df5b6;
}

.c-note {
    margin-top: 14px;
    font-family: var(--font);
    font-size: 0.75rem;
    color: #8e8e93;
}

/* CVSS breakdown */
.cvss {
    display: grid;
    gap: 24px;
    margin-top: 20px;
    padding: 28px;
    border-radius: var(--radius);
    background: var(--bg-alt);
}

@media (min-width: 640px) {
    .cvss {
        grid-template-columns: 150px 1fr;
        align-items: center;
    }
}

.cvss-ring {
    position: relative;
    width: 150px;
    height: 150px;
}

.cvss-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.cvss-ring .track {
    stroke: var(--line);
}

.cvss-ring .value {
    stroke-linecap: round;
}

.cvss-score {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
}

.cvss-score strong {
    font-family: var(--font-display);
    font-size: 2.5rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.cvss-score span {
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.cvss-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}

@media (min-width: 900px) {
    .cvss-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.cvss-metrics dt {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-3);
}

.cvss-metrics dd {
    margin: 2px 0 0;
    font-size: 1rem;
    color: var(--ink);
}

.cvss-metrics .hot {
    font-weight: 600;
}

.prose .cvss-vector {
    grid-column: 1 / -1;
    margin: 4px 0 0;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--ink-3);
    overflow-wrap: anywhere;
    letter-spacing: 0;
}

/* Article layout with sticky TOC */
.article-layout {
    max-width: 1120px;
    margin: 0 auto;
    padding-inline: var(--gutter);
}

@media (min-width: 1069px) {
    .article-layout {
        display: grid;
        grid-template-columns: 220px minmax(0, 720px);
        justify-content: center;
        gap: 64px;
    }
}

.toc {
    display: none;
}

@media (min-width: 1069px) {
    .toc {
        display: block;
        position: sticky;
        top: calc(var(--nav-h) + 40px);
        align-self: start;
        margin-top: 56px;
    }
}

.toc p {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink-3);
}

.toc ol {
    margin-top: 12px;
    border-left: 2px solid var(--line-soft);
}

.toc a {
    display: block;
    margin-left: -2px;
    padding: 7px 0 7px 16px;
    border-left: 2px solid transparent;
    color: var(--ink-3);
    font-size: 0.9375rem;
    line-height: 1.35;
}

.toc a:hover {
    color: var(--ink);
    text-decoration: none;
}

.toc a[aria-current="true"] {
    border-left-color: var(--ink);
    color: var(--ink);
    font-weight: 600;
}

.article-layout .prose {
    padding-inline: 0;
}

.share {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
}

.pager {
    display: grid;
    gap: 16px;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
}

@media (min-width: 640px) {
    .pager {
        grid-template-columns: 1fr 1fr;
    }
}

.pager a {
    display: block;
    padding: 20px 22px;
    border-radius: var(--radius);
    background: var(--bg-alt);
    color: var(--ink);
}

.pager a:hover {
    text-decoration: none;
    background: var(--line-soft);
}

.pager span {
    display: block;
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.pager strong {
    display: block;
    margin-top: 4px;
    font-size: 1.0625rem;
    line-height: 1.3;
}

.pager .next {
    text-align: right;
}

/* Reading progress */
.progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
    height: 3px;
    background: linear-gradient(92deg, #ff6b6b, #c86bfa 50%, #4fa3ff);
    transform-origin: 0 50%;
    transform: scaleX(var(--p, 0));
    pointer-events: none;
}

/* 404 */
.notfound {
    display: grid;
    place-items: center;
    min-height: calc(100vh - var(--nav-h) - 90px);
    padding-block: 80px;
    text-align: center;
}

.notfound .code {
    font-family: var(--font-display);
    font-size: clamp(6rem, 22vw, 14rem);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.06em;
}

.notfound h1 {
    margin-top: 20px;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: -0.03em;
}

.notfound p {
    margin: 14px auto 0;
    max-width: 30em;
    font-size: 1.1875rem;
    color: var(--ink-3);
}

.notfound .mono {
    display: inline-block;
    margin-top: 28px;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--card);
    box-shadow: inset 0 0 0 1px var(--line-soft);
    color: var(--ink-2);
    font-size: 0.9375rem;
}

.notfound .actions {
    justify-content: center;
    margin-top: 32px;
}

@media (prefers-reduced-motion: reduce) {
    .rcard:hover .rcard-cover {
        transform: none;
    }

    .stack-tilt {
        transform: none !important;
    }
}

.notfound p.grad {
    color: transparent;
}
