/* =====================================================================
   bgastand — Design System
   Brand (official Figma styleguide): GT Walsheim Pro · Light Black #002630 ·
   Off-White #F5F0ED · Coral Orange #FA5C45 · Electric Blue #005CA9
   Pixel reference: Figma canvas 1512px wide, 48px side margins → 1416px content.
   px→vw conversion used throughout: px / 15.12 (e.g. 92px = 6.08vw).
   ===================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "GT Walsheim Pro";
  src: url("../fonts/GTWalsheimPro-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "GT Walsheim Pro";
  src: url("../fonts/GTWalsheimPro-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
/* Figma's hero H1 uses GT Walsheim Pro BLACK (900). The file isn't in the kit yet —
   this declaration activates automatically once assets/fonts/GTWalsheimPro-Black.ttf
   is added; until then, elements set to 900 fall back to the 700 face (synthetic
   bolding is disabled on them via font-synthesis-weight:none to avoid fake-bold). */
@font-face {
  font-family: "GT Walsheim Pro";
  src: url("../fonts/GTWalsheimPro-Black.ttf") format("truetype");
  font-weight: 900; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --cream:   #F5F0ED;          /* Figma --off-white */
  --cream-2: #EFE9E4;          /* build-only: placeholder surface behind photos */
  --ink:     #002630;          /* Figma --light-balck rgba(0,38,48,1) */
  --ink-2:   #0A323E;          /* slightly lighter navy, derived from --ink */
  --coral:   #FA5C45;          /* Figma --coral-orange rgba(250,92,69,1) */
  --coral-d: #D83D2F;          /* hover shade (from client reference demo) */
  --blue:    #005CA9;          /* Figma --electric-blue (token only, unused) */
  --line:    var(--ink);           /* Figma: box/rule strokes are FULL ink, no alpha */
  --hairline: rgba(0,38,48,.38);   /* subtle divider (build-only, not in Figma) */
  --line-d:  var(--cream);         /* strokes on ink are full off-white */
  --bw:      2px;                  /* box stroke weight (Figma: 2px) */
  --bw-pill: 1.5px;                /* pill/button stroke weight (Figma: 1.5px) */
  --muted:   rgba(0,38,48,.62);
  --muted-d: rgba(245,240,237,.66);

  --r-sm: 14px;
  --r:    24px;
  --r-lg: 24px;                    /* Figma: universal 24px card radius */
  --pill: 999px;

  --container: 1512px;             /* Figma canvas width */
  --gutter: clamp(16px, 3.175vw, 48px);  /* Figma: 48px side margins (48/1512) */

  --t-fast: .25s cubic-bezier(.4,0,.2,1);
  --t:      .45s cubic-bezier(.4,0,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  --shadow: 0 18px 50px -24px rgba(0,38,48,.40);
  --shadow-sm: 0 8px 24px -16px rgba(0,38,48,.45);

  --header-h: 88px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: "GT Walsheim Pro", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.3;
  /* Figma body: 24px Regular (styleguide). 24/15.12 = 1.59vw. */
  font-size: clamp(16px, 1.59vw, 24px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, textarea, select { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 4px; }

/* ---------- Typography ----------
   Figma scale (canvas 1512): section titles 92px Bold ls 0 · hero H1 92px BLACK
   ls -3% lh .935 · subtitles 28px Regular · card/pill labels 24px Regular. */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.0; letter-spacing: 0; overflow-wrap: break-word; }
.h-display { font-size: clamp(2.75rem, 6.08vw, 5.75rem); line-height: 1.0; letter-spacing: -.03em; }  /* Figma "Own your space.": 92px Bold ls -2.76px */
.h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); }
.h2 { font-size: clamp(3.25rem, 6.08vw, 5.75rem); }   /* Figma 92px; min raised for tablet/mobile (t038-41) */
.h3 { font-size: clamp(1.6rem, 2.7vw, 2.35rem); line-height: 1.05; }
.h4 { font-size: clamp(1.2rem, 1.7vw, 1.5rem); line-height: 1.1; }
/* Figma section subtitles: 28px Regular, SOLID ink (not muted), right-aligned in head rows */
.lead { font-size: clamp(1.1rem, 1.85vw, 1.75rem); font-weight: 400; color: var(--ink); line-height: 1.2; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-size: .95rem; font-weight: 700; letter-spacing: .01em;   /* brand: no uppercase emphasis */
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--ink); opacity: 1; }  /* Figma home has no coral decoration */
.on-dark .eyebrow::before, .card--dark .eyebrow::before, .band-dark .eyebrow::before { background: var(--cream); }  /* t096/t099: lateral line visible on dark boxes */
.muted { color: var(--muted); }
.on-dark .muted, .on-dark.muted { color: var(--muted-d); }

/* dot-terminated rule — recurring brand motif: a line with a filled dot at each end.
   Figma: 2px FULL-ink stroke, 8px dots whose centers sit ON the line ends (they
   overhang by -4px — the exported rule SVGs are text-width + 8px with -4px margins). */
.rule-dots { display:block; height:2px; background: var(--line); position:relative; }
.rule-dots::before, .rule-dots::after { content:""; position:absolute; top:50%; transform:translateY(-50%); width:8px; height:8px; border-radius:50%; background: var(--ink); }
.rule-dots::before { left:-4px; } .rule-dots::after { right:-4px; }
.on-dark .rule-dots, .card--dark .rule-dots { background: var(--line-d); }
.on-dark .rule-dots::before, .on-dark .rule-dots::after,
.card--dark .rule-dots::before, .card--dark .rule-dots::after { background: var(--cream); }
.coral { color: var(--coral); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
/* Slider "attached to the edge" (desktop only): left edge aligns with the normal
   container gutter, right edge bleeds all the way to the viewport edge (no right
   gutter) — matches the Figma "Our works / Workflow / Team" sliders exactly. Mobile
   keeps its own carousel__track bleed (margin/padding trick, both sides).
   NOTE: uses the margin-based full-bleed trick (proven reliable inside Elementor,
   same family as .site-header's fix) rather than left:50%+transform — a transform
   creates a new containing block and silently breaks if any Elementor ancestor
   wrapper isn't exactly 100vw wide. margin-right:calc(50% - 50vw) self-adjusts to
   whatever the actual (possibly narrower) parent width is, as long as it's centred. */
@media (min-width: 880px) {
  .bleed-right {
    margin-right: calc(50% - 50vw) !important;
    padding-left: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
    padding-right: 0;
  }
}
.section { padding-block: clamp(36px, 3.4vw, 52px); }  /* Figma inter-section rhythm: 74-128px TOTAL between sections */
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section__head { max-width: 760px; margin-bottom: clamp(32px, 4vw, 56px); }
.section__head .lead { margin-top: .7rem; }
.section__head--row { display:flex; justify-content:space-between; align-items:flex-end; gap:32px; max-width:none; flex-wrap:wrap; }
.section__head--row .lead { text-align: right; max-width: 640px; }  /* Figma: subtitle right-aligned, baseline with title */
@media (min-width: 1100px) { .section__head--row .lead { white-space: nowrap; max-width: none; } }  /* client: no line-break in subtitles */
.stack > * + * { margin-top: 1rem; }
.text-balance { text-wrap: balance; }

/* dark band */
.band-dark { background: var(--ink); color: var(--cream); }
.band-dark .lead { color: var(--muted-d); }

/* ---------- Buttons ----------
   Figma pills: 24px Regular labels, 1.5px full-ink border, off-white fill,
   padding 10px 18px (CTA) / 12px 24px (video). Em paddings are based on the 24px label. */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .42em .75em; border-radius: var(--pill);
  border: var(--bw-pill) solid var(--ink); color: var(--ink);
  background: var(--cream);
  font-weight: 400; font-size: clamp(1rem, 1.59vw, 1.5rem); letter-spacing: 0;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
  will-change: transform;
}
.btn:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }
.btn svg, .btn .arrow { width: 1.15em; height: 1.15em; flex: none; transition: transform var(--t-fast); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--solid { background: var(--ink); color: var(--cream); }
.btn--solid:hover { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn--coral { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn--coral:hover { background: var(--coral-d); border-color: var(--coral-d); transform: translateY(-2px); }
.btn--light { border-color: var(--cream); color: var(--cream); background: transparent; }
.btn--light:hover { background: var(--cream); color: var(--ink); }
.btn--lg { padding: .5em 1em; }   /* Figma video pill: 12px 24px on the 24px label */

/* circular icon buttons — Figma slider/workflow arrows: 48px solid-ink circles */
.icon-btn {
  --s: 48px; width: var(--s); height: var(--s);
  display: inline-grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--cream); border: none;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
  flex: none;
}
.icon-btn:hover { background: var(--coral); color: #fff; transform: scale(1.06); }
.icon-btn--solid { background: var(--ink); color: var(--cream); }
.icon-btn--solid:hover { background: var(--coral); color:#fff; }
.icon-btn--light { background: transparent; border: var(--bw-pill) solid var(--cream); color: var(--cream); }
.icon-btn--light:hover { background: var(--cream); color: var(--ink); }
/* "prev" arrow — same ink circle at half opacity (Figma's 50%-opacity circle language) */
.icon-btn--muted { background: var(--ink); color: var(--cream); opacity: .5; }
.icon-btn--muted:hover { opacity: 1; background: var(--ink); color: var(--cream); transform: scale(1.06); }
.icon-btn[disabled] { opacity: .28; pointer-events: none; transform: none; }
.icon-btn svg { width: 46%; height: 46%; stroke-width: 2.2; }

/* tags / pills */
.tag {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .45em 1em; border-radius: var(--pill);
  border: var(--bw-pill) solid var(--ink); font-size: .8rem; font-weight: 700;
  letter-spacing: .04em; color: var(--ink);
}
.on-dark .tag { border-color: var(--line-d); color: var(--cream); }
.tag--coral { background: rgba(250,92,69,.14); border-color: rgba(250,92,69,.35); color: var(--coral-d); }

/* ---------- Cards ---------- */
.card {
  background: var(--cream); border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg); padding: clamp(24px, 3vw, 40px);
}
/* About us — per client mockup: text columns are PLAIN (no border/card), the wide
   cell (diagram / photo) swaps sides between the two rows (1 : 1.49). */
.about-grid { display: grid; grid-template-columns: 1fr 1.49fr; gap: clamp(24px, 3vw, 48px); align-items: stretch; }
.about-grid--flip { grid-template-columns: 1.49fr 1fr; }
.about-grid > * { min-width: 0; min-height: clamp(340px, 36vw, 547px); }
.about-grid--flip > * { min-height: clamp(380px, 49.8vw, 753px); }
@media (max-width: 860px) { .about-grid, .about-grid--flip { grid-template-columns: 1fr; } .about-grid > *, .about-grid--flip > * { min-height: 0; } }
/* plain text column: title 28px Bold + rule + body 28px Regular, all solid ink */
.about-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.3rem; padding-top: 6px; }
.about-copy .h3 { font-size: clamp(1.1rem, 1.85vw, 1.75rem); line-height: 1.15; }
.about-copy p { font-size: clamp(1.1rem, 1.85vw, 1.75rem); line-height: 1.2; color: var(--ink); }
.about-copy .rule-dots { align-self: stretch; }
.about-copy .carousel__nav { margin-top: auto; justify-content: flex-start; }  /* about-slider arrows: bottom-left of the text column */
.card--plain { border: none; background: var(--cream-2); }
.card:has(> img:only-child) { border: none; }   /* t105: photo-only cards lose the dark outline */
.page-hero .lead { color: var(--muted); }        /* t100: intro paragraphs in the lighter body tone */
.card--dark { background: var(--ink); color: var(--cream); border: none; }
.card--dark .muted { color: var(--muted-d); }

/* ---------- Header ----------
   Sits in NORMAL FLOW at the top of the page (like the mockup: plain, not overlapping
   the hero). Only once the user scrolls does it switch to position:fixed with a solid
   backdrop — .is-header-fixed on <body> adds matching padding-top at that exact moment
   so nothing jumps (the header "pops out" of flow but the gap it leaves is filled). */
.site-header {
  /* relative (not static) so z-index actually applies: at rest the hero visual now
     rises to meet the header (see .hero__visual margin-top below) and, without this,
     a static header has no stacking context so the later-painted hero box would
     cover the nav links. */
  position: relative; z-index: 1000;
  /* full-bleed even when inside a boxed/centred (transformed) ancestor */
  width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw);
  height: var(--header-h); display: flex; align-items: center;
  transition: background var(--t), box-shadow var(--t), height var(--t);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; width: 100%; }
/* Groups logo+nav so they can be treated as one block (needed on the home page,
   see the desktop override below); flex:1 + space-between here reproduces the exact
   previous look everywhere else (logo left, nav pushed to the far right). */
.site-header__left { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 20px; }
.site-header.is-scrolled {
  position: fixed; top: 0; left: 0; right: auto;
  /* left:0 is what actually pins a position:fixed box to the viewport edge; the
     margin-left:calc(50%-50vw) trick above only does useful work while the header is
     in NORMAL FLOW (where "50%" means half of its containing block). Once fixed, if
     any ancestor happens to create its own containing block (a stray transform/filter
     on an Elementor wrapper), that same 50% would resolve against THAT narrower box
     instead of the viewport, adding an unwanted offset on top of left:0 and making the
     bar render narrow/misplaced. Canceling it here keeps positioning to plain left:0,
     which stays correct regardless of what's fixed against what. */
  margin-left: 0;
  background: rgba(245,240,237,.86); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
  /* Deliberately NOT shrinking height/logo here (per user feedback): the fixed bar
     stays the exact same size as at rest, it just gains a solid backdrop. */
}
/* Compensates the space the header leaves behind the instant it pops out of flow. */
body.is-header-fixed { padding-top: var(--header-h); }
.brand { display: inline-flex; align-items: center; }
/* max-width:none overrides the theme's global img{max-width:100%} reset: with a fixed
   height and an inline-flex (shrink-to-fit) parent, that 100% cap creates a circular
   sizing dependency that some browsers resolve by under-sizing the width, squishing
   the logo narrower than its real aspect ratio while height stays fixed at 36px. */
.brand img { height: clamp(36px, 3.17vw, 48px); width: auto; max-width: none; transition: height var(--t); }  /* Figma logo: 215x48px */

.nav-desktop { display: flex; align-items: center; gap: clamp(12px, 1.59vw, 24px); }  /* Figma: 24px pill gaps */
.nav-desktop a {
  font-weight: 700; font-size: 1rem; position: relative; padding: .3em 0; letter-spacing: -.01em;
}
.nav-desktop a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: var(--coral);
  transition: width var(--t-fast);
}
.nav-desktop a:hover::after, .nav-desktop a[aria-current="page"]::after { width: 100%; }
.nav-desktop a[aria-current="page"] { color: var(--coral); }
.header-cta { margin-left: 8px; }

/* hamburger — navy (per client), sized so it never exceeds the logo */
.hamburger {
  --s: 44px; width: var(--s); height: var(--s); display: none; place-items: center;
  padding: 0 !important; line-height: 0;              /* t072/t106: glyph perfectly centered */
  border: var(--bw) solid var(--ink) !important; border-radius: 50%; background: transparent !important;
  flex: none; box-sizing: border-box;
}
.hamburger span { display:block; width: 20px; height: 2px; border-radius: 2px; background: var(--ink) !important; position: relative; transition: var(--t-fast); margin: 0 auto; }
.hamburger span::before, .hamburger span::after {
  content:""; position:absolute; left:0; width:20px; height:2px; border-radius: 2px; background: var(--ink) !important; transition: var(--t-fast);
}
.hamburger span::before { top: -6px; } .hamburger span::after { top: 6px; }
body.drawer-open .hamburger span { background: transparent !important; }
body.drawer-open .hamburger span::before { top:0; transform: rotate(45deg); }
body.drawer-open .hamburger span::after  { top:0; transform: rotate(-45deg); }

/* drawer */
.drawer {
  position: fixed; inset: 0; z-index: 99; background: var(--ink); color: var(--cream);
  display: flex; flex-direction: column; justify-content: center; padding: var(--gutter);
  transform: translateY(-100%); transition: transform var(--t) var(--ease-out);
  visibility: hidden;
}
body.drawer-open .drawer { transform: translateY(0); visibility: visible; }
.drawer nav { display: flex; flex-direction: column; gap: .2em; }
.drawer nav a {
  font-size: clamp(2.4rem, 9vw, 4rem); font-weight: 700; line-height: 1.05; letter-spacing: -.02em;
  opacity: 0; transform: translateY(20px); transition: opacity var(--t), transform var(--t);
}
body.drawer-open .drawer nav a { opacity: 1; transform: none; }
body.drawer-open .drawer nav a:nth-child(1){ transition-delay:.08s }
body.drawer-open .drawer nav a:nth-child(2){ transition-delay:.14s }
body.drawer-open .drawer nav a:nth-child(3){ transition-delay:.20s }
body.drawer-open .drawer nav a:nth-child(4){ transition-delay:.26s }
body.drawer-open .drawer nav a:nth-child(5){ transition-delay:.32s }
.drawer nav a:hover { color: var(--coral); }
.drawer__foot { display: flex; gap: 28px; margin-top: clamp(28px,5vw,56px); flex-wrap: wrap; color: var(--muted-d); }
.drawer__foot a:hover { color: var(--cream); }

/* ---------- Hero ---------- */
.hero { --hero-gap: clamp(16px, 3vw, 40px); padding-top: var(--hero-gap); padding-bottom: clamp(40px, 6vw, 80px); } /* header is in normal flow now, no need to reserve its height here */
.hero__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 2vw, 28px); align-items: stretch; }
.hero__grid > * { min-width: 0; }
/* Filled by main.js (cloned from #site-header) and shown only on the home page at
   ≥1100px — see the media query below. Hidden everywhere else by default. */
.hero__topbar { display: none; }
.hero__visual {
  background: var(--ink); border-radius: var(--r-lg); position: relative; overflow: hidden;
  min-height: clamp(340px, 54.96vw, 831px); display: grid; place-items: center;  /* Figma 3D box: 698x831 */
}
.hero__visual canvas { width: 100% !important; height: 100% !important; display:block; }
.hero__visual .poster { position: absolute; inset: 0; width:100%; height:100%; object-fit: contain; padding: 2%; opacity: 1; transition: opacity .5s; }  /* Figma logo render fills ~84% of box width */
.hero__visual .hint {
  position: absolute; left: 22px; bottom: 20px; font-size: .8rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted-d); display: inline-flex; align-items: center; gap: .6em;
}
.hero__visual .hint::before { content:""; width:8px; height:8px; border-radius:50%; background: var(--coral); }
.hero__copy {
  border: var(--bw) solid var(--ink); border-radius: var(--r-lg);
  /* Figma .frame-4: 694x765, side pad 36px, headline ~96px from box top, CTA 87px
     below the headline (NOT pinned to the bottom — the box continues empty below) */
  padding: clamp(48px, 6.35vw, 96px) clamp(20px, 2.38vw, 36px) clamp(28px, 3.4vw, 52px);
  display: flex; flex-direction: column; justify-content: flex-start; gap: clamp(40px, 5.75vw, 87px);
}
.hero__copy h1 { font-weight: 900; font-synthesis-weight: none; font-size: clamp(2.75rem, 6.08vw, 5.75rem); line-height: .935; letter-spacing: -.03em; }  /* Figma: GT Walsheim BLACK 92px, ls -2.76px, lh 86px */
/* Figma's exact headline breaks ("We design / to give you / the maximum…") — desktop only */
.br-d { display: none; }
@media (min-width: 880px) { .br-d { display: inline; } }

/* clean elliptical highlight on a word (no hand-drawn wobble) */
.mark-ellipse { position: relative; display: inline-block; white-space: nowrap; }
.mark-ellipse svg {
  /* geometry traced from the client's real vector art ("We Design…RGB.ai"):
     flat ellipse crossing mid x-height, ~9% wider / hugging the word, tilt -3.74deg */
  /* client t081: slightly bigger, must overshoot the word left AND right */
  position: absolute; left: 50%; top: 55%; width: 128%; height: 86%;
  transform: translate(-50%,-50%) rotate(-1.81deg); overflow: visible; pointer-events: none;
}
.mark-ellipse svg ellipse {
  fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.on-dark .mark-ellipse svg ellipse { stroke: var(--coral); }
.mark-ellipse.is-draw svg ellipse { animation: ellipse-draw 1.1s var(--ease-out) forwards; }
@keyframes ellipse-draw { to { stroke-dashoffset: 0; } }

/* ---------- Carousel ---------- */
.carousel { position: relative; }
.carousel__track {
  display: grid; grid-auto-flow: column; gap: clamp(16px, 1.6vw, 24px);
  grid-auto-columns: min(86%, 380px);
  overflow-x: auto; scroll-snap-type: x mandatory;
  /* top padding + negative margin = headroom so the hover lift (translateY(-6px))
     isn't clipped by this scroller (overflow-x:auto forces vertical clipping too) */
  padding-top: 10px; margin-top: -10px;
  /* t073/t077/t108: the home carousels sit OUTSIDE .container, so cards must be
     inset by the page gutter directly (no negative margins — those made the first
     card land flush at x=0 on mobile/tablet); snap aligns to the padded edge. */
  padding-bottom: 8px; padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > * { scroll-snap-align: start; }
/* drag-to-scrub (reference demo mechanics) */
.carousel__track { cursor: grab; touch-action: pan-x; scroll-behavior: smooth; }
.carousel__track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.carousel__track.is-dragging > * { pointer-events: none; }
/* (progress line removed per client — "la linea sopra le frecce via ovunque") */
.carousel--3 .carousel__track { grid-auto-columns: min(84%, 380px); }
.carousel__nav { display: flex; gap: 14px; margin-top: 28px; justify-content: flex-end; }  /* client: arrows on the right */
/* client (twice): arrows must be BIG — larger buttons and glyphs that fill them */
.carousel__nav .icon-btn { --s: clamp(52px, 4.1vw, 62px); }
.carousel__nav .icon-btn svg { width: 62%; height: 62%; stroke-width: 2.6; }
/* Desktop: stay a horizontal SLIDER (like Figma) — N cards + a peek of the next,
   arrows navigate. Not a static grid. */
@media (min-width: 880px) {
  .carousel__track { margin-inline: 0; padding-inline: 0; align-items: stretch; }
  .carousel--2 .carousel__track { grid-auto-columns: 48%; }
  .carousel--3 .carousel__track { grid-auto-columns: calc((100% - 48px) / 2.85); }   /* t084: slightly smaller cards (~2.85 + peek) */
  .carousel--4 .carousel__track { grid-auto-columns: calc((100% - 60px) / 3.4); }
  .carousel.is-static .carousel__nav { display: none; }
}

/* project card — Figma form: full photo + dark gradient at top, title overlaid on the photo */
.work-card {
  position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 3/4;
  display: block; color: var(--cream); background: var(--ink);
  transition: transform var(--t); isolation: isolate;
}
.work-card > img,
.work-card__media img { position:absolute; inset:0; width:100%; height:100%; object-fit: cover; z-index:0; transition: transform .6s var(--ease-out); }
.work-card::before {                 /* light dark scrim for text legibility (client-approved) */
  content:""; position:absolute; left:0; right:0; top:0; height:52%; z-index:1; pointer-events:none;
  background: linear-gradient(180deg, rgba(0,38,48,.72) 0%, rgba(0,38,48,.34) 55%, rgba(0,38,48,0) 100%);
}
.work-card__top { position:absolute; left:0; right:0; top:0; z-index:2;
  padding: clamp(20px,2.12vw,32px); display:flex; flex-direction:column; gap:.6rem; }  /* Figma card pad: 32px */
.work-card__fair { font-size: clamp(.95rem,1.4vw,1.3rem); letter-spacing: 0; color: var(--cream); opacity:1;  /* t095: slightly reduced */
  display:flex; flex-direction:column; gap:.55em; }
.work-card__fair .rule-dots { background: var(--cream); }  /* Figma: full off-white rule on photo */
.work-card__fair .rule-dots::before, .work-card__fair .rule-dots::after { background: var(--cream); }
.work-card__name { font-size: clamp(1.8rem,3.7vw,3.5rem); font-weight:400; line-height:1.0; transition: color var(--t-fast); }  /* t083/t095: slightly reduced */
.work-card__plus { position:absolute; right: clamp(20px,2.12vw,32px); bottom: clamp(20px,2.12vw,32px); z-index:2; --s: clamp(48px,4.03vw,61px);  /* Figma: 61px circle at card padding */
  background: rgba(245,240,237,.5); color: var(--ink); }  /* Figma: off-white @50%, ink glyph */
.work-card__plus:hover { background: var(--cream); color: var(--ink); }
.work-card:hover { transform: translateY(-6px); }
.work-card:hover > img, .work-card:hover .work-card__media img { transform: scale(1.05); }

/* ---------- Brand illustrations (real vector art from client) ---------- */
.cone { width: 100%; height: auto; display: block; }
/* full-bleed illustration card (image includes its own navy rounded card + diagram) */
.illus-card { padding: 0; overflow: hidden; }
/* t097/t098/t103: brand illustrations sized to the card's inner width */
.card--dark img.cone, .illus-card img { width: 100%; height: auto; }
.card--dark img.cone { max-width: none; }
.illus-card img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* ---------- Workflow ---------- */
.flow-card {
  border: var(--bw) solid var(--ink); border-radius: var(--r-lg);
  /* Figma: 576x497, pad 36px */
  padding: clamp(24px,2.38vw,36px); min-height: clamp(360px, 32.87vw, 497px);
  display: flex; flex-direction: column; gap: .8rem; background: var(--cream);
  transition: transform var(--t), border-color var(--t), background var(--t), color var(--t);
}
.flow-card .num { display: none; }  /* Figma workflow cards have no step number */
.flow-card .ic { width: auto; height: clamp(52px, 5.16vw, 78px); color: var(--ink); align-self: flex-start; }  /* t087: icons LEFT-aligned */
.flow-card h3 { font-size: clamp(1.6rem,3.17vw,3rem); line-height: .92; }  /* Figma: 48px Bold */
.flow-rule { display:block; height:2px; background: var(--line); position: relative; margin: .1rem 0 .5rem; }
.flow-rule::before, .flow-rule::after { content:""; position:absolute; top:50%; transform: translateY(-50%); width:8px; height:8px; border-radius:50%; background: var(--ink); }
.flow-rule::before { left:-4px; } .flow-rule::after { right:-4px; }
.flow-card p { color: var(--ink); font-size: clamp(1.05rem,1.72vw,1.625rem); line-height: 1.2; }  /* Figma: 26px solid ink */
.flow-card .icon-btn { margin-top: auto; align-self: flex-end; background: var(--ink); color: var(--cream); border-color: var(--ink); }
.flow-card:hover { transform: translateY(-6px); border-color: var(--ink); }
.flow-card:hover .ic { color: var(--coral); }
.flow-card:hover .icon-btn { background: var(--coral); border-color: var(--coral); color: #fff; }
/* On a dark band the flow-cards must be readable AT REST (not only on hover) */
.on-dark .flow-card, .band-dark .flow-card { color: var(--cream); }
.on-dark .flow-card h3, .band-dark .flow-card h3 { color: var(--cream); }
.on-dark .flow-card p, .band-dark .flow-card p { color: var(--muted-d); }
.on-dark .flow-card .ic, .band-dark .flow-card .ic { color: var(--cream); }
.on-dark .flow-rule, .band-dark .flow-rule { background: var(--line-d); }
.on-dark .flow-rule::before, .on-dark .flow-rule::after,
.band-dark .flow-rule::before, .band-dark .flow-rule::after { background: var(--cream); }
.on-dark .flow-card:hover, .band-dark .flow-card:hover { background: rgba(245,240,237,.06); border-color: var(--cream); }
.on-dark .flow-card:hover .ic, .band-dark .flow-card:hover .ic { color: var(--coral); }
.on-dark .flow-card .icon-btn, .band-dark .flow-card .icon-btn { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.on-dark .flow-card:hover .icon-btn, .band-dark .flow-card:hover .icon-btn { background: var(--coral); border-color: var(--coral); color: #fff; }

/* ---------- Team ---------- */
.member { display: flex; flex-direction: column; }
.member__photo { border-radius: var(--r); overflow: hidden; aspect-ratio: 4/5; background: var(--cream-2); }
.member__photo img { width:100%; height:100%; object-fit: cover; }
.member__role { margin-top: 1rem; font-size:.82rem; letter-spacing:.12em; text-transform:uppercase; color: var(--coral); font-weight:700; }
.member__name { font-size: clamp(1.3rem,1.8vw,1.7rem); font-weight:700; margin-top:.25rem; }
.member__bio { color: var(--muted); margin-top:.6rem; }

/* ---------- Video CTA ---------- */
.video-cta {
  position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: clamp(400px, 42vw, 635px);  /* Figma: 635px */
  display: grid; align-items: center; justify-items: start; text-align: center; color: var(--cream); padding: var(--gutter);
}
.video-cta img { position:absolute; inset:0; width:100%; height:100%; object-fit: cover; z-index:-2; }
/* mockup: dark gradient entering from the LEFT, photo clear on the right */
.video-cta::after { content:""; position:absolute; inset:0; z-index:-1;
  background: linear-gradient(90deg, rgba(0,38,48,.96) 0%, rgba(0,38,48,.72) 32%, rgba(0,38,48,.28) 58%, rgba(0,38,48,0) 80%); }
.video-cta__inner { max-width: clamp(400px, 38.1vw, 576px); display:flex; flex-direction:column; align-items:center; gap:1.4rem;
  margin-left: clamp(16px, 5vw, 96px); }  /* mockup: block sits in the left half */
.video-cta__inner h3 { font-size: clamp(1.6rem, 3.17vw, 3rem); line-height: 1.0; font-weight: 700; }  /* Figma: 48px/48px */
.play {
  --s: 96px; width:var(--s); height:var(--s); border-radius:50%; display:grid; place-items:center;
  background: var(--cream); color: var(--ink); transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.play:hover { background: var(--coral); color:#fff; transform: scale(1.08); }
.play svg { width: 42%; height:42%; margin-left: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--cream); }
.footer-nav { display:flex; justify-content:space-between; align-items:center; gap:24px; padding-block: clamp(28px,3vw,44px); flex-wrap: wrap; }
.footer-nav img { height: 40px; }
.footer-nav__links { display:flex; gap: clamp(16px,2vw,36px); flex-wrap: wrap; }
.footer-nav__links a { font-weight:700; }
.footer-nav__links a:hover { color: var(--coral); }

.footer-contact { background: var(--ink); color: var(--cream); border-radius: var(--r-lg); padding: clamp(28px,3.4vw,52px);
  display:grid; grid-template-columns: repeat(3,1fr); gap: 32px; }
.footer-contact .label { font-size:.8rem; letter-spacing:.12em; text-transform:uppercase; color: var(--muted-d); margin-bottom:.6rem; }
.footer-contact a:hover { color: var(--coral); }
.footer-social { display:flex; gap:14px; margin-block: 20px; }  /* t104: never touch the rule above / box below */

.footer-cta { background: var(--ink); color: var(--cream); border-radius: var(--r-lg); overflow:hidden;
  padding: clamp(36px,5vw,80px); margin-top: clamp(16px,2vw,24px); position: relative; }
.footer-cta h2 { font-size: clamp(3rem, 8vw, 7rem); line-height:.92; letter-spacing:-.02em; }
.footer-cta__row { display:grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px,4vw,64px); margin-top: clamp(28px,4vw,52px); align-items:end; }
.footer-cta .lead { color: var(--muted-d); max-width: 420px; }

/* underline email/newsletter field */
.field-line { display:flex; align-items:center; gap: 14px; border-bottom: 1.6px solid var(--line-d); padding-bottom: 12px; }
.field-line input { flex:1; background:none; border:none; color: var(--cream); font-size:1.1rem; letter-spacing:.06em; }
.field-line input::placeholder { color: var(--muted-d); letter-spacing:.12em; text-transform:uppercase; font-size:.95rem; }
.field-line input:focus { outline:none; }

.footer-legal { display:flex; justify-content:space-between; gap:18px; flex-wrap:wrap; padding-block: 12px; color: var(--ink); font-size: 1rem; }  /* Figma: 16px solid ink, 10px pad */
.footer-legal a:hover { color: var(--coral); }
.footer-legal .links { display:flex; gap: 12px; flex-wrap:wrap; }

/* ---------- Inner page hero ---------- */
.page-hero { padding-top: clamp(40px, 7vw, 96px); padding-bottom: clamp(36px, 5vw, 72px); } /* header is in normal flow now, no need to reserve its height here */
.page-hero h1 { font-size: clamp(2.8rem, 7vw, 6rem); line-height:.96; }
.page-hero .lead { margin-top: 1.2rem; max-width: 620px; }
.crumbs { display:flex; gap:.6em; align-items:center; color: var(--muted); font-size:.9rem; margin-bottom: 1.4rem; }
.crumbs a:hover { color: var(--coral); }

/* ---------- Stats ---------- */
.stats { display:grid; grid-template-columns: repeat(4,1fr); gap: 24px; }
.stat .n { font-size: clamp(2.4rem,4.5vw,3.6rem); font-weight:700; line-height:1; }
.stat .n .coral { color: var(--coral); }
.stat .t { color: var(--muted); margin-top:.4rem; }
.on-dark .stat .t { color: var(--muted-d); }
/* label above the number (e.g. "Dal 2004") */
.stat--top .t { margin-top: 0; margin-bottom: .25rem; }

/* ---------- Gallery grid ---------- */
/* Masonry via CSS columns: auto-fills with no gaps, adapts to any number of cards,
   keeps varied shapes (some landscape / square). */
.gallery-grid { column-count: 3; column-gap: clamp(14px,1.5vw,22px); }
.gallery-grid .work-card { width: 100%; margin: 0 0 clamp(14px,1.5vw,22px); break-inside: avoid; aspect-ratio: 4/5; }
.gallery-grid .work-card:nth-child(5n+1) { aspect-ratio: 4/3; }
.gallery-grid .work-card:nth-child(7n+4) { aspect-ratio: 1/1; }
@media (max-width: 900px) { .gallery-grid { column-count: 2; } }
@media (max-width: 560px) { .gallery-grid { column-count: 1; } }
.gallery-filter { display:flex; gap:10px; flex-wrap:wrap; margin-bottom: clamp(28px,3vw,44px); }
.gallery-filter .tag { cursor:pointer; }
.gallery-filter .tag.is-active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* ---------- Services ---------- */
.svc { border-top: var(--bw) solid var(--line); padding-block: clamp(28px,3.4vw,52px);
  display:grid; grid-template-columns: 64px 1fr 1.2fr auto; gap: clamp(18px,3vw,48px); align-items:start; }
.svc__num { font-size:1.1rem; font-weight:700; color: var(--coral); }
.svc__title { font-size: clamp(1.6rem,2.6vw,2.4rem); font-weight:700; line-height:1.04; }
.svc__desc { color: var(--muted); }
.svc:hover .svc__title { color: var(--coral); transition: color var(--t-fast); }

/* ---------- Forms (contact / quote) ---------- */
.form-grid { display:grid; grid-template-columns: repeat(2,1fr); gap: clamp(18px,2vw,28px); }
.field { display:flex; flex-direction:column; gap:.5rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight:700; font-size:.92rem; }
.field .req { color: var(--coral); }
.field input, .field textarea, .field select {
  background: var(--cream); border: var(--bw) solid var(--line); border-radius: var(--r-sm);
  padding: .9em 1.1em; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline:none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,38,48,.08);
}
.form-note { color: var(--muted); font-size:.9rem; }
.form-grid button[type="submit"] { grid-column: 1 / -1; justify-self: start; }
.choice-row { display:flex; gap:10px; flex-wrap:wrap; }
.choice { position:relative; }
.choice input { position:absolute; opacity:0; }
.choice span { display:inline-block; padding:.6em 1.1em; border:var(--bw) solid var(--line); border-radius: var(--pill); transition: var(--t-fast); font-weight:700; font-size:.95rem; }
.choice input:checked + span { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.form-success { display:none; }
.form-success.show { display:block; }

/* contact split */
.contact-split { display:grid; grid-template-columns: 1fr 1fr; gap: clamp(28px,4vw,72px); align-items:start; }
.contact-info .row { display:flex; gap:16px; padding-block: 18px; border-bottom:1px solid var(--line); }
.contact-info .row .ic { color: var(--coral); flex:none; width:24px; }
.map-card { border-radius: var(--r-lg); overflow:hidden; min-height: 320px; border:var(--bw) solid var(--line); }
.map-card iframe { width:100%; height:100%; min-height:320px; border:0; filter: grayscale(.3) contrast(1.05); }

/* ---------- g-pattern background ---------- */
.gpattern { position: relative; isolation: isolate; }
.gpattern::before {
  content:""; position:absolute; inset:0; z-index:-1; opacity:.05;
  background-image: url("../img/logo/logo_compact_navy.png");
  background-size: 90px; background-repeat: repeat;
}
.band-dark .gpattern::before, .gpattern.on-dark::before { background-image:url("../img/logo/logo_compact_offwhite.png"); opacity:.06; }

/* ---------- Reveal animations ----------
   Curve from the client's reference demo: deeper offset + slight scale + blur. */
.reveal { opacity: 0; transform: translateY(44px) scale(.985); filter: blur(10px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out), filter 1s ease; }
.reveal.in { opacity: 1; transform: none; filter: none; }
.reveal[data-d="1"]{ transition-delay:.12s } .reveal[data-d="2"]{ transition-delay:.24s }
.reveal[data-d="3"]{ transition-delay:.36s } .reveal[data-d="4"]{ transition-delay:.48s }

/* ---------- Marquee ---------- */
.marquee { overflow:hidden; border-block:var(--bw) solid var(--line); padding-block: 22px; }
.marquee__track { display:flex; gap: 64px; white-space:nowrap; width:max-content; animation: marquee 28s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span { font-size: clamp(1.5rem,2.6vw,2.4rem); font-weight:700; color: var(--ink); display:inline-flex; align-items:center; gap:.6em; }
.marquee span::after { content:"●"; color: var(--coral); font-size:.5em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .footer-contact { grid-template-columns: 1fr 1fr; }
  .footer-cta__row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .svc { grid-template-columns: 40px 1fr; }
  .svc__desc { grid-column: 2; }
  .svc .btn { grid-column: 2; justify-self: start; }
}
@media (max-width: 860px) {
  :root { --header-h: 72px; }
  .nav-desktop, .header-cta { display: none; }
  .hamburger { display: grid; }
  .hero__grid { grid-template-columns: 1fr; }
  .contact-split { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-contact { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-legal { flex-direction: column; }
  .hero__copy { padding: 24px; }
  .footer-cta { padding: 28px; }
}

/* ---------- v3.6.0 responsive refinements (client CSV) ---------- */
@media (max-width: 880px) {
  .work-card__fair .rule-dots { height: 1px; }                       /* t109 */
  .brand .logo-compact { height: 56px !important; }                  /* t107: bigger tablet/mobile logo */
  .section__head { margin-bottom: clamp(20px, 3vw, 32px); }          /* t116: tighter title spacing */
  .section__head--row .lead { text-align: left; white-space: nowrap; font-size: clamp(.8rem, 3.3vw, 1.05rem); max-width: none; }  /* t114: one line, left */
  .about-grid--flip { display: flex; flex-direction: column; }
  .about-grid--flip .about-photo { order: 1; }
  .about-grid--flip .about-copy { order: 2; }
  .footer-addr { text-align: left; }
  .footer-addr > div:last-child { text-align: right; }               /* t112 fallback: Sede sx, HQ dx */
}
@media (max-width: 880px) {
  .about-grid .card--dark { order: 1; min-height: clamp(300px, 78vw, 420px); }  /* t075/t115: diagram first (mobile mockup), bigger */
  .about-grid .about-copy { order: 2; }
  .about-grid { display: flex; flex-direction: column; }
}
@media (max-width: 560px) {
  .btn--lg { font-size: 1rem; padding: .5em 1em; }                   /* t043: smaller hero CTA */
  .footer-addr .label { font-size: 1.05rem; }                        /* t119 */
  .footer-addr p { font-size: .9rem; }
}
/* t111/t112: tablet footer keeps 2 columns (addresses BESIDE the quote column) */
@media (min-width: 561px) and (max-width: 860px) {
  .footer-main__grid { grid-template-columns: 1.15fr .85fr !important; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.001ms !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
  .reveal { opacity:1 !important; transform:none !important; filter:none !important; }
}

/* =====================================================================
   WordPress / Elementor Pro integration (Theme Builder header + Posts)
   ===================================================================== */

/* --- Sticky header: full-bleed background inside the Theme Builder header location ---
   Some Elementor containers create a containing block (transform) that would box a
   position:fixed child; neutralise it so the bar spans the whole viewport. */
.elementor-location-header { position: static !important; overflow: visible !important; }
.elementor-location-header .e-con,
.elementor-location-header .e-con-inner,
.elementor-location-header .elementor-element,
.elementor-location-header .elementor-widget-html,
.elementor-location-header .elementor-widget-container { transform: none !important; filter: none !important; perspective: none !important; }
.elementor-location-header > .e-con,
.elementor-location-header .e-con,
.elementor-location-header .e-con-inner { width: 100% !important; max-width: none !important; overflow: visible !important; }
/* Full-bleed header WIDTH — works whether the header is moved to <body> OR left inside
   the (boxed/centred) Elementor Theme Builder location. The 100vw + margin trick spans
   the whole viewport even when the containing block is a centred boxed container. This
   applies REGARDLESS of scroll state: at rest the header sits in normal flow (matching
   the mockup, no overlap with the hero); only once scrolled does it become fixed. */
.site-header,
.elementor-location-header .site-header,
body > .site-header {
  width: 100vw !important; max-width: 100vw !important; margin-left: calc(50% - 50vw) !important;
  transform: none !important; padding-block: 4px; z-index: 1000;
}
.site-header.is-scrolled,
.elementor-location-header .site-header.is-scrolled,
body > .site-header.is-scrolled {
  /* margin-left:0 overrides the calc(50%-50vw) trick above (higher specificity: two
     classes vs one) — see the matching comment in the base rule for why that trick
     must NOT apply once the header is actually position:fixed. */
  position: fixed !important; top: 0 !important; left: 0 !important; right: auto !important;
  margin-left: 0 !important;
}
body > .drawer { z-index: 999; }

/* --- Same full-bleed hazard for the Footer Theme Builder location (.footer-main)
   and for .bleed-right sliders inside normal page containers (Our works / Team on
   Home): an Elementor wrapper with any transform/filter becomes a new containing
   block and would box our 100vw trick. Neutralise on the wrapper elements site-wide,
   not just in the header location. */
.elementor-location-footer,
.elementor-widget-html,
.elementor-widget-container,
.e-con-inner { transform: none !important; filter: none !important; perspective: none !important; }
.elementor-location-footer .e-con,
.elementor-location-footer .e-con-inner { width: 100% !important; max-width: none !important; overflow: visible !important; }
/* Reinforce .site-footer's own full-bleed break-out specifically inside the Theme
   Builder footer location (defensive — same pattern already proven for .site-header),
   in case a theme wrapper around the footer location constrains width differently
   than it constrains ordinary page content. */
.site-footer,
.elementor-location-footer .site-footer {
  width: 100vw !important; max-width: 100vw !important; margin-left: calc(50% - 50vw) !important;
}

/* Nav menu (wp_nav_menu) — keep text #00222E on hover (coral underline only); active page = coral */
.nav-desktop ul { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 40px); list-style: none; margin: 0; padding: 0; }
.nav-desktop li { position: relative; }
.nav-desktop a:hover { color: var(--ink); }
.nav-desktop .current-menu-item > a,
.nav-desktop .current_page_item > a { color: var(--coral); }
.nav-desktop .current-menu-item > a::after,
.nav-desktop .current_page_item > a::after { width: 100%; }
.drawer .current-menu-item > a, .drawer .current_page_item > a { color: var(--coral); }
.drawer nav ul { display: flex; flex-direction: column; gap: .15em; list-style: none; margin: 0; padding: 0; }

/* Work-card title turns coral on hover (home + realizzazioni) */
.work-card:hover .work-card__name { color: var(--coral); }

/* =====================================================================
   Figma DESKTOP: logo + pill nav, side-by-side hero (headline left, 3D right),
   full width. (Mobile stays hamburger + stacked via the base responsive rules.)
   ===================================================================== */
/* Desktop nav as capsule pills; no big CTA button in the header (per Figma) */
.site-header .header-cta { display: none !important; }
.nav-desktop ul { display: flex; align-items: center; gap: 10px; list-style: none; margin: 0; padding: 0; }
.nav-desktop a { padding: .33em .75em; border: var(--bw-pill) solid var(--ink); border-radius: var(--pill); background: rgba(245,240,237,.9); font-weight: 400; font-size: clamp(1rem, 1.59vw, 1.5rem); transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }  /* Figma: 8px 18px pad, 1.5px ink border, off-white 90%, 24px Regular */
.nav-desktop a::after { display: none; }          /* pills, not underline */
.nav-desktop a:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.nav-desktop .current-menu-item > a,
.nav-desktop .current_page_item > a,
.nav-desktop a[aria-current="page"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* Hero: side-by-side on desktop (headline LEFT, 3D RIGHT); stacked on mobile.
   Figma: copy box 765px tall, 3D box 831px — the 3D box is intentionally TALLER. */
.hero__visual { min-height: clamp(340px, 54.96vw, 831px); }
@media (min-width: 880px) {
  .hero__grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .hero__copy { order: 1; min-height: clamp(420px, 50.6vw, 765px); }
  .hero__visual { order: 2; }
}
/* Per mockup: on the home page, the logo+nav sit as plain in-page content (.hero__topbar,
   filled by main.js from a clone of the real header's content) at the top of the LEFT
   column, and the 3D panel spans both rows (topbar height + copy height) so its top
   lines up with the topbar and its bottom with copy's bottom — using CSS Grid's own
   row-spanning, not manual pixel math. This replaces an earlier attempt (position:absolute
   with a calc'd top offset) that fought the real, fixed-capable #site-header for space —
   simpler and more robust, per direct user feedback: the logo/nav "can just live inside the
   page", and the real sticky header only needs to exist once actually scrolled.
   Threshold is 1100px, not the 880px used above for the base 2-column split: below
   ~1050px the (4-item) nav cluster overflows past the left column's width (measured via
   Playwright), so narrower desktop widths fall back to the plain #site-header instead
   (.hero__topbar stays hidden, matching how this looked before this whole effect existed).
   Scoped with two selectors: [data-page="home"] is set by the static prototype's own
   layout.js, while WordPress never sees that attribute — there the plugin sets this
   page as the real Front Page (bgastand-setup.php, show_on_front/page_on_front), so
   WP's own body_class() adds ".home" instead. Both are needed for the effect to fire
   in both environments. */
@media (min-width: 1100px) {
  body[data-page="home"] .hero__grid,
  body.home .hero__grid {
    /* stretch (not the base breakpoint's "start") so .hero__visual actually fills
       its full row-1/row-2 span instead of sitting min-height-tall at the top of it */
    grid-template-rows: auto 1fr; align-items: stretch;
  }
  body[data-page="home"] .hero__topbar,
  body.home .hero__topbar {
    display: flex; align-items: center; justify-content: space-between;
    grid-column: 1; grid-row: 1; padding-bottom: clamp(10px, 1.32vw, 20px);  /* client: less gap menu→hero */
  }
  /* Nav must fit the left column's width alone TOGETHER with the logo, with visible
     breathing room between them (client: "il logo è troppo vicino al menu"). We have
     4 pills where the Figma has 3, so in this cramped context only, the pills run
     slightly smaller/tighter than the global pill spec — frees ~70px of gap. */
  body[data-page="home"] .hero__topbar .nav-desktop,
  body.home .hero__topbar .nav-desktop {
    gap: clamp(8px, .66vw, 10px);
  }
  body[data-page="home"] .hero__topbar .nav-desktop a,
  body.home .hero__topbar .nav-desktop a {
    font-size: clamp(.95rem, 1.32vw, 1.25rem); padding: .33em .7em;
  }
  body[data-page="home"] .hero__topbar .brand,
  body.home .hero__topbar .brand {
    margin-right: clamp(16px, 2vw, 40px);   /* guaranteed minimum logo→menu gap */
  }
  body[data-page="home"] .hero__copy,
  body.home .hero__copy {
    grid-column: 1; grid-row: 2;
  }
  body[data-page="home"] .hero__visual,
  body.home .hero__visual {
    grid-column: 2; grid-row: 1 / 3; min-height: 0;
  }
  /* The real header only needs to exist once scrolled (.hero__topbar covers the
     at-rest look) — hidden here, the base .site-header{display:flex} reasserts the
     moment .is-scrolled is added since :not(.is-scrolled) no longer matches. */
  body[data-page="home"] .site-header:not(.is-scrolled),
  body.home .site-header:not(.is-scrolled) {
    display: none;
  }
  /* Since the header takes zero flow space here even at rest (display:none, not just
     static-in-flow like everywhere else), the usual body.is-header-fixed compensation
     — which backfills the ~88px gap a normally-in-flow header leaves when it pops into
     position:fixed — would add a phantom 88px gap that was never actually there.
     Cancel it back to 0 specifically in this context. */
  body[data-page="home"].is-header-fixed,
  body.home.is-header-fixed {
    padding-top: 0;
  }
}
/* The instant the real header appears (fixed, on scroll), hide the topbar clone so
   the two are never both visible while the hero is still partially in view. */
body.is-header-fixed .hero__topbar { visibility: hidden; }

/* --- Single-post photo gallery, count-aware (client: stacked full-width images were
   huge on desktop; with 3 they want "in fila" / one big + the rest).
   6-column grid; the first photo (the cover) is a wide 2:1 hero — except when there are
   exactly 2 photos (then just a pair). Remaining photos: 3 in a row when there are 4 (or 7),
   otherwise pairs. `:first-child:nth-last-child(N)` = "exactly N items", pure CSS, so the
   layout keeps working if the client removes a photo from the post. --- */
.bga-post-gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(14px, 1.6vw, 24px); margin-block: clamp(24px, 3vw, 40px); }
.bga-post-gallery .bga-gallery-item { margin: 0; grid-column: span 3; }
.bga-post-gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; border-radius: var(--r-lg); display: block; }
.bga-post-gallery .bga-gallery-item:first-child:not(:nth-last-child(2)) { grid-column: 1 / -1; }
.bga-post-gallery .bga-gallery-item:first-child:not(:nth-last-child(2)) img { aspect-ratio: 2/1; }
.bga-post-gallery .bga-gallery-item:first-child:nth-last-child(4) ~ .bga-gallery-item,
.bga-post-gallery .bga-gallery-item:first-child:nth-last-child(7) ~ .bga-gallery-item { grid-column: span 2; }
@media (max-width: 700px) {
  .bga-post-gallery .bga-gallery-item,
  .bga-post-gallery .bga-gallery-item:first-child:nth-last-child(4) ~ .bga-gallery-item,
  .bga-post-gallery .bga-gallery-item:first-child:nth-last-child(7) ~ .bga-gallery-item { grid-column: 1 / -1; }
  .bga-post-gallery .bga-gallery-item:first-child:not(:nth-last-child(2)) img { aspect-ratio: 4/3; }
}

/* --- Realizzazioni listing (Elementor Pro "Posts"/"Loop") styled as bgastand work-cards --- */
.elementor-posts .elementor-post {
  position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 3/4;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--ink); color: var(--cream); margin: 0; border: 0; isolation: isolate;
  transition: transform var(--t);
}
.elementor-posts .elementor-post:hover { transform: translateY(-6px); }
.elementor-posts .elementor-post__thumbnail { position: absolute; inset: 0; height: 100%; width: 100%; margin: 0; border-radius: 0; z-index: 0; }
.elementor-posts .elementor-post__thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.elementor-posts .elementor-post:hover .elementor-post__thumbnail img { transform: scale(1.05); }
.elementor-posts .elementor-post::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,38,48,.5) 0%, rgba(0,38,48,.05) 40%, rgba(0,38,48,.9) 100%);
}
.elementor-posts .elementor-post__card,
.elementor-posts .elementor-post__text {
  position: relative; z-index: 2; background: transparent; border: 0;
  padding: clamp(20px,2vw,28px); display: flex; flex-direction: column;
}
.elementor-posts .elementor-post__title { font-size: clamp(1.4rem,2vw,1.9rem); font-weight: 700; line-height: 1.05; margin: 0; padding-right: 56px; }
.elementor-posts .elementor-post__title a { color: var(--cream); }
.elementor-posts .elementor-post__title a:hover { color: var(--cream); }
.elementor-posts .elementor-post__excerpt { order: -1; margin: 0 0 .55rem; color: var(--cream); opacity: .9;
  font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: .5em; }
.elementor-posts .elementor-post__excerpt::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); flex: none; }
.elementor-posts .elementor-post__excerpt p { margin: 0; font: inherit; letter-spacing: inherit; }
.elementor-posts .elementor-post__meta-data { display: none; }
.elementor-posts .elementor-post__read-more {
  position: absolute; right: 20px; bottom: 20px; z-index: 3; width: 48px; height: 48px;
  border: 1.6px solid var(--cream); border-radius: 50%; display: grid; place-items: center;
  color: var(--cream); font-size: 0; transition: background var(--t-fast), color var(--t-fast); }
.elementor-posts .elementor-post__read-more::after { content: "+"; font-size: 26px; line-height: 1; }
.elementor-posts .elementor-post__read-more:hover { background: var(--cream); color: var(--ink); }

/* =====================================================================
   v3.2 — Client markup fidelity pass (footer, team, values, personality,
   mission/vision graphics, mobile hero, compact logo)
   ===================================================================== */

/* ---- Brand logo: extended on desktop, compact (taller) on mobile ---- */
.brand .logo-compact { display: none; }
@media (max-width: 860px) {
  .brand .logo-ext { display: none; }
  .brand .logo-compact { display: block; height: 40px; width: auto; }   /* logo ≥ menu button */
}

/* ---- FOOTER (one navy block, per mockup) ----
   The WHOLE footer breaks out full-bleed (not just .footer-main) so that ALL THREE
   rows escape any theme/Elementor wrapper padding uniformly and compute their width
   against the true viewport via the SAME .container class — if only .footer-main
   broke out while footer-top/footer-legal stayed inside a (possibly narrower) theme
   wrapper, the rows would drift out of alignment exactly like they did in v3.4.4. */
.site-footer {
  background: var(--cream);
  width: 100vw !important; max-width: 100vw !important; margin-left: calc(50% - 50vw) !important;
}
/* Figma .frame-50: big logo (216x132) left, links stacked RIGHT-ALIGNED in a column
   distributed over 216px height, 36px Regular underlined. */
.footer-top { display:flex; justify-content:space-between; align-items:flex-start; gap:24px;
  padding-block: clamp(34px,4vw,60px); flex-wrap: wrap; }
.footer-top .brand img { height: auto; width: clamp(140px, 14.29vw, 216px); }
.footer-links { display:flex; flex-direction: column; align-items: flex-end;
  justify-content: space-between; min-height: clamp(140px, 14.29vw, 216px); gap: 8px; }
.footer-links a { font-weight:400; font-size: clamp(1.35rem, 2.38vw, 2.25rem); line-height: 1.16;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.footer-links a:hover { color: var(--coral); }

/* Full-bleed edge-to-edge (per Figma: the navy block spans the whole viewport, no
   rounding, no side margin). Same proven technique as .site-header (margin, not
   transform) so it survives being nested inside Elementor's Footer TB location. */
/* The navy band is full-bleed for its BACKGROUND only; its content sits in the exact
   same .container used by footer-top/footer-legal above/below it, so the three rows
   are guaranteed to share the same left/right edges (no independent padding maths
   that could ever drift out of sync with .container's own centering). */
.footer-main {
  background: var(--ink); color: var(--cream);
  width: 100vw !important; max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  padding-block: clamp(52px,5.6vw,88px);   /* client: more margin/air in the footer */
  margin-bottom: clamp(18px,2.4vw,30px);
}
.footer-main__grid {
  display:grid; grid-template-columns: 1.15fr .85fr;
  gap: clamp(28px,4vw,72px); align-items: stretch;
}
.footer-main__l { display:flex; flex-direction:column; }
.footer-main__l .footer-email { margin-top: auto; }
.footer-claim { line-height:1.0; margin-bottom: clamp(20px,2.6vw,34px); font-size: clamp(2.4rem, 5vw, 4.75rem); }  /* t091: one step smaller than .h-display */
.footer-quote h3 { font-size: clamp(1.35rem,2.38vw,2.25rem); margin-bottom:.7rem; }  /* Figma: 36px Bold */
.footer-quote p { color: var(--cream); opacity: .9; max-width: 460px; font-size: clamp(1rem,1.59vw,1.5rem); line-height: 1.25; }
.footer-email { margin-top: clamp(24px,3vw,40px); max-width: 480px; }
.footer-main__r { display:flex; flex-direction:column; gap: clamp(24px,3vw,40px); justify-content: space-between; }
.footer-addr { display:grid; grid-template-columns: 1fr; gap: 24px; }  /* t094: Sede legale sopra, Headquarters sotto */
.footer-addr .label, .footer-follow .label { font-size: clamp(1.1rem,1.85vw,1.75rem); font-weight:700; color: var(--cream); margin-bottom:.55rem; }  /* t092: reduced labels */
.footer-addr p { color: var(--cream); opacity: .9; font-size: clamp(.95rem,1.32vw,1.25rem); line-height: 1.35; }  /* t092: ≤ "Richiedi un preventivo" body size */
/* Figma: the whole right column is right-aligned (labels, addresses, Seguici) */
.footer-addr { text-align: right; }
.footer-follow { text-align: right; }
.footer-follow .footer-social { display:flex; gap:14px; justify-content: flex-end; }

/* EMAIL row — Figma: 'EMAIL' 28px Regular + 34px circle-arrow, then a plain 2px
   off-white rule (NO dots), whole block 373px wide, a mailto link (not a form). */
.footer-email { max-width: clamp(280px, 24.67vw, 373px); }
.footer-email .mail-row { display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding-bottom: 12px; border-bottom: var(--bw) solid var(--cream);
  font-size: clamp(1.1rem, 1.85vw, 1.75rem); color: var(--cream); letter-spacing: .02em;
  transition: color var(--t-fast); }
.footer-email .mail-row:hover { color: var(--coral); }
.footer-email .icon-btn--light { --s: clamp(30px, 2.25vw, 34px); }
/* legacy input-form styles kept for other pages' forms */
.footer-email.field-line { align-items: flex-end; gap: 16px; border-bottom: var(--bw) solid var(--line-d); padding-bottom: 12px; }
.footer-email input { flex:1; background:none; border:none; color: var(--cream); font-size:1.15rem; line-height: 1; padding: 0 0 2px; }
.footer-email input::placeholder { color: var(--muted-d); letter-spacing:.02em; }
.footer-email input:focus { outline:none; }

@media (max-width: 860px) {
  .footer-main__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .footer-addr { grid-template-columns: 1fr; }
  .footer-addr > *:last-child, .footer-follow, .footer-follow .footer-social { text-align: left; justify-content: flex-start; }
}

/* ---- TEAM: synced slider — the active photo AND the text (role/name/bio) advance
   together; the other members show smaller + muted as a peek (per Figma). ---- */
.team-slider { display:grid; grid-template-columns: minmax(240px, .78fr) 1.6fr; gap: clamp(24px,3.5vw,56px); align-items: stretch; }  /* info column spans photo height: role top-aligned, arrows at bottom (mockup) */
.team-slider__info { display:flex; flex-direction:column; gap: .9rem; }
.team-slider__role { font-size: clamp(1rem,1.59vw,1.5rem); font-weight:700; color: var(--ink); }  /* Figma: 24px Bold ink */
.team-slider__info > .rule-dots { align-self: stretch; }   /* full-width rule UNDER the role (mockup) */
.team-slider__info .carousel__nav { margin-top: auto; justify-content: flex-end; }  /* arrows: bottom-right of info column (mockup) */
.team-slider__name { font-size: clamp(2.2rem,4.23vw,4rem); font-weight:400; line-height:1.0; }  /* Figma: 64px REGULAR */
.team-slider__bio { color: var(--ink); font-size: clamp(1rem,1.59vw,1.5rem); line-height: 1.25; max-width: 36ch; }  /* Figma: 24px solid ink */

.team-slider__photos { min-width: 0; }
.team-slider__track {
  --team-h: clamp(380px, 41.53vw, 628px);  /* Figma photos: 628px tall */
  display:flex; align-items:stretch; gap: clamp(14px,1.6vw,24px); overflow-x:auto; scrollbar-width:none; padding-bottom: 4px;
}
.team-slider__track::-webkit-scrollbar { display:none; }
.team-slide {
  /* All tiles share the SAME height — only width changes between active/peeking —
     per client: "il resto alto uguale alla prima ma stretto". Full-colour photo
     (object-fit:cover) with a light dark overlay tint (not grayscale) when inactive. */
  flex: 0 0 auto; width: clamp(140px,14.29vw,216px); height: var(--team-h); border-radius: var(--r);  /* Figma inactive: 216px */
  overflow: hidden; position: relative; padding: 0; border: none; background: var(--cream-2);
  transition: width .5s var(--ease-out);
}
.team-slide img { width:100%; height:100%; object-fit: cover; display:block; }
.team-slide::after {
  content:""; position:absolute; inset:0; background: rgba(0,38,48,.28);
  opacity: 1; transition: opacity .5s var(--ease-out); pointer-events: none;
}
.team-slide.is-active { width: clamp(280px,30.16vw,456px); }  /* Figma active: 456x628 */
.team-slide.is-active::after { opacity: 0; }
/* last (rightmost) tile fades into the page on its outer edge, like it trails off-screen */
.team-slide:last-child:not(.is-active) {
  -webkit-mask-image: linear-gradient(to right, #000 65%, transparent 100%);
  mask-image: linear-gradient(to right, #000 65%, transparent 100%);
}
@media (max-width: 860px) { .team-slider { grid-template-columns: 1fr; } }

/* ---- VALUES: clean bold-label bulleted list (brand manual) ---- */
.values-list { display:grid; gap: 0; max-width: 980px; }
.values-list li { display:grid; grid-template-columns: 1.4em 1fr; gap: .4em;
  padding-block: clamp(18px,2.2vw,28px); border-top: var(--bw) solid var(--line); }
.values-list li:last-child { border-bottom: var(--bw) solid var(--line); }
.values-list li::before { content:""; width:11px; height:11px; border-radius:50%; background: var(--coral); margin-top:.5em; }
.values-list p { display:block; color: var(--muted); max-width: 70ch; }
.values-list .v-name { font-size: clamp(1.25rem,1.9vw,1.7rem); font-weight:700; display:block; margin-bottom:.4rem; }

/* ---- PERSONALITY: 2-col grid of coral icon-tile cards (brand manual) ---- */
.persona-grid { display:grid; grid-template-columns: 1fr 1fr; gap: clamp(16px,2vw,24px); }
.persona { display:grid; grid-template-columns: clamp(72px,8vw,104px) 1fr; gap: clamp(16px,2vw,24px);
  border: var(--bw) solid var(--line); border-radius: var(--r-lg); padding: clamp(20px,2.4vw,30px); align-items:start; }
.persona__face { aspect-ratio:1; border-radius: var(--r); background: rgba(244,92,69,.16);
  display:grid; place-items:center; }
.persona__face svg { width: 60%; height:60%; color: var(--coral-d); }
.persona__name { font-size: clamp(1.25rem,1.8vw,1.6rem); font-weight:700; }
.persona__rule { display:block; height:2px; background: var(--line); position:relative; margin:.5rem 0 .8rem; }
.persona__rule::before, .persona__rule::after { content:""; position:absolute; top:50%; transform:translateY(-50%); width:11px; height:11px; border-radius:50%; background: var(--ink); }  /* Figma team rule: 10.67px ink dots */
.persona__rule::before { left:-5px; } .persona__rule::after { right:-5px; }
.persona p { color: var(--muted); }
@media (max-width: 760px) { .persona-grid { grid-template-columns: 1fr; } }

/* ---- VISION "loading" graphic + MISSION funnel (navy tech cards) ---- */
.loadbar { display:flex; gap:8px; width:100%; }
.loadbar span { flex:1; height: 26px; border-radius: 6px; border: 2px solid var(--line-d); }
.loadbar span.on { background: var(--cream); border-color: var(--cream); }
.loadbar__label { color: var(--muted-d); font-weight:700; margin-top: 1rem; display:flex; align-items:center; gap:.6em; }
.loadbar__label::before { content:""; width:9px; height:9px; border-radius:50%; background: var(--coral); }

/* ---- Filled social on contact page (client #34) ---- */
.contact-info .footer-social .icon-btn { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.contact-info .footer-social .icon-btn:hover { background: var(--coral); border-color: var(--coral); color:#fff; }

/* ---- Stats: all big numbers on one baseline (client #25) ---- */
.stats { align-items: end; }
.stat { display:flex; flex-direction:column; justify-content:flex-end; }

/* ---- Mobile / tablet hero: ~1:1 boxes, bigger headline (clients #37,#43) ---- */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 14px; }
  .hero__visual { order: 1; min-height: clamp(300px, 62vw, 460px); aspect-ratio: 1 / 1; }
  .hero__copy { order: 2; aspect-ratio: 1 / 1; justify-content: flex-start; }  /* t037: ~1:1 like the 3D box */
  .hero__copy h1 { font-size: clamp(2.6rem, 10.5vw, 4.2rem); line-height: 1.0; }  /* t043/t113: as big as possible */
}
@media (max-width: 560px) {
  .hero__copy h1 { font-size: clamp(2.5rem, 10.8vw, 3.4rem); }  /* t113: as big as possible */
}

/* Long subtitles (Chi siamo values, Works intro) must WRAP: the "one line" rule above is
   for the short home subtitles only — on long text it overflowed the viewport by hundreds
   of px (chi-siamo 43px desktop / 319px mobile). Opt-out class set in the markup. */
.section__head--row .lead--wrap { white-space: normal; max-width: 640px; }
@media (max-width: 880px) { .section__head--row .lead--wrap { max-width: none; font-size: 1rem; } }
