/* ==========================================================================
   Home v2 (Figma "00. Homepage 4"): shares the nav, carousel, showreel,
   marquee and logos with the original home (styles.css); this file holds the
   new hero, proposition, Complex Transformation Systems and contact/footer.
   Sizes are measured from the 1440-wide Figma frame and scale down with the
   viewport. The contact page ("07. Contact") reuses the eyebrow and
   contact/footer rules, and so do case pages with "footer": "v2".
   ========================================================================== */

:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"]) { --label: "Stack Sans Text", var(--text); }

/* Eyebrows: blue ring instead of a solid dot. Stack Sans Text Light on Contact, Instrument Sans on Home */
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"]) .eyebrow { font-family: var(--label); font-weight: 300; font-size: 12px; line-height: 1; letter-spacing: 0; }
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"]) .eyebrow::before { background: radial-gradient(circle, transparent 1.5px, var(--blue) 1.75px); }
[data-page="home-v2"] .eyebrow { font-family: var(--text); font-weight: 400; }

/* Side CTA: grey label over a blue line and dot */
[data-page="home-v2"] .side-cta { mix-blend-mode: normal; color: #8b8b8b; gap: 3px; }
[data-page="home-v2"] .side-cta .tail { color: var(--blue); }
[data-page="home-v2"] .side-cta .tail b { background: currentColor; }
/* Leaves once the closing Get in touch section is on screen (home2.js). Fades
   with filter/translate, not opacity: the intro in main.js owns its opacity. */
[data-page="home-v2"] .side-cta { transition: filter .5s var(--ease-out), translate .5s var(--ease-out); }
[data-page="home-v2"] .side-cta.is-away { filter: opacity(0); translate: 0 12px; pointer-events: none; }

/* ---------- Splash (home, every visit): the black logomark backlit in the brand colours (timeline in main.js) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; background: #0b0b0b;
  animation: splashFailsafe .6s 8s forwards; /* gone even if the script never runs; main.js cancels this */
}
@media (prefers-reduced-motion: reduce) { .splash { display: none; } }
@keyframes splashFailsafe { to { opacity: 0; visibility: hidden; } }
.splash > * { grid-area: 1 / 1; }
/* Reached through a transition: open on the lit mark the curtain left on screen (main.js skips the build-up) */
.is-arriving .splash .splash-bloom { opacity: .55; }
.is-arriving .splash :is(.splash-glow, .splash-rim) { opacity: 1; }

/* ---------- One left edge ----------
   Figma Homepage 4 lines every section up at x=160 in the 1440 frame: hero, Work, proposition,
   Expertise and contact. --col is that edge: it moves in with the centred 1440px frame on wider
   screens, never comes closer than the Work counter needs (94px + 20px gap past the gutter) on
   narrower ones, and drops to the gutter at 900px and below, where the counter is hidden.
   It holds a % so it resolves against whichever full-width box uses it. */
/* the About us page's people grid uses the same edge */
:is([data-page="home-v2"], [data-page="about"]) { --col: max(calc(var(--gutter) + 112px), calc(max(0px, (100% - 1440px) / 2) + clamp(16px, 11.1vw, 160px))); }
@media (max-width: 900px) { :is([data-page="home-v2"], [data-page="about"]) { --col: var(--gutter); } }

/* ---------- Hero ---------- */
[data-page="home-v2"] .hero {
  min-height: 0; padding: max(120px, min(17.6vw, 28.1vh)) var(--col) max(60px, min(14.5vw, 23.2vh)); /* 253 / 209 at 1440×900, scales with the title */
}
@media (min-width: 901px) { [data-page="home-v2"] .hero { min-height: 100vh; } }

[data-page="home-v2"] .hero-title { font-size: max(30px, min(6.94vw, 11.1vh)); text-align: left; } /* 100px at the 1440×900 Figma frame; the smaller axis wins so the hero fits one screen at any aspect ratio */
[data-page="home-v2"] .hero-title .row { transform: none; }
[data-page="home-v2"] .hero-title .r1 { margin-bottom: .4em; } /* a little air between the cycling word and the rest of the title */

/* ---------- Hero word cycle (hero-cycle.js) ---------- */
/* Words share one grid cell, so the line is as wide as the longest word and never jumps */
.hero-title .cycle { display: inline-grid; --cap: .7em; } /* --cap: the font's cap height, measured by hero-cycle.js */
.hero-title .cw { grid-area: 1 / 1; justify-self: start; }
.hero-title .cw.is-skip { display: none; } /* too long for a phone screen: left out of the rotation (hero-cycle.js) */
.hero-title .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hero-title .ch { display: inline-block; transform-origin: 50% 100%; will-change: transform; }
.hero-title .line-mask.is-loose { overflow: visible; } /* let letters and glyphs leave the line once the intro has played */

/* Glyphs: a pixel-art sprite standing in for one letter of each word (hero-cycle.js draws and animates them). 16 art pixels to the cap height, --w wide, sitting on the baseline */
.hero-title .gl { position: relative; width: calc(var(--cap) * var(--w) / 100); height: var(--cap); margin: 0 .03em; }
.hero-title .gl svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* ---------- Proposition ---------- */
[data-page="home-v2"] .prop .wrap { max-width: none; padding-left: var(--col); padding-right: clamp(16px, 5.5vw, 80px); } /* lets the 1120px copy keep its Figma line breaks next to a scrollbar */
[data-page="home-v2"] .prop-copy { max-width: 1120px; }
.prop-lede { margin: 0 0 48px; }
.prop-lede p {
  margin: 0; font-family: var(--display); font-weight: 300;
  font-size: clamp(26px, 3.61vw, 52px); line-height: 1.25; letter-spacing: -0.01em;
}
.prop-lede p + p { margin-top: 1.25em; }

/* ---------- Carousel ---------- */
[data-page="home-v2"] .carousel-sec h2 { padding-left: var(--col); max-width: none; line-height: 1.236; } /* no cap, the title stays on one line on desktop */
[data-page="home-v2"] .carousel { padding-left: calc(var(--col) - 114px); } /* the counter sits just left of the edge */
[data-page="home-v2"] :is(.progress, .carousel-cta) { margin-left: var(--col); }
@media (max-width: 900px) { [data-page="home-v2"] .carousel { padding-left: var(--col); } }

/* ---------- Complex Transformation Systems: sector tabs over a sideways row of 550px client cards ---------- */
.systems { background: var(--paper); color: #000; padding: clamp(96px, 13.9vw, 200px) 0; overflow: hidden; }
.systems .wrap { padding: 0 var(--gutter) 0 var(--col); }
.systems h2 {
  max-width: 1120px; margin: 0 0 32px; font-family: var(--display); font-weight: 300;
  font-size: clamp(30px, 3.61vw, 52px); line-height: 1.25; letter-spacing: -0.01em;
}
.sys-sub { max-width: 760px; margin: 0 0 60px; font-size: clamp(18px, 1.67vw, 24px); line-height: 1.25; letter-spacing: -0.01em; } /* Figma: 24px Instrument Sans under the 52px heading */
.sys-tabs { display: flex; gap: 16px; flex-wrap: wrap; }
.sys-tabs button {
  padding: 15px 23px; border: 1px solid transparent; border-radius: 900px;
  font-weight: 600; font-size: 14px; line-height: 14px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(0,0,0,.4); transition: color .3s, background .4s, border-color .4s;
}
.sys-tabs button:hover { color: #000; }
.sys-tabs button[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.sys-tabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 900px) {
  /* One swipeable row of tabs instead of three wrapped lines */
  .sys-tabs { flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)) 0 calc(-1 * var(--col)); padding: 3px var(--gutter) 3px var(--col); }
  .sys-tabs::-webkit-scrollbar { display: none; }
  .sys-tabs button { flex: none; padding: 13px 18px; font-size: 12px; }
}

/* The row starts on the content edge and runs off the right of the screen */
.sys-scroller {
  margin-top: 32px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab;
  padding-left: var(--col);
}
.sys-scroller::-webkit-scrollbar { display: none; }
.sys-scroller.is-dragging { cursor: grabbing; user-select: none; }
.sys-track { display: flex; gap: 16px; width: max-content; padding-right: var(--gutter); }
.sys-panel[hidden] { display: none; }
.sys-panel:not([hidden]) .sys-card { animation: sysIn .7s var(--ease-out) both; }
.sys-panel .sys-card:nth-child(2) { animation-delay: .06s; }
.sys-panel .sys-card:nth-child(3) { animation-delay: .12s; }
.sys-panel .sys-card:nth-child(4) { animation-delay: .18s; }
.sys-panel .sys-card:nth-child(5) { animation-delay: .24s; }
@keyframes sysIn { from { opacity: 0; transform: translateY(24px); } }

.sys-card { display: flex; flex-direction: column; gap: 16px; width: clamp(280px, 38.2vw, 550px); color: #000; }
.sys-media {
  position: relative; display: grid; place-items: center; aspect-ratio: 550 / 400; border-radius: 16px; overflow: hidden;
  background: #f1f1f1;
}
.sys-media > img, .sys-media > video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
a.sys-card:hover .sys-media > img, a.sys-card:hover .sys-media > video { transform: scale(1.04); }
.sys-media img, .sys-media video { -webkit-user-drag: none; user-select: none; }
.sys-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sys-tags li { padding: 3px 9px; border: 1px solid #000; border-radius: 900px; font-size: 12px; line-height: 1.2; letter-spacing: -0.01em; white-space: nowrap; }

/* ---------- Play / Pivot / Pause: the playground button sits just under the words ---------- */
/* Figma trims the 180px words to their 129px caps; these offsets take the extra line box back out */
[data-page="home-v2"] .ppp { gap: 0; padding: clamp(140px, 26vw, 374px) 0 clamp(120px, 24.2vw, 348px); }


/* ---------- About us (Figma 1640:3668): 160px padding, eyebrow → 46 → heading → 16 → lede (a 57px box) → 64 → media ---------- */
.about { background: var(--paper); color: #000; padding: clamp(96px, 11.1vw, 160px) 0; }
.about .wrap { padding: 0 var(--gutter) 0 var(--col); }
.about .eyebrow { display: flex; width: max-content; } /* no line box around it, so the heading sits 46px under the 12px label */
.about h2 {
  margin: clamp(28px, 3.2vw, 46px) 0 16px; font-family: var(--display); font-weight: 300;
  font-size: clamp(30px, 3.61vw, 52px); line-height: .96; letter-spacing: -0.01em;
}
.about-lede { max-width: 1005px; min-height: 3.6em; margin: 0; font-size: 16px; line-height: 1.2; letter-spacing: -0.01em; opacity: .4; }
.about-media { display: block; width: 100%; max-width: 1120px; height: auto; margin-top: clamp(40px, 4.44vw, 64px); }

/* Home (Figma 1653:3703): the section is the statement alone. 200px padding, 1120px measure,
   52/65 light display copy, a blank 65px line between the paragraphs. Scoped so methodology keeps the layout above. */
.about-statement { padding: clamp(112px, 13.9vw, 200px) 0; }
.about-statement p {
  max-width: 1120px; margin: 0; font-family: var(--display); font-weight: 300;
  font-size: clamp(26px, 3.61vw, 52px); line-height: 1.25; letter-spacing: -0.01em;
}
.about-statement p + p { margin-top: 1.25em; }

/* ---------- Contact + footer ---------- */
/* Copy sits centred in the 940px frame; the top padding matches the footer's height so it stays centred */
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact { min-height: 940px; padding: 107px 0 60px; justify-content: flex-start; }
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact .wrap { margin: auto; }
[data-page="home-v2"] .contact .wrap { max-width: none; margin: auto 0; padding-left: var(--col); } /* on the page's one edge rather than centred; no 1440px cap, or --col eats the line on wide screens and clips it */
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact h2 { margin: 46px 0 64px; display: flex; flex-direction: column; gap: 10px; line-height: 1; }
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact h2 .line-mask { padding-bottom: .1em; margin-bottom: -.1em; } /* room for descenders under the reveal mask */
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact h2 .dim { color: #383838; }
@media (min-width: 901px) {
  :is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact .wrap { padding-right: clamp(16px, 5.5vw, 80px); }
  :is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact h2 .line-mask { white-space: nowrap; } /* each Figma line stays one line on desktop */
}

.site-foot {
  position: relative; z-index: 1; margin: 0 var(--gutter); padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.24);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap;
  font-family: var(--label); font-weight: 300; font-size: 11px; line-height: 14px; letter-spacing: .1em; text-transform: uppercase;
}
.site-foot > span { opacity: .4; }
/* Copyright plus the legal links: privacy policy and the cookie preferences (consent.js) */
.foot-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.foot-legal > * { opacity: .4; }
.foot-legal :is(a, button) {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; padding: 0; cursor: pointer; transition: opacity .3s;
}
.foot-legal :is(a, button):hover, .foot-legal :is(a, button):focus-visible { opacity: 1; }
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .foot-links { margin: 0; justify-content: flex-end; }
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .foot-links a { font-size: inherit; line-height: inherit; letter-spacing: inherit; }
:is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .foot-links .sep { background: rgba(255,255,255,.24); }

/* Starfield behind every dark section: lift the content above its canvas */
[data-page="home-v2"] :is(#prop, #work, #contact) > :not(.bg-layer) { position: relative; z-index: 1; }

@media (max-width: 900px) {
  :is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact { min-height: 0; padding-top: 160px; }
  :is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact .wrap { margin: 0 0 120px; }
}

/* The last starfield before the city section dims out gradually instead of ending in a hard line */
[data-page="home-v2"] #work > .starfield {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - min(480px, 50%)), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - min(480px, 50%)), transparent);
}

/* ==========================================================================
   Phones (Figma "00. Home_full", 1708:17328, and the shared mobile footer).
   Sections run 80px top and bottom on the 24px gutter; headings are 32px
   light display at 1.2, a blank line between paragraphs.
   ========================================================================== */
@media (max-width: 600px) {
  /* Hero: title 179px from the top (89px header + 90px), 48px caps at 1, the sub 24px under it */
  [data-page="home-v2"] .hero { padding: 179px var(--gutter) 90px; }
  [data-page="home-v2"] .hero-title { font-size: 12.8vw; line-height: 1; } /* 48px at the 375 Figma frame */
  [data-page="home-v2"] .hero-title .r1 { margin-bottom: .25em; }
  [data-page="home-v2"] .hero-title .row:not(.r1) { white-space: normal; } /* "what's / next", "middle / east" wrap as in Figma */

  /* Work carousel: 260 × 340 cards, 9.6px apart, the counter 32px under them */
  .carousel-sec { padding: 80px 0; }
  [data-page="home-v2"] .carousel-sec h2 { margin-bottom: 48px; padding-right: var(--gutter); font-size: 32px; line-height: 1.2; }
  .card { width: 260px; border-radius: 9.6px; }
  .track { gap: 9.6px; }
  .progress { margin-top: 32px; margin-right: var(--gutter); }
  [data-page="home-v2"] .carousel-cta { display: none; } /* not in the mobile frame */

  /* Proposition */
  .prop { padding: 80px 0; }
  [data-page="home-v2"] .prop .wrap { padding: 0 var(--gutter); }
  .prop-lede { margin-bottom: 32px; }
  .prop-lede p { font-size: 32px; line-height: 1.2; }
  .prop-lede p + p { margin-top: 1.2em; }

  /* City: a plain full-bleed 740px film, no sticky reveal */
  [data-page="home-v2"] .city { height: 740px; }
  [data-page="home-v2"] .city-sticky { position: relative; height: 100%; }
  [data-page="home-v2"] .city-frame { clip-path: none !important; }
  [data-page="home-v2"] .city-frame :is(img, video) { transform: none !important; }

  /* Deep expertise: 330px cards (330 × 240 images) under 12px tabs */
  .systems { padding: 80px 0; }
  .systems h2 { margin-bottom: 36px; font-size: 32px; line-height: 1.2; }
  .sys-sub { margin-bottom: 60px; font-size: 20px; line-height: 1.2; }
  .sys-tabs { gap: 8px; }
  .sys-tabs button { padding: 15px 23px; font-size: 12px; letter-spacing: .1em; }
  .sys-card { width: 330px; gap: 16px; }
  .sys-media { border-radius: 9.6px; }

  /* Play / Pivot / Pause: 163px bold words, 525px tall */
  [data-page="home-v2"] .ppp { padding: 181px 0; }
  .ppp-track { gap: 21.8px; }
  .ppp-track .word { font-size: 163.5px; }
  .ppp-track .icon { width: 101px; }

  /* About statement */
  .about-statement { padding: 80px 0; }
  .about-statement p { font-size: 32px; line-height: 1.2; }
  .about-statement p + p { margin-top: 1.2em; }

  /* Clients: one 211px column, 50px apart, 40px between the three groups */
  .logos { padding: 80px 48px; }
  .logos h3 { margin-bottom: 80px; font-size: 24px; line-height: normal; }
  .logo-row { flex-direction: column; align-items: center; gap: 50px; }
  .client { width: 211px; }

  /* Contact + footer, on every page */
  :is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact { padding: 80px 0 40px; }
  :is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact .wrap { margin: 0 0 64px; padding: 0 var(--gutter); }
  :is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact h2 { gap: 0; font-size: 32px; }
  :is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .contact h2 .dim { margin-top: 10px; } /* the question reads as one block, the answer 10px under it */
  .site-foot { flex-direction: column; align-items: flex-start; gap: 24px; padding-top: 24px; }
  :is([data-page="home-v2"], [data-page="contact"], [data-page="privacy"], [data-page="methodology"], [data-page="work"], [data-page="about"], .case-page) .foot-links { justify-content: flex-start; gap: 32px; }
}
