/* ==========================================================================
   Martino Motti — Digital Art
   A dark gallery: the works carry the colour, everything else stays quiet.
   Captions are set like museum labels (mono, small, uppercase details).
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Colour */
  --ink: #0c0c0d;            /* page background: gallery black */
  --wall: #151517;           /* raised surfaces */
  --line: #2a2a2e;           /* hairlines */
  --bone: #ece8e1;           /* primary text */
  --ash: #9c978f;            /* secondary text */
  --gold: #c9a35b;           /* single warm accent, from Light Time */
  --glass: rgb(12 12 13 / 0.88);

  /* Type */
  --f-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-body: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --step--2: 0.6875rem;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: clamp(1.125rem, 1.6vw, 1.3125rem);
  --step-2: clamp(1.375rem, 2.4vw, 2rem);
  --step-3: clamp(1.875rem, 4.2vw, 3.25rem);
  --step-4: clamp(2.5rem, 7.5vw, 6.5rem);

  /* Space */
  --gutter: clamp(16px, 4.5vw, 64px);
  --max: 1440px;
  --header-h: 72px;
  --section: clamp(72px, 11vw, 152px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open, body.lb-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 300; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure, blockquote { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
::selection { background: var(--gold); color: var(--ink); }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--bone); color: var(--ink); padding: 10px 16px;
}
.skip-link:focus { top: 16px; }

/* ---------- Type roles ---------- */
.eyebrow, .label {
  font-family: var(--f-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
}
.eyebrow { color: var(--gold); }
.display {
  font-family: var(--f-display);
  font-stretch: 112%;
  font-weight: 250;
  font-size: var(--step-4);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.h2 {
  font-family: var(--f-display);
  font-stretch: 108%;
  font-weight: 300;
  font-size: var(--step-3);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.h3 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--step-1);
  line-height: 1.3;
}
.lede { font-size: var(--step-1); line-height: 1.6; color: var(--bone); max-width: 40em; }
.prose { max-width: 40em; color: #cfcac2; }
.prose p + p { margin-top: 1.1em; }
.prose a { color: var(--bone); border-bottom: 1px solid var(--gold); }
.muted { color: var(--ash); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.rule { border-top: 1px solid var(--line); }
.head { display: grid; gap: 20px; margin-bottom: clamp(36px, 5vw, 64px); }
.head-split { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 12px 24px;
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--bone); color: var(--bone);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn:hover { background: var(--bone); color: var(--ink); }
.btn-gold { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: transparent; color: var(--gold); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.link-arrow {
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--gold); padding-bottom: 4px;
}
.link-arrow::after { content: " →"; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-color: var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: grid; line-height: 1.1; }
.brand-name { font-family: var(--f-display); font-stretch: 125%; font-weight: 400; font-size: 1.0625rem; letter-spacing: 0.18em; text-transform: uppercase; }
.brand-sub { font-family: var(--f-mono); font-size: 0.625rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.nav a { font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; color: #d6d1c9; padding-block: 8px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--bone); box-shadow: 0 1px 0 var(--gold); }
.nav .lang { color: var(--ash); border-left: 1px solid var(--line); padding-left: clamp(18px, 2.4vw, 36px); }
.nav .lang:hover { box-shadow: none; color: var(--gold); }
.nav-toggle { display: none; width: 44px; height: 44px; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 1px; background: var(--bone); transition: transform 0.3s var(--ease), opacity 0.3s; }
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0; z-index: 49;
    flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px;
    padding: 32px var(--gutter); background: var(--ink);
    opacity: 0; visibility: hidden; transition: opacity 0.3s var(--ease), visibility 0.3s;
  }
  .nav.is-open { opacity: 1; visibility: visible; }
  .nav a { font-family: var(--f-display); font-size: 1.75rem; letter-spacing: 0; text-transform: none; font-weight: 300; padding-block: 10px; }
  .nav .lang { border: 0; padding-left: 0; margin-top: 16px; font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: 0.1em; text-transform: uppercase; }
}

/* ---------- Hero (home) ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #000; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); transition: transform 9s linear; }
.hero-slide.is-active img { transform: scale(1); }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgb(12 12 13 / 0.55) 0%, rgb(12 12 13 / 0) 22%, rgb(12 12 13 / 0) 45%, rgb(12 12 13 / 0.85) 100%);
}
.hero-copy { position: absolute; inset: auto 0 0; z-index: 2; padding-bottom: clamp(32px, 6vw, 72px); }
.hero-copy .display { max-width: 11em; }
.hero-copy .display em { font-style: normal; color: var(--gold); }
.hero-foot { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-top: clamp(20px, 3vw, 36px); flex-wrap: wrap; }
.hero-caption { font-family: var(--f-mono); font-size: var(--step--2); letter-spacing: 0.14em; text-transform: uppercase; color: #cfcac2; min-height: 1.5em; }
.hero-caption a { border-bottom: 1px solid var(--gold); }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding-top: calc(var(--header-h) + clamp(48px, 8vw, 112px)); padding-bottom: clamp(40px, 6vw, 80px); }
.page-head .display { font-size: clamp(2.25rem, 6vw, 5rem); margin-top: 18px; }
.page-head .lede { margin-top: 24px; color: #d6d1c9; }
.crumbs { font-family: var(--f-mono); font-size: var(--step--2); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ash); }
.crumbs a:hover { color: var(--bone); }
.crumbs span { margin-inline: 8px; color: var(--line); }

/* ---------- Statement ---------- */
.statement { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.statement blockquote { font-family: var(--f-display); font-stretch: 105%; font-weight: 300; font-size: var(--step-2); line-height: 1.35; }
@media (max-width: 860px) { .statement { grid-template-columns: 1fr; } }

/* ---------- Collections index ---------- */
.collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(28px, 3vw, 44px) clamp(16px, 2vw, 28px); }
.coll-card { display: grid; gap: 14px; }
.coll-card .frame { aspect-ratio: 4 / 3; overflow: hidden; background: var(--wall); }
.coll-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity 0.6s; }
.coll-card:hover img { transform: scale(1.04); }
.coll-card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.coll-card .h3 { font-size: 1.1875rem; }
.coll-card .badge { color: var(--gold); margin-left: 8px; }
.coll-card p { color: var(--ash); font-size: 0.9375rem; line-height: 1.6; }

/* ---------- Gallery (collection pages) ---------- */
.gallery { columns: 3 300px; column-gap: clamp(16px, 2.2vw, 32px); }
.gallery.is-wide { columns: 1; }
.work { break-inside: avoid; margin-bottom: clamp(28px, 3.5vw, 48px); }
.work button { display: block; width: 100%; text-align: left; cursor: zoom-in; }
.work .frame { background: var(--wall); overflow: hidden; }
.work img { width: 100%; transition: transform 1s var(--ease), filter 0.6s; }
.work button:hover img { transform: scale(1.02); }
.work figcaption { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; }
.work .t { font-family: var(--f-display); font-size: 1rem; line-height: 1.35; }
.work .d { font-family: var(--f-mono); font-size: var(--step--2); letter-spacing: 0.08em; color: var(--ash); white-space: nowrap; padding-top: 2px; }
.work .shop { color: var(--gold); }
.gallery.is-wide .work { margin-bottom: clamp(40px, 5vw, 72px); }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(28px, 5vw, 80px); padding-bottom: clamp(48px, 6vw, 88px); }
.intro .facts { display: grid; gap: 14px; align-content: start; }
.intro .facts div { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.intro .facts dd { margin: 0; font-family: var(--f-mono); font-size: var(--step--1); }
.intro .facts dt { color: var(--ash); font-family: var(--f-mono); font-size: var(--step--2); letter-spacing: 0.14em; text-transform: uppercase; padding-top: 3px; }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; } }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); padding-top: 28px; }
.pager a { display: grid; gap: 6px; }
.pager a:last-child { text-align: right; }
.pager .h3 { font-size: var(--step-2); font-weight: 300; }
.pager a:hover .h3 { color: var(--gold); }

/* ---------- Ask / buy band ---------- */
.band { background: var(--wall); border-block: 1px solid var(--line); }
.band .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 32px; align-items: center; padding-block: clamp(48px, 6vw, 80px); }
@media (max-width: 760px) { .band .wrap { grid-template-columns: 1fr; } }

/* ---------- Shop strip ---------- */
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 24px); }
.strip a { display: grid; gap: 10px; }
.strip .frame { aspect-ratio: 1; overflow: hidden; background: var(--wall); }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.strip a:hover img { transform: scale(1.05); }
.strip .t { font-size: 0.875rem; line-height: 1.4; }
@media (max-width: 960px) { .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Feature (MSC teaser, about teaser) ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.feature.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.feature.flip .feature-media { order: 2; }
.feature-media img { width: 100%; }
.feature-copy { display: grid; gap: 22px; align-content: center; }
.stats { display: flex; gap: clamp(24px, 4vw, 56px); flex-wrap: wrap; }
.stats div { display: grid; }
.stats strong { font-family: var(--f-display); font-weight: 250; font-stretch: 112%; font-size: var(--step-3); line-height: 1; color: var(--gold); }
.stats span { font-family: var(--f-mono); font-size: var(--step--2); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ash); margin-top: 8px; }
@media (max-width: 860px) {
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip .feature-media { order: 0; }
}

/* ---------- Photo grid (in situ, MSC) ---------- */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 16px); }
.photos figure { overflow: hidden; background: var(--wall); aspect-ratio: 3 / 4; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos.landscape figure { aspect-ratio: 4 / 3; }
@media (max-width: 700px) { .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-grid .portrait { position: sticky; top: calc(var(--header-h) + 24px); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .about-grid .portrait { position: static; max-width: 420px; } }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 32px; }
.pillars div { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 10px; align-content: start; }
.pillars p { color: #cfcac2; font-size: 0.9375rem; }
.timeline li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 24px; padding-block: 16px; border-top: 1px solid var(--line); }
.timeline time { font-family: var(--f-mono); font-size: var(--step--1); color: var(--gold); }
.timeline span { color: #cfcac2; }
@media (max-width: 600px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }
.review { border-left: 1px solid var(--gold); padding-left: clamp(20px, 3vw, 40px); max-width: 48em; }
.review p { font-family: var(--f-display); font-weight: 300; font-size: var(--step-1); line-height: 1.6; color: #ddd8d0; }
.review cite { display: block; margin-top: 18px; font-style: normal; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.contact-card { display: grid; gap: 10px; padding: 28px; background: var(--wall); border: 1px solid var(--line); transition: border-color 0.3s; }
.contact-card:hover { border-color: var(--gold); }
.contact-card strong { font-family: var(--f-display); font-weight: 300; font-size: var(--step-1); word-break: break-word; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 56px 40px; margin-top: var(--section); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid ul { display: grid; gap: 8px; }
.footer-grid a { color: #cfcac2; }
.footer-grid a:hover { color: var(--gold); }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Floating WhatsApp ---------- */
.wa {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: #1f1f22; border: 1px solid var(--line); color: var(--bone);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.wa:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.wa svg { width: 24px; height: 24px; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 90; background: rgb(8 8 9 / 0.97); display: grid; grid-template-rows: minmax(0, 1fr) auto; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.lb.is-open { opacity: 1; visibility: visible; }
.lb-stage { --px: clamp(56px, 7vw, 96px); --pt: 64px; --pb: 16px; position: relative; min-height: 0; }
.lb-stage img {
  position: absolute; inset: var(--pt) var(--px) var(--pb); margin: auto;
  max-width: calc(100% - 2 * var(--px)); max-height: calc(100% - var(--pt) - var(--pb));
  width: auto; height: auto; box-shadow: 0 30px 80px rgb(0 0 0 / 0.6);
}
.lb-info { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 32px; align-items: end; padding: 16px var(--gutter) 24px; border-top: 1px solid var(--line); }
.lb-info .h3 { font-size: var(--step-1); }
.lb-info .lb-meta { font-family: var(--f-mono); font-size: var(--step--2); letter-spacing: 0.08em; color: var(--ash); margin-top: 6px; line-height: 1.7; }
.lb-info .lb-note { color: #cfcac2; font-size: 0.9375rem; margin-top: 6px; max-width: 60em; }
.lb-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.lb-actions .btn { min-height: 42px; padding: 10px 18px; }
.lb-close, .lb-prev, .lb-next { position: absolute; width: 48px; height: 48px; display: grid; place-items: center; color: var(--bone); border: 1px solid var(--line); background: rgb(12 12 13 / 0.6); transition: border-color 0.3s, color 0.3s; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { border-color: var(--gold); color: var(--gold); }
.lb-close { top: 10px; right: 10px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 24px; left: var(--gutter); }
.lb-view { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; border: 1px solid var(--line); background: rgb(12 12 13 / 0.7); }
.lb-view button { min-height: 46px; padding: 0 18px; font-family: var(--f-mono); font-size: var(--step--2); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ash); transition: color 0.3s, background 0.3s; }
.lb-view button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.lb-view button:not([aria-pressed="true"]):hover { color: var(--bone); }
@media (max-width: 760px) {
  .lb-stage { --px: 8px; --pt: 60px; --pb: 64px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lb-info { grid-template-columns: 1fr; }
  .lb-actions { justify-content: flex-start; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .hero-slide img, .hero-slide.is-active img { transform: none; transition: none; }
}
