/* =========================================================================
   The polish layer
   Overrides layered on the original site's legacy sheets (bootstrap, style,
   layout-index, odometer, port). Same markup, sections, order and imagery;
   this file only refines execution. Page rules are scoped under a page's
   .polished wrapper (home, case studies); the site chrome (header, primary
   CTA, phone menu) is styled on every page. Design references in comments:
   apple-design §n and design-bank IDs (knowledge/design-core.md, flow.md).
   ========================================================================= */

:root {
  /* Brand colour, unchanged hues (C-STRATEGY) */
  --p-signal: #ff4e27;
  --p-signal-ink: #b8340e; /* orange text on #efefef / #fff: 5.17:1 / 5.70:1 (F-CONTRAST-TEXT) */
  --p-ink: #141414;
  --p-ink-2: #1e1e1e;
  --p-paper: #efefef;
  --p-white: #ffffff;
  --p-on-signal-muted: #3a1208; /* muted text on orange, tinted with the hue: 5.02:1 (C-NO-GREY-ON-COLOR) */
  --p-muted: #5e5e5e; /* 5.64:1 on #efefef */
  --p-muted-ink: #a3a3a3; /* 7.0:1 on #1e1e1e */
  --p-tab-idle: #767676; /* 4.54:1 on #fff (the original #dbdbdb was 1.35:1) */
  --p-line: #d9d9d9;
  --p-line-ink: #333333;

  /* 8 px square grid (S-SCALE, S-RHYTHM): component < group < section */
  --p-1: 8px;
  --p-2: 16px;
  --p-3: 24px;
  --p-4: 32px;
  --p-6: 48px;
  --p-8: 64px;
  --p-12: 96px;
  --p-18: 144px;

  /* Motion tokens (M-DURATION, M-EASING) */
  --p-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --p-ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --p-micro: 120ms;
  --p-state: 240ms;
}

/* ---- Square geometry everywhere (the original's own cube/square language).
   The process circle is kept: it is the original's flood device. ---------- */
.polished *:not(.process-circle),
.polished *::before,
.polished *::after {
  border-radius: 0 !important;
}

/* ---- One focus system, square, visible on every surface (F-FOCUS) ------- */
.polished a:focus-visible,
.polished button:focus-visible,
.polished [role="button"]:focus-visible,
.polished [role="tab"]:focus-visible,
.polished [tabindex]:focus-visible,
.polished input:focus-visible,
.polished textarea:focus-visible {
  outline: 3px solid var(--p-ink) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px var(--p-white) !important;
}
.polished .client-wrapper a:focus-visible,
.polished .seeall-cs-wrapper a:focus-visible,
.polished .cs-detail-desc-wrap a:focus-visible,
.polished .discover-more-case a:focus-visible {
  outline-color: var(--p-white) !important;
  box-shadow: 0 0 0 6px var(--p-ink) !important;
}
/* Skip link: off screen until focused, then a square ink tag (F-FOCUS). */
.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--p-ink);
  color: var(--p-white) !important;
  text-decoration: none;
}
.skip-link:focus {
  top: 8px;
}

/* ---- Type: one scale, size-specific tracking and leading (apple-design §15;
   T-SCALE, T-LEADING) ---------------------------------------------------- */
.polished h2,
.polished .section-title {
  letter-spacing: -0.03em;
  line-height: 0.98;
}
.polished .text-188 {
  font-size: clamp(4rem, 12vw, 11.75rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
}
.polished .text-64 {
  letter-spacing: -0.025em;
  line-height: 1;
}
.polished .text-38 {
  letter-spacing: -0.015em;
  line-height: 1.12;
}
.polished .text-24 {
  line-height: 1.35;
}
.polished .big-number {
  letter-spacing: -0.05em;
}
.polished .big-number .text-sup,
.polished .medium-number span {
  letter-spacing: 0;
}
.polished .medium-number {
  letter-spacing: -0.03em;
}

/* ---- Contrast: orange text only where it passes (F-CONTRAST-TEXT) ------- */
.polished .solution-wrapper .f-org,
.polished .services-wrapper .f-org,
.polished .casestudies-wrap .f-org {
  color: var(--p-signal-ink) !important;
}
.polished .services-wrapper .link-24,
.polished .casestudies-wrap .link-20,
.polished .logo-secco-footer ~ footer .link-32-arrow,
.polished footer .link-32-arrow {
  color: var(--p-signal-ink);
}
.polished .services-wrapper .link-24::before,
.polished .casestudies-wrap .link-20::before {
  background-color: var(--p-signal-ink);
}
.polished .nav-pills .nav-link {
  color: var(--p-tab-idle);
}
.polished .nav-pills .nav-link.active,
.polished .nav-pills .nav-link:hover {
  color: var(--p-ink);
}

/* ---- Response: hovers start at once, presses answer (apple-design §1;
   M-DURATION micro 70-150 ms; F-COMPOSITOR) -------------------------------- */
.polished .nav-orange li a::before,
.polished .link-24::before,
.polished .link-20::before {
  transition: width var(--p-state) var(--p-ease-out) !important;
}
.polished .client-logo-box {
  transition: border-color var(--p-micro) linear !important;
}
.polished a:active,
.polished button:active,
.polished [role="tab"]:active {
  transform: translateY(1px);
}

/* =========================================================================
   Header (the original header, polished)
   ========================================================================= */
.header.polished-header {
  transition:
    transform var(--p-state) var(--p-ease-out),
    background-color var(--p-state) linear !important;
}
.header.polished-header[data-hidden] {
  transform: translateY(-100%);
}
.header.polished-header[data-hidden]:focus-within {
  transform: none;
}
:is(.polished, .header) .polished-nav-actions {
  align-items: center;
  gap: var(--p-3);
}
:is(.polished, .header) .polished-nav-actions li {
  margin: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: flex-start;
}

/* The one primary action: an ink rectangle (V-ONE-CTA, H-ACTION-TIERS) */
:is(.polished, .header) .polished-cta {
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 0 var(--p-4);
  background: var(--p-ink);
  color: var(--p-white) !important;
  font-family: "Lay Grotesk Medium", "Lay Grotesk", Arial, sans-serif;
  font-size: 20px;
  line-height: 1;
  text-decoration: none !important;
  transition:
    background-color var(--p-micro) linear,
    transform var(--p-micro) var(--p-ease-out);
}
:is(.polished, .header) .polished-cta::before {
  display: none !important;
}
:is(.polished, .header) .polished-cta:hover {
  background: #000;
}
:is(.polished, .header) .polished-cta:active {
  transform: scale(0.97);
}
/* On the dark header (services, case listing) an ink button would vanish into
   the #1e1e1e bar; it takes the brand orange with ink text there (5.59:1,
   F-CONTRAST-UI, C-STRATEGY). */
.header.header-black .polished-cta {
  background: var(--p-signal);
  color: var(--p-ink) !important;
}
.header.header-black .polished-cta:hover {
  background: #ff6a47;
}
:is(.polished, .header) .nav-orange .polished-cta-small,
:is(.polished, .header) .polished-cta-small {
  min-height: 44px;
  padding: 0 var(--p-3);
  font-size: 18px;
}
.polished .polished-text-link {
  color: var(--p-ink);
  font-size: 20px;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.polished .polished-text-link:hover {
  text-decoration-thickness: 3px;
}

/* =========================================================================
   Hero (orange field, "Leading the way", header row, intro slot, wordmark)
   NEW: outcome line (h1) + primary CTA in the intro slot (V-VALUE-PROP, V-SPEED)
   ========================================================================= */
.polished .polished-hero-title {
  margin: 0 0 var(--p-3);
  font-family: "Lay Grotesk Medium", "Lay Grotesk", Arial, sans-serif;
  font-size: clamp(2.25rem, 3.05vw, 2.875rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--p-ink);
}
/* Two deliberate lines on desktop, so the hero block stays compact and the
   giant wordmark keeps its place in the first screen (H-FOCAL). */
@media (min-width: 992px) {
  .polished .polished-hero-title span {
    display: block;
    white-space: nowrap;
  }
  .polished .big-logo-intro {
    padding-top: 0;
  }
}
.polished .polished-hero-intro {
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 44ch;
  margin: 0;
}
.polished .polished-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--p-2) var(--p-4);
  margin-top: var(--p-3);
}
/* The wordmark tip-back is driven by a GSAP scrub now; drop the CSS lag. */
.polished .big-logo-desktop {
  transition: none !important;
  will-change: transform;
}

/* =========================================================================
   Proof strip (the original dark stats band; NEW role: proof hugs the hero,
   F7, V-PROOF): figures in the HTML, logos at full strength, notes
   ========================================================================= */
.polished .client-logo-box .client-logo img,
.polished .client-logo img {
  opacity: 1 !important;
}
.polished .client-logo-box:hover {
  border-top-color: var(--p-signal);
}
.polished .polished-note {
  margin: var(--p-2) 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--p-muted);
}
.polished .polished-note-ink {
  color: var(--p-muted-ink);
  padding-top: var(--p-2);
}
.polished .polished-note-on-signal {
  color: var(--p-on-signal-muted);
}

/* Odometer digits: every digit whole. Odometer sizes each digit cell from a
   hidden "8" (in the theme's Lay Grotesk Regular), but a "0" is wider than an
   "8" (and the value may be set in the wider Medium cut), so the cell's
   overflow:hidden shaved the right edge off every zero (1350, 250). Clip the
   rolling ribbon vertically only, and give the final cell room for the
   overhang so it never touches the unit that follows ("partners", "mm"). */
.polished .odometer .odometer-digit .odometer-digit-inner {
  overflow: visible;
  clip-path: inset(0 -0.25em);
}
.polished .odometer .odometer-digit:last-child {
  padding-right: 0.04em;
}

/* =========================================================================
   Services (white panel, channel list, geometric icons)
   ========================================================================= */
.polished .nav-pills .nav-link {
  transition: color var(--p-micro) linear;
}

/* Creative approach: each box is a real link now (keyboard reachable), with
   the original hover state also on focus; no cursor-chasing "Learn more" pill
   (X-ACCENT-WORD; apple-design §16 familiarity). */
.polished .creative-apr-box {
  position: relative;
}
.polished .polished-box-link {
  position: absolute;
  inset: 0;
  z-index: 12;
}
.polished .creative-apr-box:focus-within .creative-apr-active-dot,
.polished .creative-apr-box:focus-within .ico-creative-graphic-design,
.polished .creative-apr-box:focus-within .ico-creative-marketing-funnel,
.polished .creative-apr-box:focus-within .ico-creative-copywriting {
  display: block;
}
.polished .creative-apr-box .creative-apr-link-mob {
  position: absolute;
  left: auto;
  bottom: auto;
  right: var(--p-3);
  top: var(--p-3);
}

/* Phone "Menu" text on the polished pages' light header: the original orange
   on grey was 2.87:1 (F-CONTRAST-TEXT). Scoped to those pages: on the dark
   and orange headers elsewhere the original colours already read. */
.polished .header .menu-text-orange {
  color: var(--p-signal-ink) !important;
  border-bottom-color: var(--p-signal-ink);
}
.polished .intro .menu-text-orange {
  color: var(--p-ink) !important;
  border-bottom-color: var(--p-ink);
}

/* =========================================================================
   Process: circle → orange flood, then the 3D cube (desktop) whose faces are
   real HTML now (crisp text, indexable); phones get five square faces
   ========================================================================= */
.polished .polished-scene .cube > div {
  background-image: none !important;
}
.polished .polished-scene .cube .polished-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  padding: 6%;
  color: var(--p-white);
  font-family: "Lay Grotesk", Arial, sans-serif;
  background: var(--p-ink-2);
}
.polished .polished-face-title {
  grid-column: 1 / -1;
  align-self: start;
  font-size: 4.6vh;
  line-height: 1.05;
  letter-spacing: -0.02em;
  padding-bottom: 2.4%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.polished .polished-face-number {
  align-self: end;
  font-size: 11vh;
  line-height: 0.8;
  color: var(--p-signal);
  letter-spacing: -0.04em;
}
.polished .polished-face-text {
  align-self: end;
  justify-self: end;
  max-width: 22ch;
  font-size: 2.35vh;
  line-height: 1.35;
  color: #ededed;
}
.polished .polished-scene .cube .polished-face-main {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 3.6vh;
  line-height: 1.1;
  letter-spacing: -0.02em;
  padding: 14%;
}
/* Faces 3 and 4 sit rotated on the cube, as the original face art was drawn */
.polished .polished-scene .cube .polished-face-back {
  transform: rotate(90deg);
}
.polished .polished-scene .cube .polished-face-left {
  transform: rotate(180deg);
}
.polished .polished-process-list {
  display: none;
}
.polished .cube-face-index {
  display: none !important;
}

/* NEW: "How every lead is checked" on the orange field the process leaves
   behind (F8: the pin exits into a filled section; native list style). */
.polished .polished-checks {
  position: relative;
  z-index: 10;
  background: var(--p-signal);
  color: var(--p-ink);
  padding: var(--p-12) 0 var(--p-18);
}
.polished .polished-checks-kicker {
  color: var(--p-on-signal-muted);
  margin: 0 0 var(--p-3);
}
.polished .polished-checks-title {
  font-size: clamp(2.5rem, 4.4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 var(--p-6);
  max-width: 12ch;
}
.polished .polished-checks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--p-6) var(--p-6);
}
.polished .polished-checks-list li {
  border-top: 1px solid rgba(20, 20, 20, 0.35);
  padding-top: var(--p-3);
}
.polished .polished-checks-item-title {
  display: flex;
  align-items: center;
  gap: var(--p-2);
  font-family: "Lay Grotesk Medium", "Lay Grotesk", Arial, sans-serif;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 var(--p-1);
}
.polished .polished-checks-item-title::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: none;
  background: var(--p-ink);
}
.polished .polished-checks-list p {
  font-size: 18px;
  line-height: 1.45;
  margin: 0;
  max-width: 46ch;
}
.polished .polished-checks-list .polished-note {
  font-size: 14px;
  margin-top: var(--p-1);
}

/* =========================================================================
   Case studies (the original sticky stack): NEW headline metric per case,
   specific link labels, approval note
   ========================================================================= */
.polished .polished-case-metric {
  margin: var(--p-2) 0 var(--p-3);
  display: flex;
  align-items: baseline;
  gap: var(--p-1);
}
.polished .polished-case-metric-value {
  font-size: 64px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--p-signal-ink);
}
.polished .polished-case-metric-label {
  font-size: 20px;
  color: var(--p-ink);
}
.polished .casestudies-wrap .polished-note {
  margin-top: var(--p-4);
}

/* =========================================================================
   Contact (the original orange block + form) with NEW contact details
   ========================================================================= */
.polished .polished-contact .contact-form-wrapper-sub {
  padding: var(--p-12) 0 var(--p-8);
}
.polished .polished-contact-row {
  row-gap: var(--p-6);
}
.polished .polished-contact label.sr-only {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0 var(--p-1) !important;
  clip: auto !important;
  overflow: visible !important;
  white-space: normal !important;
  display: block;
  font-size: 16px;
  color: var(--p-on-signal-muted);
}
.polished .polished-contact .button-white-100 {
  transition:
    background-color var(--p-micro) linear,
    color var(--p-micro) linear,
    transform var(--p-micro) var(--p-ease-out);
}
.polished .polished-contact .button-white-100:active {
  transform: scale(0.98);
}
.polished .polished-contact .form-consent a,
.polished .polished-contact .form-consent {
  color: var(--p-ink);
}
.polished .polished-contact-details {
  margin: 0;
  display: grid;
  gap: var(--p-3);
  color: var(--p-ink);
}
.polished .polished-contact-details > div {
  border-top: 1px solid rgba(20, 20, 20, 0.35);
  padding-top: var(--p-2);
}
.polished .polished-contact-details dt {
  font-weight: normal;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-on-signal-muted);
  margin-bottom: var(--p-1);
}
.polished .polished-contact-details dd {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}
.polished .polished-contact-details a {
  color: var(--p-ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* Phone menu CTA */
.polished-menu-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin: 0 0 var(--p-3);
  background: var(--p-ink);
  color: var(--p-white) !important;
  font-size: 20px;
  text-decoration: none !important;
}

/* =========================================================================
   Phones: better layouts, no long pins (F-REFLOW, F-TARGET, flow F8)
   ========================================================================= */
@media (max-width: 767px) {
  /* The value proposition leads the phone hero; the morphing mark follows,
     smaller (V-VALUE-PROP at 390, V-SPEED). */
  .polished .intro {
    height: auto;
    min-height: 100vh;
    padding-bottom: var(--p-6);
  }
  .polished .intro .intro-description-order {
    order: 1;
  }
  .polished .intro .intro-logo-order {
    order: 2;
  }
  .polished .intro .mobile-logo-morph {
    height: 200px !important;
    margin-top: var(--p-6);
  }
  .polished .intro .mobile-logo-morph svg {
    width: 200px;
    height: 200px;
  }
  .polished .polished-hero-title {
    font-size: 2.5rem;
  }
  .polished .polished-hero-intro {
    font-size: 1.25rem;
  }
  .polished .polished-hero-actions .polished-cta {
    width: 100%;
    justify-content: center;
  }
  .polished .process-wrap {
    height: auto !important;
    padding: 0 var(--p-2) var(--p-12) !important;
  }
  .polished .polished-scene {
    display: none !important;
  }
  .polished .polished-sr-process {
    display: none;
  }
  .polished .polished-process-list {
    display: grid;
    gap: var(--p-2);
    list-style: none;
    margin: var(--p-6) 0 0;
    padding: 0;
    position: relative;
    z-index: 2;
  }
  .polished .polished-face-flat {
    aspect-ratio: 1 / 1;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr auto;
    gap: var(--p-2);
    padding: var(--p-3);
    background: var(--p-ink-2);
    color: var(--p-white);
  }
  .polished .polished-face-flat .polished-face-title {
    font-size: 28px;
  }
  .polished .polished-face-flat .polished-face-number {
    font-size: 96px;
  }
  .polished .polished-face-flat .polished-face-text {
    font-size: 16px;
    max-width: 22ch;
  }
  .polished .polished-checks {
    padding: var(--p-8) 0 var(--p-12);
  }
  .polished .polished-checks-list {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--p-4);
  }
  .polished .polished-case-metric-value {
    font-size: 48px;
  }
  .polished .polished-contact-details dd {
    font-size: 20px;
  }
}

/* Reduced motion: movement off, colour/opacity changes kept short
   (apple-design §14; F-REDUCED-MOTION, M-REDUCE-SWAP) */
@media (prefers-reduced-motion: reduce) {
  .polished *,
  .polished *::before,
  .polished *::after {
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* Phone channel accordion: idle labels were #dbdbdb on white (1.38:1) */
.polished .services-wrapper .collapsed,
.polished .services-wrapper .collapsed * {
  color: var(--p-tab-idle) !important;
}

/* Reduced motion: no flood to wait for; the process field is simply orange
   and the circle (the flood device) stays out of the way. */
@media (prefers-reduced-motion: reduce) {
  .polished .process-wrap {
    background-color: var(--p-signal) !important;
  }
  .polished .process-circle {
    visibility: hidden;
  }
}

/* ---- Spacing snapped to the 8 px square grid (S-SCALE, S-RHYTHM):
   the original mixed 100 / 150 / 50 / 30 / 25 px. Section > group > item. -- */
@media (min-width: 768px) {
  .polished .solution-wrapper {
    padding: var(--p-12) 0;
  }
  .polished .about-small-heading {
    margin-bottom: var(--p-12);
  }
  .polished .services-wrapper-sub {
    padding: var(--p-6) 0 var(--p-3);
  }
  .polished .client-wrapper-sub {
    padding: var(--p-1) 0 var(--p-4);
  }
  .polished .client-number-wrap {
    padding-top: var(--p-3);
  }
  .polished .casestudies-wrap {
    padding-top: var(--p-18);
  }
  .polished .casestudies-list-wrap {
    padding-top: var(--p-12);
  }
  .polished .case-study-stack-1,
  .polished .case-study-stack-2,
  .polished .case-study-stack-3 {
    padding: var(--p-4) 0;
  }
  .polished .case-study-desc {
    padding-left: var(--p-6);
  }
}

/* The process circle scales to 6x for the orange flood and spills past the
   viewport (the original relied on body{overflow-x:hidden}, leaving a 2,500 px
   wide document). Clip it horizontally at its own section; vertical overflow
   stays visible so the flood still fills the screen. */
.polished .process-wrap {
  overflow-x: clip;
  overflow-y: visible;
}
