/* UNPACKED Studio - style.css — revised 2026 */

/* ─── TYPOGRAPHY — Roboto ────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@100;600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #ffffff;
    --color-ink: #111111;
    --color-mid: #666666;
    --color-light: #999999;
    --color-rule: #eeeeee;
    --color-rule-soft: #f2f2f2;

    --space-xs: 10px;
    --space-sm: 20px;
    --space-md: 40px;
    --space-lg: 60px;
    --space-xl: 80px;
    --space-xxl: 100px;

    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

    /* type scale */
    --text-xs:   0.7rem;    /* 11.2px — labels, meta */
    --text-sm:   0.8rem;    /* 12.8px — UI, caps */
    --text-base: 1rem;      /* 16px   — body */
    --text-md:   1.1rem;    /* 17.6px — description */
    --text-lg:   1.2rem;    /* 19.2px — about intro */
    --text-xl:   clamp(1.8rem, 3.5vw, 2.6rem); /* titles */

    /* tracking */

    --header-h: 60px;
    --modal-padding: 40px;
    --content-max: 900px;

    --transition-fast: 0.25s ease;
    --transition-med: 0.4s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
    font-size: var(--text-base);
    font-weight: 400;
    padding: 0 var(--space-md) var(--space-lg);
    hyphens: none;
    -webkit-hyphens: none;
    -ms-hyphens: none;
}

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

img {
    display: block;
    max-width: 100%;
}

/* ─── ANIMAZIONI ────────────────────────────────────────────── */

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to   { opacity: 1; transform: translateY(0); }
}

header {
    animation: fadeInDown 0.8s ease both;
}

/* Stato iniziale delle card — invisibili finché non entrano nel viewport */
.project-item {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.project-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── HEADER ────────────────────────────────────────────────── */
header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    margin-bottom: var(--space-md);
    padding-top: var(--space-md);
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-rule);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.logo {
    font-family: 'Barlow', sans-serif;
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    line-height: 1;
    text-transform: uppercase;
}

.logo a {
    text-decoration: none;
    color: var(--color-ink);
}

.logo-unpacked {
    font-weight: 600;
    color: #e00;
    text-transform: uppercase;
}

.logo-studio {
    font-weight: 100;
    color: var(--color-ink);
    text-transform: uppercase;
}

.tagline {
    font-size: var(--text-lg);
    font-weight: 300;
    color: var(--color-mid);
    margin-bottom: 6px;
    line-height: 1.45;
    max-width: 70%;
}

/* ─── HAMBURGER ─────────────────────────────────────────────── */
.menu-triggers {
    position: relative;
    flex-shrink: 0;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    outline: none;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 1px;
    background: var(--color-ink);
    transition: transform var(--transition-fast), opacity var(--transition-fast), background var(--transition-fast);
    transform-origin: center;
}

.hamburger:hover span {
    background: var(--color-light);
}

/* Animated to X when open */
.hamburger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ─── DROPDOWN ──────────────────────────────────────────────── */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-rule);
    min-width: 160px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    z-index: 500;
}

.nav-dropdown.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown button,
.nav-dropdown a {
    background: none;
    border: none;
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 400;
    text-transform: uppercase;
    color: var(--color-ink);
    text-decoration: none;
    cursor: pointer;
    padding: 14px 20px;
    text-align: left;
    outline: none;
    transition: color var(--transition-fast), background var(--transition-fast);
    border-bottom: 1px solid var(--color-rule);
}

.nav-dropdown a:last-child,
.nav-dropdown button:last-child {
    border-bottom: none;
}

.nav-dropdown button:hover,
.nav-dropdown a:hover {
    color: var(--color-light);
    background: var(--color-rule-soft);
}

/* ─── TAGS TOGGLE ───────────────────────────────────────────── */
.filter-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    margin-bottom: 0;
}

.tags-toggle {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--color-ink);
    cursor: pointer;
    padding: 0;
    outline: none;
    flex-shrink: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.tags-toggle:hover {
    color: var(--color-light);
}

/* ─── FILTER NAV ────────────────────────────────────────────── */
#filterNav {
    display: none;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: baseline;
}

.filter-nav button {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    color: var(--color-light);
    font-size: var(--text-xs);
    font-weight: 400;
    text-transform: uppercase;
    cursor: pointer;
    outline: none;
    transition: color var(--transition-fast);
}

.filter-nav button:hover,
.filter-nav button.active {
    color: var(--color-ink);
}

/* ─── PROJECT GRID ──────────────────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.project-item {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    cursor: pointer;
    background: var(--color-rule);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    will-change: transform;
}

.project-item:hover img {
    transform: scale(1.03);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    text-align: center;
    padding: var(--space-sm);
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.overlay-info h3 {
    font-size: var(--text-base);
    font-weight: 500;
    text-transform: uppercase;
    margin: 8px 0;
    line-height: 1.3;
    color: var(--color-ink);
}

.overlay-info span {
    font-size: var(--text-xs);
    font-weight: 400;
    text-transform: uppercase;
    color: var(--color-mid);
}

/* ─── MODAL CONTENT ANIMATION ───────────────────────────────── */
.modal-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.modal-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── MODAL ─────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    z-index: 1000;
    overflow-y: auto;
    opacity: 0;
    transition: opacity var(--transition-med);
    -webkit-overflow-scrolling: touch;
}

.modal.is-visible {
    opacity: 1;
}

.modal-content {
    max-width: var(--content-max);
    margin: var(--header-h) auto var(--space-xxl);
    padding: var(--space-md) var(--modal-padding);
}

/* ─── MODAL CONTROLS ────────────────────────────────────────── */
.close-btn {
    position: fixed;
    top: 32px;
    right: 36px;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-ink);
    padding: 4px;
    outline: none;
    z-index: 1002;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.close-btn:hover {
    color: var(--color-light);
    transform: scale(1.15);
}

.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    color: #e00;
    padding: 16px 20px;
    outline: none;
    z-index: 1002;
    transition: color var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn:hover {
    color: #111;
}

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

@media (pointer: coarse) {
    .nav-btn {
        font-size: 3.8rem;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        padding: 20px;
        background: none;
        border-radius: 0;
        box-shadow: none;
        color: #e00;
    }

    .prev-btn { left: 0; }
    .next-btn { right: 0; }
}

/* ─── PROJECT CONTENT (inside modal) ───────────────────────── */
.proj-meta {
    font-size: var(--text-md);
    font-weight: 300;
    line-height: 1.8;
    color: #444;
    margin-bottom: 10px;
}

.tag-link {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: 300;
    color: var(--color-ink);
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    -webkit-appearance: none;
    appearance: none;
    transition: color var(--transition-fast);
}

.tag-link:hover {
    color: var(--color-light);
}

.proj-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
    line-height: 1.12;
}

.proj-thumb {
    width: 100%;
    margin-bottom: var(--space-lg);
}

.proj-description {
    font-size: var(--text-md);
    font-weight: 300;
    line-height: 1.8;
    color: #444;
    margin-bottom: var(--space-xs);
}

.proj-image-block {
    margin-bottom: var(--space-lg);
}

.proj-image-block img {
    width: 100%;
    margin-bottom: 12px;
}

.proj-caption {
    border-left: 1px solid var(--color-rule);
    padding-left: 14px;
    font-size: var(--text-xs);
    font-weight: 300;
    color: var(--color-light);
    line-height: 1.6;
}

.proj-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: var(--space-xl) 0;
    background: #000;
}

.proj-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.proj-video-mp4 {
    margin: var(--space-xl) 0;
    background: #000;
}

.proj-video-mp4 video {
    width: 100%;
    display: block;
}

.proj-divider {
    border: none;
    border-top: 1px solid var(--color-rule);
    margin: var(--space-lg) 0;
}

.proj-footer {
    margin-top: var(--space-xs);
    margin-bottom: var(--space-md);
}

.proj-footer .about-section-label {
    margin-top: var(--space-xs);
}

.proj-footer .proj-link {
    display: inline-block;
    margin-top: var(--space-md);
}

.proj-conclusion {
    font-size: var(--text-md);
    font-weight: 300;
    line-height: 1.8;
    color: #444;
    margin-bottom: var(--space-sm);
}

.proj-link {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-ink);
    border-bottom: 1px solid var(--color-ink);
    padding-bottom: 3px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.proj-link:hover {
    color: var(--color-light);
    border-color: var(--color-light);
}

/* ─── ABOUT CONTENT ─────────────────────────────────────────── */
.about-intro {
    font-size: var(--text-lg);
    font-weight: 300;
    line-height: 1.45;
    color: var(--color-mid);
    margin-top: 0;
    margin-bottom: var(--space-md);
}

.about-cover {
    width: 100%;
    margin-bottom: var(--space-xs);
}

.about-caption {
    font-size: var(--text-xs);
    font-weight: 300;
    color: var(--color-light);
    margin-bottom: var(--space-lg);
}

.about-section-label {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-ink);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-rule);
    display: inline-block;
}

.manifesto-text {
    font-style: italic;
    font-weight: 300;
    font-size: var(--text-base);
    line-height: 1.95;
    color: #555;
    margin-bottom: var(--space-xl);
}

.bio-text {
    font-size: var(--text-base);
    font-weight: 300;
    line-height: 1.85;
    color: var(--color-mid);
    text-align: justify;
    margin-bottom: var(--space-xl);
}

.what-we-do-intro {
    font-size: var(--text-base);
    font-weight: 300;
    line-height: 1.8;
    color: var(--color-mid);
    margin-bottom: var(--space-sm);
}

.what-we-do-list {
    list-style: none;
    margin-bottom: var(--space-xl);
}

.what-we-do-list li {
    border-left: 2px solid var(--color-rule);
    padding-left: 16px;
    margin-bottom: 16px;
    font-size: var(--text-base);
    font-weight: 300;
    line-height: 1.75;
    color: var(--color-mid);
}

.what-we-do-list li strong {
    color: var(--color-ink);
    font-weight: 500;
}

.archive-link-block {
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-rule-soft);
    margin-bottom: var(--space-xxl);
}

/* ─── FOOTER ────────────────────────────────────────────────── */
.site-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-rule);
    font-size: var(--text-xs);
    font-weight: 300;
    color: var(--color-light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-left p {
    line-height: 1;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-icon {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-light);
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: color var(--transition-fast);
    line-height: 1;
}

.footer-icon:hover {
    color: var(--color-ink);
}

.footer-privacy-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 300;
    text-transform: uppercase;
    color: var(--color-light);
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: color var(--transition-fast);
}

.footer-privacy-btn:hover {
    color: var(--color-ink);
}



/* ─── RESPONSIVE — TABLET (≤ 900px) ────────────────────────── */
@media (max-width: 900px) {
    body {
        padding: 0 24px var(--space-lg);
    }

    header {
        margin-left: -24px;
        margin-right: -24px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .tagline {
        max-width: 100%;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .modal-content {
        padding: var(--space-md) 24px;
    }

    .modal-bar {
        padding: 0 24px;
    }
}

/* ─── RESPONSIVE — MOBILE (≤ 600px) ────────────────────────── */
@media (max-width: 600px) {
    :root {
        --modal-padding: 20px;
    }

    body {
        padding: 0 16px var(--space-lg);
    }

    header {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .logo {
        font-size: 1.9rem;
    }

    .tagline {
        font-size: var(--text-lg);
        margin-bottom: 24px;
    }

    .menu-triggers {
        gap: 14px;
    }

    .menu-triggers button {
        font-size: 0.7rem;
    }

    .grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .overlay-info h3 {
        font-size: 0.8rem;
    }

    /* Modal full-screen on mobile */
    .modal-content {
        margin-top: var(--header-h);
        padding: 24px 16px;
    }

    .modal-bar {
        padding: 0 16px;
    }

    .nav-controls {
        gap: 14px;
    }

    .proj-title {
        font-size: 1.6rem;
    }

    .proj-description {
        font-size: 0.95rem;
    }

    .about-intro {
        font-size: 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
    }

    .footer-right {
        gap: 16px;
    }
}

/* ─── RESPONSIVE — VERY SMALL (≤ 380px) ────────────────────── */
@media (max-width: 380px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 1.1rem;
    }
}

/* ─── INDEX OVERLAY ─────────────────────────────────────────── */

.index-container {
    width: 100%;
}

.index-category {
    margin-bottom: 48px;
}

.index-category-title {
    font-weight: 300;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-ink);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-rule);
}

.index-works-list {
    display: grid;
    grid-template-columns: 60px 1.2fr 1.8fr;
    width: 100%;
}

.index-work-row {
    display: contents;
}

.index-work-row > span {
    padding: 5px 0;
    border-bottom: 1px solid var(--color-rule-soft);
    font-size: 0.82rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-ink);
}

.index-work-year {
    font-weight: 300;
    padding-right: 12px;
}

.index-work-title {
    font-weight: 500;
    padding-right: 20px;
}

.index-work-institution {
    font-weight: 300;
}

@media (max-width: 600px) {
    .index-works-list {
        grid-template-columns: 52px 1fr;
    }

    .index-work-institution {
        grid-column: 2;
        font-size: 0.72rem;
        color: var(--color-mid);
    }
}
