/* ==========================================================================
   Anthony Cristaldi — Portfolio
   Dark, bold, editorial. One accent colour, oversized type.
   ========================================================================== */

:root {
  --bg: #0f0e0d;
  --bg-2: #171513;
  --bg-3: #201d1a;
  --fg: #ede8e0;
  --muted: #958c80;
  --line: rgba(237, 232, 224, 0.14);
  --accent: #47b5ff;
  --accent-ink: #04131f;

  --display: "Archivo", "Helvetica Neue", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(1.1rem, 4vw, 3.5rem);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-stretch: 100%;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  width: 100%;
}
main {
  overflow-x: clip;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.mono {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.6rem 1rem; border-radius: 8px; font-weight: 700;
  transition: top 0.2s;
}
.skip:focus { top: 1rem; }

/* Grain overlay — fixed, non-interactive */
.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.95em 1.5em;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  transition: transform 0.35s var(--ease), background 0.25s, color 0.25s, border-color 0.25s;
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn--solid { background: var(--accent); color: var(--accent-ink); }
.btn--solid:hover { background: var(--fg); }
.btn--ghost { border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--fg); background: var(--fg); color: var(--bg); }
.btn--big { font-size: 1.05rem; padding: 1.15em 2em; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: 1rem var(--pad);
  transition: background 0.3s, transform 0.4s var(--ease);
}
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity 0.3s;
}
.nav.is-scrolled::before { opacity: 1; }
.nav.is-scrolled {
  background: rgba(15, 14, 13, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav__logo {
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
}
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 1.75rem; margin-left: auto; }
.nav__links a {
  font-size: 0.92rem; color: var(--muted); position: relative; transition: color 0.2s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform 0.35s var(--ease);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--fg); }
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  font-weight: 600; font-size: 0.84rem;
  white-space: nowrap; flex-shrink: 0;
  padding: 0.55rem 0.9rem; border-radius: 999px; background: var(--fg); color: var(--bg);
  transition: background 0.25s, color 0.25s;
}
.nav__cta:hover { background: var(--accent); color: var(--accent-ink); }
.nav__toggle { display: none; width: 44px; height: 44px; position: relative; }
.nav__toggle span {
  position: absolute; left: 10px; right: 10px; height: 2px; background: var(--fg);
  transition: transform 0.3s var(--ease);
}
.nav__toggle span:first-child { top: 17px; }
.nav__toggle span:last-child { top: 25px; }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 6.5rem var(--pad) 3rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(65vw 50vw at 85% 12%, rgba(71, 181, 255, 0.15), transparent 72%);
}
.hero__meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem 2rem;
  padding-bottom: 1.25rem; border-bottom: 1px solid var(--line);
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}
.status { color: var(--fg); display: inline-flex; align-items: center; gap: 0.6em; }
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: #5ed38c;
  box-shadow: 0 0 0 0 rgba(94, 211, 140, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(94, 211, 140, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(94, 211, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 211, 140, 0); }
}

.hero__title {
  margin: 0;
  font-weight: 900; font-stretch: 125%;
  text-transform: uppercase;
  font-size: var(--hero-size, 12.4vw);
  line-height: 0.84;
  letter-spacing: -0.035em;
}
.line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.word { display: inline-block; }
.hero__title .line { text-align: center; }
.line--offset { text-align: center; color: var(--accent); }

.js .hero__title .word { transform: translateY(105%); }
.is-loaded .hero__title .word { transform: none; transition: transform 1.1s var(--ease); }
.is-loaded .hero__title .line:nth-child(2) .word { transition-delay: 0.12s; }

.hero__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  align-items: end; gap: 2rem;
  margin-top: clamp(1.75rem, 4vw, 3.25rem);
}
.hero__lead {
  margin: 0; max-width: 34ch;
  font-size: clamp(1.3rem, 1rem + 1.4vw, 2.15rem);
  line-height: 1.2; font-weight: 400; letter-spacing: -0.01em;
}
.hero__lead strong { font-weight: 700; }
.hero__lead em { color: var(--accent); font-size: 1.08em; }
.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.js .hero__meta, .js .hero__bottom > * { opacity: 0; transform: translateY(18px); }
.is-loaded .hero__meta,
.is-loaded .hero__bottom > * { opacity: 1; transform: none; transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.is-loaded .hero__meta { transition-delay: 0.05s; }
.is-loaded .hero__bottom > :nth-child(1) { transition-delay: 0.45s; }
.is-loaded .hero__bottom > :nth-child(2) { transition-delay: 0.58s; }
.is-loaded .hero__bottom > :nth-child(3) { transition-delay: 0.7s; }

.badge {
  width: 132px; height: 132px; position: relative; display: grid; place-items: center;
}
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 16s linear infinite; }
.badge text { font-family: var(--mono); font-size: 15.5px; letter-spacing: 0.18em; fill: var(--fg); }
.badge__arrow {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 1.5rem; font-weight: 700;
  transition: transform 0.45s var(--ease);
}
.badge:hover .badge__arrow { transform: rotate(45deg) scale(1.08); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Marquee band ---------- */
.band {
  background: var(--accent); color: var(--accent-ink);
  transform: rotate(-1.6deg) scale(1.03);
  margin: 1.5rem 0 0;
  overflow: hidden;
  position: relative; z-index: 2;
}
.band__track {
  display: flex; gap: 2.2rem; width: max-content;
  padding: 1.05rem 0;
  font-weight: 800; font-stretch: 112%; text-transform: uppercase;
  font-size: clamp(1.25rem, 1rem + 1.5vw, 2.3rem); letter-spacing: -0.01em;
  animation: marquee 32s linear infinite;
}
.band__track b { font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Numbers ---------- */
.numbers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: clamp(4rem, 9vw, 8rem) var(--pad) 0;
  gap: 0;
}
.numbers__item {
  min-width: 0;
  container-type: inline-size;
  padding: 1.5rem 1.5rem 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.numbers__item + .numbers__item { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.numbers__value {
  font-weight: 800; font-stretch: 125%;
  font-size: clamp(1.75rem, 23cqi, 5.4rem);
  line-height: 1; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.numbers__item:last-child .numbers__value { color: var(--accent); }
.numbers__label { color: var(--muted); font-size: 0.95rem; max-width: 22ch; }

/* ---------- Section heads ---------- */
section[id] { scroll-margin-top: 4.5rem; }
.section-head {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 22rem);
  align-items: end; gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.section-head__index { align-self: start; padding-top: 0.8rem; color: var(--accent); }
.section-head__title {
  margin: 0;
  font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(2.8rem, 1rem + 7vw, 7.5rem);
  line-height: 0.88; letter-spacing: -0.04em;
}
.section-head__title em { text-transform: none; font-size: 1.04em; letter-spacing: -0.02em; color: var(--accent); }
.section-head__note { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* ---------- Work ---------- */
.work { padding: clamp(6rem, 12vw, 11rem) var(--pad) 0; }
.work__grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}
.project {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  container-type: inline-size;
}
.project--wide { grid-column: span 7; }
.project--tall { grid-column: span 5; }
.project--full { grid-column: 1 / -1; }
.project:nth-child(2) { margin-top: clamp(0rem, 8vw, 8rem); }

.project__cover {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  isolation: isolate;
}
.project--tall .project__cover { aspect-ratio: 4 / 4.4; }
.project--full .project__cover { aspect-ratio: 21 / 8; }
.project__cover > * { transition: transform 0.9s var(--ease); }
.project:hover .project__cover > *,
.project:focus-visible .project__cover > * { transform: scale(1.05); }
.project__cover::after {
  content: "Apri il caso studio"; position: absolute; left: 1rem; bottom: 1rem; z-index: 3;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--fg); color: var(--bg); padding: 0.55em 0.9em; border-radius: 999px;
  opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.4s var(--ease);
}
.project:hover .project__cover::after,
.project:focus-visible .project__cover::after { opacity: 1; transform: none; }

.project__meta {
  display: grid; grid-template-columns: 2.5rem 1fr auto auto; align-items: baseline; gap: 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.project__title {
  margin: 0; font-weight: 800; font-stretch: 115%;
  font-size: clamp(1.35rem, 1rem + 1.2vw, 2rem); letter-spacing: -0.02em; line-height: 1.1;
}
.project__tags { color: var(--muted); font-size: 0.9rem; }
.project__arrow {
  font-size: 1.4rem; color: var(--accent);
  transition: transform 0.4s var(--ease);
}
.project:hover .project__arrow { transform: rotate(45deg); }

.work__more {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.25rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
}
.work__more p { margin: 0; }

/* Works page */
.work--page { padding-top: clamp(7.5rem, 13vw, 11rem); }
.lab {
  padding: clamp(7rem, 13vw, 12rem) var(--pad) 0;
}

.lab--page {
  padding-top: clamp(7.5rem, 13vw, 11rem);
}
.lab--page .section-head {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.lab--page .section-head__note {
  grid-column: 1;
  max-width: 58ch;
}
.lab__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.lab-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  padding: clamp(1.35rem, 2.5vw, 2rem) 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.lab-item__logo {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0.65rem;
  flex-shrink: 0;
  transition: border-color 0.3s, transform 0.4s var(--ease);
}

.lab-item__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.lab-item__logo-fallback {
  font-weight: 900;
  font-stretch: 125%;
  font-size: 1.5rem;
  color: var(--accent);
}

.lab-item__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lab-item__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.lab-item__title {
  margin: 0;
  font-weight: 800;
  font-stretch: 115%;
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lab-item__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.lab-item__thumb {
  width: 68px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.lab-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (hover: hover) {
  .lab-item__thumb:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
  }
  }

.lab-item__badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28em 0.7em;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
}

.lab-item__badges { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }

.lab-item__badge--version {
  color: var(--muted);
  border-color: color-mix(in srgb, var(--line) 85%, transparent);
}

.lab-item__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  max-width: none;
}

.lab-item__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

@media (hover: hover) {
  .lab-item:hover .lab-item__logo {
    border-color: var(--accent);
    transform: translateY(-2px);
  }
}

.case__action {
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .lab-item {
    grid-template-columns: 60px minmax(0, 1fr);
    align-items: start;
  }

  .lab-item__logo {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    padding: 0.5rem;
  }

  .lab-item__actions {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0.25rem;
  }

  .lab-item__actions .btn {
    width: 100%;
    justify-content: center;
  }
}
.work__back {
  display: inline-block; margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  transition: color 0.2s;
}
.work__back:hover { color: var(--accent); }

.next {
  padding: clamp(3.5rem, 6.5vw, 6rem) var(--pad) clamp(4rem, 8vw, 7rem);
  display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem;
}
.next__title {
  margin: 0;
  font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(2.6rem, 1rem + 7vw, 8rem); line-height: 0.88; letter-spacing: -0.045em;
  max-width: 14ch;
}
.next__title em { text-transform: none; color: var(--accent); letter-spacing: -0.03em; font-size: 1.06em; }

.next--lab .next__title {
  font-size: clamp(2.1rem, 1rem + 4.8vw, 5.2rem);
  max-width: 16ch;
}

.next__sub {
  margin: -0.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.45rem);
  font-weight: 400;
}

/* Cover dei progetti */
.project__cover {
  background:
    linear-gradient(
      to top,
      rgba(15, 14, 13, 0.9) 0%,
      rgba(15, 14, 13, 0.45) 45%,
      rgba(15, 14, 13, 0.14) 100%
    ),
    var(--cover) center / cover no-repeat var(--cover-bg, #1a1816);
}
.cover-text {
  position: absolute;
  left: clamp(1rem, 2.5vw, 1.5rem);
  right: clamp(1rem, 2.5vw, 1.5rem);
  bottom: clamp(1rem, 2.5vw, 1.5rem);
  top: auto;
  translate: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #fff;
  z-index: 2;
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
@media (hover: hover) {
  .project:hover .cover-text,
  .project:focus-visible .cover-text {
    transform: translateY(-2.4rem);
  }
}
.cover-text__sub {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.25em;
  text-transform: uppercase; opacity: 0.8;
}

/* ---------- Services ---------- */
.services { padding: clamp(7rem, 13vw, 12rem) var(--pad) 0; }
.services__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-areas: "num name desc" "num name tags";
  gap: 0.75rem 1.5rem; align-items: start;
  padding: clamp(1.75rem, 3.5vw, 2.75rem) 0;
  border-bottom: 1px solid var(--line);
  position: relative; isolation: isolate;
}
.service::before {
  content: ""; position: absolute; inset: 0 calc(var(--pad) * -1); z-index: -1;
  background: var(--accent); transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.5s var(--ease);
}
.service__num { grid-area: num; padding-top: 0.6rem; transition: color 0.3s; }
.service__name {
  grid-area: name; margin: 0;
  font-weight: 800; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(1.8rem, 1rem + 3.4vw, 4.2rem); line-height: 0.95; letter-spacing: -0.035em;
  transition: transform 0.5s var(--ease);
}
.service__desc { grid-area: desc; margin: 0; color: var(--muted); max-width: 46ch; transition: color 0.3s; }
.service__tags { grid-area: tags; list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.service__tags li {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.4em 0.8em; border: 1px solid var(--line); border-radius: 999px; transition: border-color 0.3s, color 0.3s;
}
@media (hover: hover) {
  .service:hover::before { transform: scaleY(1); }
  .service:hover { color: var(--accent-ink); }
  .service:hover .service__num,
  .service:hover .service__desc { color: var(--accent-ink); }
  .service:hover .service__tags li { border-color: rgba(4, 19, 31, 0.35); }
  .service:hover .service__name { transform: translateX(0.6rem); }
}

/* ---------- Process ---------- */
.process { padding: clamp(7rem, 13vw, 12rem) var(--pad) 0; }
.process__steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: step; }
.step {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem 1.5rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.8rem; min-height: 22rem;
  transition: transform 0.45s var(--ease), border-color 0.3s, background 0.3s;
}
.step:nth-child(even) { translate: 0 2.5rem; }
.step:hover { transform: translateY(-6px); border-color: rgba(71, 181, 255, 0.55); background: var(--bg-3); }
.step__num {
  font-family: var(--serif); font-style: italic; font-size: 4.5rem; line-height: 0.8; color: var(--accent);
  margin-bottom: auto;
}
.step h3 { margin: 1.5rem 0 0; font-weight: 800; font-stretch: 120%; font-size: 1.6rem; letter-spacing: -0.02em; text-transform: uppercase; }
.step p { margin: 0; color: var(--muted); font-size: 0.96rem; }
.step__time { padding-top: 0.9rem; border-top: 1px solid var(--line); color: var(--fg); }

/* ---------- About ---------- */
.about { padding: clamp(9rem, 15vw, 14rem) var(--pad) 0; }
.about__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.about__portrait {
  aspect-ratio: 4 / 5; border-radius: var(--radius); position: sticky; top: 6rem;
  background:
    linear-gradient(200deg, rgba(71, 181, 255, 0.85), rgba(71, 181, 255, 0) 55%),
    repeating-linear-gradient(90deg, var(--bg-2) 0 2px, var(--bg-3) 2px 9px);
  display: grid; place-items: center; overflow: hidden;
}
.about__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.about__initials { font-weight: 900; font-stretch: 125%; font-size: clamp(6rem, 4rem + 9vw, 14rem); letter-spacing: -0.06em; color: var(--bg); mix-blend-mode: overlay; line-height: 1; }
.about__tag { position: absolute; left: 1rem; bottom: 1rem; color: var(--fg); }
.about__text p { margin: 0 0 1.25rem; color: var(--muted); max-width: 58ch; }
.about__text .about__big {
  color: var(--fg); max-width: 24ch;
  font-size: clamp(1.6rem, 1rem + 2.2vw, 2.9rem); line-height: 1.12; letter-spacing: -0.02em; font-weight: 500;
  margin-bottom: 2rem;
}
.about__big em { color: var(--accent); }
.quote { margin: 2.75rem 0 0; padding: 1.75rem 0 0; border-top: 1px solid var(--line); }
.quote blockquote { margin: 0 0 1rem; font-family: var(--serif); font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem); line-height: 1.3; }
.quote figcaption { color: var(--muted); font-size: 0.92rem; }
.quote figcaption strong { color: var(--fg); font-weight: 600; }

.clients { margin-top: clamp(4rem, 8vw, 7rem); border-top: 1px solid var(--line); padding-top: 1.5rem; display: grid; grid-template-columns: 14rem 1fr; gap: 1.5rem; }
.clients__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 2.25rem; }
.clients__list li { font-weight: 700; font-stretch: 112%; font-size: clamp(1.1rem, 0.9rem + 0.8vw, 1.6rem); letter-spacing: -0.02em; color: var(--muted); transition: color 0.2s; }
.clients__list li:hover { color: var(--fg); }

/* ---------- Contact ---------- */
.contact { padding: clamp(8rem, 14vw, 13rem) var(--pad) clamp(4rem, 8vw, 7rem); }
.contact__title {
  margin: 0 0 clamp(3rem, 6vw, 5rem);
  font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: min(clamp(3.2rem, 1rem + 10vw, 11.5rem), var(--contact-fit, 999rem));
  line-height: 0.86; letter-spacing: -0.045em;
}
.contact__title .line--accent em { text-transform: none; color: var(--accent); letter-spacing: -0.03em; font-size: 1.08em; }
.js .contact__title .word,
.js .contact__title em { display: inline-block; transform: translateY(105%); transition: transform 1s var(--ease); }
.contact__title.is-in .word,
.contact__title.is-in em { transform: none; }
.contact__title.is-in .line:nth-child(2) .word { transition-delay: 0.08s; }
.contact__title.is-in .line:nth-child(3) em { transition-delay: 0.16s; }

.contact__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); }
.contact__info p { margin: 0 0 2rem; color: var(--muted); max-width: 38ch; }
.contact__mail {
  display: inline-block; font-weight: 700; font-stretch: 110%;
  font-size: clamp(1.15rem, 0.9rem + 1vw, 1.65rem); letter-spacing: -0.02em;
  border-bottom: 2px solid var(--accent); padding-bottom: 0.15em; word-break: break-all;
  transition: color 0.2s;
}
.contact__mail:hover { color: var(--accent); }
.contact__social { list-style: none; margin: 2.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.contact__social a { color: var(--muted); transition: color 0.2s; }
.contact__social a:hover { color: var(--fg); }

.form {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.4rem, 3vw, 2.5rem);
  display: flex; flex-direction: column; gap: 1.6rem;
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.hidden-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { display: flex; flex-direction: column; gap: 0.5rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 0.5rem; }
.field > label { margin-bottom: 0; }
.field input, .field textarea {
  font: inherit; color: var(--fg);
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 0.6rem 0; border-radius: 0;
  transition: border-color 0.25s;
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(149, 140, 128, 0.6); }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--accent); }
.field.has-error input, .field.has-error textarea { border-bottom-color: #ff7a6a; }
.field__error { font-size: 0.82rem; color: #ff8a7a; min-height: 1.1em; }
.field__error:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 0.6em 1.05em; border-radius: 999px; border: 1px solid var(--line);
  font-size: 0.9rem; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.chip:hover span { border-color: var(--fg); }
.chip input:checked + span { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.chip:active span { transform: scale(0.96); }

.form .btn--big { align-self: flex-start; }
.form__status { margin: 0; font-size: 0.95rem; min-height: 1.4em; }
.form__status.is-ok { color: #7fe0a3; }
.form__status.is-error { color: #ff8a7a; }
.form.is-sent .field, .form.is-sent .form__row, .form.is-sent .btn { opacity: 0.4; pointer-events: none; }

/* ---------- Footer ---------- */
.footer { padding: 0 var(--pad) 1.5rem; overflow: hidden; }
.footer__big {
  display: block;
  font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: min(15.2vw, var(--footer-fit, 999rem)); line-height: 0.8; letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1px rgba(237, 232, 224, 0.22);
  margin: 0 0 1.5rem -0.04em; white-space: nowrap;
}
.footer__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.footer__row a:hover { color: var(--fg); }

/* ---------- Case study dialog ---------- */
.case {
  width: min(1100px, 100% - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--bg-2);
  color: var(--fg);
  overscroll-behavior: contain;
  overflow-x: hidden;
}

.case::backdrop { background: rgba(8, 7, 6, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.case[open] { animation: case-in 0.5s var(--ease); }
@keyframes case-in { from { opacity: 0; transform: translateY(30px) scale(0.98); } to { opacity: 1; transform: none; } }
.case__inner {
  padding: clamp(1rem, 2.5vw, 1.75rem);
  position: relative;
  min-width: 0;
}

.case__bar { position: sticky; top: 0; z-index: 5; height: 0; display: flex; justify-content: flex-end; }
.case__close {
  margin: 0.85rem 0.85rem 0 0;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--fg); color: var(--bg); font-size: 1rem; font-weight: 700;
  transition: background 0.2s, transform 0.3s var(--ease);
}
.case__close:hover { background: var(--accent); transform: rotate(90deg); }
.case__cover { border-radius: var(--radius); overflow: hidden; aspect-ratio: 21 / 9; position: relative; isolation: isolate; }
.case__cover > .project__cover { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.case__head { padding: 2rem 0 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.case__title {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  font-size: clamp(1.75rem, 1rem + 4.5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}
.case__summary { margin: 0.4rem 0 0; font-size: clamp(1.1rem, 1rem + 0.6vw, 1.45rem); max-width: none; line-height: 1.35; }
.case__facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 2rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case__facts div { padding: 1rem 1rem 1rem 0; }
.case__facts div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.case__facts dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem; }
.case__facts dd { margin: 0; font-weight: 600; }
.case__facts .is-accent dd { color: var(--accent); font-weight: 800; font-stretch: 120%; font-size: 1.35rem; letter-spacing: -0.02em; }
.case__body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.case__body h3 { margin: 0 0 0.75rem; color: var(--accent); }
.case__body p { margin: 0; color: #cfc8bd; }
.case__action {
  margin-top: 2.5rem;
  display: flex;
  justify-content: flex-end;
}
.case__action[hidden] { display: none; }
.case__nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
body.has-dialog { overflow: hidden; }

/* ---------- Case study dynamic gallery (Cornice Stabile + GPU Translate Unificato) ---------- */
.case__gallery {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.case__gallery[hidden] {
  display: none;
}

.case__slide-stage {
  position: relative;
  width: 100%;
  max-width: min(100%, 540px);
  aspect-ratio: 4 / 5;
  max-height: 78dvh;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
}

.case__slide-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
  touch-action: pan-y;
}

.case__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
}

.case__gallery-btn {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
  padding: 0;
}

.case__gallery-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.6s var(--ease);
}

@media (hover: hover) {
  .case__gallery-btn:hover img {
    transform: scale(1.02);
  }
}

.case__slide-count {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 2;
  padding: 0.45em 0.85em;
  border-radius: 999px;
  background: rgba(15, 14, 13, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  color: var(--fg);
  pointer-events: none;
}

.case__slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 14, 13, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 1.05rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.case__slide-arrow:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.case__slide-arrow--prev { left: 1rem; }
.case__slide-arrow--next { right: 1rem; }

@media (hover: none) and (pointer: coarse) {
  .case__slide-arrow {
    display: none;
  }
}

.case__slide-caption {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.3em;
}

.case__slide-caption:empty {
  display: none;
}

.case__slide-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.case__slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  transition: width 0.3s var(--ease), background 0.25s;
}

.case__slide-dot:hover {
  background: var(--muted);
}

.case__slide-dot.is-active {
  width: 24px;
  background: var(--accent);
}

/* ---------- Lightbox (GPU Translate Unificato + Loop) ---------- */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 7, 6, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fg);
  display: none;
  overflow: hidden;
}

.lightbox[open] {
  display: block;
  animation: lb-in 0.3s var(--ease);
}

.lightbox::backdrop {
  background: transparent;
}

@keyframes lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox__stage {
  margin: 0;
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

.lightbox__track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
  touch-action: pan-y;
}

.lightbox__track.is-zoomed {
  touch-action: none;
}

.lightbox__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(3.5rem, 6vw, 5rem) clamp(1rem, 4vw, 4.5rem);
}

.lightbox__slide img {
  max-width: min(1280px, 92vw);
  max-height: 82dvh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

#lightbox-count {
  position: fixed;
  left: 50%;
  bottom: clamp(1rem, 2.5vw, 1.75rem);
  transform: translateX(-50%);
  z-index: 10;
  padding: 0.45em 0.95em;
  border-radius: 999px;
  background: rgba(15, 14, 13, 0.82);
  border: 1px solid var(--line);
  color: var(--fg);
  pointer-events: none;
}

.lightbox__close,
.lightbox__nav {
  position: fixed;
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 1.15rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.lightbox__close {
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
}

.lightbox__close:hover {
  transform: rotate(90deg);
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--prev { left: clamp(0.75rem, 2.5vw, 2rem); }
.lightbox__nav--next { right: clamp(0.75rem, 2.5vw, 2rem); }
.lightbox__nav[hidden] { display: none; }

@media (hover: none) and (pointer: coarse) {
  .lightbox__nav {
    display: none;
  }
}

/* ---------- Language Switcher ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 21, 19, 0.6);
}

.lang-switch button {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35em 0.65em;
  border-radius: 999px;
  color: var(--muted);
  transition: background 0.25s, color 0.25s;
}

.lang-switch button:hover {
  color: var(--fg);
}

.lang-switch button.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.project__cover::after {
  content: attr(data-hover-label);
}

/* ---------- Privacy Consent Checkbox ---------- */
.consent {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-family: var(--display) !important;
  font-size: 0.92rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--muted) !important;
  line-height: 1.45;
}

.consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 0.18em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.consent input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.consent input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent a:hover {
  color: var(--accent);
}

/* ---------- Legal / Privacy Page ---------- */
.legal {
  padding: clamp(7.5rem, 13vw, 11rem) var(--pad) clamp(5rem, 9vw, 8rem);
  max-width: none;
}

.legal__eyebrow {
  display: block;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.legal__title {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  font-size: clamp(2.6rem, 1rem + 6vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.legal__title em {
  text-transform: none;
  color: var(--accent);
}

.legal__updated {
  margin: 1rem 0 2.5rem;
}

.legal__body {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  color: #cfc8bd;
}

.legal__body h2 {
  margin: 2rem 0 0.65rem;
  font-weight: 800;
  font-stretch: 115%;
  font-size: 1.25rem;
  color: var(--fg);
}

.legal__body h2:first-child {
  margin-top: 0;
}

.legal__body p,
.legal__body ul {
  margin: 0 0 1rem;
}

.legal__body ul {
  padding-left: 1.25rem;
}

.legal__body li {
  margin-bottom: 0.5rem;
}

.legal__body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal__body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-3);
  padding: 0.15em 0.45em;
  border-radius: 4px;
}

/* ---------- 404 Page ---------- */
.err404 {
  min-height: 82svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(7.5rem, 13vw, 11rem) var(--pad) clamp(4rem, 8vw, 7rem);
  background: radial-gradient(50vw 40vw at 80% 20%, rgba(71, 181, 255, 0.13), transparent 70%);
}

.err404__code {
  color: var(--accent);
  margin-bottom: 1rem;
}

.err404__title {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  text-transform: uppercase;
  font-size: clamp(2.8rem, 1rem + 7vw, 7.5rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  max-width: 14ch;
}

.err404__title em {
  text-transform: none;
  color: var(--accent);
}

.err404__desc {
  margin: 1.75rem 0 2.25rem;
  color: var(--muted);
  max-width: 48ch;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.3rem);
}

.err404__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero__bottom { grid-template-columns: 1fr auto; }
  .hero__actions { grid-column: 1; grid-row: 2; }
  .badge { grid-column: 2; grid-row: 1 / span 2; }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; }
  .numbers__item:nth-child(3) { padding-left: 0; border-left: 0; }
  .section-head { grid-template-columns: 3.5rem 1fr; }
  .section-head__note { grid-column: 2; }
  .process__steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(even) { translate: 0 0; }
  .service { grid-template-columns: 3.5rem 1fr; grid-template-areas: "num name" "num desc" "num tags"; }
  .case__body { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 760px) {
  .nav { gap: 1rem; }
  .lang-switch { margin-left: auto; }
  .nav__cta {
    margin-left: 0;
    padding: 0.55em 0.9em;
    font-size: 0.85rem;
  }
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; gap: 1.25rem;
    padding: var(--pad);
    background: var(--bg);
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
  }
  .nav__links a { font-size: 2.6rem; font-weight: 900; font-stretch: 125%; text-transform: uppercase; color: var(--fg); letter-spacing: -0.03em; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
  .nav.is-open { background: var(--bg); transform: none; }

  .hero { min-height: auto; justify-content: flex-start; padding-top: 5.5rem; padding-bottom: 1.5rem; }
  .hero__meta .mono:last-child { display: none; }
  .hero__bottom { grid-template-columns: 1fr; }
  .hero__actions { grid-row: auto; }
  .badge { display: none; }

  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 3rem; }
  .numbers__item { padding-right: 0.75rem; }
  .numbers__item + .numbers__item { padding-left: 0.75rem; }
  .numbers__item:nth-child(3) { padding-left: 0; }

  .work,
  .services,
  .process,
  .about,
  .contact {
    padding-top: 4.5rem;
  }

  .work--page {
    padding-top: 6rem;
  }
  .lab--page {
    padding-top: 6rem;
  }
  .lab--page .section-head__index {
  display: none;
}
  .section-head { grid-template-columns: 1fr; gap: 0.75rem; }
  .section-head__note { grid-column: 1; }
  .section-head__index { padding-top: 0; }

  .work__grid { grid-template-columns: 1fr; }
  .project--wide, .project--tall, .project--full { grid-column: auto; }
  .project:nth-child(2) { margin-top: 0; }
  .project--tall .project__cover, .project--full .project__cover { aspect-ratio: 4 / 3.4; }
  .project__meta { grid-template-columns: 2rem 1fr auto; }
  .project__tags { display: none; }

  .service { grid-template-columns: 1fr; grid-template-areas: "num" "name" "desc" "tags"; }
  .service__num { padding-top: 0; }

  .process__steps { grid-template-columns: 1fr; }
  .step { min-height: 0; }
  .step h3 { margin-top: 1rem; }

  .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .about__portrait { position: relative; top: 0; aspect-ratio: 4 / 5; }
  .about__text p:last-child { margin-bottom: 0; }
  .clients {
    grid-template-columns: 1fr;
    margin-top: 2.25rem;
    gap: 1rem;
  }

  .form__row { grid-template-columns: 1fr; }
  .form .btn--big { align-self: stretch; justify-content: center; }

  .case__facts { grid-template-columns: 1fr 1fr; }
  .case__facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .case__facts div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .case__cover { aspect-ratio: 4 / 3; }
  .case__nav .btn { padding: 0.8em 1.1em; font-size: 0.85rem; }

  .case__slide-stage {
    max-width: 100%;
    aspect-ratio: 4 / 3;
    transition: aspect-ratio 0.3s var(--ease);
  }

  .case__gallery[data-orientation="portrait"] .case__slide-stage {
    aspect-ratio: 4 / 5;
  }

  .case__gallery[data-orientation="square"] .case__slide-stage {
    aspect-ratio: 1 / 1;
  }

  .case__gallery[data-orientation="landscape"] .case__slide-stage {
    aspect-ratio: 4 / 3;
  }

  .case__gallery-btn img {
    object-fit: cover;
  }

  .lightbox__slide {
    padding: 3.5rem 0.75rem 4rem;
  }
  .lightbox__slide img {
    max-width: 94vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .band__track { animation: none; }
}

/* ---------- Mobile Floating Contact Button ---------- */
.fab-contact {
  display: none;
}

@media (max-width: 760px) {
  .fab-contact {
    position: fixed;
    right: 1.1rem;
    bottom: calc(1.1rem + env(safe-area-inset-bottom));
    z-index: 45;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .fab-contact.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
  }

  .fab-contact__btn {
    width: 48px;
    height: 48px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(15, 14, 13, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--accent);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
  }

  .fab-contact__btn:active {
    transform: scale(0.94);
  }

  .fab-contact__icon {
    display: block;
  }

  .fab-contact__close {
    display: none;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--accent);
  }

  .fab-contact.is-open .fab-contact__icon {
    display: none;
  }

  .fab-contact.is-open .fab-contact__close {
    display: block;
  }

  .fab-contact.is-open .fab-contact__btn {
    border-color: var(--accent);
    background: rgba(20, 19, 17, 0.98);
  }

  .fab-contact__menu {
    display: flex;
    flex-direction: column;
    min-width: 210px;
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(20, 19, 17, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    animation: fabPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .fab-contact__menu[hidden] {
    display: none;
  }

  .fab-contact__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.85rem;
    border-radius: 9px;
    color: var(--fg);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
  }

  .fab-contact__item:hover,
  .fab-contact__item:active {
    background: rgba(71, 181, 255, 0.12);
    color: var(--accent);
  }

  .fab-contact__item .mono {
    font-size: 0.7rem;
    color: var(--accent);
  }
}

@keyframes fabPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}