/* ═══════════════════════════════════════════════════════════
   ROMANOVSKIS.CH — v2 · base
   Galleria su carta: bianco caldo, inchiostro, una linea rossa.
═══════════════════════════════════════════════════════════ */

:root {
  --paper: #F4F2ED;
  --paper-2: #EBE8E1;
  --ink: #141414;
  --ink-2: #55524D;
  --ink-3: #8E8A83;
  --line: rgba(20, 20, 20, 0.14);
  --line-soft: rgba(20, 20, 20, 0.07);
  --red: #E2261C;

  --display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 4vw, 56px);
  --nav-h: 84px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-variation-settings: 'opsz' 14, 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Grana sottile della carta */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 9000;
  pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Tipografia ─────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--red); }
.eyebrow.plain::before { display: none; }

.display {
  font-family: var(--display);
  font-weight: 500;
  font-variation-settings: 'opsz' 96, 'wdth' 100;
  letter-spacing: -0.035em;
  line-height: 0.96;
}
.display em { font-style: normal; color: var(--red); }

.h-xl { font-size: clamp(3rem, 8.5vw, 8rem); }
.h-lg { font-size: clamp(2.4rem, 5.6vw, 5.2rem); }
.h-md { font-size: clamp(1.8rem, 3.4vw, 3rem); line-height: 1.05; }
.h-sm { font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1.15; }

.lead { font-size: clamp(1.05rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--ink-2); max-width: 34em; }
.body { color: var(--ink-2); max-width: 36em; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.4s, backdrop-filter 0.4s;
}
.nav.solid { background: rgba(244, 242, 237, 0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-brand img { width: 30px; height: 30px; object-fit: contain; }
.nav-brand span { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -0.03em; }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-link {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2); position: relative; padding: 6px 0;
  transition: color 0.3s;
}
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--red); transition: width 0.4s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-burger { display: none; width: 32px; height: 20px; position: relative; z-index: 1100; }
.nav-burger span { position: absolute; left: 0; width: 100%; height: 1px; background: var(--ink); transition: transform 0.4s var(--ease), opacity 0.3s, top 0.4s var(--ease); }
.nav-burger span:nth-child(1) { top: 3px; }
.nav-burger span:nth-child(2) { top: 16px; }
.nav-burger.open span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.nav-burger.open span:nth-child(2) { top: 9px; transform: rotate(-45deg); }

.nav-overlay {
  position: fixed; inset: 0; z-index: 1050; background: var(--paper);
  display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gutter);
  gap: 8px; opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
}
.nav-overlay.open { opacity: 1; pointer-events: auto; }
.nav-overlay a {
  font-family: var(--display); font-weight: 500; font-size: clamp(2.6rem, 11vw, 5rem); line-height: 1.05;
  letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 18px;
  opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.nav-overlay a small { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--red); }
.nav-overlay.open a { opacity: 1; transform: none; }
.nav-overlay.open a:nth-child(2) { transition-delay: 0.06s; }
.nav-overlay.open a:nth-child(3) { transition-delay: 0.12s; }
.nav-overlay.open a:nth-child(4) { transition-delay: 0.18s; }
.nav-overlay .ov-meta { position: absolute; bottom: 32px; left: var(--gutter); }

/* Cambio lingua */
.nav-lang { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); margin-left: 24px; transition: border-color 0.3s, color 0.3s; }
.nav-lang:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 899px) { .nav-lang { margin-left: auto; margin-right: 16px; } }

/* ── Bottoni / link ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 14px 22px; border: 1px solid var(--ink); border-radius: 999px;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.red { border-color: var(--red); color: var(--red); }
.btn.red:hover { background: var(--red); color: var(--paper); }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.link-line {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  position: relative; padding-bottom: 4px; display: inline-flex; gap: 8px; align-items: center;
}
.link-line::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--line); transition: background 0.3s; }
.link-line:hover::after { background: var(--red); }

/* ── Layout comune ──────────────────────────────────────── */
.container { padding-left: var(--gutter); padding-right: var(--gutter); }
.page { padding-top: calc(var(--nav-h) + 6vh); }
.rule { height: 1px; background: var(--line); margin: 0 var(--gutter); }

.page-head { padding-bottom: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
.page-head .lead { justify-self: end; }

/* ── Figure / opere ─────────────────────────────────────── */
.fig { position: relative; }
.fig img { width: 100%; height: auto; background: var(--paper-2); }
.fig figcaption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-top: 12px; border-top: 1px solid transparent;
}
.fig .t { font-family: var(--display); font-weight: 500; font-size: 16px; letter-spacing: -0.02em; }
.fig .m { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.fig .n { font-family: var(--mono); font-size: 10px; color: var(--red); margin-right: 10px; }
.fig .m.mista { color: var(--red); }
.fig .m.mista::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-right: 8px; vertical-align: middle; }
.lb-item { cursor: zoom-in; }
.lb-item img { transition: transform 0.7s var(--ease), filter 0.5s; }
.lb-item:hover img { transform: scale(1.012); }

/* ── Reveal ─────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 0.07s); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ── Lightbox ───────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 2000; background: rgba(244, 242, 237, 0.96);
  display: grid; grid-template-rows: 1fr auto; opacity: 0; pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-stage { display: grid; place-items: center; padding: calc(var(--nav-h)) var(--gutter) 16px; min-height: 0; }
.lb-stage img { max-height: calc(100vh - var(--nav-h) - 120px); max-width: 100%; width: auto; object-fit: contain; box-shadow: 0 30px 80px rgba(20, 20, 20, 0.12); transition: opacity 0.3s; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px var(--gutter) 28px; gap: 24px; }
.lb-cap { display: flex; flex-direction: column; gap: 6px; }
.lb-ask { margin-top: 6px; color: var(--red); }
.lb-ask::after { background: var(--red); }
.lb-cap .t { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: -0.02em; }
.lb-ctl { display: flex; gap: 8px; }
.lb-ctl button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; transition: border-color 0.3s, background 0.3s, color 0.3s; }
.lb-ctl button:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.lb-close { position: absolute; top: 26px; right: var(--gutter); width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; }
.lb-close:hover { border-color: var(--ink); }
.lb-count { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-3); }

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  margin-top: 12vh; padding: 48px var(--gutter) 40px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
}
.footer h4 { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; font-weight: 500; }
.footer li { margin-bottom: 6px; font-size: 14px; color: var(--ink-2); }
.footer li a:hover { color: var(--red); }
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-brand img { width: 40px; }
.footer-brand p { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: -0.02em; line-height: 1.25; max-width: 18em; }
.footer-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line-soft); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 899px) {
  :root { --nav-h: 68px; }
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .page-head { grid-template-columns: 1fr; gap: 20px; }
  .page-head .lead { justify-self: start; }
  .footer { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .lb-close { top: 14px; }
}
