/* ============================================================
   Design tokens
   ============================================================ */
:root {
    --bg:           #f9fafb;
    --surface:      #ffffff;
    --text:         #111827;
    --muted:        #4b5563;
    --subtle:       #6b7280;
    --accent:       #0f172a;
    --accent-hover: #1e3a5f;
    --border:       #e5e7eb;
    --font:         'Inter', system-ui, -apple-system, sans-serif;
    --max-w:        1100px;
    --section-pad:  128px;
    --nav-h:        64px;
}

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

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip link — visible only on focus (keyboard nav) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    z-index: 1000;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
}

/* Global focus style */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============================================================
   Layout helpers
   ============================================================ */
.container {
    max-width: var(--max-w);
    margin-inline: auto;
    padding-inline: 24px;
}

/* ============================================================
   Navigation
   ============================================================ */
#nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: rgba(249, 250, 251, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#nav.scrolled {
    border-color: var(--border);
    box-shadow: 0 1px 12px rgba(15, 23, 42, 0.06);
}

.nav-inner {
    max-width: var(--max-w);
    height: 100%;
    margin-inline: auto;
    padding-inline: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--subtle);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent);
}

/* ============================================================
   Sections — shared
   ============================================================ */
.section {
    padding-block: var(--section-pad);
}

#hero {
    padding-block: 160px 140px;
    min-height: calc(100vh - var(--nav-h));
    min-height: calc(100svh - var(--nav-h)); /* accounts for mobile browser chrome */
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

#about {
    border-bottom: 1px solid var(--border);
}

/* Fade-in on scroll */
.fade-section {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Hero
   ============================================================ */
.hero-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--subtle);
    margin-bottom: 28px;
    animation: heroFadeUp 0.8s ease 0.05s both;
}

.hero-headline {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: -0.03em;
    color: var(--accent);
    margin-bottom: 24px;
    max-width: 700px;
    animation: heroFadeUp 0.8s ease 0.15s both;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--muted);
    max-width: 460px;
    margin-bottom: 48px;
    line-height: 1.75;
    animation: heroFadeUp 0.8s ease 0.28s both;
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: #ffffff;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    animation: heroFadeUp 0.8s ease 0.4s both;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 64px;
    align-items: start;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--subtle);
    padding-top: 8px;
}

.about-content h2 {
    font-size: clamp(1.5rem, 2.8vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--accent);
    margin-bottom: 20px;
    line-height: 1.3;
}

.about-content p {
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.8;
    max-width: 580px;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-inner .section-label {
    margin-bottom: 20px;
}

.contact-inner h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--accent);
    margin-bottom: 12px;
    line-height: 1.2;
}

.contact-sub {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 36px;
}

.contact-email {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 2px solid var(--border);
    padding-bottom: 3px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-email:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
}

/* ============================================================
   Footer
   ============================================================ */
footer {
    border-top: 1px solid var(--border);
    padding-block: 32px;
}

.footer-inner {
    display: flex;
    justify-content: center;
}

footer span {
    font-size: 0.8125rem;
    color: var(--subtle);
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .fade-section {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-eyebrow,
    .hero-headline,
    .hero-sub,
    .btn {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .btn:hover {
        transform: none;
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --section-pad: 80px;
    }

    #hero {
        padding-block: 96px 80px;
        min-height: auto;
        align-items: flex-start;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .about-content p {
        max-width: 100%;
    }

    .contact-email {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .hero-sub {
        font-size: 1rem;
    }
}
