/* =========================================================================
   JOEM CREATIVE STUDIO — styles.css
   Sistema editoriale: Ink dominante · Carta · Ottone (accento whisper)
   Tipografia: Questrial (display) + Outfit (testo)
   Tutti i colori derivano dal brand kit (tokens.css).
   ========================================================================= */

/* ----------------------------------------------------------------------- *
 * 1. FONTS (self-hosted, OFL)
 * ----------------------------------------------------------------------- */
@font-face {
  font-family: 'Questrial';
  src: url('../assets/fonts/Questrial-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../assets/fonts/Outfit-VF.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------------------- *
 * 2. DESIGN TOKENS
 * ----------------------------------------------------------------------- */
:root {
  /* core */
  --ink: #0E0E0C;
  --nero: #000000;
  --carta: #F4F1EA;
  --bianco: #FFFFFF;

  /* stone — neutri caldi */
  --stone-50:  #F3EFE8;
  --stone-100: #EAE6DE;
  --stone-200: #DDD8CD;
  --stone-300: #C9C3B8;
  --stone-400: #B3AC9E;
  --stone-500: #9A9284;
  --stone-600: #7E776B;
  --stone-700: #615B51;
  --stone-800: #45413A;
  --stone-900: #2A2722;

  /* ottone — accento */
  --ottone-300: #D8B978;
  --ottone-400: #C49E50;
  --ottone-500: #B0883C;
  --ottone-600: #93702F;
  --ottone-700: #745824;
  --accent: #B0883C;
  --accent-soft: #C49E50;

  /* semantici (tema scuro di default) */
  --bg: var(--ink);
  --bg-elevated: #15140F;
  --surface: var(--stone-900);
  --text: var(--carta);
  --text-dim: var(--stone-400);
  --text-faint: var(--stone-600);
  --border: rgba(244, 241, 234, 0.10);
  --border-strong: rgba(244, 241, 234, 0.18);

  /* tipografia */
  --font-display: 'Questrial', system-ui, -apple-system, sans-serif;
  --font-text: 'Outfit', system-ui, -apple-system, sans-serif;

  /* scala fluida (clamp) — base ratio 1.25 */
  --fs-micro: 0.72rem;
  --fs-2xs:   0.8rem;
  --fs-xs:    0.9rem;
  --fs-sm:    1rem;
  --fs-base:  clamp(1.02rem, 0.97rem + 0.28vw, 1.18rem);
  --fs-lead:  clamp(1.2rem, 1.05rem + 0.7vw, 1.6rem);
  --fs-h4:    clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem);
  --fs-h3:    clamp(1.3rem, 1.05rem + 1.1vw, 1.9rem);
  --fs-h2:    clamp(2rem, 1.3rem + 2.9vw, 3.6rem);
  --fs-h1:    clamp(2.6rem, 1.4rem + 5.2vw, 5.4rem);
  --fs-mega:  clamp(2.9rem, 0.6rem + 9.5vw, 8.5rem);

  --lh-tight: 1.04;
  --lh-snug:  1.18;
  --lh-text:  1.62;
  --tracking-caps: 0.22em;
  --tracking-wide: 0.14em;

  /* layout */
  --maxw: 1320px;
  --maxw-prose: 62ch;
  --gutter: clamp(1.25rem, 0.6rem + 3.2vw, 3.5rem);
  --section-y: clamp(4.5rem, 2.5rem + 8vw, 9.5rem);
  --grid-gap: clamp(0.9rem, 0.5rem + 1.6vw, 2rem);

  /* radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.55s;

  --header-h: 76px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Lenis gestisce lo smooth scroll quando il JS è attivo */
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-weight: 300;
  font-size: var(--fs-base);
  line-height: var(--lh-text);
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img, video { height: auto; }
/* <picture> trasparente al layout: l'<img> eredita il box del frame
   (così object-fit:cover riempie sempre, qualunque sia il formato sorgente) */
picture { display: contents; }

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

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}
button { cursor: pointer; }

::selection { background: var(--accent); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
  border-radius: 2px;
}

/* skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  background: var(--carta);
  color: var(--ink);
  padding: 0.7em 1.1em;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* ----------------------------------------------------------------------- *
 * 4. TYPOGRAPHY HELPERS
 * ----------------------------------------------------------------------- */
.display { font-family: var(--font-display); font-weight: 400; line-height: var(--lh-tight); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-snug);
  letter-spacing: -0.005em;
}

.eyebrow {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.85em;
}
.eyebrow::before {
  content: "";
  width: 2.4em;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow.is-plain::before { display: none; }

.section-index {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
  line-height: 1;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.4;
  font-weight: 300;
  color: var(--text);
  max-width: 26ch;
}

p { color: var(--text-dim); max-width: var(--maxw-prose); }
p strong, .text-bright { color: var(--text); font-weight: 400; }

.text-accent { color: var(--accent); }

/* ----------------------------------------------------------------------- *
 * 5. LAYOUT PRIMITIVES
 * ----------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}
.section + .section { border-top: 1px solid var(--border); }

/* intestazione di sezione (numero + eyebrow + titolo) */
.section-head {
  display: grid;
  gap: clamp(0.8rem, 0.5rem + 1vw, 1.4rem);
  margin-bottom: clamp(2.2rem, 1.4rem + 3vw, 4rem);
  max-width: 60ch;
}
.section-head .meta {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: var(--fs-h2);
  text-wrap: balance;
}

.lines-top { border-top: 1px solid var(--border); }

/* tema chiaro (sezione carta) */
.section--light {
  background: var(--carta);
  color: var(--ink);
  --text: var(--ink);
  --text-dim: var(--stone-700);
  --text-faint: var(--stone-500);
  --border: rgba(14, 14, 12, 0.12);
  --border-strong: rgba(14, 14, 12, 0.2);
}
.section--light p { color: var(--stone-700); }

/* ----------------------------------------------------------------------- *
 * 6. BUTTONS / LINKS
 * ----------------------------------------------------------------------- */
.btn {
  --btn-fg: var(--ink);
  --btn-bg: var(--carta);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  padding: 0.95em 1.6em;
  border-radius: 100px;
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease-out),
              background-color 0.4s var(--ease-out),
              color 0.4s var(--ease-out),
              opacity 0.4s var(--ease-out);
  will-change: transform;
}
.btn .arrow { transition: transform 0.45s var(--ease-out); }
.btn:hover { transform: translateY(-2px); }
.btn:hover .arrow { transform: translateX(4px); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: rgba(244,241,234,0.06); border-color: var(--accent); color: var(--text); }
.section--light .btn--ghost:hover { background: rgba(14,14,12,0.04); }

/* link testuale con underline animata + accento ottone */
.link {
  position: relative;
  display: inline-block;
  color: var(--text);
  padding-bottom: 2px;
  transition: color 0.35s var(--ease-out);
}
.link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out), background-color 0.35s var(--ease-out);
}
.link:hover { color: var(--accent); }
.link:hover::after { transform: scaleX(1); background: var(--accent); }
.link.is-static::after { transform: scaleX(1); opacity: 0.4; }

/* ----------------------------------------------------------------------- *
 * 7. HEADER / NAV
 * ----------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: height 0.45s var(--ease-out),
              background-color 0.45s var(--ease-out),
              border-color 0.45s var(--ease-out),
              backdrop-filter 0.45s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header.is-scrolled {
  height: 62px;
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
}
.brand .brand-wordmark { height: 26px; width: auto; }
.brand .brand-symbol { height: 26px; width: auto; display: none; }
.brand img { transition: opacity 0.4s var(--ease-out); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 0.5rem + 1.8vw, 2.6rem);
}
.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 0.5rem + 1.8vw, 2.4rem);
  list-style: none;
}
.nav-list a {
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--text-dim);
  transition: color 0.3s var(--ease-out);
  position: relative;
}
.nav-list a:hover { color: var(--text); }
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.nav-list a:hover::after { transform: scaleX(1); }

.nav-cta { display: inline-flex; }

/* hamburger */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  position: relative;
  flex: none;
  margin-right: -8px;
}
.nav-toggle span {
  position: absolute;
  left: 11px; right: 11px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.4s var(--ease-out), opacity 0.3s var(--ease-out);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 27px; }
body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ----------------------------------------------------------------------- *
 * 8. HERO
 * ----------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--ink);
}
.hero-media img,
.hero-media video {
  position: absolute;
  inset: -8% 0;
  width: 100%;
  height: 116%;
  object-fit: cover;
  object-position: center;
  will-change: transform;
}
/* fallback se l'immagine manca: gradiente caldo profondo */
.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 70% 10%, rgba(176,136,60,0.16), transparent 55%),
    linear-gradient(160deg, #14130f 0%, #0E0E0C 60%, #060605 100%);
  z-index: -1;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(14,14,12,0.92) 0%, rgba(14,14,12,0.35) 42%, rgba(14,14,12,0.25) 70%, rgba(14,14,12,0.55) 100%);
}
.hero-scrim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 40%, transparent 55%, rgba(0,0,0,0.45) 100%);
}

.hero-inner {
  width: 100%;
  padding-block: clamp(2.5rem, 1rem + 6vw, 5.5rem);
  padding-top: calc(var(--header-h) + 2rem);
}
.hero-eyebrow { margin-bottom: clamp(1.4rem, 1rem + 2vw, 2.4rem); }

.hero-wordmark {
  width: min(680px, 78vw);
  margin-bottom: clamp(1.6rem, 1rem + 2.5vw, 2.8rem);
}
.hero-wordmark img { width: 100%; height: auto; }

.hero-headline {
  font-size: var(--fs-h1);
  line-height: 1.06;
  max-width: 16ch;
  text-wrap: balance;
  margin-bottom: clamp(1.4rem, 1rem + 2vw, 2.2rem);
}
.hero-sub {
  font-size: var(--fs-lead);
  font-weight: 300;
  color: var(--stone-300);
  max-width: 44ch;
  line-height: 1.42;
  margin-bottom: clamp(2rem, 1.4rem + 2.5vw, 3rem);
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 0.5rem + 1.6vw, 2rem);
  flex-wrap: wrap;
}

/* meta riga sotto l'hero (luogo / disciplina) */
.hero-meta {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(1.4rem, 1rem + 1.5vw, 2.4rem);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  font-size: var(--fs-2xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--stone-500);
  pointer-events: none;
  z-index: 2;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--stone-500);
  pointer-events: auto;
}
.scroll-cue .line {
  width: 1px; height: 46px;
  background: linear-gradient(var(--accent), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-cue .line::after {
  content: "";
  position: absolute;
  top: -50%; left: 0;
  width: 100%; height: 50%;
  background: var(--carta);
  animation: scrollcue 2.4s var(--ease-inout) infinite;
}
@keyframes scrollcue {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(300%); }
}

/* ----------------------------------------------------------------------- *
 * 9. SERVIZI — Cosa facciamo
 * ----------------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  column-gap: clamp(1.6rem, 0.8rem + 2.4vw, 3.5rem);
}
.service {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 0.5rem + 1.5vw, 2rem);
  padding: clamp(1.8rem, 1.2rem + 2.5vw, 2.8rem) 0;
  border-top: 1px solid var(--border);
}
.service-no {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  color: var(--accent);
  line-height: 1;
  padding-top: 0.2em;
}
.service-body h3 {
  font-size: var(--fs-h3);
  margin-bottom: 0.6em;
}
.service-body p { font-size: var(--fs-base); max-width: 38ch; }
.service-tags {
  margin-top: 1.1em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}
.service-tags span {
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.35em 0.85em;
}

/* ----------------------------------------------------------------------- *
 * 10. PORTFOLIO — Selected work
 * ----------------------------------------------------------------------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}
.work {
  grid-column: span var(--span, 6);
  display: block;
  position: relative;
}
.work-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--stone-900);
  aspect-ratio: var(--ratio, 0.8);
}
.work-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,14,12,0.55), rgba(14,14,12,0) 45%);
  opacity: 0.55;
  transition: opacity 0.5s var(--ease-out);
  z-index: 1;
}
.work:hover .work-frame::after { opacity: 0.8; }
.work-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 0.9s var(--ease-out), filter 0.6s var(--ease-out);
  filter: saturate(0.92) brightness(0.96);
}
.work:hover .work-frame img { transform: scale(1.06); filter: saturate(1) brightness(1); }

.work-meta {
  position: absolute;
  left: clamp(1rem, 0.5rem + 1vw, 1.8rem);
  right: clamp(1rem, 0.5rem + 1vw, 1.8rem);
  bottom: clamp(1rem, 0.5rem + 1vw, 1.6rem);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.work-meta .titles { transform: translateY(0); }
.work-name {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  color: var(--carta);
  line-height: 1.1;
}
.work-sector {
  display: block;
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ottone-300);
  margin-top: 0.5em;
}
.work-cta {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(244,241,234,0.4);
  display: grid;
  place-items: center;
  color: var(--carta);
  opacity: 0;
  transform: translateY(8px) rotate(-30deg);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), background-color 0.4s, border-color 0.4s;
}
.work:hover .work-cta {
  opacity: 1;
  transform: translateY(0) rotate(0);
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.work-cta svg { width: 16px; height: 16px; }

/* ----------------------------------------------------------------------- *
 * 11. SETTORI — Per chi lavoriamo (sezione carta)
 * ----------------------------------------------------------------------- */
.sectors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}
.sector {
  display: flex;
  flex-direction: column;
}
.sector-img {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  aspect-ratio: 4 / 5;
  background: var(--stone-200);
  margin-bottom: 1.4rem;
}
.sector-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.95);
  transition: transform 0.9s var(--ease-out);
}
.sector:hover .sector-img img { transform: scale(1.05); }
.sector-no {
  font-family: var(--font-display);
  font-size: var(--fs-2xs);
  letter-spacing: var(--tracking-wide);
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.sector h3 {
  font-size: var(--fs-h3);
  margin-bottom: 0.6rem;
}
.sector p { font-size: var(--fs-base); }

/* ----------------------------------------------------------------------- *
 * 12. APPROCCIO — manifesto
 * ----------------------------------------------------------------------- */
.approach {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 1rem + 3vw, 3.5rem);
}
.manifesto {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1rem + 3vw, 3.4rem);
  line-height: 1.18;
  font-weight: 400;
  max-width: 20ch;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.manifesto em {
  font-style: normal;
  color: var(--accent);
}
.approach-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 1rem + 2vw, 3rem);
  padding-top: clamp(1.5rem, 1rem + 2vw, 3rem);
  border-top: 1px solid var(--border);
}
.approach-col h4 {
  font-size: var(--fs-h4);
  margin-bottom: 0.7rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}
.approach-col h4 .n {
  font-size: var(--fs-2xs);
  color: var(--accent);
  font-family: var(--font-text);
  letter-spacing: var(--tracking-wide);
}
.approach-col p { font-size: var(--fs-base); }

/* ----------------------------------------------------------------------- *
 * 13. CLIENTI
 * ----------------------------------------------------------------------- */
/* carosello loghi — scorrimento automatico in loop */
.client-marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--border);
  padding-block: clamp(1.6rem, 1rem + 2vw, 2.8rem);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.client-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: client-scroll 42s linear infinite;
}
.client-marquee:hover .client-track { animation-play-state: paused; }
.client-group { display: flex; align-items: center; }
.client-item {
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding-inline: clamp(1.6rem, 1rem + 2.6vw, 3.4rem);
}
.client-logo {
  height: 46px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.4s var(--ease-out);
}
.client-item:hover .client-logo { opacity: 1; }
.client-name {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 0.85rem + 0.3vw, 1.15rem);
  color: var(--stone-400);
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: color 0.4s var(--ease-out);
}
.client-item:hover .client-name { color: var(--carta); }
@keyframes client-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.clients-note {
  margin-top: 1.6rem;
  font-size: var(--fs-xs);
  color: var(--text-faint);
}

/* ----------------------------------------------------------------------- *
 * 14. CONTATTO
 * ----------------------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
  align-items: start;
}
.contact-lead .big {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
.contact-lead p { margin-bottom: 2rem; }

.contact-details {
  display: grid;
  gap: 1.4rem;
  margin-top: 2.2rem;
}
.contact-item {
  display: grid;
  gap: 0.3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.contact-item .label {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-faint);
}
.contact-item a, .contact-item .val {
  font-size: var(--fs-lead);
  font-weight: 300;
  color: var(--text);
  width: fit-content;
}

/* form minimale */
.contact-form { display: grid; gap: 1.5rem; }
.field { position: relative; display: grid; gap: 0.5rem; }
.field label {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-faint);
}
.field input,
.field textarea {
  width: 100%;
  background: rgba(244,241,234,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95em 1.1em;
  font-size: var(--fs-base);
  font-weight: 300;
  color: var(--text);
  transition: border-color 0.35s var(--ease-out), background-color 0.35s var(--ease-out);
}
.field textarea { resize: vertical; min-height: 130px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(244,241,234,0.05);
}
.contact-form .btn { justify-self: start; margin-top: 0.4rem; }
.form-note { font-size: var(--fs-xs); color: var(--text-faint); }
.form-status { font-size: var(--fs-sm); min-height: 1.2em; padding: 0.9em 1.1em; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.form-status.ok { color: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: rgba(176,136,60,0.08); }
.form-status.err { color: #d79179; border-color: rgba(207,139,120,0.4); background: rgba(207,139,120,0.08); }

/* honeypot anti-spam: invisibile */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* consenso privacy */
.consent {
  display: flex;
  gap: 0.65em;
  align-items: flex-start;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  line-height: 1.5;
  cursor: pointer;
}
.consent input { margin-top: 0.2em; flex: none; width: 1rem; height: 1rem; accent-color: var(--accent); }
.consent a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* barra cookie (informativa) */
.cookie-bar {
  position: fixed;
  left: clamp(0.8rem, 0.4rem + 1.5vw, 1.5rem);
  right: clamp(0.8rem, 0.4rem + 1.5vw, 1.5rem);
  bottom: clamp(0.8rem, 0.4rem + 1.5vw, 1.5rem);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: space-between;
  background: color-mix(in srgb, var(--ink) 92%, black);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: clamp(0.9rem, 0.6rem + 1vw, 1.3rem) clamp(1.1rem, 0.8rem + 1vw, 1.6rem);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.cookie-bar.is-in { opacity: 1; transform: none; }
body.menu-open .cookie-bar { opacity: 0 !important; visibility: hidden; pointer-events: none; }
.cookie-text { color: var(--stone-300); font-size: var(--fs-xs); margin: 0; flex: 1 1 300px; line-height: 1.55; }
.cookie-text a { color: var(--accent); text-decoration: underline; }
.cookie-actions { display: flex; gap: 0.7rem; flex: none; }
.cookie-bar .btn { padding: 0.7em 1.5em; font-size: var(--fs-xs); }
@media (max-width: 560px) {
  .cookie-bar { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0.9rem; }
  .cookie-text { flex: 0 0 auto; }            /* niente basis 300px in colonna → no vuoto verticale */
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; justify-content: center; }
}

/* pagine legali (privacy / cookie) */
.legal-page { padding-top: calc(var(--header-h) + clamp(2rem, 1rem + 4vw, 4rem)); padding-bottom: var(--section-y); }
.legal { max-width: 74ch; }
.legal .back { display: inline-flex; align-items: center; gap: 0.5em; margin-bottom: 2.4em; color: var(--text-dim); font-size: var(--fs-sm); }
.legal .back:hover { color: var(--accent); }
.legal h1 { font-size: var(--fs-h2); margin-bottom: 0.35em; }
.legal .updated { color: var(--text-faint); font-size: var(--fs-xs); margin-bottom: 2.4em; }
.legal h2 { font-size: var(--fs-h3); margin: 2em 0 0.6em; }
.legal p, .legal li { color: var(--text-dim); margin-bottom: 0.9em; }
.legal ul { padding-left: 1.2em; margin-bottom: 1em; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal strong { color: var(--text); font-weight: 500; }
.legal .ph { color: var(--accent-soft); background: rgba(176,136,60,0.14); padding: 0 0.3em; border-radius: 3px; }
.legal code { font-size: 0.9em; background: rgba(244,241,234,0.08); padding: 0.1em 0.4em; border-radius: 4px; color: var(--stone-300); }
.legal-bar { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.legal-bar .brand img { display: block; height: 24px; width: auto; }
.legal-foot { border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 3rem; color: var(--text-faint); font-size: var(--fs-xs); }
.legal-foot a { color: var(--stone-400); }
.legal-foot a:hover { color: var(--accent); }

/* ----------------------------------------------------------------------- *
 * 15. FOOTER
 * ----------------------------------------------------------------------- */
.site-footer {
  background: var(--nero);
  border-top: 1px solid var(--border);
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) 2.5rem;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 1rem + 3vw, 4rem);
  padding-bottom: clamp(2.5rem, 1.5rem + 3vw, 4rem);
  border-bottom: 1px solid var(--border);
}
.footer-brand .footer-wordmark { width: 150px; margin-bottom: 1.4rem; }
.footer-brand p { font-size: var(--fs-sm); color: var(--text-faint); max-width: 34ch; }
.footer-col h5 {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--text-faint);
  margin-bottom: 1.3rem;
}
.footer-col ul { list-style: none; display: grid; gap: 0.8rem; }
.footer-col a { font-size: var(--fs-sm); color: var(--stone-400); transition: color 0.3s; }
.footer-col a:hover { color: var(--carta); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 2rem;
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
.footer-bottom .credit a { color: var(--stone-500); }
.footer-bottom .credit a:hover { color: var(--accent); }

/* ----------------------------------------------------------------------- *
 * 16. MOBILE MENU PANEL
 * ----------------------------------------------------------------------- */
.menu-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--ink) 98%, black);
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + clamp(1.2rem, 0.8rem + 3vw, 2.6rem)) var(--gutter) clamp(2rem, 1.5rem + 3vw, 3.5rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
  overflow-y: auto;
}
body.menu-open .menu-panel { opacity: 1; visibility: visible; }

.menu-nav {
  display: grid;
  gap: clamp(0.4rem, 0.2rem + 1.1vw, 0.9rem);
  margin: auto 0;
}
.menu-nav a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 3.4vw, 2.9rem);
  color: var(--stone-300);
  line-height: 1.12;
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  transition: color 0.3s var(--ease-out);
}
.menu-nav a .mi {
  font-family: var(--font-text);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: var(--tracking-wide);
  width: 1.7em;
  flex: none;
}
.menu-nav a:hover, .menu-nav a:focus-visible { color: var(--carta); }

.menu-foot {
  display: grid;
  gap: 0.9rem;
  padding-top: clamp(1.4rem, 1rem + 2vw, 2.2rem);
  border-top: 1px solid var(--border);
}
.menu-mail {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1rem + 1vw, 1.4rem);
  color: var(--carta);
}
.menu-mail:hover { color: var(--accent); }
.menu-meta {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--text-faint);
}
.menu-meta a { color: var(--stone-400); }
.menu-meta a:hover { color: var(--accent); }

/* ----------------------------------------------------------------------- *
 * 17. REVEAL / ANIMAZIONI (gated su .js, disattivate con reduced-motion)
 * ----------------------------------------------------------------------- */
.js .reveal { opacity: 0; }
.js .reveal-up { opacity: 0; transform: translateY(28px); }
.js .reveal-clip > * { will-change: transform; }

/* fallback: senza JS o con reduced-motion tutto è visibile (gestito in JS) */
.no-anim .reveal,
.no-anim .reveal-up { opacity: 1 !important; transform: none !important; }
.no-anim .client-track { animation: none !important; }

/* ----------------------------------------------------------------------- *
 * 18. RESPONSIVE
 * ----------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .contact { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --header-h: 66px; }

  .nav-list, .nav-cta { display: none; }
  .nav-toggle { display: block; }

  /* su mobile teniamo la wordmark "Joem" (non il solo monogramma) */
  .brand .brand-wordmark { display: block; height: 24px; }
  .brand .brand-symbol { display: none; }

  .sectors { grid-template-columns: 1fr; gap: clamp(2rem, 1rem + 3vw, 3rem); }
  .sector { flex-direction: row; gap: 1.4rem; align-items: flex-start; }
  .sector-img { width: 38%; flex: none; aspect-ratio: 3/4; margin-bottom: 0; }
  .approach-cols { grid-template-columns: 1fr; gap: 1.8rem; }
}

@media (max-width: 680px) {
  .services-grid { grid-template-columns: 1fr; }
  .service { border-right: none; }

  /* portfolio: tutto a piena larghezza su mobile */
  .work { grid-column: span 12 !important; }
  .work-frame { aspect-ratio: var(--ratio-m, 4 / 5); }
  .work--wide .work-frame { aspect-ratio: 3 / 2; }

  .footer-top { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }

  /* su mobile la riga meta dell'hero verrebbe a sovrapporsi alle CTA:
     la nascondiamo (luogo e scroll sono ridondanti su schermo piccolo) */
  .hero-meta { display: none; }
  .hero { align-items: center; }
  .hero-inner { padding-bottom: clamp(2rem, 1rem + 4vw, 3rem); }
}

@media (max-width: 460px) {
  .sector { flex-direction: column; }
  .sector-img { width: 100%; aspect-ratio: 4/3; margin-bottom: 1.2rem; }
}

/* ----------------------------------------------------------------------- *
 * 19. PREFERS-REDUCED-MOTION
 * ----------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-up { opacity: 1 !important; transform: none !important; }
  .scroll-cue .line::after { animation: none !important; }
  /* niente auto-scroll: il carosello loghi diventa scorribile a dito */
  .client-track { animation: none !important; }
  .client-marquee { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .client-marquee::-webkit-scrollbar { display: none; }
  .hero-media img, .hero-media video { inset: 0; height: 100%; }
}

/* lo stesso quando il JS disattiva le animazioni (reduced-motion / fallback) */
.no-anim .client-track { animation: none; }
.no-anim .client-marquee { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.no-anim .client-marquee::-webkit-scrollbar { display: none; }

/* utility */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
