/* ============================================
   Nicholas R. Chitwood
   ============================================ */

:root {
    --bg: #0c1220;
    --bg-alt: #111827;
    --bg-header: #0a0f1a;
    --surface: #182030;
    --border: #1f2937;
    --border-dim: rgba(31, 41, 55, 0.5);
    --text: #b8c0cc;
    --text-dim: #6b7280;
    --heading: #e8ecf1;
    --accent: #3b82f6;
    --accent-dim: rgba(59, 130, 246, 0.12);
    --serif: 'Instrument Serif', Georgia, serif;
    --sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --content-width: 980px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 56px;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---- Nav ---- */

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 0 28px;
    height: 52px;
    display: flex;
    align-items: center;
    transition: background-color 0.25s, border-color 0.25s;
    border-bottom: 1px solid transparent;
}

.nav-scrolled {
    background: rgba(12, 18, 32, 0.95);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
}

.nav-inner {
    max-width: var(--content-width);
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-name {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--heading);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.nav-links { display: flex; gap: 28px; }

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: color 0.15s;
}

.nav-links a:hover { color: var(--accent); }

/* ---- Hero ---- */

.hero {
    position: relative;
    padding: 76px 28px 48px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

/* Dot grid pattern */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(59, 130, 246, 0.07) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.6;
    pointer-events: none;
    transform: translateY(var(--scroll-y, 0));
    will-change: transform;
}

/* Soft glow behind headshot area */
.hero::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06), transparent 70%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: var(--content-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 40px;
}

.headshot {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2.5px solid var(--accent);
    box-shadow:
        0 0 0 6px rgba(59, 130, 246, 0.08),
        0 4px 24px rgba(0, 0, 0, 0.4);
    background: var(--surface);
}

.hero-text h1 {
    font-family: var(--serif);
    font-size: 2.6rem;
    font-weight: 400;
    color: var(--heading);
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 4px;
}

.hero-org {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.social-links { display: flex; gap: 10px; }

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--text-dim);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.social-links a svg {
    width: 22px;
    height: 22px;
}

.social-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* ---- Sections ---- */

section {
    border-bottom: 1px solid var(--border);
}

section:last-of-type {
    border-bottom: none;
}

/* Alternating backgrounds */
#about { background: var(--bg); }
#work { background: var(--bg-alt); }
#presentations { background: var(--bg); }
#cv { background: var(--bg-alt); }

.section-header {
    background: var(--bg-header);
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-dim);
}

.section-header h2 {
    max-width: var(--content-width);
    margin: 0 auto;
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--heading);
    padding-left: 18px;
    border-left: 3px solid var(--accent);
}

.section-body {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 40px 28px;
}

/* ---- About ---- */

.about-body {
    max-width: 780px;
}

.about-body p {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.about-body p:last-child {
    margin-bottom: 0;
}

/* ---- Work ---- */

.work-list {
    display: flex;
    flex-direction: column;
}

.work-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    align-items: start;
    text-decoration: none;
    color: inherit;
    padding: 20px 16px;
    border-top: 2px solid var(--accent-dim);
    border-bottom: 1px solid var(--border-dim);
    transition: transform 0.2s, box-shadow 0.2s;
}

.work-item:last-child {
    border-bottom: none;
}

.work-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.work-item:hover .work-screenshot img {
    opacity: 1;
}

.work-screenshot {
    aspect-ratio: 16 / 9;
    background: var(--surface);
    overflow: hidden;
    border: 1px solid var(--border);
}

.work-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.work-detail h3 {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--heading);
    margin-bottom: 6px;
    line-height: 1.3;
}

.work-detail p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.55;
    margin-bottom: 8px;
}

.work-tool {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

/* ---- Featured Video ---- */

.featured-video {
    margin-bottom: 48px;
    padding-bottom: 40px;
    padding-left: 36px;
    border-bottom: 1px solid var(--border);
}

.featured-video-label {
    font-family: var(--serif);
    font-size: 1.1rem;
    color: var(--heading);
    margin-bottom: 12px;
}

.featured-video-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 28px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid var(--border);
}

/* ---- Presentations (timeline) ---- */

.timeline {
    position: relative;
    padding-left: 36px;
}

/* Vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border);
}

.timeline-entry {
    position: relative;
    padding-bottom: 32px;
}

.timeline-entry:last-child {
    padding-bottom: 0;
}

/* Dot node */
.timeline-node {
    position: absolute;
    left: -36px;
    top: 6px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    z-index: 1;
}

.timeline-content {
    padding: 16px 20px;
    background: var(--surface);
    border-left: 2px solid var(--accent);
}

.pres-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin-bottom: 8px;
}

.pres-conf {
    font-weight: 600;
    color: var(--heading);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.pres-where {
    color: var(--text-dim);
    font-size: 0.76rem;
}

.pres-badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 8px;
    margin-left: auto;
}

.pres-badge.badge-alt {
    color: #d4a053;
    background: rgba(212, 160, 83, 0.12);
}

.pres-title {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--heading);
    line-height: 1.35;
    margin-bottom: 6px;
}

.pres-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.pres-more {
    margin-top: 28px;
    font-size: 0.85rem;
}

.pres-more a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}

.pres-more a:hover {
    color: var(--heading);
}

/* ---- CV ---- */

.cv-body p {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.cv-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: 10px 24px;
    border: 1.5px solid var(--accent);
    transition: background-color 0.15s, color 0.15s;
}

.cv-link:hover {
    background: var(--accent);
    color: var(--bg);
}

/* ---- Footer ---- */

.footer {
    padding: 32px 28px;
    background: var(--bg-header);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.footer-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    display: flex;
    gap: 24px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.footer-inner a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-inner a:hover {
    color: var(--accent);
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .hero { padding: 72px 20px 40px; }

    .hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .headshot { width: 150px; height: 150px; }

    .hero-text h1 { font-size: 2rem; }

    .social-links { justify-content: center; }

    .section-header { padding: 16px 20px; }

    .section-body { padding: 32px 20px; }

    .work-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px 8px;
    }

    .work-screenshot {
        max-width: 280px;
    }

    .timeline { padding-left: 24px; }
    .timeline-node { left: -24px; width: 13px; height: 13px; }
    .timeline::before { left: 5px; }
    .timeline-content { padding: 14px 16px; }
    .pres-badge { margin-left: 0; }

    .footer-inner {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-text h1 { font-size: 1.6rem; }
    .hero-title { font-size: 0.88rem; }
    .nav-links { gap: 16px; }
    .nav-links a { font-size: 0.78rem; }
}
