:root {
    --font-heading: 'Sora', 'Segoe UI', sans-serif;
    --font-body: 'Manrope', 'Segoe UI', sans-serif;

    --bg: #fdf7f0;
    --surface: #fffdf9;
    --surface-2: #f5ede2;
    --ink: #1b1713;
    --ink-soft: #655a4f;
    --line: #dfd2c2;

    --teal: #0e9084;
    --teal-strong: #096a61;
    --orange: #ee6b2f;
    --orange-strong: #cc5624;
    --lime: #a9c83f;

    --shadow-soft: 0 14px 38px rgba(83, 54, 24, 0.14);
    --shadow-hard: 0 22px 55px rgba(39, 27, 16, 0.2);
    --radius-lg: 20px;
    --radius-md: 14px;
}

html.theme-dark {
    --bg: #0d1417;
    --surface: #132026;
    --surface-2: #192c33;
    --ink: #ebf8f7;
    --ink-soft: #a8c2c7;
    --line: #2a454f;

    --teal: #56dfd0;
    --teal-strong: #33bbad;
    --orange: #ff9d69;
    --orange-strong: #ff7b42;
    --lime: #c5de6f;

    --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.36);
    --shadow-hard: 0 30px 70px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body.experience-body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(52rem 40rem at -12% -8%, rgba(14, 144, 132, 0.22), transparent 58%),
        radial-gradient(42rem 36rem at 102% 0%, rgba(238, 107, 47, 0.24), transparent 60%),
        radial-gradient(38rem 35rem at 90% 95%, rgba(169, 200, 63, 0.14), transparent 64%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.18), transparent 38%);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand-logo {
    width: min(220px, 45vw);
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-end;
    min-width: 0;
}

.nav-link {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: all 180ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    border-color: var(--line);
    color: var(--ink);
    background: var(--surface-2);
}

.nav-link.is-active {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(115deg, var(--teal), var(--orange));
}

.mobile-menu-toggle,
.theme-toggle,
.project-menu-toggle {
    font-family: var(--font-body);
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink);
    padding: 0.42rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.theme-toggle {
    width: auto;
    max-width: max-content;
    justify-self: end;
    white-space: nowrap;
}

.mobile-menu-toggle {
    display: none;
    margin-left: auto;
}

.project-menu-wrap {
    position: relative;
}

.project-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: min(530px, 90vw);
    max-height: min(70vh, 560px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-hard);
    padding: 0.55rem;
    display: none;
}

.project-menu-wrap.open .project-menu-panel {
    display: grid;
    gap: 0.28rem;
}

.project-menu-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem;
    border-radius: 11px;
}

.project-menu-item:hover {
    background: var(--surface-2);
}

.project-menu-item img {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.project-menu-item strong {
    display: block;
    font-size: 0.88rem;
    line-height: 1.25;
}

.project-menu-item small {
    color: var(--ink-soft);
    font-size: 0.76rem;
}

.mobile-nav {
    display: none;
    gap: 0.42rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.75rem 1rem 1rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.mobile-nav.open {
    display: grid;
}

.site-main {
    width: min(1260px, 95vw);
    margin: 1rem auto 2.8rem;
}

.page-shell {
    display: grid;
    gap: 1rem;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius-lg) + 2px);
    background: linear-gradient(140deg, color-mix(in srgb, var(--teal) 16%, var(--surface) 84%), color-mix(in srgb, var(--orange) 15%, var(--surface) 85%));
    box-shadow: var(--shadow-hard);
    padding: clamp(1.1rem, 3.2vw, 2.5rem);
}

.hero-panel::after {
    content: '';
    position: absolute;
    width: 340px;
    height: 340px;
    right: -110px;
    top: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 70%);
    pointer-events: none;
}

.hero-kicker {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--teal-strong);
}

.hero-title {
    margin: 0.45rem 0 0;
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.06;
    max-width: 18ch;
}

.hero-title span {
    color: var(--orange-strong);
}

.hero-subtitle {
    margin: 0.95rem 0 0;
    max-width: 68ch;
    color: var(--ink-soft);
    font-size: clamp(0.95rem, 2.4vw, 1.08rem);
}

.hero-actions {
    margin-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.btn {
    min-height: 42px;
    border-radius: 999px;
    padding: 0.52rem 0.95rem;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: 0.38rem;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

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

.btn-primary {
    color: #ffffff;
    background: linear-gradient(120deg, var(--teal), var(--orange));
    box-shadow: 0 8px 18px rgba(24, 72, 53, 0.24);
}

.btn-secondary {
    color: var(--teal-strong);
    border-color: color-mix(in srgb, var(--teal) 45%, var(--line) 55%);
    background: color-mix(in srgb, var(--surface) 78%, var(--teal) 22%);
}

.btn-ghost {
    color: var(--ink-soft);
    border-color: var(--line);
    background: transparent;
}

.quick-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.7rem;
}

.quick-stat {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    padding: 0.75rem;
}

.quick-stat strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.16rem;
    line-height: 1.15;
}

.quick-stat span {
    color: var(--ink-soft);
    font-size: 0.82rem;
}

.control-bar {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    padding: 0.95rem;
    display: grid;
    gap: 0.78rem;
}

.search-field {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.65rem 0.8rem;
}

.search-field:focus {
    outline: 2px solid color-mix(in srgb, var(--teal) 48%, transparent);
    outline-offset: 1px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chip {
    min-height: 36px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-soft);
    padding: 0.35rem 0.76rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.chip.is-active {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(120deg, var(--teal), var(--orange));
}

.results-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    color: var(--ink-soft);
    font-size: 0.88rem;
}

.results-meta strong {
    color: var(--ink);
    font-family: var(--font-heading);
    font-size: 1rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
    gap: 0.92rem;
}

.project-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
}

.project-thumb-wrap {
    position: relative;
    overflow: hidden;
    min-height: 148px;
    max-height: 148px;
    background:
        linear-gradient(150deg, color-mix(in srgb, var(--teal) 16%, var(--surface) 84%), color-mix(in srgb, var(--orange) 14%, var(--surface) 86%));
    border-bottom: 1px solid var(--line);
}

.project-thumb-wrap::after {
    content: '';
    position: absolute;
    left: -14%;
    bottom: -54%;
    width: 60%;
    height: 140%;
    transform: rotate(18deg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
    pointer-events: none;
}

.project-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.8rem;
}

.project-status {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--teal) 38%, var(--line) 62%);
    background: color-mix(in srgb, var(--surface) 78%, var(--teal) 22%);
    color: var(--teal-strong);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.22rem 0.56rem;
}

.project-card-body {
    padding: 0.9rem;
    display: grid;
    gap: 0.62rem;
}

.project-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.project-category {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line) 65%);
    padding: 0.12rem 0.52rem;
    color: var(--orange-strong);
    font-size: 0.67rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.project-tier {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--teal) 36%, var(--line) 64%);
    padding: 0.12rem 0.5rem;
    color: var(--teal-strong);
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--surface) 80%, var(--teal) 20%);
}

.project-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.2;
}

.project-summary {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.34rem;
}

.tag-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.71rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.project-drilldown {
    border-top: 1px dashed var(--line);
    padding-top: 0.5rem;
}

.project-drilldown summary {
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--teal-strong);
}

.project-drilldown ul {
    margin: 0.55rem 0 0;
    padding-left: 1rem;
    color: var(--ink-soft);
    font-size: 0.86rem;
    display: grid;
    gap: 0.34rem;
}

.empty-state {
    display: none;
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink-soft);
    padding: 0.95rem;
}

.empty-state.show {
    display: block;
}

.single-project-layout {
    display: grid;
    gap: 0.95rem;
}

.project-hero {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 14%, var(--surface) 86%), color-mix(in srgb, var(--orange) 12%, var(--surface) 88%));
    box-shadow: var(--shadow-hard);
    padding: clamp(1rem, 3vw, 2rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 250px);
    gap: 1rem;
    align-items: center;
}

.project-hero-image {
    width: 100%;
    max-height: 145px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    padding: 0.72rem;
}

.section-nav {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    padding: 0.55rem;
}

.section-nav a {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 0.79rem;
    font-weight: 800;
    padding: 0.29rem 0.62rem;
}

.section-nav a:hover {
    color: var(--teal-strong);
    border-color: color-mix(in srgb, var(--teal) 40%, var(--line) 60%);
}

.expand-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.44rem;
}

.detail-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.detail-accordion summary {
    cursor: pointer;
    list-style: none;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.82rem 0.9rem;
}

.detail-accordion summary::-webkit-details-marker {
    display: none;
}

.detail-body {
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    padding: 0.8rem 0.9rem 0.95rem;
}

.detail-kv p {
    margin: 0 0 0.42rem;
}

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

.detail-kv strong {
    color: var(--ink);
}

.detail-body ul {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.34rem;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.45rem;
}

.directory-grid a {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    padding: 0.42rem 0.55rem;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

.directory-grid a:hover {
    color: var(--teal-strong);
    border-color: color-mix(in srgb, var(--teal) 38%, var(--line) 62%);
}

.site-footer {
    width: min(1260px, 95vw);
    margin: 0 auto 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    padding: 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
}

.footer-grid h3 {
    margin: 0 0 0.35rem;
    font-family: var(--font-heading);
}

.footer-grid p,
.footer-grid a {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.89rem;
    display: block;
    padding: 0.08rem 0;
}

.footer-meta {
    margin: 0.9rem 0 0;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.8rem;
}

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

@media (max-width: 1040px) {
    .site-header {
        grid-template-columns: auto auto auto;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .theme-toggle {
        justify-self: end;
    }

    .project-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .site-main {
        width: min(1260px, 97vw);
    }

    .hero-actions,
    .project-actions,
    .expand-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .quick-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (orientation: landscape) and (max-height: 640px) {
    .site-header {
        position: static;
    }

    .hero-panel {
        padding-top: 0.9rem;
        padding-bottom: 0.95rem;
    }

    .project-thumb-wrap {
        min-height: 112px;
        max-height: 112px;
    }
}

@media (orientation: portrait) and (max-width: 880px) {
    .hero-title {
        font-size: clamp(1.65rem, 7.3vw, 2.55rem);
    }
}
