/* ═══════════════════════════════════════════════════════════
   ROMANOVSKIS.XYZ · base (nata con la v2)
   Token, tipografia, bottoni, sezioni, servizi, processo, about,
   contatto, case study. La v3 aggiunge v3.css e pathbar.css.
═══════════════════════════════════════════════════════════ */

:root {
  --bg: #F5F4F0;
  --bg-2: #ECEBE6;
  --card: #E9E8E2;
  --fg: #0F0F0F;
  --muted: #6F6D67;
  --muted-2: #A3A19B;
  --muted-card: #5E5C57; /* testo secondario sulle card #E9E8E2 (AA) */
  --line: #DBD9D2;
  --line-soft: #E8E6E0;
  --green: #22C55E;
  --green-text: #15803D; /* verde per testo piccolo su carta (AA) */
  --signal: var(--fg); /* "sei qui" e approvazioni in inchiostro: il rosso ora vuol dire solo web design */
  --rgb-r: #FF0000; --rgb-g: #00FF00; --rgb-b: #0000FF; /* sistema RGB: web design, front-end, grafica */
  --rgb-k: #0F0F0F; /* + K, l'inchiostro della stampa: Visuals, immagini e video (quarto pilastro, AD 8 ott 2026) */

  --display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 4vw, 64px);
  --radius: 22px;
  --radius-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  -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, ol { list-style: none; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* ── Type ───────────────────────────────────────────────── */
.display { font-family: var(--display); font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.h-xl { font-size: clamp(2.8rem, 7.2vw, 7rem); letter-spacing: -0.045em; }
.h-lg { font-size: clamp(2.2rem, 4.6vw, 4.2rem); }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.3rem); line-height: 1.5; color: var(--muted); max-width: 32em; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--fg); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 13px 22px; border-radius: 999px; border: 1px solid var(--fg);
  background: var(--fg); color: var(--bg);
  transition: transform 0.35s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--fg); }
.btn .arr { transition: transform 0.35s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn.sm { padding: 9px 16px; font-size: 13px; }


/* ── Layout ─────────────────────────────────────────────── */
.section { padding: clamp(80px, 12vh, 160px) var(--gutter) 0; }
.section-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 40px; }
.section-head .lead { margin-top: 18px; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { min-height: 100svh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 140px var(--gutter) 60px; position: relative; }
.hero h1 .thin { font-weight: 500; color: var(--muted); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ── Services ───────────────────────────────────────────── */
.services { border-top: 1px solid var(--fg); }
.service {
  display: grid; grid-template-columns: 140px 1fr 1fr; gap: 32px; align-items: start;
  padding: 44px 0; border-bottom: 1px solid var(--line);
}
.service .num { font-family: var(--display); font-weight: 600; font-size: clamp(3rem, 6vw, 5.5rem); letter-spacing: -0.05em; line-height: 0.85; color: var(--fg); }
.service h3 { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 2.6vw, 2.2rem); letter-spacing: -0.03em; line-height: 1.05; }
.service p { color: var(--muted); margin-top: 14px; max-width: 30em; }
.service ul { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; padding-top: 8px; }
.service li { font-size: 13px; color: var(--muted); padding-left: 14px; position: relative; }
.service li::before { content: ''; position: absolute; left: 0; top: 9px; width: 5px; height: 1px; background: var(--muted-2); }

/* ── Process ────────────────────────────────────────────── */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { background: var(--card); border-radius: var(--radius); padding: 28px 24px 30px; display: flex; flex-direction: column; gap: 40px; min-height: 240px; }
.step .k { font-family: var(--mono); font-size: 11px; color: var(--muted-card); letter-spacing: 0.1em; }
.step h3 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.03em; margin-top: auto; }
.step p { color: var(--muted-card); font-size: 13.5px; margin-top: 8px; }

/* ── About ──────────────────────────────────────────────── */

/* ── Contact ────────────────────────────────────────────── */
.contact { margin-top: clamp(80px, 12vh, 160px); padding: clamp(72px, 12vh, 140px) var(--gutter) 40px; color: var(--bg); border-radius: 36px 36px 0 0; }
.contact h2 { max-width: 9em; }
.contact .lead { color: rgba(245,244,240,0.6); margin: 24px 0 36px; }
.contact-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.contact .btn { background: var(--bg); color: var(--fg); border-color: var(--bg); }
.contact .btn.ghost { background: transparent; color: var(--bg); border-color: rgba(245,244,240,0.3); }
.contact .btn.ghost:hover { border-color: var(--bg); }

/* ── Case study overlay ─────────────────────────────────── */
.cs { position: fixed; inset: 0; z-index: 2000; display: grid; grid-template-columns: 1fr 420px; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease); }
.cs.open { opacity: 1; pointer-events: auto; }
.cs-media { position: relative; background: var(--card); display: grid; place-items: center; overflow: hidden; }
.cs-media img, .cs-media video { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; }
.cs-media .cs-count { position: absolute; left: 20px; bottom: 20px; font-family: var(--mono); font-size: 11px; color: var(--muted); background: rgba(245,244,240,0.85); padding: 6px 10px; border-radius: 999px; }
.cs-nav { position: absolute; right: 20px; bottom: 20px; display: flex; gap: 6px; }
.cs-nav button, .cs-close { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; transition: background 0.3s, color 0.3s; }
.cs-nav button:hover, .cs-close:hover { background: var(--fg); color: var(--bg); }
.cs-close { position: absolute; top: 20px; right: 20px; z-index: 2; }
.cs-side { padding: 32px 32px 40px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; border-left: 1px solid var(--line); }
.cs-side .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.cs-side h2 { font-family: var(--display); font-weight: 600; font-size: 2rem; letter-spacing: -0.04em; line-height: 1; }
.cs-side .sub { color: var(--muted); font-size: 15px; margin-top: 6px; }
.cs-side .desc { color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-grid dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.cs-grid dd { font-size: 13px; color: var(--fg); line-height: 1.45; }
.cs-grid > div:last-child { grid-column: 1 / -1; }
.cs-tabs { display: flex; flex-direction: column; gap: 4px; }
.cs-tabs button { display: grid; grid-template-columns: 28px 1fr; gap: 10px; text-align: left; padding: 12px 12px; border-radius: 12px; transition: background 0.25s; }
.cs-tabs button:hover { background: var(--card); }
.cs-tabs button.on { background: var(--fg); color: var(--bg); }
.cs-tabs button.on .k { color: rgba(245,244,240,0.5); }
.cs-tabs b { font-weight: 500; font-size: 14px; display: block; }
.cs-tabs small { display: block; font-size: 12.5px; color: inherit; opacity: 0.7; margin-top: 3px; line-height: 1.45; }
.cs-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cs-tags span { font-size: 11px; font-weight: 500; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.cs-side .cs-foot { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.cs-foot .btn.sm { min-height: 44px; }
.cs-nextp { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; margin-right: -12px; }
/* senza JS l'overlay non esiste (i suoi contenuti arrivano da main.js) e "Copy email" non fa nulla */
html:not(.js) .cs, html:not(.js) [data-copy] { display: none; }

/* ── Reveal ─────────────────────────────────────────────── */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 0.06s); }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; }
  .btn, .btn .arr { transition: none; } .btn:hover, .btn:hover .arr { transform: none; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .service { grid-template-columns: 100px 1fr; }
  .service ul { grid-column: 2; }
  .process { grid-template-columns: 1fr 1fr; }
  .cs { grid-template-columns: 1fr 360px; }
}
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; align-items: start; }
  .service { grid-template-columns: 1fr; gap: 16px; padding: 32px 0; }
  .service ul { grid-column: 1; }
  .process { grid-template-columns: 1fr; }
  .step { min-height: 0; gap: 24px; }
  .contact { border-radius: 24px 24px 0 0; }
  .cs { grid-template-columns: 1fr; grid-template-rows: 46vh 1fr; }
  .cs-side { border-left: 0; border-top: 1px solid var(--line); padding: 24px 20px 32px; }
  .cs-close { top: 12px; right: 12px; }
}
