/* ============================================================
   /2 — 9to5-inspired horizontal scroll portfolio
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #7EB8E0;
    --black: #0a0a0a;
    --white: #fefefe;
    --gray: #888;
    --font-main: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --side-w: 60px;
    --bookmark-w: 70px;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--white);
    color: var(--black);
    cursor: none;
    overflow: hidden;
}

/* ── CUSTOM CURSOR ─────────────────────────────────────────── */

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* ── INTRO ─────────────────────────────────────────────────── */

.intro {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.intro-bg {
    position: absolute;
    inset: 0;
    background: var(--accent);
}

.intro-content {
    position: relative;
    z-index: 1;
    padding: 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.intro-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 7rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--black);
    gap: 0 20px;
}

.intro-title span {
    opacity: 0;
    transform: translateY(60px);
}

.intro-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
}

.intro-text {
    max-width: 600px;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    line-height: 1.6;
    color: var(--black);
    opacity: 0;
    transform: translateY(30px);
}

.intro-scroll {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(20px);
}

/* A project page opens on its sheet: no intro, even before the scripts arrive */
body.detail-open .intro {
    display: none;
}

/* ── SIDE BUTTONS ──────────────────────────────────────────── */

.side-btn {
    position: fixed;
    top: 0;
    bottom: 0;
    width: var(--side-w);
    z-index: 90;
    display: none;
}

.side-btn button {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--black);
    border: none;
    cursor: none;
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.side-btn button span {
    color: var(--white);
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
}

.side-left {
    left: 0;
}

.side-right {
    right: 0;
}

/* ── OVERLAYS ──────────────────────────────────────────────── */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    background: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.5s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-close {
    position: absolute;
    top: 20px;
    right: 0;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 100;
    padding: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
}
.overlay-close::before,
.overlay-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 1.5px;
    background: var(--white);
    border-radius: 1px;
}
.overlay-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}
.overlay-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}
.overlay-close:hover {
    transform: rotate(90deg);
    opacity: 0.7;
}

.overlay-inner {
    position: relative;
    padding: 60px;
    width: 100%;
    max-width: 900px;
}

/* Menu scrolls when it outgrows a short screen; margin:auto keeps it centred
   otherwise without clipping the top the way align-items:center would */
#menu-overlay {
    align-items: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#menu-overlay .overlay-inner {
    margin: auto;
}

.overlay-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 60px;
}

.overlay-link {
    font-family: var(--font-main);
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    text-transform: uppercase;
    line-height: 1.1;
    transition: color 0.3s;
    letter-spacing: -0.02em;
}

.overlay-link:hover {
    color: var(--accent);
}

.overlay-info {
    font-size: 0.85rem;
    color: var(--gray);
    line-height: 1.6;
}

.menu-contacts {
    margin-top: 48px;
    padding-top: 36px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.menu-contacts-label {
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 20px;
}

.menu-contacts-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--white);
    line-height: 1.6;
}

.menu-contacts-info a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.25s;
}

.menu-contacts-info a:hover {
    color: var(--accent);
}

.overlay-footer {
    margin-top: 48px;
    font-size: 0.65rem;
    line-height: 2;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.02em;
}

.overlay-footer a {
    color: rgba(255,255,255,0.55);
    text-underline-offset: 3px;
    transition: color 0.25s;
}

.overlay-footer a:hover {
    color: var(--white);
}

.contacts-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contacts-label {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray);
    margin-bottom: 8px;
}

.contacts-value {
    font-size: clamp(1rem, 2vw, 1.5rem);
    line-height: 1.5;
}

.contacts-link {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.contacts-link:hover {
    color: var(--accent);
}

/* ── HORIZONTAL SCROLL ─────────────────────────────────────── */

#horizontal-wrap {
    position: relative;
    opacity: 0;
    visibility: hidden;
    height: 100vh;
    overflow: hidden;
}

#horizontal-track {
    display: flex;
    flex-direction: row;
    width: fit-content;
    height: 100vh;
    will-change: transform;
}

/* ── HERO PANEL ────────────────────────────────────────────── */

.hero-panel {
    position: relative;
    flex: none;
    width: auto;
    min-width: 320px;
    height: 100vh;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    gap: 60px;
    max-width: 500px;
    width: 100%;
}

.hero-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hero-logo-mark {
    font-family: var(--font-main);
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--black);
}

.hero-logo-img {
    width: clamp(220px, 32vw, 420px);
    height: auto;
    display: block;
}

.hero-logo-sub {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gray);
}

.hero-text p {
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.7;
    color: #555;
}

/* ── WORK ITEMS ────────────────────────────────────────────── */

.work-items {
    display: flex;
    flex-direction: row;
    height: 100vh;
}

.work-card {
    display: flex;
    flex-direction: row;
    flex: none;
    height: 100vh;
    width: fit-content;
    text-decoration: none;
    color: inherit;
    cursor: none;
    overflow: visible;
    position: relative;
    isolation: isolate;
}

.work-card.hidden-card {
    display: none !important;
}

/* Individual bookmarks — vertical bands */
.work-card .bookmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 50px;
    height: 100vh;
    padding: 24px 0;
    border-right: 1px solid #eee;
    border-left: 1px solid #eee;
    flex: none;
    position: relative;
    z-index: 5;
    background: var(--white);
    will-change: transform;
}

.bookmark .bk-num,
.bookmark .bk-name {
    font-family: var(--font-main);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    white-space: nowrap;
}

.work-card .card-image-wrap {
    overflow: hidden;
    position: relative;
    height: 100vh;
}

.work-card .card-image-wrap img {
    width: auto;
    min-width: 80vw;
    height: 100vh;
    max-height: none;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card:hover .card-image-wrap img {
    transform: scale(1.03);
}

/* Title overlay — mix-blend-mode: difference + parallax */
.card-title-overlay {
    position: absolute;
    top: 28px;
    left: 0;
    right: 0;
    font-family: var(--font-main);
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 0.95;
    color: var(--white);
    mix-blend-mode: difference;
    pointer-events: none;
    white-space: nowrap;
    will-change: transform;
    z-index: 3;
}

/* ── CATEGORY FILTERS ──────────────────────────────────────── */

.filters {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 88;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.filters.visible {
    opacity: 1;
    visibility: visible;
}

/* The project sheet owns the screen — the selector steps aside */
body.detail-open .filters {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Single trigger — shrinks when the fan opens */
.filters-toggle {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-main);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 15px 30px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 40px;
    background: var(--white);
    color: var(--black);
    cursor: none;
    white-space: nowrap;
    box-shadow: 0 12px 34px rgba(0,0,0,0.26), 0 2px 8px rgba(0,0,0,0.14);
    transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.filters-toggle:hover {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.filters.open .filters-toggle {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

/* Plus mark → rotates into a cross when open */
.filters-toggle-icon {
    position: relative;
    width: 9px;
    height: 9px;
    flex: none;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.filters-toggle-icon::before,
.filters-toggle-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    background: currentColor;
}

.filters-toggle-icon::before { width: 100%; height: 1.5px; }
.filters-toggle-icon::after  { width: 1.5px; height: 100%; }

.filters.open .filters-toggle-icon {
    transform: rotate(135deg);
}

/* Fan origin — a zero-size anchor at the centre of the toggle */
.filter-fan {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    z-index: 1;
}

.filter-btn {
    font-family: var(--font-main);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 11px 20px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 30px;
    background: var(--white);
    color: var(--black);
    cursor: none;
    transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
    white-space: nowrap;
}

.fan-chip {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.16);
}

.filters.open .fan-chip {
    pointer-events: auto;
}

.filter-btn:hover {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.filter-btn.active {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

/* ── END SPACER ────────────────────────────────────────────── */

.end-spacer {
    flex: none;
    width: 80px;
    height: auto;
}

/* ── DETAIL VIEW ───────────────────────────────────────────── */

.detail-view {
    position: fixed;
    inset: 0;
    z-index: 85;
    background: var(--white);
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease,
                visibility 0.7s;
}

.detail-view.active {
    opacity: 1;
    visibility: visible;
    /* none, not translateY(0): any transform turns the view into the containing
       block of its fixed children, and the close button would scroll away */
    transform: none;
}

body.detail-open {
    overflow: hidden !important;
}

.detail-content {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Stays put while the sheet scrolls, so it sits on a disc to read over photos */
.detail-close {
    position: fixed;
    top: 24px;
    right: 24px;
    background: rgba(254,254,254,0.92);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 18px rgba(0,0,0,0.14);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    width: 48px;
    height: 48px;
    cursor: pointer;
    z-index: 86;
    padding: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
}
.detail-close::before,
.detail-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 1.5px;
    background: var(--black);
    border-radius: 1px;
}
.detail-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.detail-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.detail-close:hover   { transform: rotate(90deg); opacity: 0.7; }

.detail-top {
    margin-bottom: 40px;
    padding-right: 60px;
}

.detail-title {
    font-family: var(--font-main);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.detail-category {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray);
    margin-top: 12px;
}

.detail-hero {
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
}

.detail-hero-img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-hero-img.loaded {
    opacity: 1;
}

.detail-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #f0f0f0;
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item img.loaded {
    opacity: 1;
}

/* An odd one out closes the grid full-width instead of leaving a hole */
.gallery-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.gallery-item:last-child:nth-child(odd) img {
    aspect-ratio: 16/10;
}

/* Shared expand hover — gallery items & hero */
.gallery-item:hover img,
.detail-hero:hover .detail-hero-img {
    transform: scale(1.03);
}

.gallery-item::after,
.detail-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.3s;
    pointer-events: none;
}

.gallery-item:hover::after,
.detail-hero:hover::after {
    background: rgba(0,0,0,0.12);
}

.gallery-item::before,
.detail-hero::before {
    content: '';
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cpolyline points='9 21 3 21 3 15'/%3E%3Cline x1='21' y1='3' x2='14' y2='10'/%3E%3Cline x1='3' y1='21' x2='10' y2='14'/%3E%3C/svg%3E") center/16px no-repeat;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2;
}

.gallery-item:hover::before,
.detail-hero:hover::before {
    opacity: 1;
}

/* ── DETAIL NAV (prev / next project) ─────────────────────── */

.detail-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.detail-nav-btn {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
}

.detail-nav-btn:hover { opacity: 0.6; }

.detail-nav-next {
    text-align: right;
    margin-left: auto;
}

.detail-nav-label {
    font-family: var(--font-main);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray);
}

.detail-nav-name {
    font-family: var(--font-main);
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 700;
    color: var(--black);
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

/* ── LIGHTBOX ──────────────────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 201;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
}
.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 1.5px;
    background: #fff;
    border-radius: 1px;
}
.lightbox-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.lightbox-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.lightbox-close:hover { transform: rotate(90deg); opacity: 0.7; }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    z-index: 201;
    padding: 20px;
    line-height: 1;
    transition: opacity 0.3s;
    user-select: none;
}

.lightbox-nav:hover { opacity: 0.6; }

.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-family: var(--font-main);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

/* ── PROGRESS BAR ──────────────────────────────────────────── */

.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 92;
    opacity: 0;
}

/* ── BACKDROP ──────────────────────────────────────────────── */

.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 89;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
    backdrop-filter: grayscale(100%);
}

.backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ── DESKTOP (LG) ──────────────────────────────────────────── */

@media (min-width: 1024px) {

    body {
        overflow: hidden;
    }

    .hero-panel {
        width: auto;
        min-width: 500px;
        padding-left: calc(var(--side-w) + 40px);
        padding-right: 40px;
    }

    .side-btn {
        display: block;
    }

    /* Desktop: wider bookmarks and images */
    .work-card .bookmark {
        width: var(--bookmark-w);
        padding: 32px 0;
    }

    .work-card .card-image-wrap img {
        min-width: 55vw;
    }

    .end-spacer {
        width: 120px;
        height: auto;
    }

    .filters {
        bottom: 28px;
    }
}

/* ── MOBILE (< 1024px) ─────────────────────────────────────── */

@media (max-width: 1023px) {

    /* Touch: no custom cursor. The page itself scrolls here (the Sommario is
       a plain document), and body must not clip or sticky parts stop sticking,
       not even behind an open project */
    body { cursor: auto; overflow: visible; }
    body.detail-open { overflow: visible !important; }
    .custom-cursor { display: none; }
    * { cursor: auto !important; }

    .intro-title {
        flex-direction: column;
        gap: 0;
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }

    .intro-content {
        padding: 32px 20px;
    }

    .intro-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    /* The horizontal portfolio is the desktop's: phones read the Sommario */
    #horizontal-wrap,
    .filters,
    .progress-bar {
        display: none;
    }

    /* Lightbox mobile */
    .lightbox-nav { font-size: 2rem; padding: 12px; }
    .lightbox-close { top: 12px; right: 12px; }
    .lightbox img { max-width: 95vw; max-height: 85vh; }

    /* Project sheet: photographs first, swiped sideways (see DETAIL STRIP) */
    .detail-content {
        display: flex;
        flex-direction: column;
        padding: 0 20px calc(40px + env(safe-area-inset-bottom));
    }

    .detail-top {
        margin-bottom: 24px;
        padding-right: 0;
    }

    .detail-title {
        font-size: clamp(1.6rem, 7vw, 2.4rem);
    }

    .detail-hero,
    .detail-gallery {
        display: none;
    }

    .detail-close {
        top: 16px;
        right: 16px;
    }

    .detail-nav {
        margin-top: 40px;
        padding-top: 24px;
    }

    /* Overlays */
    .overlay-inner {
        padding: 60px 20px 40px;
    }

    /* Studio and Architetti close on a disc, like the project sheet */
    .overlay-close,
    .overlay-close.studio-close {
        position: fixed;
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(254,254,254,0.92);
        box-shadow: 0 4px 18px rgba(0,0,0,0.2);
        mix-blend-mode: normal;
    }

    .overlay-close::before,
    .overlay-close::after {
        width: 18px;
        background: var(--black);
    }

    .overlay-close:hover {
        transform: none;
        opacity: 1;
    }

    .contacts-grid {
        gap: 24px;
    }
}

/* ── MOBILE: SOMMARIO ─────────────────────────────────────────
   Below 1024px the projects are an index, like the contents page of a
   monograph: names in chapters by category; the one crossing the reading
   line lights up and its photograph fills the screen behind the list. */

.som,
.som-foot {
    display: none;
}

@media (max-width: 1023px) {

    .som {
        display: block;
        position: relative;
        overflow-x: clip;
        background: var(--black);
        color: var(--white);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.6s ease, visibility 0.6s;
    }

    .som.is-on {
        opacity: 1;
        visibility: visible;
    }

    /* The photograph stays put while the names scroll over it */
    .som-bg {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100lvh;
        overflow: hidden;
    }

    .som-bg img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0;
        transform: scale(1.08);
        transition: opacity 0.7s ease, transform 2.2s cubic-bezier(0.2, 0.7, 0.2, 1);
    }

    .som-bg img.on {
        opacity: 1;
        transform: scale(1);
    }

    .som-bg::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(10,10,10,0.5) 0%, rgba(10,10,10,0.46) 30%, rgba(10,10,10,0.5) 62%, rgba(10,10,10,0.9) 100%);
    }

    /* Reading line: a tick on the left edge */
    .som-lens {
        position: absolute;
        left: 0;
        top: var(--som-tick, 45vh);
        width: 14px;
        height: 2px;
        background: var(--accent);
        z-index: 1;
    }

    .som-body {
        position: relative;
        z-index: 1;
        margin-top: -100vh;
        margin-top: -100lvh;
    }

    .som-top {
        position: sticky;
        top: 0;
        z-index: 3;
        display: grid;
        gap: 14px;
        padding: 18px 20px 12px;
        background: rgba(10,10,10,0.78);
    }

    /* Names fade out as they slide under the header */
    .som-top::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 56px;
        background: linear-gradient(rgba(10,10,10,0.78), rgba(10,10,10,0));
        pointer-events: none;
    }

    .som-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
    }

    .som-logo {
        width: clamp(120px, 34vw, 200px);
        height: auto;
        display: block;
        filter: invert(1);
    }

    .som-studio {
        min-height: 40px;
        padding: 0 16px;
        border: 1px solid rgba(255,255,255,0.4);
        border-radius: 99px;
        background: none;
        color: inherit;
        font-family: var(--font-main);
        font-size: 0.66rem;
        font-weight: 600;
        letter-spacing: 0.16em;
        text-transform: uppercase;
    }

    .som-sub {
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.22);
        font-family: var(--font-main);
        font-size: 0.62rem;
        font-weight: 600;
        letter-spacing: 0.18em;
        text-transform: uppercase;
    }

    .som-count {
        font-variant-numeric: tabular-nums;
        color: rgba(255,255,255,0.75);
    }

    .som-chl {
        display: flex;
        justify-content: space-between;
        padding: 36px 20px 10px 56px;
        font-family: var(--font-main);
        font-size: 0.62rem;
        font-weight: 600;
        letter-spacing: 0.22em;
        text-transform: uppercase;
        color: #9CCBEA;
    }

    .som-item {
        display: grid;
        grid-template-columns: 36px 1fr;
        align-items: baseline;
        width: 100%;
        padding: 6px 20px;
        background: none;
        border: 0;
        color: inherit;
        font: inherit;
        text-align: left;
        text-decoration: none;
        opacity: 0.4;
        transition: opacity 0.35s;
    }

    .som-item.on {
        opacity: 1;
    }

    /* The page never rests between two names: it snaps the nearest one onto
       the reading line (main.js sets --som-lens), and the footer is the last stop */
    html.som-snap {
        scroll-snap-type: y mandatory;
    }

    .som-item {
        scroll-snap-align: start;
        scroll-margin-top: var(--som-lens, 42lvh);
    }

    .som-foot {
        scroll-snap-align: end;
    }

    /* The lit name steps in; its text moves, not its box, so nothing pokes
       past the screen edge and widens the page */
    .som-item > * {
        transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .som-item.on > * {
        transform: translateX(10px);
    }

    .som-num {
        font-family: var(--font-main);
        font-size: 0.66rem;
        font-weight: 500;
        letter-spacing: 0.1em;
        font-variant-numeric: tabular-nums;
    }

    .som-name {
        font-family: var(--font-main);
        font-size: clamp(1.75rem, 7.6vw, 3.2rem);
        font-weight: 700;
        line-height: 0.98;
        letter-spacing: -0.025em;
        text-transform: uppercase;
        text-wrap: balance;
    }

    .som-meta {
        grid-column: 2;
        margin-top: 6px;
        font-size: 0.75rem;
        letter-spacing: 0.04em;
        color: rgba(255,255,255,0.8);
        opacity: 0;
        transition: opacity 0.35s;
    }

    .som-item.on .som-meta {
        opacity: 1;
    }

    .som-chapters {
        position: sticky;
        bottom: 0;
        z-index: 3;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 32px 20px calc(18px + env(safe-area-inset-bottom));
        background: linear-gradient(rgba(10,10,10,0), rgba(10,10,10,0.85) 55%);
        scrollbar-width: none;
    }

    .som-chapters::-webkit-scrollbar {
        display: none;
    }

    .som-chip {
        flex: none;
        min-height: 40px;
        padding: 0 15px;
        border: 1px solid rgba(255,255,255,0.32);
        border-radius: 99px;
        background: none;
        color: inherit;
        font-family: var(--font-main);
        font-size: 0.66rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        white-space: nowrap;
        transition: background 0.3s, color 0.3s, border-color 0.3s;
    }

    .som-chip small {
        margin-left: 4px;
        font-size: 0.58rem;
        opacity: 0.6;
    }

    .som-chip.on {
        background: var(--white);
        color: var(--black);
        border-color: var(--white);
    }

    /* After the index the page simply goes on */
    .som-foot {
        display: grid;
        gap: 22px;
        padding: 64px 20px calc(48px + env(safe-area-inset-bottom));
        background: var(--black);
        color: rgba(255,255,255,0.6);
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .som-foot-logo {
        width: 180px;
        height: auto;
        filter: invert(1);
    }

    .som-foot p {
        margin: 0;
    }

    .som-foot a {
        color: var(--white);
        text-underline-offset: 3px;
    }

    .som-foot-legal {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 18px;
        font-size: 0.75rem;
    }
}

/* ── DETAIL STRIP (mobile) ────────────────────────────────────
   Every photograph of the project, full-bleed, swiped sideways; then all
   of them again as a contact sheet under the text. Tap opens the viewer. */

.detail-strip,
.detail-thumbs {
    display: none;
}

@media (max-width: 1023px) {

    .detail-strip {
        display: block;
        position: relative;
        order: -1;
        margin: 0 -20px 24px;
    }

    .detail-strip-track {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .detail-strip-track::-webkit-scrollbar {
        display: none;
    }

    .detail-strip-slide {
        display: block;
        padding: 0;
        border: 0;
        flex: none;
        width: 100%;
        height: min(72svh, 135vw);
        scroll-snap-align: start;
        background: #f0f0f0;
    }

    .detail-strip-slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .detail-strip::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 30%;
        background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.45));
        pointer-events: none;
    }

    .detail-strip-meta {
        position: absolute;
        left: 20px;
        right: 20px;
        bottom: 16px;
        z-index: 1;
        display: flex;
        align-items: center;
        gap: 14px;
        pointer-events: none;
    }

    .detail-strip-bar {
        flex: 1;
        display: flex;
        gap: 4px;
    }

    .detail-strip-bar i {
        flex: 1;
        height: 2px;
        background: rgba(255,255,255,0.4);
        transition: background 0.3s;
    }

    .detail-strip-bar i.on {
        background: var(--white);
    }

    .detail-strip-count {
        font-family: var(--font-main);
        font-size: 0.68rem;
        font-weight: 600;
        letter-spacing: 0.12em;
        color: var(--white);
        font-variant-numeric: tabular-nums;
    }

    .detail-thumbs {
        display: block;
        margin-top: 8px;
    }

    .detail-thumbs-label {
        display: flex;
        justify-content: space-between;
        margin-bottom: 12px;
        font-family: var(--font-main);
        font-size: 0.6rem;
        font-weight: 500;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--gray);
    }

    .detail-thumbs-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    .detail-thumb {
        padding: 0;
        border: 0;
        background: #f0f0f0;
    }

    .detail-thumb img {
        display: block;
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
    }
}

/* ── STUDIO OVERLAY ───────────────────────────────────────── */

/* ── STUDIO — immersive scroll ─────────────────────────────
   Full-bleed plates drift under the text; the title inverts
   whatever photograph passes behind it. */

.studio-overlay {
    display: block;
    align-items: initial;
    justify-content: initial;
}

.studio-scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.studio-scroll::-webkit-scrollbar { display: none; }

.studio-close {
    position: fixed;
    top: 32px;
    right: 40px;
    z-index: 10;
    mix-blend-mode: difference;
}

/* Opening frame */

.studio-hero {
    position: relative;
    height: 100vh;
    min-height: 560px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.studio-hero-media {
    position: absolute;
    inset: -12% 0;
    will-change: transform;
}

.studio-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.05) brightness(0.75);
    transform: scale(1.06);
}

.studio-hero-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.25) 45%, rgba(10,10,10,0.95) 100%);
}

.studio-hero-inner {
    position: relative;
    padding: 0 clamp(24px, 6vw, 90px) clamp(60px, 10vh, 110px);
    width: 100%;
}

.studio-eyebrow {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-main);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent);
    margin-bottom: 28px;
}

.studio-eyebrow-line {
    width: 56px;
    height: 1px;
    background: var(--accent);
}

.studio-title {
    font-family: var(--font-main);
    font-size: clamp(3.5rem, 13vw, 11rem);
    font-weight: 700;
    line-height: 0.86;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    color: var(--white);
    mix-blend-mode: difference;
}

.studio-title span {
    display: block;
}

.studio-lede {
    font-family: var(--font-main);
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.7);
    margin-top: 28px;
    max-width: 46ch;
}

.studio-scroll-hint {
    position: absolute;
    right: clamp(24px, 6vw, 90px);
    bottom: clamp(60px, 10vh, 110px);
    font-family: var(--font-main);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: rgba(255,255,255,0.5);
    writing-mode: vertical-rl;
    animation: studioHint 2.4s ease-in-out infinite;
}

@keyframes studioHint {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50%      { transform: translateY(12px); opacity: 1; }
}

/* Text chapters */

.studio-chapter {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(80px, 14vh, 160px) clamp(24px, 6vw, 90px);
}

.studio-chapter p {
    font-size: clamp(0.95rem, 1.25vw, 1.15rem);
    line-height: 1.85;
    color: rgba(255,255,255,0.7);
    max-width: 62ch;
    margin-bottom: 24px;
}

.studio-chapter p strong {
    color: var(--white);
    font-weight: 500;
}

.studio-lead {
    font-size: clamp(1.15rem, 2vw, 1.75rem) !important;
    line-height: 1.55 !important;
    color: rgba(255,255,255,0.92) !important;
    max-width: 24ch !important;
    letter-spacing: -0.01em;
}

.studio-sub {
    font-family: var(--font-main);
    font-size: clamp(1.6rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 32px;
}

.studio-chapter--split {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 1.4fr;
    gap: clamp(32px, 6vw, 90px);
    align-items: start;
}

.studio-chapter--split .studio-sub {
    margin-bottom: 0;
}

/* Full-bleed plates */

.studio-plate {
    position: relative;
    margin: 0;
    height: 78vh;
    min-height: 420px;
    overflow: hidden;
}

.studio-plate--tall {
    height: 88vh;
}

.studio-plate img {
    position: absolute;
    inset: -12% 0;
    width: 100%;
    height: 124%;
    object-fit: cover;
    filter: grayscale(1) brightness(0.8);
    transition: filter 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.studio-plate.in-view img {
    filter: grayscale(0) brightness(0.92);
}

.studio-plate figcaption {
    position: absolute;
    left: clamp(24px, 6vw, 90px);
    bottom: clamp(28px, 5vh, 56px);
    display: flex;
    align-items: baseline;
    gap: 18px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease 0.15s, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

.studio-plate.in-view figcaption {
    opacity: 1;
    transform: none;
}

.studio-plate-num {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.studio-plate-text {
    font-family: var(--font-main);
    font-size: clamp(0.7rem, 1.1vw, 0.85rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--white);
    text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}

/* Closing facts */

.studio-facts {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(80px, 12vh, 140px) clamp(24px, 6vw, 90px) clamp(100px, 16vh, 180px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(32px, 5vw, 72px);
    border-top: 1px solid rgba(255,255,255,0.12);
}

.studio-fact-label {
    font-family: var(--font-main);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255,255,255,0.38);
    margin-bottom: 14px;
}

.studio-fact-value {
    font-family: var(--font-main);
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    font-weight: 500;
    color: var(--white);
    line-height: 1.55;
}

/* Reveal on entry */

[data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: none;
}

@media (max-width: 767px) {
    .studio-chapter--split {
        grid-template-columns: 1fr;
    }

    .studio-plate,
    .studio-plate--tall {
        height: 62vh;
    }

    .studio-scroll-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    .studio-scroll-hint { animation: none; }
}

/* Touch screens at desktop width (iPad landscape): no custom cursor */
@media (hover: none), (pointer: coarse) {
    .custom-cursor { display: none; }
    * { cursor: auto !important; }
}

/* ── DETAIL INFO (project metadata) ───────────────────────── */

.detail-info {
    display: flex;
    gap: 48px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.detail-info-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-info-label {
    font-family: var(--font-main);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gray);
}

.detail-info-value {
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--black);
    line-height: 1.5;
}

.detail-description {
    max-width: 600px;
}

.detail-description p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #555;
}

/* Here, after the base rules, or the base gap would win the cascade */
@media (max-width: 1023px) {
    .detail-info {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px 24px;
        margin-bottom: 28px;
    }

    .detail-description {
        grid-column: 1 / -1;
    }
}


/* ── SITE FOOTER ──────────────────────────────────────────── */

.site-footer {
    flex: none;
    width: 300px;
    height: 100vh;
    background: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 40px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-logo {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.footer-logo-img {
    width: 180px;
    max-width: 100%;
    height: auto;
    display: block;
    /* SVG inchiostro nero → bianco per il fondo scuro del footer */
    filter: invert(1);
}

.footer-copy {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.02em;
}

.footer-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
}

.footer-right a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.25s;
}

.footer-right a:hover {
    color: var(--white);
}

.footer-legal {
    display: flex;
    gap: 18px;
}

.footer-legal a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-restart {
    align-self: flex-start;
    margin-top: 8px;
    padding: 12px 22px;
    font-family: var(--font-main);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--white);
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 30px;
    cursor: none;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.footer-restart:hover {
    background: var(--white);
    color: var(--black);
    border-color: var(--white);
}

/* ── ARCHITECTS OVERLAY ───────────────────────────────────── */

.arch-overlay {
    align-items: stretch;
    justify-content: stretch;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(126,184,224,0.10), transparent 60%),
        radial-gradient(ellipse 70% 50% at 50% 120%, rgba(126,184,224,0.08), transparent 60%),
        var(--black);
}

.arch-overlay .arch-close {
    position: fixed;
    top: 24px;
    right: 32px;
}

.arch-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 64px clamp(32px, 6vw, 80px) 80px;
    scrollbar-width: thin;
    scrollbar-color: rgba(126,184,224,0.3) transparent;
}

.arch-scroll::-webkit-scrollbar {
    width: 6px;
}
.arch-scroll::-webkit-scrollbar-thumb {
    background: rgba(126,184,224,0.25);
    border-radius: 4px;
}
.arch-scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* Header */
.arch-header {
    max-width: 1100px;
    margin: 0 auto 80px;
    text-align: left;
}

.arch-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.arch-eyebrow-line {
    width: 56px;
    height: 1px;
    background: var(--accent);
    opacity: 0.7;
}

.arch-eyebrow-text {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
}

.arch-heading {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(2.4rem, 7.5vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    color: var(--white);
    text-transform: uppercase;
    margin-bottom: 36px;
}

.arch-heading-row {
    display: block;
}

.arch-heading-row--accent {
    color: var(--accent);
    font-style: italic;
    font-weight: 500;
    font-family: var(--font-body);
    letter-spacing: -0.02em;
    text-transform: none;
    padding-left: clamp(40px, 8vw, 120px);
}

.arch-heading-ampersand {
    color: rgba(255,255,255,0.4);
    font-style: normal;
    margin-left: 4px;
}

.arch-intro {
    max-width: 560px;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.7;
    color: rgba(255,255,255,0.65);
    padding-left: clamp(40px, 8vw, 120px);
}

/* Architect cards */
.arch-card {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 0;
    position: relative;
}

.arch-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 96px);
    align-items: start;
}

.arch-card--mirror .arch-card-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

.arch-card--mirror .arch-card-media {
    order: 2;
}

.arch-card--mirror .arch-card-body {
    order: 1;
    text-align: right;
}

.arch-card--mirror .arch-card-bio,
.arch-card--mirror .arch-card-meta {
    margin-left: auto;
}

.arch-card--mirror .arch-card-meta {
    justify-content: flex-end;
}

.arch-card--mirror .arch-card-meta-item {
    text-align: right;
}

/* Media side */
.arch-card-media {
    position: relative;
    align-self: start;
}

.arch-card-frame {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255,255,255,0.04);
    box-shadow: 0 30px 80px -30px rgba(0,0,0,0.6);
}

.arch-card-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(0.35) contrast(1.02);
    transition: filter 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1.02);
}

.arch-card:hover .arch-card-frame img {
    filter: grayscale(0) contrast(1);
    transform: scale(1.05);
}

.arch-card-tint {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,0) 0%, rgba(10,10,10,0) 60%, rgba(10,10,10,0.55) 100%);
    pointer-events: none;
}

.arch-card-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(126,184,224,0);
    pointer-events: none;
    transition: border-color 0.6s ease, inset 0.6s ease;
}

.arch-card:hover .arch-card-frame::after {
    border-color: rgba(126,184,224,0.5);
    inset: -8px;
}

.arch-card-tag {
    position: absolute;
    left: 0;
    bottom: 20px;
    padding: 12px 18px 12px 0;
    background: var(--black);
    display: flex;
    align-items: baseline;
    gap: 14px;
    border-top: 1px solid rgba(126,184,224,0.3);
}

.arch-card--mirror .arch-card-tag {
    left: auto;
    right: 0;
    padding: 12px 0 12px 18px;
    flex-direction: row-reverse;
}

.arch-card-tag-num {
    font-family: var(--font-main);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    letter-spacing: -0.03em;
}

.arch-card-tag-label {
    font-family: var(--font-main);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.55);
}

/* Body side */
.arch-card-body {
    padding-top: 8px;
}

.arch-card-role {
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent);
    margin-bottom: 24px;
}

.arch-card-name {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    color: var(--white);
    text-transform: uppercase;
    margin-bottom: 40px;
}

.arch-card-name span {
    display: block;
}

.arch-card-name--accent {
    color: var(--accent);
    font-style: italic;
    font-weight: 500;
    font-family: var(--font-body);
    letter-spacing: -0.02em;
    text-transform: none;
}

.arch-card-bio {
    max-width: 480px;
    margin-bottom: 40px;
}

.arch-card-bio p {
    font-size: clamp(0.95rem, 1.05vw, 1.05rem);
    line-height: 1.75;
    color: rgba(255,255,255,0.72);
    margin-bottom: 18px;
}

.arch-card-bio p:last-child {
    margin-bottom: 0;
}

.arch-card-bio strong {
    color: var(--white);
    font-weight: 500;
}

.arch-card-bio em {
    font-style: italic;
    color: rgba(255,255,255,0.85);
}

/* Meta */
.arch-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 28px 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.12);
    max-width: 480px;
    list-style: none;
}

.arch-card-meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

.arch-card-meta-item dt {
    font-family: var(--font-main);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255,255,255,0.4);
}

.arch-card-meta-item dd {
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--white);
    line-height: 1.45;
    letter-spacing: 0.01em;
}

/* Divider between architects */
.arch-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 64px auto;
    max-width: 600px;
    color: rgba(126,184,224,0.6);
}

.arch-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(126,184,224,0.45), transparent);
}

.arch-divider-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.arch-divider-label {
    font-family: var(--font-main);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: rgba(126,184,224,0.7);
    white-space: nowrap;
}

/* Footer */
.arch-footer {
    max-width: 1100px;
    margin: 96px auto 0;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.arch-footer-mark {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.arch-footer-text {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.55);
    max-width: 520px;
}

.arch-footer-text a {
    color: var(--white);
    text-decoration: none;
    border-bottom: 1px solid rgba(126,184,224,0.4);
    transition: border-color 0.3s, color 0.3s;
}

.arch-footer-text a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Publications — accordion editorial */
.arch-pubs {
    margin-top: 36px;
    max-width: 560px;
}

.arch-pubs-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 0;
    background: none;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    font-family: var(--font-main);
    color: var(--white);
    text-align: left;
    transition: border-color 0.4s ease, color 0.3s ease;
}

.arch-pubs-toggle:hover {
    border-top-color: var(--accent);
}

.arch-pubs-toggle:hover .arch-pubs-toggle-label {
    color: var(--accent);
}

.arch-pubs-toggle-icon {
    position: relative;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.arch-pubs-toggle-bar {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 1.5px;
    background: var(--accent);
    transform: translateY(-50%);
    transition: transform 0.45s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.3s ease;
}

.arch-pubs-toggle-bar--v {
    transform: translateY(-50%) rotate(90deg);
}

.arch-pubs-toggle[aria-expanded="true"] .arch-pubs-toggle-bar--v {
    transform: translateY(-50%) rotate(0deg);
    opacity: 0;
}

.arch-pubs-toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white);
    transition: color 0.3s ease;
}

.arch-pubs-toggle-count {
    font-family: var(--font-main);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.38);
    margin-left: 2px;
}

.arch-pubs-toggle-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 100%);
    transform-origin: left center;
    transform: scaleX(0.6);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease;
}

.arch-pubs-toggle:hover .arch-pubs-toggle-line {
    transform: scaleX(1);
    background: linear-gradient(90deg, rgba(126,184,224,0.5) 0%, rgba(126,184,224,0) 100%);
}

.arch-pubs-toggle[aria-expanded="true"] .arch-pubs-toggle-line {
    background: linear-gradient(90deg, rgba(126,184,224,0.5) 0%, rgba(126,184,224,0) 100%);
}

/* Collapsible panel */
.arch-pubs-panel {
    height: 0;
    overflow: hidden;
    will-change: height;
}

.arch-pubs-inner {
    padding: 28px 0 8px;
}

.arch-pubs-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.arch-pubs-item {
    display: grid;
    grid-template-columns: 28px 64px 1fr;
    column-gap: 20px;
    align-items: baseline;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    will-change: transform, opacity;
}

.arch-pubs-item:last-child {
    border-bottom: none;
}

.arch-pubs-idx {
    font-family: var(--font-main);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    color: rgba(255,255,255,0.35);
    padding-top: 6px;
}

.arch-pubs-year {
    font-family: var(--font-main);
    font-size: clamp(1.4rem, 2.2vw, 1.7rem);
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    letter-spacing: -0.02em;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.arch-pubs-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 2px;
}

.arch-pubs-title {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(255,255,255,0.92);
    letter-spacing: -0.005em;
}

.arch-pubs-source {
    font-family: var(--font-main);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
}

/* Mirror variant — but Matteo doesn't have pubs, so this is just safety */
.arch-card--mirror .arch-pubs {
    margin-left: auto;
}

.arch-card--mirror .arch-pubs-toggle {
    flex-direction: row-reverse;
}

.arch-card--mirror .arch-pubs-toggle-line {
    transform-origin: right center;
}

.arch-card--mirror .arch-pubs-item {
    grid-template-columns: 1fr 64px 28px;
    text-align: right;
}

.arch-card--mirror .arch-pubs-body {
    order: -1;
}

/* Animation states (controlled via JS, but also work as fallback) */
.arch-overlay .arch-anim {
    opacity: 0;
    transform: translateY(28px);
}

.arch-overlay.active .arch-anim {
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--anim-delay, 0s);
    opacity: 1;
    transform: translateY(0);
}

/* ── ARCHITECTS — TABLET ──────────────────────────────────── */

@media (max-width: 1024px) {
    .arch-card-media {
        position: relative;
        top: 0;
    }

    .arch-card-grid {
        gap: 48px;
    }

    .arch-heading-row--accent,
    .arch-intro {
        padding-left: clamp(24px, 6vw, 80px);
    }
}

/* ── ARCHITECTS — MOBILE ──────────────────────────────────── */

@media (max-width: 768px) {
    .arch-overlay .arch-close {
        top: 16px;
        right: 16px;
    }

    .arch-scroll {
        padding: 56px 20px 64px;
    }

    .arch-header {
        margin-bottom: 56px;
    }

    .arch-heading {
        font-size: clamp(2.4rem, 12vw, 4rem);
        margin-bottom: 24px;
    }

    .arch-heading-row--accent {
        padding-left: 28px;
    }

    .arch-intro {
        padding-left: 28px;
        font-size: 0.95rem;
    }

    .arch-card {
        padding: 24px 0;
    }

    .arch-card-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .arch-card--mirror .arch-card-grid {
        grid-template-columns: 1fr;
    }

    .arch-card--mirror .arch-card-media {
        order: 1;
    }

    .arch-card--mirror .arch-card-body {
        order: 2;
        text-align: left;
    }

    .arch-card--mirror .arch-card-bio,
    .arch-card--mirror .arch-card-meta {
        margin-left: 0;
    }

    .arch-card--mirror .arch-card-meta {
        justify-content: flex-start;
    }

    .arch-card--mirror .arch-card-meta-item {
        text-align: left;
    }

    .arch-card--mirror .arch-card-tag {
        left: 0;
        right: auto;
        padding: 12px 18px 12px 0;
        flex-direction: row;
    }

    .arch-card-frame {
        aspect-ratio: 3 / 4;
    }

    .arch-card-name {
        font-size: clamp(2.2rem, 11vw, 3.4rem);
        margin-bottom: 28px;
    }

    .arch-card-bio {
        margin-bottom: 32px;
    }

    .arch-card-meta {
        gap: 20px 28px;
        padding-top: 24px;
    }

    .arch-card-meta-item {
        min-width: 120px;
    }

    .arch-divider {
        margin: 40px auto;
    }

    .arch-footer {
        margin-top: 64px;
        padding-top: 32px;
        flex-direction: column;
        align-items: flex-start;
    }

    .arch-pubs {
        margin-top: 28px;
    }

    .arch-pubs-toggle {
        padding: 16px 0;
        gap: 12px;
    }

    .arch-pubs-toggle-label {
        font-size: 0.78rem;
    }

    .arch-pubs-inner {
        padding: 20px 0 4px;
    }

    .arch-pubs-item {
        grid-template-columns: 22px 1fr;
        grid-template-rows: auto auto;
        column-gap: 16px;
        row-gap: 8px;
        padding: 16px 0;
    }

    .arch-pubs-idx {
        grid-row: 1;
        grid-column: 1;
        padding-top: 4px;
    }

    .arch-pubs-year {
        grid-row: 1;
        grid-column: 2;
        font-size: 1.3rem;
    }

    .arch-pubs-body {
        grid-row: 2;
        grid-column: 2;
    }

    .arch-pubs-title {
        font-size: 0.92rem;
    }
}

