/* ============================================================
   nathancrock.com — Stylesheet
   Warm editorial palette · Serif + Sans pairing
   Classy, distinctive, not another minimal-white academic site.
   ============================================================ */

/* --- Design Tokens --- */
:root {
    /* Palette — warm parchment + deep teal */
    --bg: #f7f5f0;
    --surface: #fffefb;
    --surface-alt: #eeece6;
    --border: #dcd7cd;
    --border-light: #e6e2d8;

    --text: #1e1b16;
    --text-muted: #6b6050;
    --text-faint: #9a8f80;

    --accent: #2d5a6e;
    --accent-hover: #1e4050;
    --accent-light: #e5f2f6;
    --accent-text: #1e4254;

    --heading: #15120d;

    /* Typography */
    --font-serif: 'Lora', 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;

    /* Spacing scale (rem) */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 5rem;

    /* Sizing */
    --max-width: 66rem;
    --narrow-width: 48rem;
    --radius: 0.25rem;
    --radius-lg: 0.4rem;
}


/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    color: var(--heading);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
}

h2 {
    font-size: 1.6rem;
}

/* Card titles and UI labels stay sans-serif */
h3 {
    font-size: 1.05rem;
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0;
}

h4 {
    font-size: 1rem;
    font-family: var(--font-sans);
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

strong {
    font-weight: 600;
}

small,
.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-faint {
    color: var(--text-faint);
}


/* --- Layout --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--space-lg);
}

.container--narrow {
    max-width: var(--narrow-width);
}

section {
    padding-block: var(--space-3xl);
}

section+section {
    border-top: 1px solid var(--border-light);
}


/* --- Header / Nav --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 245, 240, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    /* Distinctive teal accent stripe at very top */
    box-shadow: inset 0 3px 0 var(--accent);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: var(--space-md);
}

.site-header__name {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--heading);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.site-header__name:hover {
    color: var(--accent);
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.site-nav a {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--accent);
}


/* --- Hero --- */
.hero {
    padding-block: var(--space-3xl) var(--space-2xl);
}

.hero__layout {
    display: flex;
    align-items: center;
    gap: var(--space-2xl);
}

.hero__content {
    flex: 1;
    min-width: 0;
}

/* Name with a teal accent rule underneath */
.hero h1 {
    margin-bottom: var(--space-md);
    display: inline-block;
}

.hero h1::after {
    content: '';
    display: block;
    width: 2.75rem;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: var(--space-sm);
}

.hero__subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 38rem;
    margin-bottom: var(--space-lg);
    line-height: 1.75;
}

.hero__links {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* Pill-button outline links — restrained, tactile */
.hero__links a {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent-text);
    text-decoration: none;
    padding: 0.35rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    letter-spacing: 0.04em;
    transition: background 0.15s ease, color 0.15s ease;
}

.hero__links a:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* Photo — circle with teal ring and soft shadow */
.hero__photo {
    flex-shrink: 0;
}

.hero__photo img {
    display: block;
    width: 168px;
    height: 168px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid var(--accent);
    box-shadow:
        0 0 0 6px var(--accent-light),
        0 10px 32px rgba(45, 90, 110, 0.18);
    transition: box-shadow 0.3s ease;
}

.hero__photo img:hover {
    box-shadow:
        0 0 0 6px var(--accent-light),
        0 14px 40px rgba(45, 90, 110, 0.28);
}


/* --- About section pillars --- */
.about-pillars {
    list-style: none;
    padding: 0;
    margin: var(--space-md) 0 var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.about-pillars li {
    padding: 0.65rem var(--space-md);
    border-left: 3px solid var(--accent);
    background: var(--accent-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.925rem;
    line-height: 1.65;
}

.about-pillars strong {
    color: var(--accent-text);
}

.about-kicker {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

.about-kicker em {
    color: var(--accent);
    font-weight: 600;
}


/* --- Cards / Content Lists --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: box-shadow 0.2s ease, border-left-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
    border-left-color: var(--accent);
    box-shadow: 0 4px 20px rgba(45, 90, 110, 0.1);
    transform: translateY(-2px);
}

.card__tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-text);
    background: var(--accent-light);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: var(--space-sm);
}

.card h3 {
    margin-bottom: var(--space-xs);
}

.card h3 a {
    color: var(--heading);
    text-decoration: none;
}

.card h3 a:hover {
    color: var(--accent);
}

.card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.65;
}


/* --- Section Headers --- */
.section-header {
    margin-bottom: var(--space-xl);
}

.section-header h2 {
    margin-bottom: var(--space-xs);
}

.section-header p {
    color: var(--text-muted);
    margin-bottom: 0;
    font-size: 0.95rem;
}


/* --- CV / Bio List --- */
.cv-entry {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0 var(--space-md);
    padding-block: var(--space-md);
    align-items: start;
}

.cv-entry+.cv-entry {
    border-top: 1px solid var(--border-light);
}

/* Right-aligned date with a subtle divider — timeline feel */
.cv-entry__date {
    font-size: 0.8rem;
    color: var(--text-faint);
    font-weight: 500;
    padding-top: 0.15rem;
    text-align: right;
    padding-right: var(--space-md);
    border-right: 1px solid var(--border);
}

.cv-entry__title {
    font-weight: 600;
    color: var(--heading);
    font-size: 0.95rem;
}

.cv-entry__org {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.15rem;
}


/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    padding-block: var(--space-xl);
    text-align: center;
    color: var(--text-faint);
    font-size: 0.8rem;
    background: var(--surface-alt);
    letter-spacing: 0.02em;
}


/* --- Utility --- */
.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;
}

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


/* --- Responsive --- */
@media (max-width: 640px) {
    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .container {
        padding-inline: var(--space-lg);
    }

    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .site-nav {
        gap: var(--space-md);
    }

    .hero__layout {
        flex-direction: column-reverse;
        gap: var(--space-lg);
    }

    .hero__photo img {
        width: 120px;
        height: 120px;
    }

    .hero {
        text-align: left;
    }

    .cv-entry {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
    }

    .cv-entry__date {
        text-align: left;
        border-right: none;
        padding-right: 0;
        padding-bottom: var(--space-xs);
    }

    section {
        padding-block: var(--space-2xl);
    }
}