/* Coral palette — Kev-soft layout, original typography */

:root {
    --color-paper: #FFFAF7;
    --color-ink: #1F1F1F;
    --color-brand-core: #D44D4D;
    --color-accent: #E8906F;
    --color-accent-soft: #F5C4A8;
    --color-brand-hero: color-mix(in srgb, var(--color-accent-soft) 55%, var(--color-paper));
    --color-brand: var(--color-brand-core);
    --color-mute: #5E5E5E;
    --color-on-brand: #FFFFFF;
    --color-band: #FFFFFF;

    --background: var(--color-paper);
    --text-primary: var(--color-ink);
    --text-secondary: var(--color-mute);
    --primary-color: var(--color-brand);
    --secondary-color: var(--color-ink);
    --accent-color: var(--color-accent);
    --accent-light: var(--color-accent-soft);
    --surface: #FFFFFF;
    --border: #F5D4C4;
}

html:has(body.theme-revamp) {
    background: var(--color-paper);
}

body.theme-revamp {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-paper);
    color: var(--color-ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.theme-revamp .hero {
    background: var(--color-brand-hero) !important;
    color: var(--color-ink);
    min-height: 100vh;
}

body.theme-revamp .hero::before {
    display: none;
}

body.theme-revamp .hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.2s;
}

body.theme-revamp .hero .subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.4s;
}

body.theme-revamp .hero .description {
    font-size: 1.1rem;
    max-width: 600px;
    color: var(--color-ink);
    opacity: 0;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease forwards 0.6s;
}

body.theme-revamp .hero .cta-button {
    background: var(--color-brand);
    color: var(--color-on-brand);
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    font-size: 1rem;
    border: none;
    box-shadow: none;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.8s;
}

body.theme-revamp .hero .cta-button:hover {
    background: var(--color-ink);
    color: var(--color-on-brand);
    transform: translateY(-2px);
}

body.theme-revamp .hero-gif-showcase {
    padding: 1rem;
}

body.theme-revamp .hero-gif-showcase .gif-item {
    background: color-mix(in srgb, var(--color-brand-hero) 88%, #fff);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

body.theme-revamp .hero-gif-showcase .gif-container {
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background: color-mix(in srgb, var(--color-brand-hero) 60%, #fff);
}

body.theme-revamp .navbar,
body.theme-revamp .navbar.menu-active {
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
    border-bottom: none !important;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

body.theme-revamp .navbar.scrolled {
    background: color-mix(in srgb, #ffffff 72%, var(--color-paper)) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: none !important;
}

body.theme-revamp .logo {
    color: var(--color-ink);
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    font-size: 1.5rem;
    transition: color 0.25s ease;
}

body.theme-revamp .logo:hover {
    color: var(--color-brand);
}

body.theme-revamp .navbar.scrolled .logo {
    color: var(--color-brand);
}

body.theme-revamp .navbar.scrolled .logo:hover {
    color: var(--color-ink);
}

body.theme-revamp .nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

body.theme-revamp .nav-links a {
    color: var(--color-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.25s ease;
}

body.theme-revamp .nav-links a:hover {
    color: var(--color-brand);
}

body.theme-revamp .navbar.scrolled .nav-links a {
    color: var(--color-brand);
}

body.theme-revamp .navbar.scrolled .nav-links a:hover {
    color: var(--color-ink);
}

body.theme-revamp .nav-links a.is-current {
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 1.5px;
}

body.theme-revamp .hamburger {
    display: none;
}

body.theme-revamp .hero-ctas {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

body.theme-revamp .hero-text-link {
    color: var(--color-brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.9s;
}

body.theme-revamp .page-intro {
    padding: 5.5rem 0 2rem;
    background: var(--color-brand-hero);
}

body.theme-revamp .page-intro > .container > h1 {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    margin: 0;
}

body.theme-revamp .work-board {
    background: var(--color-band);
    padding: 2rem 0 5rem;
    flex: 1;
}

body.theme-revamp .work-shelf {
    max-width: 1100px;
    margin: 0 auto 3.5rem;
}

body.theme-revamp .work-shelf:last-child {
    margin-bottom: 0;
}

body.theme-revamp .work-shelf-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-ink);
    margin: 0 0 1.25rem;
}

body.theme-revamp .work-shelf-empty {
    margin: 0;
    color: var(--color-mute);
    font-size: 1rem;
}

body.theme-revamp .work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

body.theme-revamp .work-grid .case-study-item {
    margin-top: 0;
    min-height: 300px;
    height: 300px;
    padding: 0;
}

body.theme-revamp .work-card {
    position: relative;
}

/* Studio logo cards: show the full mark instead of cropping it to fill the tile. */
body.theme-revamp .work-card--logo {
    background-color: #000;
    background-size: 82% auto;
}

body.theme-revamp .work-board .portfolio-item {
    opacity: 1;
    transform: none;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.theme-revamp .work-board .portfolio-item:hover {
    transform: translateY(-4px);
    z-index: 2;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body.theme-revamp .work-board .portfolio-item:hover .portfolio-header {
    transform: none;
}

body.theme-revamp .work-board .portfolio-item:hover .portfolio-gif {
    transform: scale(1.03);
}

body.theme-revamp .work-board .case-study-item {
    transform: none;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.theme-revamp .work-board .case-study-item:hover {
    transform: translateY(-4px);
    z-index: 2;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body.theme-revamp .work-board .case-study-item:focus-visible {
    transform: translateY(-4px);
    z-index: 2;
    outline: 3px solid var(--color-brand);
    outline-offset: 3px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body.theme-revamp .work-board .case-study-item:hover .case-study-header,
body.theme-revamp .work-board .case-study-item:focus-visible .case-study-header {
    transform: none;
}

body.theme-revamp .work-card--wip .portfolio-gif-container {
    background: #ffffff;
}

body.theme-revamp .work-card--wip .portfolio-gif {
    object-fit: contain;
    width: 100%;
    height: 100%;
    transform: none;
}

body.theme-revamp .work-board .work-card--wip:hover .portfolio-gif {
    object-fit: cover;
    transform: scale(1.12);
    transform-origin: center center;
}

body.theme-revamp .work-card--wip {
    cursor: default;
}

body.theme-revamp .notes-list {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 0 4rem;
    flex: 1;
    width: 100%;
}

body.theme-revamp .note-row {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

body.theme-revamp .note-row:hover .note-row-title {
    text-decoration: underline;
    text-underline-offset: 4px;
}

body.theme-revamp .note-row-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    color: var(--color-mute);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

body.theme-revamp .note-tag {
    font-weight: 600;
    color: var(--color-ink);
}

body.theme-revamp .note-row-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--color-ink);
}

body.theme-revamp .note-row-dek {
    margin: 0;
    color: var(--color-mute);
    line-height: 1.55;
}

body.theme-revamp .note-article {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0 5rem;
}

body.theme-revamp .note-body {
    flex: 1;
    width: 100%;
    padding-top: 2.5rem;
}

body.theme-revamp .note-article--header {
    padding-bottom: 0;
}

body.theme-revamp .note-article--header h1 {
    margin-bottom: 0;
}

body.theme-revamp .note-article .note-row-meta {
    justify-content: flex-start;
    margin-bottom: 1rem;
}

body.theme-revamp .note-article h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    margin: 0 0 1.5rem;
}

body.theme-revamp .note-article p {
    line-height: 1.75;
    margin-bottom: 1rem;
}

body.theme-revamp .note-back {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--color-mute);
    font-weight: 600;
    text-decoration: none;
}

body.theme-revamp .note-back:hover {
    color: var(--color-ink);
}

@media (max-width: 768px) {
    body.theme-revamp .nav-links {
        display: none;
    }

    body.theme-revamp .hamburger {
        display: flex;
    }

    body.theme-revamp .work-grid {
        grid-template-columns: 1fr;
    }

    body.theme-revamp .hero-ctas {
        justify-content: center;
    }
}

body.theme-revamp .hamburger span,
body.theme-revamp .hamburger.active span,
body.theme-revamp .hamburger.hamburger-spin.active span {
    background: var(--color-ink);
    box-shadow: none;
}

body.theme-revamp .navbar.scrolled .hamburger span,
body.theme-revamp .navbar.scrolled .hamburger.active span,
body.theme-revamp .navbar.scrolled .hamburger.hamburger-spin.active span {
    background: var(--color-brand);
}

body.theme-revamp .mobile-menu {
    background: var(--color-brand-hero);
}

body.theme-revamp .mobile-menu::before {
    display: none;
}

body.theme-revamp .mobile-nav-links a {
    color: var(--color-brand);
    text-shadow: none;
}

body.theme-revamp .mobile-nav-links a::before {
    background: var(--color-brand);
    box-shadow: none;
}

body.theme-revamp .mobile-nav-links a:hover {
    color: var(--color-ink);
    text-shadow: none;
}

body.theme-revamp .section-band,
body.theme-revamp .section {
    padding: 5rem 0;
    background: transparent;
}

body.theme-revamp #about,
body.theme-revamp #experience,
body.theme-revamp #education {
    background: transparent;
}

body.theme-revamp #education,
body.theme-revamp #experience {
    border-top: 2px solid color-mix(in srgb, var(--color-ink) 16%, transparent);
}

body.theme-revamp #portfolio,
body.theme-revamp #case-studies {
    background: var(--color-band);
}

body.theme-revamp #contact {
    background: var(--color-brand-hero);
}

body.theme-revamp .section-kicker {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-mute);
    margin-bottom: 0.35rem;
}

body.theme-revamp .section-heading,
body.theme-revamp .section-title,
body.theme-revamp .contact-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--color-ink);
    margin-bottom: 2.5rem;
}

/* About / Education / Experience run at a smaller body size than the rest of
   the site, so their headings scale down to stay in proportion. */
body.theme-revamp .section-heading {
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    margin-bottom: 1.75rem;
}

body.theme-revamp .about-info--band {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

body.theme-revamp .about-info--band h3 {
    color: var(--color-brand);
    font-size: 1.25rem;
    margin-bottom: 0.8rem;
}

body.theme-revamp .about-info--band p {
    color: var(--color-ink);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    line-height: 1.65;
}

body.theme-revamp .about-info--band .cta-button {
    margin-top: 1.5rem;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

body.theme-revamp .resume-layout {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
}

body.theme-revamp .resume-col-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-ink);
    margin-bottom: 1.75rem;
}

body.theme-revamp .resume-job {
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}

body.theme-revamp .resume-job:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

body.theme-revamp .resume-job h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-brand);
    margin-bottom: 0.2rem;
}

body.theme-revamp .resume-job-meta {
    display: inline-block;
    color: var(--color-ink);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1.5px;
    text-decoration-color: color-mix(in srgb, var(--color-ink) 32%, transparent);
}

body.theme-revamp .resume-job-lead {
    color: var(--color-ink);
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.65;
    font-weight: 400;
}

body.theme-revamp .resume-job ul {
    margin-left: 1.1rem;
    color: var(--color-ink);
}

body.theme-revamp .resume-job li {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    line-height: 1.65;
}


body.theme-revamp .section-title {
    color: var(--color-ink);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 700;
}

body.theme-revamp .about-info h3,
body.theme-revamp .experience-item h3 {
    color: var(--color-brand) !important;
}

body.theme-revamp .about-section-centered .cta-button {
    background: var(--color-brand);
    color: var(--color-on-brand);
    border-radius: 8px;
    font-weight: 600;
    text-transform: none;
}

body.theme-revamp .about-section-centered .cta-button:hover {
    background: var(--color-ink);
    color: var(--color-on-brand);
}

body.theme-revamp .contact-section {
    background: var(--color-brand-hero);
    color: var(--color-ink);
}

body.theme-revamp .site-footer {
    background: var(--color-ink);
    color: rgba(255, 255, 255, 0.75);
    border-top: none;
    margin-top: auto;
    padding: 1.5rem 0;
}

body.theme-revamp .contact-title {
    color: var(--color-ink);
}

body.theme-revamp .contact-email {
    color: var(--color-ink);
}

body.theme-revamp .contact-email::after {
    background: var(--color-ink);
}

body.theme-revamp .contact-email:hover {
    color: var(--color-brand);
}

body.theme-revamp .contact-email:hover::after {
    background: var(--color-brand);
}

body.theme-revamp .contact-location strong {
    color: var(--color-mute);
    font-weight: 600;
}

body.theme-revamp .contact-location p {
    color: var(--color-ink);
}

body.theme-revamp .contact-social a {
    color: var(--color-ink);
    background: color-mix(in srgb, var(--color-accent-soft) 42%, var(--color-paper));
}

body.theme-revamp .contact-social a:hover {
    color: var(--color-brand);
    background: color-mix(in srgb, var(--color-accent-soft) 58%, #fff);
}

/* Project / case modal — top tabs instead of floating side rail */
body.theme-revamp .project-modal-content {
    margin: 2rem auto !important;
    width: min(950px, calc(100% - 2rem)) !important;
    max-width: 950px !important;
}

@media (min-width: 1400px) {
    body.theme-revamp .project-modal-content {
        width: min(1100px, calc(100% - 3rem)) !important;
        max-width: 1100px !important;
    }
}

@media (max-width: 900px) {
    body.theme-revamp .project-modal-content {
        margin-bottom: 2rem !important;
        width: min(950px, calc(100% - 1.5rem)) !important;
    }
}

body.theme-revamp .project-modal-header {
    background: var(--color-brand-hero);
    padding: 1rem 2rem 0.85rem;
}

body.theme-revamp .project-modal-header h2 {
    color: var(--color-ink);
    text-shadow: none;
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
    padding-right: 3rem;
}

body.theme-revamp .project-modal [data-panel-content][hidden] {
    display: none !important;
}

/* Keep the page laid out behind the modal so the backdrop blurs real content
   instead of the bare html background. */
body.theme-revamp.modal-open {
    height: auto;
}

body.theme-revamp .project-modal {
    background-color: color-mix(in srgb, var(--color-ink) 45%, transparent);
    backdrop-filter: blur(6px);
}

body.theme-revamp .project-modal.active .modal-side-menu,
body.theme-revamp .modal-side-menu {
    position: sticky !important;
    top: 0;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    margin: 0 !important;
    padding: 0.35rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    z-index: 5;
}

body.theme-revamp .modal-menu-btn {
    min-width: 0;
    max-width: none;
    flex: 0 0 auto;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--color-mute);
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: none;
    transform: none !important;
}

body.theme-revamp .modal-menu-btn .menu-icon {
    display: none;
}

body.theme-revamp .modal-menu-btn .menu-text {
    font-size: inherit;
    letter-spacing: normal;
    white-space: nowrap;
}

body.theme-revamp .modal-menu-btn:hover {
    background: transparent;
    border: none;
    color: var(--color-ink);
    box-shadow: none;
    transform: none !important;
}

body.theme-revamp .modal-menu-btn.active {
    background: transparent;
    border: none;
    color: var(--color-ink);
    box-shadow: inset 0 -2px 0 var(--color-ink);
}

body.theme-revamp .project-modal-close,
body.theme-revamp .case-modal-close {
    background: color-mix(in srgb, var(--color-ink) 8%, transparent);
    color: var(--color-ink);
    width: 34px;
    height: 34px;
    top: 0.85rem;
    right: 1rem;
    font-size: 1.15rem;
}

body.theme-revamp .project-modal-body {
    padding: 1.25rem 2.5rem 2.5rem;
}

/* Prose panels (Requirements, Development, Results) were running a size and a
   half larger than the Implementation cards. Match them. */
body.theme-revamp .project-section {
    margin-bottom: 2rem;
    padding: 1.5rem 1.6rem;
}

body.theme-revamp .project-section-title {
    margin-bottom: 1.1rem;
    padding: 0.5rem 1.1rem;
    font-size: 1.1rem;
}

body.theme-revamp .project-section-content {
    font-size: 0.94rem;
    line-height: 1.62;
}

body.theme-revamp .project-section-content h4 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

body.theme-revamp .project-section-content p {
    margin-bottom: 0.7rem;
}

body.theme-revamp .project-section-content ul {
    margin-left: 0;
    padding-left: 1.35rem;
}

body.theme-revamp .project-section-content li {
    margin-bottom: 0.3rem;
}

/* The case brief is reference material, so it sits a step below the
   implementation prose in size. */
body.theme-revamp #case-modal-requirements {
    font-size: 0.82rem;
    line-height: 1.58;
}

body.theme-revamp #case-modal-requirements h4 {
    margin: 1.15rem 0 0.45rem;
    color: var(--primary-color);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
}

body.theme-revamp #case-modal-requirements > h4:first-child {
    margin-top: 0;
}

body.theme-revamp #case-modal-requirements p {
    margin: 0 0 0.5rem;
}

body.theme-revamp #case-modal-requirements ul {
    margin: 0 0 0.55rem;
    padding-left: 1.1rem;
}

body.theme-revamp #case-modal-requirements li {
    margin-bottom: 0.2rem;
}

body.theme-revamp .req-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

body.theme-revamp .req-note-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    object-fit: contain;
}

body.theme-revamp .req-note p {
    margin: 0;
}

body.theme-revamp .systems-group + .systems-group {
    margin-top: 2.5rem;
}

body.theme-revamp .systems-group-label {
    margin: 0 0 1rem;
    color: var(--color-mute);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

body.theme-revamp .systems-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
}

body.theme-revamp .system-figure {
    margin: 0 auto;
    min-width: 0;
    max-width: min(100%, 760px);
}

body.theme-revamp .system-figure figcaption {
    margin-top: 0.65rem;
    font-size: 0.92rem;
    line-height: 1.5;
    text-align: center;
    color: color-mix(in srgb, var(--color-ink) 68%, transparent);
}

/* ---------------- full-size diagram viewer ---------------- */

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: clamp(1rem, 3vw, 2.5rem);
    background: rgba(8, 12, 20, 0.93);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.image-lightbox[hidden] {
    display: none;
}

/* it only takes focus so Escape can reach this document, never as a visible target */
.image-lightbox:focus {
    outline: none;
}

.image-lightbox.is-open {
    opacity: 1;
}

.image-lightbox-img {
    max-width: min(100%, 1800px);
    max-height: 86vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    cursor: zoom-out;
}

.image-lightbox-caption {
    margin: 0;
    max-width: min(100%, 900px);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.78);
}

.image-lightbox-caption:empty {
    display: none;
}

.image-lightbox-close {
    position: absolute;
    top: clamp(0.6rem, 2vw, 1.4rem);
    right: clamp(0.6rem, 2vw, 1.4rem);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    font-size: 1.7rem;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

body.theme-revamp .system-figure img,
body.theme-revamp .system-card-media img {
    cursor: zoom-in;
}

body.theme-revamp .system-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--color-ink) 18%, transparent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

body.theme-revamp .system-card {
    min-width: 0;
    padding: 1.5rem 1.6rem;
    background: color-mix(in srgb, var(--color-paper) 48%, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

body.theme-revamp .system-card--has-media {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 48%);
}

/* Code sits full-width under the explanation + image row so opening it
   doesn't push or resize the media. */
body.theme-revamp .system-card--has-media > .code-toggle,
body.theme-revamp .system-card--has-media > .system-code {
    grid-column: 1 / -1;
}

body.theme-revamp .system-card-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

body.theme-revamp .system-card-media {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    align-self: start;
}

body.theme-revamp .system-card-media img,
body.theme-revamp .system-card-media video {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--color-ink) 6%, transparent);
    display: block;
    align-self: center;
}

body.theme-revamp .system-card h4,
body.theme-revamp .system-card-copy h4 {
    margin: 0 0 0.85rem;
    color: var(--color-ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

body.theme-revamp .system-card p,
body.theme-revamp .system-card-copy p {
    margin: 0;
    max-width: 68ch;
    color: var(--color-ink);
    font-size: 0.94rem;
    line-height: 1.65;
}

body.theme-revamp .system-card > * + p,
body.theme-revamp .system-card-copy > * + p {
    margin-top: 0.8rem;
}

body.theme-revamp .system-card p code,
body.theme-revamp .system-card-copy p code {
    padding: 0.1rem 0.3rem;
    background: color-mix(in srgb, var(--color-ink) 8%, transparent);
    border-radius: 4px;
    font-size: 0.88em;
}

body.theme-revamp .system-code {
    margin: 0.9rem 0 0;
    padding: 1rem 1.1rem;
    background: color-mix(in srgb, var(--color-ink) 92%, #000);
    border: 1px solid color-mix(in srgb, var(--color-ink) 70%, #000);
    border-radius: 8px;
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
}

body.theme-revamp .code-toggle {
    margin: 0.9rem 0 0;
    max-width: 100%;
    min-width: 0;
}

body.theme-revamp .code-toggle-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: color-mix(in srgb, var(--color-ink) 6%, transparent);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--color-mute);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    list-style: none;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

body.theme-revamp .code-toggle-summary::-webkit-details-marker {
    display: none;
}

body.theme-revamp .code-toggle-summary::before {
    content: '';
    width: 0.34rem;
    height: 0.34rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg) translateY(-1px);
    transition: transform 0.2s ease;
}

body.theme-revamp .code-toggle[open] > .code-toggle-summary::before {
    transform: rotate(45deg) translateY(-1px);
}

body.theme-revamp .code-toggle-summary:hover,
body.theme-revamp .code-toggle[open] > .code-toggle-summary {
    color: var(--color-ink);
    background: color-mix(in srgb, var(--color-ink) 10%, transparent);
    border-color: color-mix(in srgb, var(--color-ink) 28%, transparent);
}

body.theme-revamp .code-toggle-summary:focus-visible {
    outline: 2px solid var(--color-accent, var(--color-ink));
    outline-offset: 2px;
}

body.theme-revamp .code-toggle .system-code {
    margin-top: 0.65rem;
}

body.theme-revamp .system-code code {
    display: block;
    color: #F6E9E2;
    background: none;
    padding: 0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.55;
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
    max-width: none;
    tab-size: 4;
}

@media (max-width: 700px) {
    body.theme-revamp .project-modal.active .modal-side-menu,
    body.theme-revamp .modal-side-menu {
        flex-wrap: nowrap !important;
        gap: 0.45rem;
        padding: 0.65rem 0.75rem;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    body.theme-revamp .modal-menu-btn {
        flex: 0 0 auto;
        padding: 0.5rem 0.65rem;
    }

    body.theme-revamp .project-modal-body {
        padding: 1.5rem 1rem 2rem;
    }

    body.theme-revamp .system-card {
        padding: 1.15rem 1.1rem;
        gap: 1.15rem;
    }

    body.theme-revamp .system-card--has-media {
        grid-template-columns: minmax(0, 1fr);
    }

    body.theme-revamp .system-card-media img,
    body.theme-revamp .system-card-media video {
        max-height: none;
    }

    body.theme-revamp .system-code {
        padding: 0.85rem 0.9rem;
    }

    body.theme-revamp .system-code code {
        font-size: 0.78rem;
    }
}

