:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --line: #e2e8f0;
    --accent: #1d4ed8;
    --accent-soft: #dbeafe;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    width: min(980px, 92vw);
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0.6rem;
    z-index: 1000;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    background: var(--text);
    color: #ffffff;
    text-decoration: none;
}

.skip-link:focus-visible {
    left: 0.8rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.96);
    backdrop-filter: blur(6px);
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.2px;
}

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

.nav-menu {
    display: flex;
    gap: 0.9rem;
    align-items: center;
}

.nav-menu a {
    color: var(--muted);
    font-size: 0.95rem;
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
}

.nav-menu a:hover {
    text-decoration: none;
    color: var(--text);
    background: var(--accent-soft);
}

.nav-menu a.is-active {
    color: var(--text);
    background: var(--accent-soft);
    font-weight: 600;
}


.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
}

.hero {
    padding: 4rem 0 2.5rem;
}

.hero-kicker {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted);
    font-weight: 600;
}

h1 {
    margin: 0.7rem 0 1rem;
    font-size: clamp(1.85rem, 3.7vw, 2.8rem);
    line-height: 1.2;
}

.hero-text {
    margin: 0;
    color: var(--muted);
    max-width: 760px;
}

.hero-text + .hero-text {
    margin-top: 1rem;
}

.button-row {
    margin-top: 1.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button {
    display: inline-block;
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
}

.button:hover {
    text-decoration: none;
    filter: brightness(0.98);
}

.button:focus-visible,
.nav-toggle:focus-visible,
.nav-menu a:focus-visible,
.brand:focus-visible,
.lightbox-close:focus-visible,
.lightbox-open:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

.button-secondary {
    background: var(--surface);
    color: var(--accent);
}

.section {
    padding: 2.5rem 0;
}

.section h2 {
    margin: 0 0 0.95rem;
    font-size: 1.5rem;
}

.two-col,
.card-grid,
.video-grid,
.media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
}

.panel h3,
.panel h4 {
    margin: 0 0 0.4rem;
}

.panel p {
    margin: 0;
}

.muted {
    color: var(--muted);
}

.stack {
    display: grid;
    gap: 1rem;
}

.item-head {
    margin-bottom: 0.6rem;
}

.item ul,
.project-card ul {
    margin: 0.55rem 0 0;
    padding-left: 1.1rem;
}

.project-details {
    margin-top: 0.45rem;
}

.project-details.is-hidden {
    display: none;
}

.project-details-toggle {
    width: fit-content;
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0.46rem 0.8rem;
    background: #f8fbff;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.project-details-toggle:hover {
    background: var(--accent-soft);
}

.project-details-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

.project-card {
    margin-bottom: 1rem;
    padding: 1rem;
}

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

.project-card p {
    line-height: 1.55;
}

.project-card p + p {
    margin-top: 0.85rem;
}

.project-card > * + * {
    margin-top: 0.6rem;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.project-details-toggle + .project-links {
    margin-top: 1rem;
}

.project-details-toggle + .project-details + .project-links {
    margin-top: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.34rem 0.72rem;
    background: #f8fbff;
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.project-link::after {
    content: "\2197";
    font-size: 0.78rem;
    line-height: 1;
    opacity: 0.8;
}

.project-link:hover {
    text-decoration: none;
    background: var(--accent-soft);
    border-color: #bfd7ff;
}

.project-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

.media-group {
    display: grid;
    gap: 0.55rem;
}

.project-card .media-group > .media-card:only-of-type {
    width: min(100%, 560px);
}

.media-card {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
}

.media-link {
    display: block;
    background: #ffffff;
}

.media-link img {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
    border: 0;
}

.media-card iframe,
.media-card video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border: 0;
    background: #000;
}

.media-card figcaption {
    padding: 0.45rem 0.6rem;
    font-size: 0.86rem;
    color: var(--muted);
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.media-card.is-hidden {
    display: none;
}

.media-toggle {
    width: fit-content;
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0.5rem 0.84rem;
    background: #f8fbff;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.media-toggle:hover {
    background: var(--accent-soft);
}

.media-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 1.2rem 0 1.6rem;
    color: var(--muted);
    margin-top: 2rem;
    font-size: 0.94rem;
}

body.no-scroll {
    overflow: hidden;
}

.lightbox[hidden] {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.84);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox-inner {
    width: min(1040px, 96vw);
    max-height: 94vh;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem;
    display: grid;
    gap: 0.6rem;
}

.lightbox-stage {
    width: 100%;
    max-height: 78vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.lightbox-close {
    justify-self: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0.35rem 0.65rem;
    cursor: pointer;
}

.lightbox-image {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    cursor: zoom-in;
    transform-origin: 0 0;
    transition: transform 180ms ease;
    user-select: none;
    touch-action: none;
}

.lightbox-image.is-zoomed {
    cursor: grab;
}

.lightbox-image.is-zoomed.is-panning {
    cursor: grabbing;
}

.lightbox-open {
    justify-self: start;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .two-col,
    .card-grid,
    .video-grid,
    .media-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 68px;
        right: 4vw;
        width: min(230px, 90vw);
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 0.4rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu a {
        padding: 0.5rem 0.6rem;
    }

    .hero {
        padding-top: 3.2rem;
    }

    .project-links {
        gap: 0.4rem;
    }

    .project-link {
        padding: 0.32rem 0.65rem;
        font-size: 0.82rem;
    }
}