/* ============================================================
   Tokens — black on white
   ============================================================ */
:root {
    --bg:    #ffffff;
    --ink:   #111111;
    --body:  #555555;
    --faint: #a3a3a3;
    --line:  #d4d4d4;

    --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
    --serif: "Newsreader", Georgia, serif;   /* used for the name only */
    --sidebar: 15rem;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--body);
    font-family: var(--sans);
    font-size: 0.95rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
ul, ol { list-style: none; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ============================================================
   Layout: sticky sidebar + content
   ============================================================ */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    gap: 4rem;
    max-width: 78rem;
    margin-inline: auto;
    padding-inline: 3rem;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-block: 6.5rem 3rem;
}


/* ---------- Nav: dash grows and darkens for what's in view ---------- */
.nav > ul { display: grid; gap: 1.1rem; }

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: var(--faint);
    transition: color 0.4s ease;
}
.nav a::before {
    content: "";
    height: 1px;
    background: currentColor;
    transition: width 0.45s ease;
}

/* sections */
.nav > ul > li > a {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.nav > ul > li > a::before { width: 2rem; }

/* entries inside a section */
.subnav {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.6rem;
    padding-left: 1rem;
}
.subnav a { font-size: 0.82rem; gap: 0.75rem; }
.subnav a::before { width: 0.75rem; }

.nav a:hover,
.nav a[aria-current="true"] { color: var(--ink); }
.nav > ul > li > a:hover::before,
.nav > ul > li > a[aria-current="true"]::before { width: 4rem; }
.subnav a:hover::before,
.subnav a[aria-current="true"]::before { width: 2rem; }

.links { display: grid; gap: 0.5rem; }
.links a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--body);
    transition: color 0.15s;
}
.links a:hover { color: var(--ink); }
.links svg { width: 1rem; height: 1rem; }

.content { padding-bottom: 5rem; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 6.5rem;
    scroll-margin-top: 0;
}

.hero-name {
    font-family: var(--serif);
    font-size: clamp(2.8rem, 6vw, 4.6rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.hero-title {
    margin-top: 0.6rem;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    letter-spacing: -0.015em;
    color: var(--faint);
}

.hero-email {
    margin-top: 1.25rem;
    font-size: 1.05rem;
}

.headline {
    max-width: 34rem;
    font-size: 1.1rem;
    line-height: 1.55;
    color: var(--ink);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
    padding-top: 6rem;
    scroll-margin-top: 0;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
    padding-bottom: 1rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--line);
}

/* Room below the last section so the nav can reach every item */
.content > .section:last-child { min-height: 75vh; }

.entries { display: grid; gap: 3rem; }

.entry {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 2rem;
    scroll-margin-top: 3rem;
}

.entry-period { color: var(--faint); font-variant-numeric: tabular-nums; }

.entry-title {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ink);
}
.entry-title a { text-decoration: underline; text-underline-offset: 0.2em; }

.entry-location { color: var(--faint); }

.entry-text { margin-top: 0.4rem; max-width: 38rem; }
.entry-stack { margin-top: 0.5rem; color: var(--faint); }

/* Contact: same plain underlined style as the email under the name */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2.5rem;
    font-size: 1.05rem;
}
.contact-links a,
.hero-email a {
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}
.contact-links a:hover,
.hero-email a:hover { text-decoration-thickness: 2px; }

/* ============================================================
   Tablet and phone: sidebar becomes a header
   ============================================================ */
@media (max-width: 900px) {
    .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-inline: 1.25rem; }
    .sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
        padding-block: 1.5rem 0;
    }
    .nav { display: none; }
    .links { justify-items: end; }
    .links span { display: none; }
    .links svg { width: 1.2rem; height: 1.2rem; }
    .sidebar { justify-content: flex-end; }
    .links { grid-auto-flow: column; gap: 1rem; }
    .content { padding-top: 2rem; }
    .hero { padding-top: 0; gap: 1.25rem; }
    .section { padding-top: 4.5rem; }
    .entry { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
