/* ==========================================================================
   MACINA LAB | Foglio di stile (basato sul tema Sheila, Homepage 01)
   Part 1: shared base + Homepage 01 (dark editorial, <body class="home-01">)
   Part 2: Homepage 02 overrides (blue + coral, <body class="home-02">)
   Part 3: Homepage 03 overrides (mist + forest green, <body class="home-03">)
   Order follows the page: tokens, base, shared parts, then section by section.
   ========================================================================== */


/* --------------------------------------------------------------------------
   CSS: Design tokens (colours, font, spacing)
   Dark is the default. Add .section--light to any section to flip the colours.
   -------------------------------------------------------------------------- */
:root {
  --night: #090a12;          /* deep indigo-black, echoes the hero artwork */
  --night-2: #121320;        /* raised dark surface (popup, image frames) */
  --ivory: #ebe9e3;          /* pearl, used for light sections and text on dark */
  --champagne: #ffe906;      /* accent on dark */
  --bronze: #6b5a00;         /* accent on light (better contrast) */

  --font: "Space Grotesk", system-ui, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-space: clamp(5rem, 11vw, 10rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Context colours, these change inside .section--light */
  --bg: var(--night);
  --fg: var(--ivory);
  --on-fg: var(--night);
  --muted: rgba(235, 233, 227, 0.7);
  --line: rgba(235, 233, 227, 0.16);
  --acc: var(--champagne);

  /* Soft colour glows painted on section backgrounds (see .section) */
  --glow: rgba(255, 233, 6, 0.10);       /* indigo glow, top right */
  --glow-2: rgba(255, 233, 6, 0.05);  /* champagne glow, bottom left */
}

.section--light {
  --bg: var(--ivory);
  --fg: var(--night);
  --on-fg: var(--ivory);
  --muted: #55524b;
  --line: rgba(9, 10, 18, 0.18);
  --acc: var(--bronze);
  --glow: rgba(255, 233, 6, 0.28);    /* warm glow, top right */
  --glow-2: rgba(9, 10, 18, 0.05);    /* faint indigo, bottom left */
}



/* --------------------------------------------------------------------------
   CSS: Base / reset
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  font-family: var(--font); background: var(--night); color: var(--ivory);
  font-size: 1rem; line-height: 1.7; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; margin: 0; }
::selection { background: var(--champagne); color: var(--night); }

/* Very fine film grain over the whole page. It ignores clicks and sits under the preloader. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9000; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

:focus-visible { outline: 2px solid var(--champagne); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}



/* --------------------------------------------------------------------------
   CSS: Type scale (display, h2, h3, lead text)
   -------------------------------------------------------------------------- */
.display-title {
  font-weight: 300; font-size: clamp(3rem, 8vw, 8.5rem);
  line-height: 0.95; letter-spacing: -0.05em; margin: 0;
}
.display-title--sm { font-size: clamp(2.6rem, 6vw, 5.6rem); margin-bottom: 1.5rem; }

.h2-title {
  font-weight: 300; font-size: clamp(2.2rem, 4.8vw, 4.4rem);
  line-height: 1.02; letter-spacing: -0.04em; margin: 0 0 1.5rem;
}
.h3-title { font-weight: 400; font-size: clamp(1.4rem, 2.2vw, 2rem); line-height: 1.15; letter-spacing: -0.03em; margin: 0; }
.lead-copy { font-size: 1.1rem; color: var(--muted); max-width: 32rem; }

/* JS wraps each word in .w so it can slide up from behind a mask */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.w > span { display: inline-block; will-change: transform; }



/* --------------------------------------------------------------------------
   CSS: Shared layout helpers (wrap, sections, media frames, plus icon)
   -------------------------------------------------------------------------- */
.wrap { padding-inline: var(--gutter); max-width: 1720px; margin-inline: auto; }

.section {
  padding-block: var(--section-space); color: var(--fg);
  background:
    radial-gradient(60rem 38rem at 92% -8%, var(--glow), transparent 65%),
    radial-gradient(50rem 32rem at 0% 108%, var(--glow-2), transparent 60%),
    var(--bg);
}

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 3rem; }
.section-head__note { color: var(--muted); max-width: 20rem; margin: 0 0 1.5rem; }
.sample-tag { font-size: 0.8rem; color: var(--muted); margin-bottom: 2rem; }

/* Image frame: crops the image and hides overflow while it moves or scales */
.media { position: relative; overflow: hidden; background: var(--night-2); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--wide { aspect-ratio: 16 / 10; }
.media--tall { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1 / 1; }
.media--portrait { aspect-ratio: 4 / 5; }
.media.is-broken img { display: none; }   /* image failed: the dark frame stays */

/* Round "+" badge that tells people a card opens a popup */
.plus {
  position: absolute; right: 1rem; bottom: 1rem; width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--ivory); color: var(--night); font-size: 1.1rem;
  transition: transform 0.6s var(--ease), background 0.4s;
}
.plus--sm { width: 2.4rem; height: 2.4rem; font-size: 0.9rem; }
a:hover .plus { transform: rotate(90deg); background: var(--champagne); }



/* --------------------------------------------------------------------------
   CSS: Buttons and links
   -------------------------------------------------------------------------- */
.btn-pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3rem;
  padding: 0.75rem 1.8rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: 0.95rem; cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn-pill--accent { background: var(--champagne); color: var(--night); }
.btn-pill--accent:hover { background: var(--ivory); }
.btn-pill--line { border-color: rgba(235, 233, 227, 0.5); color: var(--ivory); }
.btn-pill--line:hover { background: var(--ivory); color: var(--night); }
.btn-pill--primary { background: var(--fg); color: var(--on-fg); }
.btn-pill--primary:hover { background: var(--acc); color: #fff; }

.text-link { position: relative; font-weight: 500; padding-bottom: 0.2rem; }
.text-link::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: currentColor; transform-origin: right; transition: transform 0.5s var(--ease);
}
.text-link:hover::after { transform: scaleX(0.35); }



/* --------------------------------------------------------------------------
   CSS: Section 01, Preloader
   -------------------------------------------------------------------------- */
.preloader {
  position: fixed; inset: 0; z-index: 9999; background: var(--night); color: var(--ivory);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem;
}
.preloader__word { font-size: clamp(3.5rem, 13vw, 10rem); font-weight: 300; line-height: 1; letter-spacing: -0.06em; }
.preloader__count { font-size: 0.9rem; font-variant-numeric: tabular-nums; color: var(--champagne); }
.preloader__bar { width: min(16rem, 60vw); height: 1px; background: rgba(255, 255, 255, 0.2); }
.preloader__bar span { display: block; height: 100%; background: var(--champagne); transform: scaleX(0); transform-origin: left; }



/* --------------------------------------------------------------------------
   CSS: Section 02, Navigation (desktop row + mobile full screen panel)
   The blurred background lives on ::before. Putting backdrop-filter directly
   on the header would trap the fixed mobile panel inside the header height.
   -------------------------------------------------------------------------- */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; color: var(--ivory); }
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(9, 10, 18, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(235, 233, 227, 0.1); opacity: 0; transition: opacity 0.4s;
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header .navbar { transition: padding 0.4s var(--ease); }
.site-header.is-scrolled .navbar { padding-block: 0.7rem; }   /* slimmer once the page has scrolled */

.site-header .navbar { padding-block: 1.1rem; }
.brand { font-size: 1.9rem; font-weight: 500; line-height: 1; letter-spacing: -0.06em; position: relative; z-index: 1002; color: var(--ivory); }
.brand:hover { color: var(--champagne); }

.nav-panel { display: flex; align-items: center; margin-left: auto; }   /* menu and button sit on the right */
.nav-link { color: var(--ivory); font-weight: 500; font-size: 0.9rem; position: relative; padding: 0.4rem 0.75rem !important; }
.nav-link:hover, .nav-link.is-active { color: var(--champagne); }
.nav-link small { display: none; }   /* numbers only show in the mobile panel */
.nav-link::after {
  content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.1rem; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

/* Small laptops: tighter spacing so the 7 links and the button always fit on one row */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .nav-link { padding: 0.4rem 0.5rem !important; font-size: 0.85rem; }
  .nav-link::after { left: 0.5rem; right: 0.5rem; }
}

/* Menu button: the word "Menu" and a two line icon that becomes a cross */
.menu-toggle { position: relative; z-index: 1002; display: flex; align-items: center; gap: 0.7rem; border: 0; background: none; padding: 0.4rem 0; color: var(--ivory); font-weight: 500; font-size: 0.9rem; }
.menu-toggle__icon { position: relative; width: 1.6rem; height: 1rem; }
.menu-toggle__icon i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform 0.5s var(--ease), top 0.5s var(--ease); }
.menu-toggle__icon i:nth-child(1) { top: 0.1rem; }
.menu-toggle__icon i:nth-child(2) { top: 0.7rem; }
.menu-open .menu-toggle__icon i:nth-child(1) { top: 0.4rem; transform: rotate(45deg); }
.menu-open .menu-toggle__icon i:nth-child(2) { top: 0.4rem; transform: rotate(-45deg); }

/* Mobile and tablet: the panel covers the whole screen */
@media (max-width: 991.98px) {
  .nav-panel {
    position: fixed; inset: 0; z-index: 1001; height: 100vh; height: 100dvh; background: var(--night);
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 1.5rem;
    padding: 6rem var(--gutter) 2rem; overflow-y: auto; opacity: 0; visibility: hidden;
    transition: opacity 0.5s var(--ease), visibility 0.5s;
  }
  .menu-open .nav-panel { opacity: 1; visibility: visible; }
  body.menu-open { overflow: hidden; }

  .nav-panel .navbar-nav { width: 100%; }
  .nav-panel .nav-link {
    display: flex; align-items: baseline; gap: 1rem; padding: 0.15rem 0 !important;
    font-size: clamp(2.2rem, 9vw, 3.6rem); font-weight: 300; letter-spacing: -0.05em; line-height: 1.2;
  }
  .nav-panel .nav-link small { display: inline; font-size: 0.8rem; letter-spacing: 0; color: var(--champagne); font-weight: 500; }
  .nav-panel .nav-link::after { display: none; }

  .nav-panel__foot { width: 100%; display: flex; justify-content: space-between; align-items: center; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.95rem; }
  .nav-panel__foot span { display: flex; gap: 1.2rem; font-size: 1.2rem; }
}


/* --------------------------------------------------------------------------
   CSS: Home dropdown (lists the three homepage versions)
   -------------------------------------------------------------------------- */
.nav-item--drop { position: relative; display: flex; align-items: center; }
.nav-item--drop .nav-link { padding-right: 0.2rem !important; }

.drop-toggle { border: 0; background: none; color: var(--ivory); padding: 0.4rem 0.5rem 0.4rem 0.2rem; font-size: 0.7rem; line-height: 1; }
.drop-toggle i { display: block; transition: transform 0.4s var(--ease); }
.nav-item--drop.is-open .drop-toggle i { transform: rotate(180deg); }

.drop-menu {
  position: absolute; top: 100%; left: 0; min-width: 15rem; margin-top: 0.6rem; padding: 0.5rem;
  background: var(--night-2); border: 1px solid rgba(235, 233, 227, 0.14);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
}
.drop-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -0.7rem; height: 0.7rem; }   /* keeps hover alive across the gap */
.drop-menu a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 0.9rem; font-size: 0.9rem; font-weight: 500; color: var(--ivory); transition: background 0.3s, color 0.3s; }
.drop-menu a:hover { background: rgba(235, 233, 227, 0.08); color: var(--champagne); }
.drop-menu small { font-size: 0.72rem; font-weight: 500; color: rgba(235, 233, 227, 0.5); }
.drop-menu a.is-current small { color: var(--champagne); }
.drop-menu a[aria-disabled="true"] { cursor: default; }

.nav-item--drop.is-open .drop-menu { opacity: 1; visibility: visible; transform: none; }

/* Mouse users can also just hover on desktop */
@media (min-width: 992px) and (hover: hover) {
  .nav-item--drop:hover .drop-menu { opacity: 1; visibility: visible; transform: none; }
  .nav-item--drop:hover .drop-toggle i { transform: rotate(180deg); }
}

/* Mobile panel: the list opens inline under the Home link */
@media (max-width: 991.98px) {
  .nav-item--drop { flex-wrap: wrap; }
  .nav-panel .nav-item--drop .nav-link { padding-right: 0.5rem !important; }
  .drop-toggle { font-size: 1rem; color: var(--champagne); }
  .drop-menu { position: static; display: none; width: 100%; margin: 0.4rem 0 0.6rem; opacity: 1; visibility: visible; transform: none; background: none; border: 0; border-left: 1px solid var(--line); padding: 0 0 0 1rem; }
  .drop-menu::before { display: none; }
  .nav-item--drop.is-open .drop-menu { display: block; }
  .drop-menu a { padding: 0.5rem 0; font-size: 1.15rem; }
}


/* --------------------------------------------------------------------------
   CSS: Section 03, Hero (full bleed image, headline at the bottom)
   -------------------------------------------------------------------------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding: 8rem 0 2rem; overflow: hidden; background: var(--night); }
.hero__bg { position: absolute; inset: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9, 10, 18, 0.62) 0%, rgba(9, 10, 18, 0.32) 40%, rgba(9, 10, 18, 0.88) 100%); }
.hero__content { position: relative; z-index: 2; }

.hero__meta { font-size: 0.9rem; font-weight: 500; color: #ecd29c; margin-bottom: 1.5rem; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45); }
.hero__lead { color: rgba(235, 233, 227, 0.8); margin-bottom: 1.5rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.hero__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 2rem;
  margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid rgba(235, 233, 227, 0.2);
  font-size: 0.85rem; font-weight: 500;
}
.hero__status { display: inline-flex; align-items: center; gap: 0.6rem; }
.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #3ddc84; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.scroll-hint { display: inline-flex; align-items: center; gap: 0.6rem; }
.scroll-hint i { width: 1px; height: 1.6rem; background: var(--ivory); animation: drip 1.8s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .dot, .scroll-hint i { animation: none; }
}



/* --------------------------------------------------------------------------
   CSS: Section 04, Trusted by (marquee)
   -------------------------------------------------------------------------- */
.trusted { padding: 3rem 0; overflow: hidden; background: var(--night); border-bottom: 1px solid var(--line); border-top: 1px solid rgba(235, 233, 227, 0.08); }
.trusted__label { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.2rem; }

.marquee { overflow: hidden; }
.marquee__track { display: flex; width: max-content; }
.marquee__group { display: flex; flex-shrink: 0; }
.marquee__group span {
  font-size: clamp(2rem, 4.5vw, 3.6rem); font-weight: 300; letter-spacing: -0.04em; white-space: nowrap;
  padding-right: clamp(2.5rem, 6vw, 5rem); color: rgba(235, 233, 227, 0.35); transition: color 0.4s;
}
.marquee__group span:hover { color: var(--champagne); }



/* --------------------------------------------------------------------------
   CSS: Section 05, About the studio
   -------------------------------------------------------------------------- */
#about .media { max-height: 78vh; }
.about__copy { margin-top: 2.5rem; }
.about__copy .text-link { display: inline-block; margin-top: 1.5rem; }
[data-parallax] { will-change: transform; }



/* --------------------------------------------------------------------------
   CSS: Section 06, Selected work
   Default = stacked grid (mobile, tablet, no JS, reduced motion).
   .work--horizontal is added by JS on desktop and turns it into a pinned
   sideways gallery.
   -------------------------------------------------------------------------- */
.work {
  color: var(--fg); padding-block: var(--section-space); overflow: hidden;
  background:
    radial-gradient(60rem 38rem at 8% 0%, var(--glow), transparent 65%),
    radial-gradient(50rem 32rem at 100% 100%, var(--glow-2), transparent 60%),
    var(--bg);
}
.work__intro p { color: var(--muted); max-width: 24rem; }
.work__hint, .work__end, .work__meta { display: none; }   /* desktop gallery only */

.work__track { display: grid; gap: 3.5rem 1.5rem; padding-inline: var(--gutter); }
@media (min-width: 640px) {
  .work__track { grid-template-columns: 1fr 1fr; }
  .work__intro { grid-column: 1 / -1; }
}

.work-card a { display: block; }
.work-card--wide .media { aspect-ratio: 4 / 3; }
.work-card--tall .media { aspect-ratio: 4 / 5; }
.work-card--square .media { aspect-ratio: 1 / 1; }

.work-card__info { display: flex; align-items: baseline; gap: 1rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.work-card__no { font-size: 0.85rem; font-weight: 500; color: var(--acc); }
.work-card__cat { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--muted); }
.work-card .h3-title { transition: color 0.4s; }
.work-card a:hover .h3-title { color: var(--champagne); }

/* When the "View" bubble is active the small plus icon is not needed */
.work.has-cursor .plus { display: none; }

.cursor-view {
  position: fixed; left: 0; top: 0; z-index: 900; width: 5.5rem; height: 5.5rem; margin: -2.75rem 0 0 -2.75rem;
  border-radius: 50%; background: var(--champagne); color: var(--night); display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 600; pointer-events: none; opacity: 0;
}
@media (hover: none) { .cursor-view { display: none; } }

/* ----- Desktop pinned horizontal gallery ----- */
.work--horizontal { padding-block: 0; }
.work--horizontal .work__pin { position: relative; height: 100vh; display: flex; align-items: center; overflow: hidden; }
.work--horizontal .work__track { display: flex; align-items: center; gap: 7vw; width: max-content; padding-inline: var(--gutter) 12vw; will-change: transform; }

.work--horizontal .work__intro { flex-shrink: 0; width: 26vw; min-width: 21rem; margin: 0; }
.work--horizontal .work__hint { display: inline-flex; align-items: center; gap: 0.7rem; margin-top: 2rem; font-size: 0.85rem; color: var(--champagne); }

.work--horizontal .work-card { flex-shrink: 0; }
.work--horizontal .work-card--wide { width: 38vw; }
.work--horizontal .work-card--tall { width: 24vw; }
.work--horizontal .work-card--square { width: 30vw; }
.work--horizontal .work-card .media { max-height: 56vh; }
.work--horizontal .work-card:nth-of-type(odd) { margin-top: -5vh; }    /* alternating heights for an editorial rhythm */
.work--horizontal .work-card:nth-of-type(even) { margin-top: 9vh; }

.work--horizontal .work__end { display: flex; flex-shrink: 0; width: 22vw; font-size: clamp(1.6rem, 2.6vw, 2.6rem); font-weight: 300; letter-spacing: -0.04em; line-height: 1.15; }
.work--horizontal .work__meta { display: flex; align-items: center; gap: 1.5rem; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 2rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.work__bar { position: relative; flex: 1; height: 1px; background: var(--line); }
.work__bar i { position: absolute; inset: 0; background: var(--champagne); transform: scaleX(0); transform-origin: left; }



/* --------------------------------------------------------------------------
   CSS: Section 07, Services
   -------------------------------------------------------------------------- */
.service { position: relative; }
.service__line { position: absolute; top: 0; left: 0; width: 100%; height: 1px; background: var(--fg); transform-origin: left; }
.service:last-child { border-bottom: 1px solid var(--fg); }

.service__row {
  position: relative; display: grid; grid-template-columns: 2.5rem 1fr 2.4rem; gap: 0.25rem 1rem; align-items: center;
  padding: 1.6rem 0; transition: padding-left 0.5s var(--ease);
}
.service__no { font-size: 0.85rem; font-weight: 500; color: var(--acc); }
.service__name { font-size: clamp(1.7rem, 3.2vw, 2.8rem); font-weight: 300; letter-spacing: -0.045em; line-height: 1.1; position: relative; justify-self: start; }
.service__name::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px;
  background: var(--acc); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease);
}
.service__text { grid-column: 2; grid-row: 2; color: var(--muted); margin: 0; }
.service__row .plus { position: static; grid-column: 3; grid-row: 1; background: var(--fg); color: var(--on-fg); }
.service__row:hover { padding-left: 1rem; }
.service__row:hover .service__name::after { transform: scaleX(1); }

@media (min-width: 768px) {
  .service__row { grid-template-columns: 2.5rem 1.2fr 1fr 2.4rem; }
  .service__text { grid-column: 3; grid-row: 1; }
  .service__row .plus { grid-column: 4; }
}



/* --------------------------------------------------------------------------
   CSS: Section 08, Creative statement (image background, big type)
   -------------------------------------------------------------------------- */
.statement { position: relative; padding: clamp(6rem, 14vw, 12rem) 0; overflow: hidden; background: var(--night); }
.statement__bg { position: absolute; inset: 0; }
.statement__bg img { width: 100%; height: 100%; object-fit: cover; }
.statement__bg::after { content: ""; position: absolute; inset: 0; background: rgba(9, 10, 18, 0.72); }

.statement__text { position: relative; margin: 0; text-align: center; font-weight: 300; line-height: 0.95; letter-spacing: -0.055em; font-size: clamp(2.6rem, 10vw, 10rem); }
.statement__line { display: block; white-space: nowrap; will-change: transform; }
.statement__line--accent { color: var(--champagne); }

@media (max-width: 575.98px) {
  .statement__text { font-size: 10.5vw; }
}



/* --------------------------------------------------------------------------
   CSS: Section 09, Our process
   -------------------------------------------------------------------------- */
.process { position: relative; padding-left: 4.5rem; }
.process__track { position: absolute; left: 1.35rem; top: 1rem; bottom: 1rem; width: 1px; background: var(--line); }
.process__fill { position: absolute; inset: 0; background: var(--champagne); transform: scaleY(0); transform-origin: top; }

.process__step { position: relative; padding-bottom: clamp(2.5rem, 6vw, 4.5rem); opacity: 0.4; transition: opacity 0.6s var(--ease); }
.process__step:last-child { padding-bottom: 0; }
.process__step.is-active { opacity: 1; }
.process__step p { margin: 0.5rem 0 0; color: var(--muted); max-width: 30rem; }

.process__no {
  position: absolute; left: -4.5rem; top: 0; width: 2.7rem; height: 2.7rem; border-radius: 50%;
  background: var(--night); border: 1px solid var(--line); display: grid; place-items: center;
  font-weight: 600; font-size: 0.9rem; transition: background 0.5s, color 0.5s, border-color 0.5s;
}
.process__step.is-active .process__no { background: var(--champagne); border-color: var(--champagne); color: var(--night); }



/* --------------------------------------------------------------------------
   CSS: Section 10, Team
   -------------------------------------------------------------------------- */
.member a { display: block; }
.member .media img { filter: grayscale(1); transition: filter 0.8s var(--ease), transform 1s var(--ease); }
.member a:hover .media img { filter: grayscale(0); transform: scale(1.05); }
.member__name { font-size: clamp(1.2rem, 1.8vw, 1.6rem); font-weight: 400; letter-spacing: -0.03em; margin: 1rem 0 0; }
.member__role { margin: 0; font-size: 0.9rem; color: var(--muted); }

@media (min-width: 992px) {
  .member:nth-child(even) { margin-top: 4rem; }   /* alternating offset */
}



/* --------------------------------------------------------------------------
   CSS: Section 11, Testimonials
   -------------------------------------------------------------------------- */
.quotes { max-width: 62rem; }
.quote { display: none; margin: 0; }
.quote.is-active { display: block; }
.quote p { font-size: clamp(1.9rem, 4.4vw, 3.8rem); font-weight: 300; line-height: 1.1; letter-spacing: -0.045em; margin-bottom: 2rem; }
.quote footer { font-size: 0.95rem; color: var(--muted); }
.quote strong { color: var(--champagne); font-weight: 500; }

.quote-controls { display: flex; gap: 0.8rem; margin-top: 3rem; }
.quote-controls button {
  width: 3.2rem; height: 3.2rem; border-radius: 50%; border: 1px solid var(--line);
  background: none; color: var(--fg); transition: background 0.4s, color 0.4s;
}
.quote-controls button:hover { background: var(--ivory); color: var(--night); }



/* --------------------------------------------------------------------------
   CSS: Section 12, Studio facts
   -------------------------------------------------------------------------- */
.fact { display: flex; flex-direction: column; gap: 0.3rem; }
.fact__num { font-weight: 300; font-size: clamp(3.6rem, 8vw, 7.5rem); line-height: 1; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.fact > span:last-child { font-weight: 500; font-size: 0.9rem; color: var(--muted); padding-top: 0.8rem; border-top: 1px solid var(--line); }



/* --------------------------------------------------------------------------
   CSS: Section 13, Journal
   -------------------------------------------------------------------------- */
.post a { display: block; }
.post .media img { transition: transform 1s var(--ease); }
.post a:hover .media img { transform: scale(1.06); }
.post__meta { margin: 1.1rem 0 0.4rem; font-size: 0.82rem; font-weight: 500; color: var(--acc); }
.post .h3-title { transition: color 0.4s; }
.post a:hover .h3-title { color: var(--champagne); }



/* --------------------------------------------------------------------------
   CSS: Section 14, Contact CTA
   -------------------------------------------------------------------------- */
.contact {
  color: var(--fg); padding: var(--section-space) 0; position: relative; overflow: hidden;
  background: radial-gradient(50rem 32rem at 0% 108%, var(--glow-2), transparent 60%), var(--bg);
}
.contact::before {
  content: ""; position: absolute; width: 40rem; height: 40rem; right: -12rem; top: var(--glow-y, -16rem); border-radius: 50%;
  background: var(--champagne); opacity: 0.35; filter: blur(110px); pointer-events: none;
}
.contact .container-fluid { position: relative; }
.contact__mail { display: inline-block; margin-top: 1.5rem; font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 300; letter-spacing: -0.04em; border-bottom: 1px solid currentColor; }
.contact__mail:hover { color: var(--acc); }

.contact__form { display: grid; gap: 1rem; }
.contact__form input, .contact__form textarea {
  width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--fg); padding: 0.8rem 0; font: inherit; border-radius: 0;
}
.contact__form input::placeholder, .contact__form textarea::placeholder { color: var(--muted); }
.contact__form input:focus, .contact__form textarea:focus { outline: none; border-color: var(--fg); }
.contact__form .btn-pill { justify-self: start; margin-top: 0.8rem; }
.contact__note { min-height: 1.5rem; margin: 0; font-size: 0.9rem; color: var(--acc); }



/* --------------------------------------------------------------------------
   CSS: Section 15, Footer
   -------------------------------------------------------------------------- */
.site-footer {
  color: var(--ivory); padding: 0 0 2rem; overflow: hidden;
  background: radial-gradient(70rem 30rem at 50% 105%, rgba(255, 233, 6, 0.12), transparent 65%), var(--night);
}
.footer__top { padding-top: 4.5rem; }
.footer__about { font-size: clamp(1.4rem, 2.3vw, 2rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1.25; max-width: 26rem; }
.footer__links li + li { margin-top: 0.5rem; }
.footer__links a { color: rgba(235, 233, 227, 0.7); transition: color 0.3s; }
.footer__links a:hover { color: var(--champagne); }

.footer__word { font-size: clamp(6rem, 28vw, 30rem); font-weight: 300; line-height: 0.82; letter-spacing: -0.07em; text-align: center; margin: 3rem 0 2rem; color: var(--ivory); }

.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.85rem; color: rgba(235, 233, 227, 0.7); padding-top: 1.5rem; border-top: 1px solid var(--line); }
.footer__right { display: flex; align-items: center; gap: 1.5rem; }
.to-top { width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ivory); transition: background 0.4s, color 0.4s; }
.to-top:hover { background: var(--ivory); color: var(--night); }



/* --------------------------------------------------------------------------
   CSS: Detail popup (Bootstrap modal for services, work, team, journal)
   -------------------------------------------------------------------------- */
.detail .modal-content { background: var(--night-2); color: var(--ivory); border: 1px solid rgba(235, 233, 227, 0.14); border-radius: 0; }
.detail .modal-dialog { --bs-modal-margin: 0.75rem; }
.detail__close {
  position: absolute; top: 1rem; right: 1rem; z-index: 5; width: 2.8rem; height: 2.8rem; border-radius: 50%;
  border: 0; background: var(--ivory); color: var(--night); display: grid; place-items: center; transition: background 0.3s, transform 0.5s var(--ease);
}
.detail__close:hover { background: var(--champagne); transform: rotate(90deg); }

.detail__media { height: 100%; min-height: 16rem; }
.detail__body { padding: clamp(1.5rem, 4vw, 3.5rem); }
.detail__type { color: var(--champagne); font-size: 0.85rem; font-weight: 500; margin-bottom: 0.8rem; }
.detail__title { font-weight: 300; font-size: clamp(2rem, 3.8vw, 3.4rem); line-height: 1; letter-spacing: -0.05em; margin: 0 0 0.8rem; }
.detail__meta { color: rgba(235, 233, 227, 0.6); font-size: 0.9rem; margin-bottom: 1.5rem; }
.detail__text p { color: rgba(235, 233, 227, 0.82); }
.detail__list { margin: 1.5rem 0 2rem; border-top: 1px solid rgba(235, 233, 227, 0.16); }
.detail__list li { padding: 0.7rem 0; border-bottom: 1px solid rgba(235, 233, 227, 0.16); font-size: 0.95rem; }
.detail__list li::before { content: "+"; color: var(--champagne); margin-right: 0.8rem; font-weight: 600; }

.modal-backdrop.show { opacity: 0.8; }

/* On small screens the popup uses the full screen */
@media (max-width: 991.98px) {
  .detail .modal-dialog { margin: 0; max-width: none; min-height: 100%; }
  .detail .modal-content { min-height: 100vh; }
  .detail__media { aspect-ratio: 16 / 10; height: auto; }
}


/* ==========================================================================
   MACINA LAB: aggiunte
   ========================================================================== */
.brand span, .preloader__word span, .footer__word span { color: var(--champagne); }
.footer__word { font-size: clamp(3.5rem, 15vw, 17rem); white-space: nowrap; }
.preloader__word { font-size: clamp(3rem, 10vw, 8rem); }
.work-card__link { display: inline-flex; gap: .4rem; align-items: center; margin-top: .35rem; font-size: .85rem; color: var(--acc); }
.footer__legal { opacity: .6; font-size: .8rem; }
/* Giallo su chiaro è poco leggibile: sui pulsanti accent nelle sezioni chiare usiamo il nero */
.section--light .btn-pill--accent { background: var(--night); color: var(--ivory); }
.btn-pill--primary:hover { color: var(--night); }
.section--light .btn-pill--primary:hover { color: #fff; }

/* --- Hero slider --- */
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s var(--ease), transform 7s linear; transform: scale(1.06); }
.hero__img.is-active { opacity: 1; transform: scale(1); }
#heroImg.is-active { transform: none; }
.hero__bg .hero__img--right { object-position: 70% center; }
.hero__shade { background: linear-gradient(180deg, rgba(9,10,18,.55) 0%, rgba(9,10,18,.15) 35%, rgba(9,10,18,.9) 100%), linear-gradient(90deg, rgba(9,10,18,.55) 0%, transparent 60%); }
.hero__slides { display: grid; }
.hero__slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease), visibility 0s .8s; }
.hero__slide.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .9s var(--ease) .25s, transform .9s var(--ease) .25s, visibility 0s; }
.hero__foot { align-items: center; }
.hero__dots { display: flex; gap: .5rem; }
.hero__dots button { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: pointer; }
.hero__dots i { display: block; width: 34px; height: 3px; border-radius: 3px; background: rgba(235,233,227,.3); overflow: hidden; position: relative; }
.hero__dots i::after { content: ""; position: absolute; inset: 0; background: var(--champagne); transform: scaleX(0); transform-origin: left; }
.hero__dots .is-active i::after { animation: heroDot var(--hero-delay, 6.5s) linear forwards; }
.hero.is-paused .hero__dots .is-active i::after { animation-play-state: paused; }
@keyframes heroDot { to { transform: scaleX(1); } }
.hero__arrows { display: flex; gap: .6rem; }
.hero__arrows button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(235,233,227,.35); background: transparent; color: var(--ivory); display: grid; place-items: center; transition: background .3s, color .3s; }
.hero__arrows button:hover { background: var(--champagne); color: var(--night); border-color: var(--champagne); }
@media (prefers-reduced-motion: reduce) { .hero__img, .hero__slide { transition: none; transform: none; } .hero__dots .is-active i::after { animation: none; transform: scaleX(1); } }

/* --- Loghi --- */
.marquee__group--logos span { display: inline-flex; align-items: center; height: 64px; color: rgba(235,233,227,.85); }
.marquee__group--logos img { height: 34px; width: auto; opacity: .85; transition: opacity .3s; }
.marquee__group--logos img.logo-tall { height: 46px; }
.marquee__group--logos span:hover img { opacity: 1; }
.logo-text { font-weight: 600 !important; font-size: clamp(1.8rem, 3.6vw, 2.6rem) !important; letter-spacing: -0.05em !important; }
.card-logo { position: absolute; left: 1.4rem; bottom: 1.2rem; z-index: 2; pointer-events: none; }
.card-logo img { height: 30px; width: auto; filter: drop-shadow(0 2px 10px rgba(0,0,0,.6)); }
.card-logo--text { font-size: 2rem; font-weight: 600; letter-spacing: -0.05em; color: var(--ivory); }
.hero__shade { transition: background .8s var(--ease); }
.hero[data-slide="2"] .hero__shade { background: linear-gradient(180deg, rgba(9,10,18,.5) 0%, rgba(9,10,18,.1) 35%, rgba(9,10,18,.9) 100%), linear-gradient(90deg, rgba(9,10,18,.94) 0%, rgba(9,10,18,.86) 42%, rgba(9,10,18,.2) 70%, transparent 100%); }
.logo-text { font-size: 2.1rem !important; }

/* slide studio, slide Mario (ritratto verticale a destra, sfumato verso il buio) */
.hero__bg .hero__img--studio { object-position: 64% center; }
.hero__bg .hero__img--portrait { left: auto; right: 0; width: auto; max-width: 70%; height: 100%; object-fit: cover; object-position: center top;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%); mask-image: linear-gradient(90deg, transparent 0%, #000 45%); }
.hero[data-slide="3"] .hero__shade { background: linear-gradient(180deg, rgba(9,10,18,.45) 0%, rgba(9,10,18,0) 35%, rgba(9,10,18,.85) 100%); }
@media (max-width: 767.98px) {
  .hero__bg .hero__img--portrait { left: 0; width: 100%; max-width: none; object-fit: cover; object-position: center top; -webkit-mask-image: none; mask-image: none; }
  .hero[data-slide="3"] .hero__shade { background: linear-gradient(180deg, rgba(9,10,18,.3) 0%, rgba(9,10,18,.2) 35%, rgba(9,10,18,.92) 75%); }
}
/* logo: due parole */
.brand span, .preloader__word span, .footer__word span { color: var(--champagne); }

/* --- Selettore lingua --- */
.nav-lang .nav-link { display: inline-flex; align-items: center; gap: .35rem; }
.nav-lang .nav-link i { font-size: .9em; }
.nav-lang .drop-menu { left: auto; right: 0; min-width: 12rem; }
@media (max-width: 991.98px) { .nav-panel .nav-lang .nav-link { font-size: 1.4rem; letter-spacing: 0; margin-top: .6rem; } }

/* --- Lingue con alfabeti diversi --- */
html[lang="zh"] { --font: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
html[lang="ar"] { --font: "Noto Sans Arabic", "Space Grotesk", Tahoma, sans-serif; }
html[lang="zh"] .display-title, html[lang="ar"] .display-title { letter-spacing: 0; line-height: 1.15; }
html[lang="zh"] .h2-title, html[lang="ar"] .h2-title, html[lang="zh"] .statement__text, html[lang="ar"] .statement__text { letter-spacing: 0; }
/* RTL: le parti animate in orizzontale restano LTR */
[dir="rtl"] .work__pin, [dir="rtl"] .marquee, [dir="rtl"] .hero__dots, [dir="rtl"] .brand, [dir="rtl"] .footer__word, [dir="rtl"] .preloader__word { direction: ltr; }
[dir="rtl"] .work-card__info, [dir="rtl"] .work__intro { direction: rtl; text-align: right; }
[dir="rtl"] .navbar-nav.ms-lg-auto { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] .navbar-nav.me-lg-3 { margin-right: auto !important; margin-left: 1rem !important; }
[dir="rtl"] .nav-lang .drop-menu { right: auto; left: 0; }
[dir="rtl"] .hero__arrows { flex-direction: row-reverse; }
[dir="rtl"] .bi-arrow-left, [dir="rtl"] .bi-arrow-right { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .hero__arrows .bi-arrow-left, [dir="rtl"] .hero__arrows .bi-arrow-right { transform: none; }
[dir="rtl"] .hero__shade { transform: scaleX(-1); }
[dir="rtl"] .hero__bg .hero__img--portrait { right: auto; left: 0; -webkit-mask-image: linear-gradient(270deg, transparent 0%, #000 45%); mask-image: linear-gradient(270deg, transparent 0%, #000 45%); }
@media (max-width: 767.98px) { [dir="rtl"] .hero__bg .hero__img--portrait { -webkit-mask-image: none; mask-image: none; } }
[dir="rtl"] .detail__list li::before { margin-right: 0; margin-left: .8rem; }
html[lang="zh"] .display-title, html[lang="ar"] .display-title, html[lang="zh"] .h2-title, html[lang="ar"] .h2-title { text-wrap: balance; }
.brand, .footer__word, .preloader__word, .logo-text, .card-logo--text { font-family: "Space Grotesk", system-ui, sans-serif; }
