/* ============================================================================
   ReasoningBytes — "The Signal"
   A data-portrait design system. Pure CSS, no framework.
   Dark-default with a light theme. Gold/amber accent on warm near-black.
   ----------------------------------------------------------------------------
   Type:  Bricolage Grotesque (display) · Hanken Grotesk (body) · JetBrains Mono
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    /* dark theme (default) */
    --bg:        #0a0b0d;
    --bg-2:      #101216;
    --bg-3:      #16191e;
    --ink:       #ece9e1;
    --ink-2:     #9a9da4;
    --ink-3:     #62656c;
    --line:      rgba(255, 255, 255, 0.09);
    --line-2:    rgba(255, 255, 255, 0.05);
    --gold:      #e7b24c;
    --gold-2:    #f3c66e;
    --gold-soft: rgba(231, 178, 76, 0.12);
    --gold-line: rgba(231, 178, 76, 0.32);
    --anomaly:   #ff6b5d;
    --on-gold:   #0a0b0d;
    --grid:      rgba(255, 255, 255, 0.035);
    --glow:      rgba(231, 178, 76, 0.16);
    --shadow:    0 24px 60px -28px rgba(0, 0, 0, 0.8);
    --shadow-sm: 0 8px 24px -16px rgba(0, 0, 0, 0.7);

    /* type */
    --font-display: "Bricolage Grotesque", Georgia, serif;
    --font-body:    "Hanken Grotesk", system-ui, sans-serif;
    --font-mono:    "JetBrains Mono", ui-monospace, monospace;

    /* scale & geometry */
    --maxw:   1120px;
    --radius: 14px;
    --radius-sm: 9px;
    --ease:   cubic-bezier(0.22, 1, 0.36, 1);

    color-scheme: dark;
}

html[data-theme="light"] {
    --bg:        #efeae0;
    --bg-2:      #faf7f0;
    --bg-3:      #f2ecdf;
    --ink:       #17181b;
    --ink-2:     #55585f;
    --ink-3:     #8a8c91;
    --line:      rgba(20, 20, 25, 0.13);
    --line-2:    rgba(20, 20, 25, 0.07);
    --gold:      #a06a12;
    --gold-2:    #875a0c;
    --gold-soft: rgba(160, 106, 18, 0.10);
    --gold-line: rgba(160, 106, 18, 0.30);
    --anomaly:   #c2392b;
    --on-gold:   #fbf7ee;
    --grid:      rgba(20, 20, 25, 0.05);
    --glow:      rgba(160, 106, 18, 0.10);
    --shadow:    0 24px 60px -30px rgba(60, 50, 25, 0.35);
    --shadow-sm: 0 10px 26px -18px rgba(60, 50, 25, 0.3);

    color-scheme: light;
}

/* ----------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

/* The "plot" — a faint data-grid + atmospheric gold light. Replaces particles.js */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        radial-gradient(var(--grid) 1px, transparent 1px);
    background-size: 34px 34px;
    background-position: -17px -17px;
    pointer-events: none;
}
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    top: -10%;
    left: 50%;
    width: min(900px, 90vw);
    height: 540px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, var(--glow), transparent 68%);
    pointer-events: none;
    opacity: 0.9;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--gold); color: var(--on-gold); }

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

/* ----------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.02em;
    color: var(--ink);
}

h1 { font-size: clamp(2.9rem, 7.2vw, 5.4rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); letter-spacing: -0.01em; }

p { text-wrap: pretty; }

.mono {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
}

.muted   { color: var(--ink-2); }
.faint   { color: var(--ink-3); }
.accent  { color: var(--gold); }

/* Section eyebrow: [ 02 ] · Professional Experience */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
}
.eyebrow .idx {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--gold-line);
    border-radius: 5px;
    background: var(--gold-soft);
}
.eyebrow .label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-2);
}

/* ----------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section { padding-block: clamp(4.5rem, 10vw, 8rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.rule {
    height: 1px;
    background: var(--line);
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 200;
    background: var(--gold);
    color: var(--on-gold);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ----------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--line-2);
}
.nav__inner {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.brand .blip {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 0 var(--glow);
    animation: blip 3.2s var(--ease) infinite;
}
.brand:hover { color: var(--gold); }

.nav__links {
    display: flex;
    align-items: center;
    gap: 1.9rem;
}
.nav__link {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink-2);
    position: relative;
    padding-block: 0.4rem;
    transition: color 0.25s var(--ease);
}
.nav__link::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1.5px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--ink); }

.nav__tools { display: flex; align-items: center; gap: 0.6rem; }

.icon-btn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-2);
    color: var(--ink-2);
    cursor: pointer;
    transition: all 0.25s var(--ease);
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold-line); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
html[data-theme="light"] .theme-toggle .sun { display: none; }
html[data-theme="light"] .theme-toggle .moon { display: block; }

.nav-burger { display: none; }

/* mobile menu panel */
.nav-mobile {
    position: fixed;
    inset: 68px 0 auto 0;
    z-index: 99;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 0.25rem;
    padding: 1rem clamp(1.25rem, 5vw, 2.5rem) 1.75rem;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--ease);
}
.nav-mobile.is-open { transform: none; opacity: 1; visibility: visible; }
.nav-mobile a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line-2);
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ink);
}
.nav-mobile a .n {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gold);
}

/* ----------------------------------------------------------------------------
   6. Buttons & tags
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary {
    background: var(--gold);
    color: var(--on-gold);
    box-shadow: 0 0 0 0 var(--glow);
}
.btn--primary:hover {
    background: var(--gold-2);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -12px var(--glow);
}
.btn--ghost {
    background: var(--bg-2);
    color: var(--ink);
    border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--gold-line); color: var(--gold); transform: translateY(-2px); }

.btn--primary .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--ink-2);
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--bg-2);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s var(--ease);
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.tag:hover { border-color: var(--gold-line); color: var(--ink); transform: translateY(-2px); }
.tag--solid { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold); }

/* ----------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem;
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    position: relative;
}
.card:hover { border-color: var(--gold-line); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.card--accent { border-left: 2px solid var(--gold); }

/* ----------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    padding-top: clamp(7rem, 14vh, 11rem);
    padding-bottom: clamp(3rem, 7vw, 6rem);
    overflow: hidden;
}
.hero__grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-2);
    border: 1px solid var(--line);
    background: var(--bg-2);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1.8rem;
}
.status-chip .live {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
    animation: blip 2.4s var(--ease) infinite;
}
.hero h1 .line2 {
    color: var(--gold);
    position: relative;
}
.hero__lede {
    color: var(--ink-2);
    font-size: clamp(1.05rem, 1.6vw, 1.22rem);
    max-width: 38ch;
    margin-top: 1.6rem;
    line-height: 1.6;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.2rem; }
.hero__meta {
    display: flex;
    gap: 2rem;
    margin-top: 2.6rem;
    flex-wrap: wrap;
}
.hero__meta .stat .n {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.9rem;
    color: var(--ink);
    line-height: 1;
}
.hero__meta .stat .k {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-top: 0.4rem;
}

/* career-graph canvas */
.graph {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 520px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        linear-gradient(var(--line-2) 1px, transparent 1px) 0 0 / 100% 25%,
        linear-gradient(90deg, var(--line-2) 1px, transparent 1px) 0 0 / 25% 100%,
        var(--bg-2);
    overflow: hidden;
}
.graph__corner {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: var(--ink-3);
    text-transform: uppercase;
    z-index: 2;
    pointer-events: none;
}
.graph__corner.tl { top: 0.9rem; left: 1rem; }
.graph__corner.br { bottom: 0.9rem; right: 1rem; color: var(--gold); }
.graph canvas { width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.graph canvas:active { cursor: grabbing; }
.graph__hint {
    position: absolute;
    bottom: 0.9rem;
    left: 1rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    z-index: 2;
    pointer-events: none;
}

/* ----------------------------------------------------------------------------
   9. Marquee / tech strip
   -------------------------------------------------------------------------- */
.strip {
    border-block: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-2) 60%, transparent);
    padding-block: 2.5rem;
}
.strip__label {
    text-align: center;
    color: var(--ink-3);
    margin-bottom: 1.5rem;
}
.strip__items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
}

/* ----------------------------------------------------------------------------
   10. Two-column content + sidebar
   -------------------------------------------------------------------------- */
.layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}
.layout__side { position: sticky; top: 100px; display: grid; gap: 1.25rem; }
.stack { display: grid; gap: clamp(3rem, 6vw, 5rem); }

/* ----------------------------------------------------------------------------
   11. Timeline (experience)
   -------------------------------------------------------------------------- */
.timeline {
    position: relative;
    margin-left: 0.5rem;
    padding-left: 2rem;
    border-left: 1px solid var(--line);
    display: grid;
    gap: 1.1rem;
}
.tl-item { position: relative; }
.tl-item::before {
    content: "";
    position: absolute;
    left: calc(-2rem - 5px);
    top: 1.7rem;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--bg-3);
    border: 2px solid var(--ink-3);
    transition: all 0.3s var(--ease);
}
.tl-item--now::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.tl-item:hover::before { border-color: var(--gold); }
.tl-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}
.tl-role { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; color: var(--ink); }
.tl-when {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--ink-2);
    border: 1px solid var(--line);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    white-space: nowrap;
}
.tl-item--now .tl-when { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }
.tl-org { color: var(--gold); font-weight: 500; font-size: 0.92rem; margin-bottom: 0.7rem; }
.tl-body { color: var(--ink-2); font-size: 0.95rem; }
.tl-body ul { padding-left: 1.1rem; display: grid; gap: 0.4rem; }
.tl-body li::marker { color: var(--ink-3); }

.era-divider {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}
.era-divider .mono { color: var(--gold); }
.tl-item--faded { opacity: 0.72; }
.tl-item--faded:hover { opacity: 1; }

/* ----------------------------------------------------------------------------
   12. Patents & publications
   -------------------------------------------------------------------------- */
.pub {
    border: 1px solid var(--line);
    border-left: 2px solid var(--gold);
    border-radius: var(--radius);
    background: var(--bg-2);
    padding: 1.6rem;
    transition: all 0.3s var(--ease);
}
.pub:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.pub__top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; align-items: center; }
.pub__title { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; color: var(--ink); }
.pub__venue { color: var(--ink-2); font-style: italic; font-size: 0.9rem; margin-top: 0.5rem; }

.patent-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; margin-top: 0.9rem; }
.patent {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    padding: 1.1rem 1.2rem;
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}
.patent::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--st, var(--gold));
}
.patent:hover { transform: translateY(-3px); border-color: var(--gold-line); box-shadow: var(--shadow-sm); }
.patent .status {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--st, var(--gold));
    margin-bottom: 0.5rem;
    display: block;
}
.patent .name { font-weight: 600; font-size: 0.95rem; color: var(--ink); line-height: 1.3; }

/* ----------------------------------------------------------------------------
   13. Work / case studies
   -------------------------------------------------------------------------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.work {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
    overflow: hidden;
    transition: all 0.3s var(--ease);
}
.work:hover { transform: translateY(-4px); border-color: var(--gold-line); box-shadow: var(--shadow); }
.work__viz {
    height: 168px;
    position: relative;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(ellipse at 78% 18%, var(--gold-soft), transparent 60%),
        linear-gradient(var(--line-2) 1px, transparent 1px) 0 0 / 100% 22px,
        var(--bg-3);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.work__tag {
    position: absolute; top: 0.9rem; left: 1rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
}
.work__sig { width: 80%; height: 44%; color: var(--gold); opacity: 0.85; }
.work__body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.work__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.25s var(--ease);
}
.work:hover .work__title { color: var(--gold); }
.work__title .arrow { opacity: 0; transform: translateX(-4px); transition: all 0.25s var(--ease); width: 18px; height: 18px; }
.work:hover .work__title .arrow { opacity: 1; transform: none; }
.work__desc { color: var(--ink-2); font-size: 0.92rem; flex: 1; }

/* metric stat row */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
}
.stat-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    padding: 1.2rem 1rem;
    text-align: center;
}
.stat-card .n { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--ink); line-height: 1; }
.stat-card .n.gold { color: var(--gold); }
.stat-card .k { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 0.55rem; }

/* sidebar widgets */
.widget { }
.widget h3 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 1.1rem; font-weight: 600; }
.edu-item + .edu-item { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line-2); }
.edu-item .deg { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.edu-item .sch { color: var(--ink-2); font-size: 0.83rem; }
.edu-item .spec { color: var(--gold); font-size: 0.78rem; margin-top: 0.2rem; font-family: var(--font-mono); letter-spacing: 0.03em; }

.talk-list { display: grid; gap: 1rem; }
.talk { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; font-size: 0.9rem; color: var(--ink-2); }
.talk .ico { color: var(--gold); }
.talk a:hover { color: var(--gold); }

.cta-card {
    background:
        radial-gradient(ellipse at top right, var(--gold-soft), transparent 70%),
        var(--bg-2);
    border: 1px solid var(--gold-line);
}
.cta-card h3 { font-family: var(--font-display); text-transform: none; letter-spacing: -0.01em; font-size: 1.25rem; color: var(--ink); margin-bottom: 0.6rem; }
.cta-card p { color: var(--ink-2); font-size: 0.9rem; margin-bottom: 1.1rem; }

/* ----------------------------------------------------------------------------
   14. Contact
   -------------------------------------------------------------------------- */
.contact { text-align: center; }
.contact h2 { max-width: 18ch; margin-inline: auto; }
.contact p { color: var(--ink-2); max-width: 52ch; margin: 1.2rem auto 2.2rem; }
.contact__row { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; }
.bigmail {
    font-family: var(--font-mono);
    font-size: clamp(0.95rem, 3vw, 1.4rem);
    color: var(--gold);
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--gold-line);
    padding-bottom: 0.15rem;
    transition: border-color 0.25s var(--ease);
}
.bigmail:hover { border-color: var(--gold); }

/* ----------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */
.footer {
    border-top: 1px solid var(--line);
    padding-block: 2.6rem;
}
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer .mono { color: var(--ink-3); }
.footer__links { display: flex; gap: 1.6rem; }
.footer__links a { color: var(--ink-2); font-size: 0.88rem; transition: color 0.2s var(--ease); }
.footer__links a:hover { color: var(--gold); }

/* ----------------------------------------------------------------------------
   16. Prose (article / case study templates)
   -------------------------------------------------------------------------- */
.prose { color: var(--ink); font-size: 1.08rem; line-height: 1.75; max-width: 68ch; }
.prose > * + * { margin-top: 1.3rem; }
.prose h2 { margin-top: 2.6rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.prose h3, .prose h4 { margin-top: 2rem; color: var(--ink); }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--gold); border-bottom: 1px solid var(--gold-line); }
.prose ul, .prose ol { padding-left: 1.3rem; display: grid; gap: 0.5rem; }
.prose li::marker { color: var(--gold); }
.prose blockquote {
    border-left: 2px solid var(--gold);
    padding: 0.4rem 0 0.4rem 1.4rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ink);
    font-style: normal;
}
.prose code, .codeblock {
    font-family: var(--font-mono);
    font-size: 0.88em;
}
.codeblock {
    display: block;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1.3rem 1.5rem;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--ink);
}
.codeblock .k { color: var(--gold); }
.codeblock .c { color: var(--ink-3); }
.codeblock .n { color: var(--anomaly); }
.codeblock .s { color: #7fb88a; }
html[data-theme="light"] .codeblock .s { color: #3f7d4a; }

.diagram {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--bg-2);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

/* article header */
.article-head { max-width: 68ch; margin-inline: auto; text-align: center; }
.article-head .kicker { color: var(--gold); margin-bottom: 1.2rem; }
.article-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.article-head .dek { color: var(--ink-2); font-size: 1.2rem; margin-top: 1.2rem; font-weight: 400; }

.byline { display: flex; align-items: center; gap: 0.9rem; margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.byline .ava {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--gold-soft);
    border: 1px solid var(--gold-line);
    color: var(--gold);
    font-family: var(--font-mono);
    font-weight: 700;
}

/* back link */
.backlink { color: var(--ink-2); font-size: 0.86rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.4rem; }
.backlink:hover { color: var(--gold); }

/* doc layout w/ TOC */
.doc { display: grid; grid-template-columns: 220px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.toc { position: sticky; top: 100px; }
.toc h4 { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 1rem; font-weight: 600; }
.toc a { display: block; color: var(--ink-2); font-size: 0.88rem; padding: 0.4rem 0; border-left: 1px solid var(--line); padding-left: 0.9rem; margin-left: -1px; transition: all 0.2s var(--ease); }
.toc a:hover, .toc a.is-active { color: var(--gold); border-left-color: var(--gold); }

/* writing index list */
.entry-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.entry {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 1.5rem;
    align-items: baseline;
    padding: 1.8rem 0.5rem;
    border-bottom: 1px solid var(--line);
    transition: all 0.3s var(--ease);
}
.entry:hover { background: var(--bg-2); padding-inline: 1.2rem; }
.entry__date { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-3); letter-spacing: 0.04em; padding-top: 0.3rem; }
.entry__main h3 { font-size: 1.35rem; margin-bottom: 0.4rem; transition: color 0.25s var(--ease); }
.entry:hover .entry__main h3 { color: var(--gold); }
.entry__main p { color: var(--ink-2); font-size: 0.92rem; }
.entry__type {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    border: 1px solid var(--gold-line);
    background: var(--gold-soft);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   17. Scroll-reveal & keyframes
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

@keyframes blip {
    0%, 100% { box-shadow: 0 0 0 0 var(--glow); }
    50%      { box-shadow: 0 0 0 5px transparent; }
}

/* page-load hero stagger */
.hero .anim {
    opacity: 0;
    transform: translateY(16px);
    animation: rise 0.85s var(--ease) forwards;
}
.hero .anim[data-d="0"] { animation-delay: 0.05s; }
.hero .anim[data-d="1"] { animation-delay: 0.16s; }
.hero .anim[data-d="2"] { animation-delay: 0.27s; }
.hero .anim[data-d="3"] { animation-delay: 0.38s; }
.hero .anim[data-d="4"] { animation-delay: 0.49s; }
.hero .graph-wrap { opacity: 0; animation: fade 1.1s var(--ease) 0.4s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

/* ----------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .hero__grid { grid-template-columns: 1fr; }
    .hero .graph-wrap { order: -1; max-width: 440px; margin-inline: auto; width: 100%; }
    .layout { grid-template-columns: 1fr; }
    .layout__side { position: static; }
    .doc { grid-template-columns: 1fr; }
    .toc { display: none; }
    .nav__links { display: none; }
    .nav-burger { display: grid; }
}

@media (max-width: 680px) {
    body { font-size: 16px; }
    .work-grid, .patent-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .entry { grid-template-columns: 1fr; gap: 0.6rem; }
    .entry__date { order: -1; }
    .hero__meta { gap: 1.4rem; }
}

/* ----------------------------------------------------------------------------
   19. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    .hero .anim, .hero .graph-wrap { opacity: 1; transform: none; animation: none; }
}

/* ----------------------------------------------------------------------------
   20. Print — the page becomes a clean one-page résumé
   -------------------------------------------------------------------------- */
@media print {
    :root {
        --bg: #fff; --bg-2: #fff; --bg-3: #fff;
        --ink: #111; --ink-2: #333; --ink-3: #666;
        --line: #ccc; --line-2: #ddd;
        --gold: #8a5a00; --gold-line: #bbb; --gold-soft: transparent;
    }
    body { font-size: 10.5pt; line-height: 1.4; }
    body::before, body::after { display: none; }
    .nav, .nav-mobile, .graph-wrap, .strip, .hero__cta, .work__viz,
    .cta-card, .footer__links, .no-print, .contact__row .btn { display: none !important; }
    .hero { padding: 0 0 0.6rem; }
    .hero__grid { display: block; }
    .section { padding-block: 0.7rem; break-inside: avoid; }
    .card, .pub, .patent, .work, .tl-item { break-inside: avoid; box-shadow: none !important; transform: none !important; }
    .layout { grid-template-columns: 1fr 240px; gap: 1.5rem; }
    a { color: #111; }
    .contact { text-align: left; }
    h1 { font-size: 24pt; }
    h2 { font-size: 14pt; }
    .hero__meta { margin-top: 0.6rem; }
}
