/* ==========================================================================
   Design Tokens
   Change the theme here. Everything below reads from these variables.
   ========================================================================== */

:root {
    color-scheme: dark;

    --bg: #0a0a0a;
    --surface: #141414;
    --surface-raised: #1c1c1c;
    --text: #f5f5f5;
    --muted: #a3a3a3;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.22);
    --nav-bg: rgba(10, 10, 10, 0.8);
    --hover-fill: #d4d4d4;

    --font-serif: 'DM Serif Display', serif;
    --font-sans: 'Outfit', sans-serif;

    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-pill: 100px;

    --max-width: 1200px;
    --gutter: 2.5rem;
    --transition: 0.3s ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
}

[hidden] { display: none !important; }

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

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--text);
    color: var(--bg);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    z-index: 200;
}

.skip-link:focus { top: 1rem; }

/* ==========================================================================
   Navigation
   ========================================================================== */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1.25rem var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: var(--nav-bg);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.navbar.scrolled { border-bottom-color: var(--border); }

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links { display: flex; gap: 2rem; align-items: center; }

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color var(--transition);
}

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

.nav-links .cta-link {
    background: var(--text);
    color: var(--bg);
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-pill);
    transition: background var(--transition), transform 0.2s;
}

.nav-links .cta-link:hover {
    background: var(--hover-fill);
    color: var(--bg);
    transform: translateY(-1px);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
    cursor: pointer;
    border: 1.5px solid transparent;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--text);
    color: var(--bg);
}

.btn-primary:hover {
    background: var(--hover-fill);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-outline:hover {
    border-color: var(--text);
    transform: translateY(-2px);
}

.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem var(--gutter) 4rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.hero-content { max-width: 800px; }

.eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

.hero .eyebrow {
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hero .eyebrow::before {
    content: '';
    width: 2rem;
    height: 2px;
    background: var(--muted);
}

.hero h1 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 1.75rem;
}

.hero h1 em { font-style: italic; }

.hero-desc {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 560px;
    line-height: 1.75;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
    padding: 6rem var(--gutter);
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 560px;
    line-height: 1.7;
    font-weight: 300;
    margin-bottom: 3rem;
}

.subsection-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.6rem;
    margin: 3.5rem 0 1.5rem;
}

.subsection-title:first-child { margin-top: 0; }

.divider {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.divider hr {
    border: none;
    height: 1px;
    background: var(--border);
}

/* Inner pages (e.g. Bookshelf) start below the fixed navbar */
.page-header { padding-top: 10rem; padding-bottom: 0; }
.page-header + .section { padding-top: 0; }
.page-header h1 { font-size: clamp(2.6rem, 5vw, 4rem); }

/* ==========================================================================
   About
   ========================================================================== */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    font-weight: 300;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.stat {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
}

.stat-num {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

/* ==========================================================================
   Grid & Cards
   One card style shared by skills, interests, experience, and books.
   ========================================================================== */

.grid {
    --grid-min: 280px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--grid-min), 100%), 1fr));
    gap: 1.5rem;
}

.grid--wide { --grid-min: 340px; gap: 2rem; }

.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2.25rem;
    color: inherit;
    text-decoration: none;
    transition: transform var(--transition), border-color var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--surface-raised);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.card-icon svg { width: 22px; height: 22px; }

.card-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
}

.card-text {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
    font-weight: 300;
}

.card-link-label {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tags span {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    background: var(--surface-raised);
    border-radius: var(--radius-pill);
    color: var(--muted);
}

/* Experience & project cards: header band + body */
.card--flush { padding: 0; overflow: hidden; }

.card-header {
    padding: 1.75rem;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border);
}

.card-date {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border-strong);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    display: inline-block;
    margin-bottom: 0.9rem;
}

.card-header .card-title { font-size: 1.3rem; margin-bottom: 0.25rem; }

.card-subtitle {
    font-size: 0.88rem;
    font-weight: 300;
    color: var(--muted);
}

.card-body { padding: 1.75rem; }

.highlights {
    list-style: none;
    margin-bottom: 1.25rem;
}

.highlights li {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
    font-weight: 300;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.highlights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text);
}

/* Book cards */
.book-author {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.empty-state {
    color: var(--muted);
    font-weight: 300;
    padding: 3rem 0;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-section { text-align: center; padding-bottom: 8rem; }

.contact-section .section-desc { margin: 0 auto 2.5rem; }

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    border: 1.5px solid var(--border-strong);
    transition: border-color var(--transition), transform var(--transition);
}

.contact-links a:hover {
    border-color: var(--text);
    transform: translateY(-2px);
}

.contact-links a svg { width: 16px; height: 16px; }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   Scroll Reveal
   Uses an animation (not a transition) so the stagger delay never slows
   down card hover effects. Only hides content when JS is running.
   ========================================================================== */

.js .fade-up:not(.visible) { opacity: 0; }

.fade-up.visible { animation: fade-up 0.7s ease var(--delay, 0s) backwards; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .fade-up:not(.visible) { opacity: 1; }
    .fade-up.visible { animation: none; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    :root { --gutter: 1.5rem; }

    .navbar { padding: 1rem var(--gutter); }
    .nav-links { gap: 1rem; }
    .nav-links a:not(.cta-link) { display: none; }

    .hero { padding: 7rem var(--gutter) 3rem; }
    .section { padding: 4rem var(--gutter); }
    .page-header { padding-top: 8rem; padding-bottom: 0; }

    .about-grid { grid-template-columns: 1fr; gap: 2rem; }

    .stats-row { gap: 0.75rem; }
    .stat { padding: 1rem; }
    .stat-num { font-size: 1.5rem; }

    .contact-section { padding-bottom: 6rem; }
}
