html {
    transition: background-color 0.4s, color 0.4s;
}

* {
    transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}

:root {
    --bg: #0b0c10;
    --surface: #12131a;
    --text: #e9eef2;
    --muted: #a7b0b8;
    --brand: #5cc8ff;
    --accent: #8bf6a0;

    --radius: 14px;
    --gap: 1rem;
    --maxw: 1000px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .25);

    --grad1: 5, 145, 5;
    --gradCSU: 30, 77, 43;
    --gradCC: 113, 16, 61;
}

/* Explicit light theme (when JS sets data-theme="light") */
:root[data-theme="light"] {
    --bg: #f9fafb;
    --surface: #ffffff;
    --text: #0e1116;
    --muted: #4b5563;
    --brand: #0ea5e9;
    --accent: #10b981;

    --grad1: 0, 50, 150;
    --gradCSU: 217, 120, 45;
    --gradCC: 253, 215, 25;
    --gradTest: rgb(0, 50, 150);
}


* {
    box-sizing: border-box;
}

html body {
    height: 100%;
}

body {
    margin: 0;
    font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(1200px 600px at 10% 10%, rgba(var(--grad1), 0.5), transparent 30%),
        var(--bg);
    background-attachment: fixed;
    /* lock the gradient to the viewport */
    background-repeat: no-repeat;
    background-size: cover;
    /* avoid tiling on tall pages */
}



/* Utilities */
.container {
    width: min(100% - 2rem, var(--maxw));
    margin-inline: auto;
}

.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    background: var(--brand);
    color: #000;
    padding: .5rem 1rem;
    border-radius: 8px;
}

/* Header & Nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: saturate(180%) blur(10px);
    background: color-mix(in oklab, rgba(var(--grad1), 0.5), transparent 0%);
    border-bottom: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: var(--text);
    padding: .8rem 1rem;
    font-weight: 600;
}

.site-nav {
    display: flex;
    align-items: left;
    gap: 1rem;
    margin-left: auto;
    padding-right: 1rem;
}

.site-header,
.site-nav ul {
    display: flex;
    align-items: center;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    gap: .25rem;
}

.site-nav a {
    color: var(--text);
    text-decoration: none;
    padding: .55rem .8rem;
    border-radius: 10px;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
    background: color-mix(in oklab, var(--brand) 22%, transparent);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    margin-right: .5rem;
    background: none;
    border: 1px solid color-mix(in oklab, var(--text) 18%, transparent);
    color: var(--text);
    padding: .45rem .6rem;
    border-radius: 10px;
    cursor: pointer;
}

/* Mobile nav */
@media (max-width: 800px) {
    .nav-toggle {
        display: block;
    }

    .site-nav {
        position: fixed;
        inset: 60px 1rem auto 1rem;
        display: grid;
        gap: .5rem;
        padding: .75rem;
        background: var(--surface);
        border: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
        border-radius: 14px;
        box-shadow: var(--shadow);
        transform: scale(0.98);
        opacity: 0;
        pointer-events: none;
    }

    .site-nav.open {
        transform: scale(1);
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav ul {
        display: grid;
        gap: .25rem;
    }
}

/* Hero */
.hero {
    padding: clamp(2.5rem, 8vw, 6rem) 0 1.5rem;
}

.hero h1 {
    font-size: clamp(2rem, 4vw + 1rem, 3rem);
    line-height: 1.2;
    margin: 0 0 .5rem 0;
}

.hero-cta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    padding: .7rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--brand);
    color: #001018;
}

.btn:hover {
    filter: brightness(1.05);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: color-mix(in oklab, var(--text) 22%, transparent);
}

/* Cards grid */
.grid.cards {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(12, 1fr);
    margin: 2rem 0 4rem;
}

.card {
    grid-column: span 6;
    /* 3-up on desktop */
    background: var(--surface);
    border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}


.card h2 {
    margin-top: .2rem;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: 0;
    margin: .5rem 0 0 0;
    list-style: none;
}

.pill-list li {
    padding: .25rem .55rem;
    border-radius: 20px;
    background: color-mix(in oklab, var(--brand) 18%, transparent);
    color: var(--text);
    font-size: .9rem;
}

.link {
    color: var(--brand);
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

@media (max-width: 1100px) {
    .card {
        grid-column: span 6;
    }
}

/* 2-up */
@media (max-width: 640px) {
    .card {
        grid-column: span 12;
    }
}

/* 1-up */

/* Footer */
.site-footer {
    padding: 2rem 1rem;
    border-top: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
    color: var(--muted);
    text-align: center;
}

/* Theme toggle */
.theme-toggle {
    margin-left: .5rem;
    border: 1px solid color-mix(in oklab, var(--text) 18%, transparent);
    background: transparent;
    color: var(--text);
    border-radius: 10px;
    padding: .45rem .6rem;
    cursor: pointer;
}

/* ===============================
WORK PAGE — BASE LAYOUT + FIXES
   =============================== */

/* --- Section container with solid background that spans all content --- */
.work-section {
    position: relative;
    margin: 3rem 0;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    /* If a child scales on hover, keep it inside the section */
    overflow: hidden;
    /* Progressive enhancement default (visible) — JS will enhance below */
    opacity: 1;
    transform: none;
}

.work-section__header {
    margin-bottom: 1rem;
}

.work-section h2 {
    margin: 0 0 .25rem 0;
}

.bullets {
    margin: .5rem 0 0 0;
    padding-left: 1.25rem;
}

/* Horizontal scroller with snap */
.media-reel {
    display: flex;
    flex-wrap: nowrap;
    /* keep in one row */
    align-items: flex-start;
    /* top-align items of varying heights */
    gap: 1rem;

    overflow-x: auto;
    overflow-y: hidden;
    padding: .5rem;

    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    /*
    border-radius: calc(var(--radius) - 4px);
    background: color-mix(in oklab, var(--surface) 90%, transparent);
    */
}


.media-reel::-webkit-scrollbar {
    height: 10px;
}

.media-reel::-webkit-scrollbar-thumb {
    background: color-mix(in oklab, var(--text) 18%, transparent);
    border-radius: 999px;
}

/* Each card has a fixed basis so flex won't shrink them to tiny */
.media {
    flex: 0 0 clamp(260px, 80vw, 560px);
    /* <- width of each card */
    scroll-snap-align: start;
    background: var(--bg);
    border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
    border-radius: 12px;
    overflow: hidden;
    transition: opacity .35s ease, transform .35s ease, box-shadow .35s ease;
}

/* Image controls the height; no cropping, no letterboxing bars */
.media img {
    display: block;
    width: 100%;
    height: 100%;
    /* IMPORTANT: let height follow the image */
    object-fit: contain;
    /* show whole image, no crop */
    object-position: center;
}

.media p {
    font-size: x-small;
    text-align: center;
}

.media figcaption {
    font-size: x-small;
    text-align: center;
}

/* --- Hover focus effect without bleeding out of the section --- */
.media-reel:hover .media {
    opacity: .65;
    transform: scale(0.98);
}

.media-reel .media:hover {
    opacity: 1;
    transform: scale(1.015);
    /* gentle to avoid overlap */
    box-shadow: 0 12px 36px rgba(0, 0, 0, .35);
}

/* --- Remove sticky to avoid jitter (optional) --- */
.work-section-header {
    position: static !important;
    top: auto !important;
}

/* --- Progressive enhancement (animate only if JS marks html.js) --- */
html.js .work-section {
    opacity: 0;
    transition: opacity .45s ease;
}

html.js .work-section.in-view {
    opacity: 1;
}

html.js .media {
    opacity: 0;
    transform: translateY(0);
}

html.js .media.in-view {
    opacity: 1;
    transform: none;
}

/* --- Respect reduced motion --- */
@media (prefers-reduced-motion: reduce) {

    html.js .work-section,
    html.js .media {
        transition: opacity .01s linear !important;
        transform: none !important;
    }

    .media-reel:hover .media,
    .media-reel .media:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

.head {
    image-rendering: auto;
}

.head img {
    display: block;
    float: left;
    height: 100%;
    width: 100%;
    margin-bottom: 50px;
}

.card.index {
    grid-column: span 6;
    /* 3-up on desktop */
    background: var(--surface);
    border: 1px solid color-mix(in oklab, var(--text) 10%, transparent);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.card.index p {
    text-indent: 0;
}

.card.index.edu {
    grid-column: span 12;
    border: 0px;
}

.card.index.edu.csu {
    background: linear-gradient(to left, rgba(var(--gradCSU)), transparent);
}

.card.index.edu.cc {
    background: linear-gradient(to left, rgba(var(--gradCC)), transparent);
}


.columns {
    display: flex;
    flex-wrap: wrap;
}

.columns.edu {
    background: fixed;
}

.columns.edu.csu {
    background: radial-gradient(ellipse at 125% 125%, rgba(var(--gradCSU)), transparent 50%);
}

.columns.edu.cc {
    background: radial-gradient(ellipse at 125% 125%, rgba(var(--gradCC)), transparent 50%);
}

.sidebar {
    flex: 30%;
    padding: 20px;
}


.sidebar p {
    text-align: justify;
}

.middle {
    flex: 70%;
    padding: 20px;
}

.middle p {
    text-indent: 50px;
}

.quote {
    font-style: italic;
    text-indent: 50px;
}

@media (max-width:768px) {
    .columns {
        display: block;
    }

    .head img {
        height: 50%;
        width: 50%;
    }
}

.layout2 {
    display: grid;
    grid-template-columns: 2fr 3fr;
    height: 75vh;
    margin-bottom: 100px;
}

.sidebar2 {
    padding: 20px;
    overflow: hidden;
}

.sidebar2 p {
    text-indent: 25px;
}

.middlebar2 {
    padding: 20px;
    overflow-y: auto;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery img {
    width: 100%;
    display: block;
    border-radius: 8px;
}


.overview {
    text-align: left;
}

.overview.text {
    text-indent: 50px;
}

.layout3 {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    height: 75vh;
    margin-bottom: 100px;
}

.leftbar3 {
    text-align: left;
    padding: 20px;
    overflow: hidden;
}

.leftbar3 p {
    text-indent: 50px;
}

.middlebar3 {
    padding: 20px;
    overflow-x: auto;
}

.rightbar3 {
    padding: 20px;
}

.rightbar3 p {
    text-indent: 50px;
}

.subdued {
    font-size: small;
}