/* ============================================================
   Sky — personal site
   Design: Claude Code.  Words: hand-written by Sky.
   An elevated literary aesthetic — paper, ink, and oxblood.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..600&family=Newsreader:ital,opsz,wght@0,6..72,300..600;1,6..72,300..500&family=Inter:wght@400;500;600&display=swap');

:root {
    --paper:        #f5efe4;   /* warm cream ground */
    --paper-raised: #fbf7ef;   /* lighter, for lifted surfaces */
    --ink:          #241f1b;   /* warm near-black */
    --ink-soft:     #6f655b;   /* secondary text */
    --ink-faint:    #9a8f82;   /* captions, meta */
    --oxblood:      #8a3324;   /* primary accent — deep terracotta */
    --oxblood-deep: #6f2519;
    --gold:         #a9823c;   /* rare secondary accent */
    --rule:         #ddd1bf;   /* hairlines */
    --rule-soft:    #e8ded0;
    --selection:    #ecdcc6;

    --maxw: 1080px;
    --serif-display: 'Fraunces', Georgia, serif;
    --serif-body:    'Newsreader', Georgia, serif;
    --sans:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dusk mode — a warm, ink-brown night for the moodier reading */
[data-theme="dark"] {
    --paper:        #181410;
    --paper-raised: #221c16;
    --ink:          #ece2d3;
    --ink-soft:     #b0a290;
    --ink-faint:    #7c7063;
    --oxblood:      #d8765c;   /* brighter terracotta to glow on dark */
    --oxblood-deep: #b85a42;
    --gold:         #d0a55f;
    --rule:         #3a3128;
    --rule-soft:    #2a231c;
    --selection:    #3c2c22;
}

html { transition: background-color 0.5s ease; background-color: var(--paper); }
body, .nav-container, .card, .tree-node, .category-link, .interest-tag {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

::selection {
    background: var(--selection);
    color: var(--ink);
}

/* Faint paper grain over everything */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

body {
    font-family: var(--serif-body);
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.7;
    font-size: 1.02rem;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    font-family: var(--serif-display);
    font-weight: 500;
    letter-spacing: -0.015em;
    font-optical-sizing: auto;
}

a { color: inherit; }

/* ---------- Navigation ---------- */
.nav-container {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background-color 0.5s ease;
}

/* Reading-progress bar across the top */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--oxblood);
    z-index: 200;
    transition: width 0.1s linear;
}

/* Right side of nav: links + theme toggle */
.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--rule);
    border-radius: 999px;
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink-soft);
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.4s ease;
    flex-shrink: 0;
}
.theme-toggle:hover { color: var(--oxblood); border-color: var(--oxblood); transform: rotate(25deg); }
.theme-toggle svg { width: 1rem; height: 1rem; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-container.scrolled { border-bottom-color: var(--rule); }

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.35rem 2rem;
    max-width: var(--maxw);
    margin: 0 auto;
}

.logo {
    font-family: var(--serif-display);
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.01em;
    position: relative;
    font-style: italic;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--oxblood);
    transition: width 0.35s ease;
}
.logo:hover::after { width: 100%; }

nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

nav ul li a {
    color: var(--ink-soft);
    text-decoration: none;
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    transition: color 0.3s ease;
}
nav ul li a:hover { color: var(--oxblood); }

/* ---------- Hero ---------- */
header#hero {
    position: relative;
    max-width: var(--maxw);
    margin: 0 auto;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 7rem 2rem 4rem;
    overflow: visible;
}

/* hero portrait — warm-treated, anchored top-right of the hero */
.hero-portrait {
    position: absolute;
    top: 7rem;
    right: 2rem;
    width: clamp(120px, 14vw, 184px);
    aspect-ratio: 1;
    margin: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--rule);
    box-shadow: 0 18px 44px -18px color-mix(in srgb, var(--oxblood) 48%, transparent);
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    animation: fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards 0.4s;
    z-index: 1;
}
@media (max-width: 768px) {
    .hero-portrait { top: 5rem; right: 1.5rem; width: clamp(84px, 22vw, 120px); }
}
.hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* warm the cool purple/pink studio background toward the site palette */
    filter: sepia(0.32) saturate(0.85) contrast(1.02) brightness(1.02) hue-rotate(-12deg);
    transition: filter 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* oxblood wash on top, multiplied, to fully reconcile the background tint */
.hero-portrait::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--oxblood);
    mix-blend-mode: color;
    opacity: 0.14;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.hero-portrait:hover img { transform: scale(1.05); }
.hero-portrait:hover::after { opacity: 0.06; }
[data-theme="dark"] .hero-portrait img { filter: sepia(0.3) saturate(0.8) contrast(1.03) brightness(0.95) hue-rotate(-10deg); }
[data-theme="dark"] .hero-portrait::after { opacity: 0.2; }
@media (prefers-reduced-motion: reduce) {
    .hero-portrait { opacity: 1; transform: none; animation: none; }
    .hero-portrait img { transition: none; }
}

/* the giant signature name */
.hero-name {
    font-family: var(--serif-display);
    font-weight: 600;
    font-size: clamp(4.5rem, 17vw, 13rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--ink);
    margin: 0.5rem 0 1.5rem -0.06em;
    font-optical-sizing: auto;
    font-variation-settings: 'opsz' 144;
    opacity: 0;
    transform: translateY(24px);
    animation: fadeUp 1s cubic-bezier(0.2, 0.7, 0.2, 1) forwards 0.15s;
    text-shadow: 0 10px 26px color-mix(in srgb, var(--paper) 76%, transparent);
}
.hero-name em {
    font-style: normal;
    color: var(--oxblood);
    font-weight: 600;
}

/* time-of-day greeting line */
.hero-greeting {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--ink-faint);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 0.35s;
}

/* scroll cue at the bottom of the hero */
.scroll-cue {
    position: absolute;
    left: 2rem;
    bottom: 2.5rem;
    font-family: var(--sans);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faint);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.8s;
}
.scroll-cue::after {
    content: '';
    width: 2.5rem;
    height: 1px;
    background: var(--ink-faint);
    animation: cueSlide 2s ease-in-out infinite;
    transform-origin: left;
}
@keyframes cueSlide {
    0%, 100% { transform: scaleX(0.4); opacity: 0.5; }
    50%      { transform: scaleX(1);   opacity: 1; }
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.hero-kicker {
    font-family: var(--sans);
    font-size: 0.76rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--oxblood);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 0.1s;
}
.hero-kicker::after {
    content: '';
    height: 1px;
    flex: 0 0 3rem;
    background: var(--rule);
}

/* The opening verse — set like a poem, not a headline */
.hero-verse {
    font-family: var(--serif-display);
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
    line-height: 1.34;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 2.25rem;
    max-width: 24ch;
    text-shadow: 0 3px 16px color-mix(in srgb, var(--paper) 72%, transparent);
}
.hero-verse span {
    display: block;
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero-verse span:nth-child(1) { animation-delay: 0.45s; }
.hero-verse span:nth-child(2) { animation-delay: 0.58s; }
.hero-verse span:nth-child(3) { animation-delay: 0.71s; }
.hero-verse span:nth-child(4) { animation-delay: 0.84s; }
.hero-verse span:nth-child(5) { animation-delay: 0.97s; }
.hero-verse em {
    font-style: italic;
    color: var(--oxblood);
}

.hero-subtitle {
    font-size: 1.12rem;
    line-height: 1.78;
    color: var(--ink);
    max-width: 54ch;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 1.1s;
    text-shadow: 0 3px 14px color-mix(in srgb, var(--paper) 70%, transparent);
}
.hero-subtitle strong {
    font-weight: 500;
    color: var(--ink);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem 2.25rem;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 1.25s;
}

/* magnetic primary CTA — pill that lifts and fills */
.cta-link {
    position: relative;
    font-family: var(--sans);
    font-size: 0.9rem;
    color: var(--paper);
    background: var(--oxblood);
    text-decoration: none;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.25s ease, box-shadow 0.3s ease;
    will-change: transform;
}
.cta-link:hover {
    background: var(--oxblood-deep);
    box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--oxblood) 60%, transparent);
}

.cta-link--ghost {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--rule);
    font-weight: 500;
}
.cta-link--ghost:hover {
    background: transparent;
    color: var(--oxblood);
    border-color: var(--oxblood);
    box-shadow: none;
}

/* ---------- Main + sections ---------- */
main {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
    border-top: 1px solid var(--rule-soft);
    scroll-margin-top: 5rem;
}

/* scroll-reveal: sections rise once, on first view */
.reveal-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal-up.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal-up { opacity: 1; transform: none; transition: none; }
}

/* staggered item reveal — children rise in sequence once their parent enters view */
.stagger > * {
    opacity: 0;
    transform: translateY(18px);
}
.stagger.in > * {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i, 0) * 70ms);
}
@media (prefers-reduced-motion: reduce) {
    .stagger > * { opacity: 1; transform: none; transition: none; }
}

/* skill-tree: connectors draw outward like a graph assembling itself */
.skill-tree .skill-tree-connector,
.skill-tree .tree-branch-connector,
.skill-tree .tree-leaves::before {
    transform: scaleX(0);
    transform-origin: left;
}
.skill-tree .skill-tree-trunk,
.skill-tree .tree-leaves::before { transform-origin: top; }
.skill-tree.in .skill-tree-connector,
.skill-tree.in .tree-branch-connector {
    transform: scaleX(1);
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.skill-tree .skill-tree-trunk { transform: scaleY(0); }
.skill-tree.in .skill-tree-trunk {
    transform: scaleY(1);
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s;
}
.skill-tree.in .tree-node {
    animation: nodePop 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.skill-tree.in .tree-node--branch { animation-delay: 0.4s; }
.skill-tree.in .tree-node--leaf  { animation-delay: 0.6s; }
@keyframes nodePop {
    from { opacity: 0; transform: translateX(-8px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .skill-tree .skill-tree-connector,
    .skill-tree .tree-branch-connector,
    .skill-tree .skill-tree-trunk { transform: none; }
    .skill-tree.in .tree-node { animation: none; }
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    margin-bottom: 2.75rem;
}

/* ---------- Chapter rail (fixed section tracker) ---------- */
.chapter-rail {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.chapter-rail.show { opacity: 1; }
.chapter-rail a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--ink-faint);
}
.chapter-rail .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1px solid var(--ink-faint);
    background: transparent;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}
.chapter-rail .label {
    font-family: var(--sans);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
    white-space: nowrap;
}
.chapter-rail a:hover .label { opacity: 1; transform: translateX(0); }
.chapter-rail a:hover .dot { border-color: var(--oxblood); }
.chapter-rail a.active .dot {
    background: var(--oxblood);
    border-color: var(--oxblood);
    transform: scale(1.3);
}
.chapter-rail a.active .label { opacity: 1; transform: translateX(0); color: var(--oxblood); }
@media (max-width: 1180px) { .chapter-rail { display: none; } }

.section-label {
    font-family: var(--serif-display);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
}
/* split the "NN / Title" into a big oxblood numeral + serif title via styling */
.section-label .num {
    font-style: italic;
    color: var(--oxblood);
    font-size: 0.95rem;
    font-family: var(--sans);
    font-weight: 600;
    letter-spacing: 0.1em;
}

.section-note {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--ink-faint);
    max-width: 42ch;
}

/* ---------- Featured essay (editorial lead) ---------- */
.featured {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
    padding-bottom: 3.5rem;
    border-bottom: 1px solid var(--rule-soft);
}
.featured-tag {
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--oxblood);
    display: block;
    margin-bottom: 1.1rem;
}
.featured h2 {
    font-family: var(--serif-display);
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.05;
    font-weight: 500;
    letter-spacing: -0.025em;
    margin-bottom: 1.25rem;
}
.featured h2 a { text-decoration: none; transition: color 0.3s ease; }
.featured:hover h2 a { color: var(--oxblood); }
.featured .pull {
    font-family: var(--serif-body);
    font-style: italic;
    font-size: 1.45rem;
    line-height: 1.5;
    color: var(--ink);
    border-left: 2px solid var(--oxblood);
    padding-left: 1.5rem;
}
.featured .featured-excerpt {
    font-family: var(--serif-body);
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--ink-soft);
    margin-bottom: 1.5rem;
}
.featured-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    align-items: center;
}
@media (max-width: 760px) {
    .featured { grid-template-columns: 1fr; gap: 1.75rem; }
    .featured .pull { font-size: 1.2rem; }
}

/* ---------- Generic grid (used by Work/Contact) ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 2.75rem 3rem;
}

.card {
    padding-top: 1.4rem;
    border-top: 1.5px solid var(--rule);
    transition: border-color 0.3s ease, transform 0.3s ease;
}
.card:hover {
    border-top-color: var(--oxblood);
    transform: translateY(-3px);
}

.card h3 {
    font-size: 1.45rem;
    line-height: 1.2;
    margin-bottom: 0.7rem;
    font-weight: 500;
}

.card-cat {
    font-family: var(--sans);
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--oxblood);
    display: block;
    margin-bottom: 0.85rem;
}

.card p {
    color: var(--ink-soft);
    font-size: 1.02rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.card-link {
    font-family: var(--sans);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
    border-bottom: 1.5px solid transparent;
    transition: border-color 0.3s ease, color 0.25s ease;
}
.card-link:hover { border-bottom-color: var(--oxblood); color: var(--oxblood); }

.card-tag {
    display: block;
    margin-top: 1.1rem;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    text-transform: uppercase;
}

.card.hidden { display: none; }

/* ---------- Writing section: a chapbook contents index ---------- */
#writing .grid {
    display: block;          /* flow vertically like a table of contents */
    max-width: 760px;
    counter-reset: entry;
}

#writing .grid > .card {
    counter-increment: entry;
    position: relative;
    padding: 1.9rem 0 1.9rem 4.25rem;
    border-top: 1px solid var(--rule-soft);
    transition: padding-left 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.5s ease, border-color 0.5s ease;
}

/* (contents are always visible; entrance motion handled subtly via JS only) */

/* small reading-time tag at the end of each entry */
.read-time {
    font-family: var(--sans);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-left: 1rem;
}
#writing .grid > .card:last-of-type { border-bottom: 1px solid var(--rule-soft); }
#writing .grid > .card:hover {
    transform: none;
    border-top-color: var(--rule-soft);
    padding-left: 4.75rem;
}

/* roman-ish running number in the margin */
#writing .grid > .card::before {
    content: counter(entry, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 2.15rem;
    font-family: var(--serif-display);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
}

#writing .grid > .card .card-cat {
    margin-bottom: 0.4rem;
}

#writing .grid > .card h3 {
    font-size: 1.65rem;
    font-weight: 400;
    line-height: 1.18;
    margin-bottom: 0.55rem;
    transition: color 0.25s ease;
}
#writing .grid > .card:hover h3 { color: var(--oxblood); }

#writing .grid > .card p {
    font-family: var(--serif-body);
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--ink-soft);
    max-width: 60ch;
    margin-bottom: 0.9rem;
}

/* make the whole entry feel clickable; keep the explicit link subtle */
#writing .grid > .card .card-link {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
}
#writing .grid > .card:hover .card-link { color: var(--oxblood); }

/* ---------- Category filter ---------- */
.categories {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.6rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.category-link {
    font-family: var(--sans);
    display: inline-block;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--rule);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.category-link:hover { border-color: var(--oxblood); color: var(--oxblood); }
.category-link.active {
    background: var(--oxblood);
    color: var(--paper-raised);
    border-color: var(--oxblood);
}

/* ---------- Experience timeline ---------- */
.timeline {
    position: relative;
    max-width: 760px;
    padding-left: 1.75rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 1px;
    background: var(--rule);
}
.tl-item {
    position: relative;
    padding: 0 0 2.5rem 0.25rem;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: '';
    position: absolute;
    left: calc(-1.75rem - 4px);
    top: 0.55rem;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--paper);
    border: 1.5px solid var(--oxblood);
    transition: background 0.25s ease;
}
.tl-item:hover::before { background: var(--oxblood); }
.tl-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}
.tl-role {
    font-family: var(--serif-display);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--ink);
}
.tl-org { color: var(--oxblood); font-style: italic; }
.tl-when {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    white-space: nowrap;
}
.tl-item p {
    font-family: var(--serif-body);
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--ink-soft);
    margin-top: 0.5rem;
    max-width: 64ch;
}

/* ---------- Education + languages strip ---------- */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2.5rem 3rem;
}
.fact h4 {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
    margin-bottom: 0.85rem;
}
.fact p {
    font-family: var(--serif-body);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--ink);
}
.fact p span { color: var(--ink-soft); display: block; font-size: 0.95rem; margin-top: 0.2rem; }

/* ---------- Interests ---------- */
.interests-groups {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}
.interest-group {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.interest-group-label {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ink-faint);
    flex-shrink: 0;
    width: 9rem;
}
.interests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.interest-tag {
    font-family: var(--serif-body);
    font-size: 1rem;
    font-weight: 400;
    color: var(--ink);
    padding: 0.3rem 1rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.interest-tag:hover { border-color: var(--oxblood); color: var(--oxblood); }

/* ---------- Skill tree ---------- */
.skill-tree {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.skill-tree-root-wrap { display: flex; align-items: center; flex-shrink: 0; }
.skill-tree-connector { width: 3rem; height: 1px; background: var(--rule); flex-shrink: 0; }
.skill-tree-trunk {
    width: 1px;
    align-self: stretch;
    background: var(--rule);
    flex-shrink: 0;
}
.tree-col--branches { display: flex; flex-direction: column; gap: 2rem; }
.tree-branch { display: flex; align-items: center; position: relative; }
.tree-branch-connector { width: 2rem; height: 1px; background: var(--rule); flex-shrink: 0; }
.tree-leaves {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-left: 2rem;
    position: relative;
}
.tree-leaves::before {
    content: '';
    position: absolute;
    left: 0.55rem;
    top: 0.85rem;
    bottom: 0.85rem;
    width: 1px;
    background: var(--rule);
}
.tree-node {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 0.4rem 0.95rem;
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--paper-raised);
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.tree-node--root {
    font-family: var(--serif-display);
    font-style: italic;
    font-size: 1.05rem;
    font-weight: 600;
    border-color: var(--oxblood);
    color: var(--oxblood);
    padding: 0.55rem 1.35rem;
}
.tree-node--branch {
    font-family: var(--serif-display);
    font-size: 0.92rem;
    color: var(--ink);
    border-color: var(--gold);
    flex-shrink: 0;
}
.tree-node--leaf { position: relative; color: var(--ink-soft); font-size: 0.78rem; font-weight: 400; }
.tree-node--leaf::before {
    content: '';
    position: absolute;
    left: -1.45rem;
    top: 50%;
    width: 0.9rem;
    height: 1px;
    background: var(--rule);
}
.tree-node--leaf:hover { border-color: var(--oxblood); color: var(--ink); background: var(--selection); }
.tree-node--branch:hover { border-color: var(--oxblood); color: var(--oxblood); }

/* ---------- Contact ---------- */
.contact-card p { color: var(--ink-soft); font-size: 1.08rem; max-width: 60ch; margin-bottom: 1rem; }
.contact-card a { color: var(--oxblood); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.25s ease; }
.contact-card a:hover { border-bottom-color: var(--oxblood); }

/* ---------- Marquee ---------- */
.marquee-wrap {
    overflow: hidden;
    border-top: 1px solid var(--rule-soft);
    border-bottom: 1px solid var(--rule-soft);
    padding: 0.85rem 0;
    margin-top: 2rem;
}
.marquee-track {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: marquee 26s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-item {
    font-family: var(--serif-display);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--ink-soft);
    white-space: nowrap;
}
.marquee-dot { color: var(--gold); }
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ---------- Footer + colophon ---------- */
footer {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 4rem 2rem 3.5rem;
    border-top: 1px solid var(--rule-soft);
    color: var(--ink-faint);
    font-family: var(--sans);
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-end;
}
.colophon {
    max-width: 46ch;
    line-height: 1.65;
    font-family: var(--serif-body);
    font-size: 0.95rem;
    color: var(--ink-soft);
    font-style: italic;
}
.colophon strong { font-style: normal; font-weight: 500; color: var(--ink); }
footer .copyright { white-space: nowrap; }

/* ---------- Essay reading page ---------- */
.essay-body {
    max-width: 680px;
    margin: 4rem auto 8rem;
    padding: 0 2rem;
}
.essay-body .back-link {
    display: inline-block;
    margin-bottom: 3rem;
    font-family: var(--sans);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    transition: color 0.3s ease;
}
.essay-body .back-link:hover { color: var(--oxblood); }
.essay-body .meta {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--oxblood);
    margin-bottom: 1.25rem;
    display: block;
}
.essay-body h1 {
    font-size: clamp(2.2rem, 5vw, 3.25rem);
    line-height: 1.12;
    margin-bottom: 2.5rem;
    color: var(--ink);
    font-weight: 400;
}
.prose {
    font-family: var(--serif-body);
    font-size: 1.2rem;
    line-height: 1.85;
    color: var(--ink);
}
.prose p { margin-bottom: 1.8rem; }
.prose p:first-of-type::first-letter {
    font-family: var(--serif-display);
    float: left;
    font-size: 3.6rem;
    line-height: 0.82;
    padding: 0.5rem 0.7rem 0 0;
    color: var(--oxblood);
    font-weight: 500;
}
.prose h3 {
    margin: 2.75rem 0 1.25rem;
    font-family: var(--serif-display);
    font-weight: 600;
    color: var(--ink);
    font-size: 1.5rem;
}
.essay-foot {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
    font-family: var(--serif-body);
    font-style: italic;
    color: var(--ink-faint);
    font-size: 0.95rem;
}

/* ---------- Category landing page ---------- */
.category-page { max-width: 720px; margin: 3rem auto 6rem; padding: 0 2rem; }
.category-page > h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    margin-bottom: 2.5rem;
    font-weight: 400;
}
.category-page .card { margin-bottom: 2.25rem; }

/* ---------- Polish: nav underline, dusk glow ---------- */
nav ul li a {
    position: relative;
}
nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background: var(--oxblood);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
nav ul li a:hover::after { transform: scaleX(1); transform-origin: left; }

/* in dusk mode, let the oxblood accents glow a touch */
[data-theme="dark"] .cta-link {
    box-shadow: 0 0 0 transparent;
}
[data-theme="dark"] .cta-link:hover {
    box-shadow: 0 0 28px -6px color-mix(in srgb, var(--oxblood) 70%, transparent);
}
[data-theme="dark"] body::before { opacity: 0.05; }
[data-theme="dark"] .section-label .num { text-shadow: 0 0 18px color-mix(in srgb, var(--oxblood) 50%, transparent); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    nav ul { display: none; }
    header#hero { padding: 5rem 1.5rem 4rem; min-height: 92svh; }
    .hero-name { font-size: clamp(3.5rem, 19vw, 7rem); }
    .scroll-cue { left: 1.5rem; }
    main { padding: 0 1.5rem; }
    .grid { grid-template-columns: 1fr; gap: 2.25rem; }
    #writing .grid > .card { padding-left: 3rem; }
    #writing .grid > .card:hover { padding-left: 3rem; }
    #writing .grid > .card::before { top: 2.05rem; font-size: 0.85rem; }
    .hero-sky { display: none; }
    .skill-tree { flex-direction: column; align-items: flex-start; }
    .interest-group-label { width: 100%; }
    footer { flex-direction: column; align-items: flex-start; }
}
