/* ==========================================================
   Design tokens
   ========================================================== */
:root {
    --ink: #172337;
    --ink-soft: #44546a;
    --muted: #5d6b7e;
    --accent: #1769aa;
    --accent-dark: #0f4f84;
    --accent-light: #7cc0f5;
    --accent-tint: #e8f2fb;
    --heading: #1e3a5f;
    --border: #e2e8f0;
    --bg: #f5f7fb;
    --surface: #ffffff;

    --navy: #0e1a2b;
    --navy-2: #172a46;
    --on-dark: #b8c7da;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 14px rgba(23, 35, 55, 0.06);
    --shadow-hover: 0 14px 30px rgba(23, 35, 55, 0.12);

    --space-section: clamp(60px, 8vw, 104px);
    --header-h: 72px;

    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================
   Base
   ========================================================== */
* {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--font-body);
}

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

a:hover {
    text-decoration: underline;
}

a:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.hero :focus-visible,
.band-dark :focus-visible {
    outline-color: #ffffff;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--ink);
    color: #fff;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
    text-decoration: none;
}

/* ==========================================================
   Header / navigation
   ========================================================== */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

nav {
    max-width: 1100px;
    min-height: var(--header-h);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.logo {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.logo::before {
    content: "";
    width: 10px;
    height: 10px;
    margin-right: 10px;
    background: var(--accent);
    border-radius: 2px;
    transform: rotate(45deg);
}

.logo:hover {
    text-decoration: none;
}

nav ul {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

nav ul a {
    display: block;
    padding: 10px 14px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    transition: background 0.2s, color 0.2s;
}

nav ul a:hover {
    background: var(--bg);
    color: var(--accent);
    text-decoration: none;
}

nav ul a.is-active {
    background: var(--accent-tint);
    color: var(--accent-dark);
}

/* ==========================================================
   Sections / bands
   ========================================================== */
main {
    counter-reset: section;
}

.band {
    padding: var(--space-section) 0;
    scroll-margin-top: calc(var(--header-h) - 1px);
}

.band-tint {
    background: var(--bg);
}

.band-white {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.band-dark {
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
}

.band h2 {
    counter-increment: section;
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
}

/* Auto-numbered eyebrow above each section title */
.band h2::before {
    content: "0" counter(section);
    display: block;
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
}

.band .container > p {
    max-width: 65ch;
    color: var(--muted);
}

.band-dark h2 {
    color: #fff;
}

.band-dark h2::before {
    color: var(--accent-light);
}

.band-dark .container > p {
    color: var(--on-dark);
}

.band-dark a {
    color: var(--accent-light);
    font-weight: 600;
}

/* ==========================================================
   Buttons
   ========================================================== */
.btn {
    display: inline-block;
    padding: 13px 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.4;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-primary {
    background: #ffffff;
    color: var(--navy);
}

.btn-primary:hover {
    background: var(--accent-tint);
}

.btn-secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.btn-secondary:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================
   Hero
   ========================================================== */
.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(72px, 11vw, 128px) 0 clamp(52px, 8vw, 84px);
    color: #fff;
    background:
        radial-gradient(900px 420px at 88% 0%, rgba(23, 105, 170, 0.6), transparent 60%),
        linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, var(--heading) 100%);
    scroll-margin-top: 0;
}

/* Subtle blueprint grid */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 25%, transparent 100%);
    pointer-events: none;
}

.hero .container {
    position: relative;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    color: var(--accent-light);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 36px;
    height: 2px;
    background: var(--accent-light);
}

.hero h1 {
    max-width: 820px;
    margin: 22px 0;
    font-size: clamp(38px, 6.4vw, 68px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.hero h1 .accent {
    background: linear-gradient(90deg, #9fd3ff, #5aa9e6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lede {
    max-width: 640px;
    margin: 0;
    font-size: 18px;
    color: var(--on-dark);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

/* Highlight numbers (pulled from the existing content) */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: clamp(44px, 7vw, 72px) 0 0;
    padding: 28px 0 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-stats strong {
    display: block;
    font-size: clamp(26px, 3.4vw, 36px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #fff;
}

.hero-stats span {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--on-dark);
}

/* ==========================================================
   Cards
   ========================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
    gap: 24px;
    margin-top: 36px;
}

.card-grid.skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    min-width: 0;
    transition: transform 0.25s, box-shadow 0.25s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card h3 {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--heading);
}

.card p {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.card p:last-child {
    margin-bottom: 0;
}

.card .meta {
    color: var(--ink-soft);
    font-weight: 600;
}

/* Project card: image flush to the top edge */
.card-project {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* Image strip: scrolls sideways and snaps to each image (no JavaScript) */
.card-media {
    display: flex;
    gap: 4px;
    margin: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c5d0de transparent;
    background: var(--border);
}

.card-media:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}

.card-media::-webkit-scrollbar {
    height: 6px;
}

.card-media::-webkit-scrollbar-thumb {
    background: #c5d0de;
    border-radius: 3px;
}

.card-media::-webkit-scrollbar-track {
    background: transparent;
}

.project-image {
    display: block;
    flex: 0 0 90%;           /* the next image peeks in to show there is more */
    width: 90%;
    min-width: 0;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    scroll-snap-align: start;
}

.project-image:only-child {
    flex-basis: 100%;        /* a single image fills the card */
    width: 100%;
}

.card-body {
    padding: 24px 26px 28px;
}

/* Tool / method pills */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.tags li {
    padding: 4px 12px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--accent-dark);
    background: var(--accent-tint);
    border-radius: 999px;
}

/* Skills card: colored top edge */
.card-skill {
    border-top: 4px solid var(--accent);
}

/* Experience / education card: left accent edge */
.card-accent {
    border-left: 5px solid var(--accent);
    border-radius: var(--radius);
    padding: 28px 30px;
}

.card-static:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.band .card-accent {
    margin-top: 32px;
}

/* ==========================================================
   Contact
   ========================================================== */
#contact .container > p:last-child {
    margin-bottom: 0;
}

/* ==========================================================
   Footer
   ========================================================== */
footer {
    padding: 28px 24px;
    background: #0a1422;
    color: #8fa2ba;
    text-align: center;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

footer p {
    margin: 0;
}

/* ==========================================================
   Mobile (kept last so it can override everything above)
   ========================================================== */
@media (max-width: 700px) {
    :root {
        --header-h: 108px;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 0;
        padding: 10px 24px 0;
    }

    nav ul {
        width: 100%;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    nav ul::-webkit-scrollbar {
        display: none;
    }

    nav ul a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0 14px;
        white-space: nowrap;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 20px;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
        text-align: center;
    }

    .card-body {
        padding: 20px 20px 24px;
    }

    .card-accent {
        padding: 22px 20px;
    }
}
