/* --- Base / Theme -------------------------------------------------------- */
:root {
    --bg: #0f1115;
    --bg-alt: #131722;
    --text: #e9eef5;
    --muted: #b6c2d1;
    --primary: #00c2a8;
    --card: #0f121a;
    --border: #22304a;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #ffffff;
        --bg-alt: #f6f8fb;
        --text: #0f172a;
        --muted: #475569;
        --card: #ffffff;
        --border: #e5e9f2;
        --shadow: 0 8px 24px rgba(2, 8, 23, 0.08);
    }
}

[data-theme="light"] {
    --bg: #ffffff;
    --bg-alt: #f6f8fb;
    --text: #0f172a;
    --muted: #475569;
    --card: #ffffff;
    --border: #e5e9f2;
    --shadow: 0 8px 24px rgba(2, 8, 23, 0.08);
}

[data-theme="dark"] {
    --bg: #0f1115;
    --bg-alt: #131722;
    --text: #e9eef5;
    --muted: #b6c2d1;
    --primary: #00c2a8;
    --card: #0f121a;
    --border: #22304a;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* --- Reset-ish ----------------------------------------------------------- */
* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans",
        "Apple Color Emoji", "Segoe UI Emoji";
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
img {
    max-width: 100%;
    display: block;
}
a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
ul {
    margin: 0;
    padding-left: 1.25rem;
}
time {
    opacity: 0.85;
}

/* --- Layout -------------------------------------------------------------- */
.container {
    width: min(1100px, 92vw);
    margin-inline: auto;
}
.section {
    padding: 64px 0;
}
.section.alt {
    background: var(--bg-alt);
}
.title-xxl {
    font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
    margin: 0.25rem 0 1rem;
}
.title-xl {
    font-size: clamp(1.5rem, 1.5vw + 1rem, 2rem);
    margin: 0 0 1rem;
}
.title-lg {
    font-size: 1.25rem;
    margin: 1rem 0 0.75rem;
}
.title-md {
    font-size: 1.125rem;
    margin: 0.25rem 0 0.75rem;
}
.title-sm {
    font-size: 1rem;
    margin: 0.25rem 0 0.5rem;
    color: var(--muted);
}
.lead {
    font-size: 1.125rem;
    color: var(--muted);
}
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #000;
}

/* --- Header / Nav -------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
    background: color-mix(in oklab, var(--bg) 80%, transparent);
    border-bottom: 1px solid var(--border);
}
.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: var(--text);
}
.brand-logo {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #00110d;
    border-radius: 6px;
    font-weight: 900;
}
.nav {
    display: flex;
}
.nav ul {
    display: flex;
    gap: 1rem;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}
.nav a {
    color: var(--text);
    opacity: 0.9;
}
.nav a:hover {
    opacity: 1;
    text-decoration: none;
}
.nav-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 0.25rem;
    cursor: pointer;
}
.nav-toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
}

.theme-toggle button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
}
.theme-toggle button:hover {
    border-color: var(--primary);
}

/* --- Mobile Nav ---------------------------------------------------------- */
@media (max-width: 820px) {
    .nav {
        position: fixed;
        inset: 60px 0 auto 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        transform: translateY(-120%);
        transition: transform 0.25s ease;
    }
    .nav[aria-expanded="true"] {
        transform: translateY(0);
    }
    .nav ul {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-toggle {
        display: block;
    }
}

/* --- Hero --------------------------------------------------------------- */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: min(6vw, 48px);
    align-items: center;
}
.hero-media {
    order: 1;
}
.hero-copy {
    order: 2;
}
.headshot {
    width: min(320px, 50vw);
    aspect-ratio: 1/1;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.hero-cta {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-weight: 600;
}
.btn-primary {
    background: var(--primary);
    color: #00110d;
    border: 0;
}
.btn-ghost {
    background: transparent;
    color: var(--text);
}
.btn-link {
    padding: 0.25rem 0;
    border: 0;
    border-radius: 0;
}
.useless-btn {
    background: transparent;
    color: var(--text);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .hero-media {
        order: 2;
    }
    .hero-copy {
        order: 1;
    }
    .headshot {
        width: 220px;
    }
}

/* --- Cards / Carousel ---------------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: min(350px, 92vw);
    display: flex;
    flex-direction: column;
}
.card-media img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}
.card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    padding: 1rem;
}

.card-body p {
    flex-grow: 1;
}

.card-body ul.bullets {
    margin-top: auto;
}

.meta {
    color: var(--muted);
    margin: 0.25rem 0 0.5rem;
}
.bullets {
    margin: 0.5rem 0 0;
}
.bullets.two-col {
    columns: 2;
    column-gap: 1.25rem;
}
.bullets li {
    margin: 0.25rem 0;
}

.carousel {
    position: relative;
    margin-top: 1rem;
}
.carousel-track {
    display: flex;
    gap: 1rem;
    overflow: auto hidden;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
    align-items: stretch;
}
.carousel-track > * {
    scroll-snap-align: start;
}
.carousel-nav {
    position: absolute;
    top: 50%;
    translate: 0 -50%;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.carousel-nav.prev {
    left: -10px;
}
.carousel-nav.next {
    right: -10px;
}
.carousel-nav:hover {
    border-color: var(--primary);
}

/* --- Skills -------------------------------------------------------------- */
.skills {
    margin-top: 2rem;
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}
.tags li {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in oklab, var(--card) 80%, transparent);
}

/* --- Contact ------------------------------------------------------------- */
.contact-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}
.contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
}
.contact:hover {
    border-color: var(--primary);
    text-decoration: none;
}

/* --- Footer -------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 18px 0;
}
.footer-grid nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.fineprint {
    color: var(--muted);
    margin: 0;
}

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