/* =========================================================
   IAMETECH — Officine meccaniche di precisione
   Design system derived from the new iamekarting.com
   (Archivo expanded uppercase display, hairline structure,
   electric-blue accent) set on an IAME navy ground built
   from one hue, #1d3660, at several opacities.
   ========================================================= */

:root {
  /* Navy ground: one brand hue, layered */
  color-scheme: dark;
  --navy: #1d3660;                 /* IAME corporate navy */
  --base: #07132a;                 /* page ground */
  --deep: #040c1d;                 /* footer, drawer */
  --n-15: rgba(29, 54, 96, .15);
  --n-30: rgba(29, 54, 96, .30);
  --n-50: rgba(29, 54, 96, .50);
  --n-75: rgba(29, 54, 96, .75);

  --text: #f3f6fb;
  --text-2: #c9d3e3;
  --muted: #8e9cb5;
  --line: rgba(160, 184, 224, .14);
  --line-2: rgba(160, 184, 224, .30);

  --blue: #1338ff;                 /* IAME electric blue (buttons, fills) */
  --blue-deep: #0a1f9e;
  --blue-hi: #7d93ff;              /* electric blue tuned for text on navy */
  --paper: #ffffff;                /* product photo tiles */

  --f-display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --f-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 64px);
  --max: 1440px;
  --header-h: 84px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--base); overflow-x: clip; }
body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 3px; }
::selection { background: var(--blue); color: #fff; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--blue); color: #fff; padding: 8px 14px; z-index: 200; }
.skip:focus { left: 8px; }

/* ---------- Type scale ---------- */
.display, h1, h2, h3, .eyebrow, .nav a, .btn, .link { font-family: var(--f-display); }
.display-xl {
  font-family: var(--f-display); font-stretch: 125%; font-weight: 800; text-transform: uppercase;
  font-size: clamp(44px, 9.6vw, 156px); line-height: .86; letter-spacing: -.01em; margin: 0; text-wrap: balance;
}
h1, .h1 {
  font-stretch: 118%; font-weight: 800; text-transform: uppercase;
  font-size: clamp(40px, 6.4vw, 96px); line-height: .92; letter-spacing: -.005em; margin: 0; text-wrap: balance;
}
h2, .h2 {
  font-stretch: 115%; font-weight: 700; text-transform: uppercase;
  font-size: clamp(30px, 4.2vw, 60px); line-height: .95; margin: 0; text-wrap: balance;
}
h3, .h3 {
  font-stretch: 110%; font-weight: 700; text-transform: uppercase;
  font-size: clamp(19px, 1.6vw, 24px); line-height: 1.1; margin: 0; letter-spacing: .01em;
}
h1, .h1, h2, .h2, .display-xl { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; font-stretch: 110%;
  color: var(--muted); margin: 0;
}
.eyebrow--blue { color: var(--blue-hi); }
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; max-width: 60ch; margin: 0; color: var(--text-2); }
p { margin: 0; max-width: 68ch; color: var(--text-2); }
strong { color: var(--text); font-weight: 600; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.accent { color: var(--blue-hi); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 10vw, 160px); position: relative; }
.section--tight { padding-block: clamp(56px, 7vw, 104px); }
/* navy layers: same hue, increasing opacity over the page ground */
.section--n1 { background: var(--n-15); }
.section--n2 { background: var(--n-30); }
.section--n3 { background: var(--n-50); }
.section--n4 { background: var(--navy); }
.section--deep { background: var(--deep); }
.section + .section--rule { border-top: 1px solid var(--line); }
.stack { display: grid; gap: 24px; }
.stack-sm { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: clamp(32px, 4vw, 56px); }
.split {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px); align-items: end;
}
.split > .col-l { grid-column: 1 / span 7; min-width: 0; }
.split > .col-r { grid-column: 8 / span 5; min-width: 0; }
.split--top { align-items: start; }
.split--even > .col-l { grid-column: 1 / span 6; }
.split--even > .col-r { grid-column: 7 / span 6; }
@media (max-width: 860px) { .split > .col-l, .split > .col-r { grid-column: 1 / -1 !important; } }
.prose { display: grid; gap: 18px; }
.prose p { max-width: 68ch; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 28px;
  font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-stretch: 112%;
  border: 1px solid currentColor;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.btn--solid { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn--solid:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn--ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.btn--ghost:hover { background: #fff; border-color: #fff; color: var(--base); }
.link {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-stretch: 112%;
  padding-bottom: 6px;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: background-size .45s var(--ease), color .3s;
}
.link:hover { background-size: 30% 1px; }
.link--blue { color: var(--blue-hi); }
.arrow { width: 22px; height: 10px; flex: none; transition: transform .35s var(--ease); }
.link:hover .arrow, .btn:hover .arrow, a:hover > .arrow { transform: translateX(5px); }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding-top: env(safe-area-inset-top, 0px); color: #fff;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), transform .4s var(--ease);
}
.header__bar {
  height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter);
}
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(4,12,29,.6), rgba(4,12,29,0)); transition: opacity .4s;
}
.header.is-solid, .header--solid {
  background: rgba(7,19,42,.88); box-shadow: 0 1px 0 var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
}
.header.is-solid::before, .header--solid::before { opacity: 0; }
.header.is-hidden { transform: translateY(-100%); }
.logo { display: block; }
.logo img { height: 46px; width: auto; display: block; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 14px; justify-self: start;
  font-family: var(--f-display); font-size: 12px; font-weight: 700; letter-spacing: .22em; font-stretch: 112%; text-transform: uppercase;
  height: 44px;
}
.burger { width: 26px; height: 12px; position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; }
.burger::before { top: 0; }
.burger::after { top: 10px; }
.nav { justify-self: end; display: flex; gap: clamp(16px, 2.2vw, 36px); align-items: center; }
.nav a { font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-stretch: 110%; position: relative; padding-block: 6px; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav .nav__cta { padding: 0 16px; height: 38px; display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.45); transition: background .3s, border-color .3s; }
.nav .nav__cta::after { display: none; }
.nav .nav__cta:hover { background: var(--blue); border-color: var(--blue); }
@media (max-width: 860px) {
  .nav a:not(.nav__keep) { display: none; }
  .menu-btn .menu-btn__label { display: none; }
  .logo img { height: 34px; }
}
.nav__cta { white-space: nowrap; }
@media (max-width: 860px) { .nav .lang > a { display: inline; } }
@media (max-width: 520px) {
  .nav .lang { display: none; }
  .nav .nav__cta { padding: 0 10px; letter-spacing: .12em; font-size: 11px; }
}

/* ---------- Language switch ---------- */
.lang { display: inline-flex; align-items: center; gap: 0; font-family: var(--f-display); font-size: 12px; font-weight: 700; letter-spacing: .18em; font-stretch: 110%; }
.lang > * { padding: 6px 8px; line-height: 1; }
.lang > span[aria-current] { color: #fff; }
.lang > a { color: var(--muted); border-left: 1px solid var(--line-2); transition: color .25s; }
.lang > a:hover { color: #fff; }
.nav .lang { padding-block: 0; }
.nav .lang a::after { display: none; }

/* ---------- Full-screen menu ---------- */
.drawer {
  position: fixed; inset: 0; z-index: 150;
  background:
    radial-gradient(90% 70% at 100% 100%, rgba(29,54,96,.55), transparent 70%),
    var(--deep);
  color: #fff;
  display: grid; grid-template-rows: auto 1fr auto;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  clip-path: inset(0 0 100% 0); transition: clip-path .7s var(--ease); visibility: hidden;
}
.drawer.is-open { clip-path: inset(0 0 0 0); visibility: visible; }
.drawer__top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; max-width: var(--max); width: 100%; margin-inline: auto; padding-inline: var(--gutter); }
.drawer__top img { height: 30px; width: auto; }
.drawer__body {
  max-width: var(--max); width: 100%; margin-inline: auto; padding-inline: var(--gutter);
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 48px; align-content: center; overflow-y: auto;
}
.drawer__main { display: grid; gap: 4px; }
.drawer__main a {
  font-family: var(--f-display); font-stretch: 122%; font-weight: 800; text-transform: uppercase;
  font-size: clamp(32px, 5vw, 68px); line-height: 1.04;
  color: #55648a; transition: color .3s, padding-left .45s var(--ease);
}
.drawer__main a:hover, .drawer__main a[aria-current="page"] { color: #fff; padding-left: 14px; }
.drawer__side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; align-content: start; }
.drawer__side h4 { margin: 0 0 10px; font-family: var(--f-display); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.drawer__side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.drawer__side a { font-size: 16px; color: #dfe5ef; }
.drawer__side a:hover, .drawer__side a[aria-current="page"] { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.drawer__foot { max-width: var(--max); width: 100%; margin-inline: auto; padding: 24px var(--gutter); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.close-btn { display: inline-flex; align-items: center; gap: 12px; height: 44px; font-family: var(--f-display); font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.close-btn svg { width: 20px; height: 20px; }
@media (max-width: 860px) {
  .drawer__body { grid-template-columns: 1fr; align-content: start; padding-top: 16px; gap: 36px; }
}
@media (max-width: 420px) { .drawer__side { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: min(100svh, 1000px);
  display: flex; align-items: flex-end;
  color: #fff; background: var(--deep); overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__media img:only-child { transform: scale(1.06); animation: heroZoom 9s var(--ease) forwards; }
/* home: four workshop photos crossfading */
.hero__media--fade img { opacity: 0; animation: heroFade 24s infinite; }
.hero__media--fade img:nth-child(1) { animation-delay: 0s; }
.hero__media--fade img:nth-child(2) { animation-delay: 6s; }
.hero__media--fade img:nth-child(3) { animation-delay: 12s; }
.hero__media--fade img:nth-child(4) { animation-delay: 18s; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(0deg, rgba(7,19,42,.96) 0%, rgba(7,19,42,.35) 50%, rgba(7,19,42,.45) 100%),
    linear-gradient(90deg, rgba(7,19,42,.55), rgba(7,19,42,0) 60%),
    radial-gradient(120% 70% at 85% 100%, rgba(19,56,255,.28), transparent 60%);
}
.hero__inner { width: 100%; max-width: var(--max); margin-inline: auto; padding: calc(var(--header-h) + 64px) var(--gutter) clamp(40px, 6vw, 88px); display: grid; gap: clamp(24px, 3vw, 40px); }
.hero__inner > * { min-width: 0; }
.hero__meta { display: flex; gap: 32px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.hero__meta p { color: #dfe5ef; max-width: 48ch; font-size: 18px; }
.hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__scroll { position: absolute; right: var(--gutter); top: 50%; writing-mode: vertical-rl; font-family: var(--f-display); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: #c9d3e3; display: flex; align-items: center; gap: 14px; }
.hero__scroll::after { content: ""; width: 1px; height: 64px; background: linear-gradient(#fff, transparent); animation: drip 2.4s infinite; }
@media (max-width: 860px) { .hero__scroll { display: none; } }
.hero--page { min-height: clamp(480px, 74svh, 780px); }
.hero--compact { min-height: auto; background: var(--base); }
.hero--compact::after { background: radial-gradient(70% 120% at 100% 0%, rgba(29,54,96,.7), transparent 70%); }
.hero--compact .hero__inner { padding-top: calc(var(--header-h) + clamp(56px, 8vw, 120px)); padding-bottom: clamp(40px, 5vw, 72px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--f-display); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.crumbs a:hover { color: #fff; }
.crumbs span[aria-hidden] { opacity: .5; }
@keyframes heroZoom { to { transform: scale(1); } }
@keyframes heroFade { 0% { opacity: 0; transform: scale(1.08); } 4% { opacity: 1; } 25% { opacity: 1; } 30% { opacity: 0; transform: scale(1); } 100% { opacity: 0; } }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.rise { animation: rise 1s var(--ease) both; }
.rise-2 { animation-delay: .12s; }
.rise-3 { animation-delay: .24s; }
@keyframes rise { from { transform: translateY(24px); opacity: .001; } to { transform: none; opacity: 1; } }

/* ---------- Stats band ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.stat { padding: 32px 24px 8px; display: grid; gap: 6px; border-right: 1px solid var(--line); align-content: start; }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat__n { font-family: var(--f-display); font-stretch: 125%; font-weight: 800; font-size: clamp(40px, 4.6vw, 76px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
.stat__n small { font-size: .36em; letter-spacing: .04em; color: var(--blue-hi); margin-left: 4px; font-weight: 700; }
.stat__l { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding-left: 0; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
}

/* ---------- Process cards (lavorazioni) ---------- */
.procs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); }
.proc { position: relative; isolation: isolate; min-height: 460px; display: flex; align-items: flex-end; overflow: hidden; background: var(--deep); }
.proc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .55; filter: saturate(.6); transition: transform 1.2s var(--ease), opacity .6s; }
.proc::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(4,12,29,.95) 10%, rgba(4,12,29,.25) 70%); }
.proc:hover img { transform: scale(1.06); opacity: .8; }
.proc__body { padding: 24px; display: grid; gap: 12px; width: 100%; }
.proc__n { font-family: var(--f-mono); font-size: 12px; color: var(--blue-hi); }
.proc__body p { font-size: 14px; line-height: 1.5; color: #c9d3e3; }
.proc .arrow { color: #fff; }
@media (max-width: 1100px) { .procs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .proc { min-height: 380px; } }
@media (max-width: 700px) { .procs { grid-template-columns: 1fr; } .proc { min-height: 300px; } }

/* ---------- Index list (servizi, menu-like rows) ---------- */
.rows { display: grid; border-top: 1px solid var(--line-2); }
.row { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.2fr) 32px; gap: 24px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--line); transition: padding .35s var(--ease), background .3s; }
.row:hover { padding-inline: 16px; background: var(--n-30); }
.row__n { font-family: var(--f-mono); color: var(--blue-hi); font-size: 14px; }
.row h3 { font-size: clamp(20px, 2vw, 28px); }
.row p { font-size: 15px; color: var(--muted); }
.row .arrow { justify-self: end; }
@media (max-width: 760px) { .row { grid-template-columns: 40px minmax(0, 1fr) 24px; } .row p { grid-column: 2 / -1; grid-row: 2; } }

/* ---------- Values / principles ---------- */
.values { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.value { padding: 28px 22px 0 0; display: grid; gap: 10px; align-content: start; }
.value + .value { padding-left: 22px; border-left: 1px solid var(--line); }
.value b { font-family: var(--f-mono); font-weight: 400; font-size: 13px; color: var(--blue-hi); }
.value h3 { font-size: clamp(17px, 1.4vw, 21px); }
.value p { font-size: 15px; }
@media (max-width: 1100px) { .values { grid-template-columns: repeat(2, minmax(0, 1fr)); } .value, .value + .value { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); } .value:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--line); } }
@media (max-width: 640px) { .values { grid-template-columns: 1fr; } .value:nth-child(even) { padding-left: 0; border-left: 0; } }

/* ---------- Rail (production parts) ---------- */
.rail-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.rail-ctrl { display: flex; gap: 8px; }
.rail-ctrl button { width: 52px; height: 52px; border: 1px solid var(--line-2); display: grid; place-items: center; transition: background .3s, color .3s, border-color .3s; }
.rail-ctrl button:hover:not(:disabled) { background: #fff; color: var(--base); border-color: #fff; }
.rail-ctrl button:disabled { opacity: .35; cursor: default; }
.rail-ctrl svg { width: 20px; height: 20px; }
.rail {
  display: grid; grid-auto-flow: column; --n: 5;
  grid-auto-columns: calc((min(100vw, var(--max)) - 2 * var(--gutter) - (var(--n) - 1) * 16px) / var(--n));
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.rail::-webkit-scrollbar { display: none; }
.rail-progress { height: 2px; background: var(--line); margin-top: 24px; position: relative; overflow: hidden; }
.rail-progress span { position: absolute; left: 0; top: 0; bottom: 0; width: 30%; background: #fff; transition: transform .2s linear; }
@media (max-width: 1100px) { .rail { --n: 4; } }
@media (max-width: 860px) { .rail { --n: 2; } }
@media (max-width: 520px) { .rail { grid-auto-columns: 72%; } }

.part { scroll-snap-align: start; display: grid; gap: 10px; }
.part__img { background: var(--paper); aspect-ratio: 1; overflow: hidden; }
.part__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.part:hover .part__img img { transform: scale(1.06); }
.part__ref { font-family: var(--f-mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; }

/* ---------- Production grid ---------- */
.parts-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.parts-grid .part button { display: block; width: 100%; padding: 0; text-align: left; }
@media (max-width: 1100px) { .parts-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .parts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .parts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 180; background: rgba(4,12,29,.94); display: grid; grid-template-rows: auto 1fr auto; padding: 16px var(--gutter) 24px; }
.lightbox__top { display: flex; justify-content: space-between; align-items: center; height: 56px; color: var(--muted); font-family: var(--f-mono); font-size: 13px; }
.lightbox figure { margin: 0; display: grid; place-items: center; min-height: 0; }
.lightbox img { max-height: 100%; max-width: min(100%, 900px); width: auto; height: auto; background: #fff; object-fit: contain; }
.lightbox__nav { display: flex; justify-content: center; gap: 8px; padding-top: 16px; }
.lightbox__nav button, .lightbox__top button { width: 52px; height: 52px; border: 1px solid var(--line-2); display: grid; place-items: center; color: #fff; }
.lightbox__nav button:hover, .lightbox__top button:hover { background: #fff; color: var(--base); }
.lightbox svg { width: 20px; height: 20px; }

/* ---------- Tiles (two-up editorial links) ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; background: var(--line); }
.tile { position: relative; isolation: isolate; min-height: 560px; display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: var(--deep); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s var(--ease); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(4,12,29,.94), rgba(4,12,29,.1) 65%); }
.tile:hover img { transform: scale(1.05); }
.tile__body { padding: clamp(28px, 4vw, 56px); display: grid; gap: 16px; }
.tile__body p { color: #d8dfea; max-width: 42ch; }
.tile h2 { font-size: clamp(28px, 3.3vw, 48px); }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr; } .tile { min-height: 440px; } }

/* ---------- Sector grid ---------- */
.sectors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.sector { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 24px; display: grid; gap: 12px; align-content: start; min-height: 150px; transition: background .3s; }
.sector:hover { background: var(--n-50); }
.sector__n { font-family: var(--f-mono); font-size: 12px; color: var(--blue-hi); }
.sector h3 { font-size: 17px; letter-spacing: .04em; }
.sector p { font-size: 14px; line-height: 1.55; color: var(--muted); }
@media (max-width: 1100px) { .sectors { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sectors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .sectors { grid-template-columns: 1fr; } .sector { min-height: 0; } }

/* sector ticker on home */
.ticker { overflow: hidden; border-block: 1px solid var(--line); padding-block: 22px; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker__track { display: flex; gap: 48px; width: max-content; animation: tick 60s linear infinite; }
.ticker__track span { font-family: var(--f-display); font-stretch: 122%; font-weight: 800; text-transform: uppercase; font-size: clamp(24px, 3vw, 44px); line-height: 1; color: #55648a; white-space: nowrap; display: inline-flex; align-items: center; gap: 48px; }
.ticker__track span::after { content: ""; width: 10px; height: 10px; background: var(--blue); flex: none; }
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- Spec lists / columns ---------- */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); }
.col { background: var(--base); padding: clamp(24px, 3vw, 40px); display: grid; gap: 18px; align-content: start; }
.section--n1 .col, .section--n2 .col { background: #0b1933; }
.col__n { font-family: var(--f-mono); font-size: 12px; color: var(--blue-hi); }
@media (max-width: 960px) { .cols { grid-template-columns: 1fr; } }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; }
.ticks li { padding: 13px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; color: var(--text-2); font-size: 16px; }
.ticks li::before { content: ""; width: 8px; height: 8px; margin-top: 9px; background: var(--blue); }
.ticks li b { color: #fff; font-weight: 600; }
.ticks--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
@media (max-width: 760px) { .ticks--2 { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; font-family: var(--f-display); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--line-2); color: #e6ebf3; white-space: nowrap; transition: all .25s; }
a.chip:hover { background: #fff; color: var(--base); border-color: #fff; }
.chip small { font-family: var(--f-mono); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 8px; }

/* ---------- Feature (image + text) ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 88px); align-items: center; }
.feature--rev .feature__media { order: 2; }
.feature__media { margin: 0; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--deep); }
.feature__media img { width: 100%; height: 100%; object-fit: cover; }
.feature__media::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.feature__media--contain { background: transparent; aspect-ratio: auto; }
.feature__media--contain img { object-fit: contain; height: auto; }
.feature__media--contain::after { display: none; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature--rev .feature__media { order: 0; } }

/* ---------- Gallery (workshop) ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.gallery figure { margin: 0; aspect-ratio: 3 / 2; overflow: hidden; background: var(--deep); }
.gallery { grid-auto-flow: dense; }
.gallery figure:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery figure:nth-child(12) { grid-column: span 2; aspect-ratio: 3 / 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.gallery figure:hover img { transform: scale(1.05); }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Mission / Vision ---------- */
.mv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); }
.mv article { background: #0b1933; padding: clamp(28px, 4vw, 64px); display: grid; gap: 22px; align-content: start; }
.mv .big { font-family: var(--f-display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: clamp(56px, 8vw, 120px); line-height: .82; letter-spacing: -.02em; color: transparent; -webkit-text-stroke: 1px var(--blue-hi); margin: 0; }
@media (max-width: 860px) { .mv { grid-template-columns: 1fr; } }

/* ---------- Big quote ---------- */
.quote { font-family: var(--f-display); font-stretch: 122%; font-weight: 800; text-transform: uppercase; font-size: clamp(34px, 5.4vw, 84px); line-height: .94; margin: 0; max-width: 18ch; text-wrap: balance; }
.quote em { font-style: normal; color: var(--blue-hi); }

/* ---------- Detail page (lavorazione / servizio) ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 96px); }
.detail__aside { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; display: grid; gap: 24px; }
.detail__aside nav { display: grid; border-top: 1px solid var(--line-2); }
.detail__aside nav a { display: grid; grid-template-columns: 32px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); font-family: var(--f-display); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); transition: color .25s, padding .35s var(--ease); }
.detail__aside nav a span { font-family: var(--f-mono); font-weight: 400; letter-spacing: 0; color: inherit; opacity: .7; }
.detail__aside nav a:hover { color: #fff; padding-left: 6px; }
.detail__aside nav a[aria-current="page"] { color: #fff; }
.detail__aside nav a[aria-current="page"] span { color: var(--blue-hi); opacity: 1; }
.detail__main { display: grid; gap: clamp(48px, 6vw, 88px); min-width: 0; }
.block { display: grid; gap: 20px; }
.block__head { display: flex; gap: 16px; align-items: baseline; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.block__head .mono { color: var(--blue-hi); font-size: 13px; }
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.grades div { padding: 18px 16px 0 0; display: grid; gap: 6px; }
.grades b { font-family: var(--f-display); font-stretch: 122%; font-weight: 800; font-size: clamp(28px, 3vw, 44px); line-height: 1; color: #fff; }
.grades span { font-size: 14px; color: var(--muted); }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } .detail__aside { position: static; } .detail__aside nav { display: none; } }
@media (max-width: 640px) { .grades { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; } }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; background: var(--line); border-block: 1px solid var(--line); }
.pager a { background: var(--base); padding: clamp(28px, 4vw, 56px) var(--gutter); display: grid; gap: 10px; transition: background .3s; }
.pager a:hover { background: var(--n-50); }
.pager a:last-child { text-align: right; justify-items: end; }
.pager .h2 { font-size: clamp(24px, 3vw, 44px); }

/* ---------- CTA band ---------- */
.cta { position: relative; overflow: hidden; background: var(--navy); }
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 140% at 100% 100%, rgba(19,56,255,.45), transparent 60%); pointer-events: none; }
.cta__inner { position: relative; display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 32px; align-items: end; }
.cta__inner > :last-child { justify-self: end; }
@media (max-width: 860px) { .cta__inner { grid-template-columns: 1fr; } .cta__inner > :last-child { justify-self: start; } }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); }
.contact dl { margin: 0; display: grid; gap: 28px; align-content: start; }
.contact dt { font-family: var(--f-display); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.contact dd { margin: 0; font-size: 19px; color: #fff; }
.contact dd a { border-bottom: 1px solid var(--line-2); transition: color .25s, border-color .25s; }
.contact dd a:hover { border-color: var(--blue-hi); color: var(--blue-hi); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
.field { display: grid; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--f-display); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 17px; color: #fff;
  border: 0; border-bottom: 1px solid var(--line-2); background: transparent; padding: 10px 0; border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.field select option { color: #000; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--blue-hi); box-shadow: 0 1px 0 var(--blue-hi); }
.check { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check a { text-decoration: underline; text-underline-offset: 3px; }
.check input { margin-top: 4px; accent-color: var(--blue); }
.hp { position: absolute; left: -9999px; }
.notice { grid-column: 1 / -1; padding: 16px 20px; border-left: 3px solid var(--blue); background: var(--n-50); font-size: 15px; }
.map { aspect-ratio: 16 / 7; width: 100%; border: 0; display: block; filter: grayscale(1) invert(.92) hue-rotate(185deg) saturate(.6) brightness(.9); }
@media (max-width: 860px) { .contact, .form { grid-template-columns: 1fr; } .map { aspect-ratio: 4 / 3; } }

/* ---------- Legal ---------- */
.legal { display: grid; gap: clamp(40px, 6vw, 80px); max-width: 76ch; }
.legal__block { display: grid; gap: 16px; scroll-margin-top: calc(var(--header-h) + 16px); }
.legal__block a:not(.link) { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Group band (IAME) ---------- */
.group { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(24px, 4vw, 64px); align-items: center; }
.group img { height: 52px; width: auto; }
@media (max-width: 760px) { .group { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer { background: var(--deep); color: #b9c3d4; padding-top: clamp(64px, 8vw, 112px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer__top { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2fr)); gap: 40px; padding-bottom: 64px; border-bottom: 1px solid var(--line); }
.footer__logo { height: 64px; width: auto; }
.footer__claim { font-family: var(--f-display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: clamp(26px, 2.8vw, 40px); line-height: .95; color: #fff; margin-top: 28px; max-width: 14ch; }
.footer__group { display: flex; align-items: center; gap: 12px; margin-top: 28px; font-family: var(--f-display); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.footer__group img { height: 18px; width: auto; }
.footer h4 { margin: 0 0 18px; font-family: var(--f-display); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.footer a:hover { color: #fff; }
.footer address { font-style: normal; font-size: 15px; line-height: 1.7; }
.footer__legal { padding-block: 28px; font-size: 12px; line-height: 1.7; color: #76839b; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__legal p { max-width: 90ch; color: inherit; }
.footer__legal nav { display: flex; gap: 20px; flex-wrap: wrap; }
@media (max-width: 960px) { .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer__top > :first-child { grid-column: 1 / -1; } }

/* ---------- Reveal on scroll (visible without JS) ---------- */
.js .reveal { transform: translateY(32px); opacity: .001; transition: transform 1s var(--ease), opacity 1s var(--ease); }
.js .reveal.is-in { transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { transform: none; opacity: 1; }
  .hero__media--fade img:first-child { opacity: 1; }
}
@media (max-width: 480px) {
  h1, .h1 { font-size: clamp(34px, 10vw, 44px); }
}
