/* ==========================================================================
   Methodology (Figma "05. Methodology", node 1652:9837). Also styles Work's
   Approach section, which is the same block. Shares the nav, starfield and
   contact/footer with Home v2 (styles.css, home2.css). Sizes come from the
   1440-wide frame and scale with the viewport.
   ========================================================================== */

[data-page="methodology"] { --paper: #fff; }
[data-page="methodology"] .side-cta { mix-blend-mode: normal; color: #8b8b8b; gap: 3px; }
[data-page="methodology"] .side-cta .tail { color: var(--blue); }
[data-page="methodology"] .side-cta .tail b { background: currentColor; }
[data-page="methodology"] .eyebrow { font-family: var(--text); font-weight: 400; }

/* ---------- Approach (Figma 1652:9842 / Work 1653:3717): intro, four phases, challenge to impact ---------- */
.approach { position: relative; background: #0b0b0b; color: #fff; padding: 120px 0 clamp(80px, 8.33vw, 120px); overflow: hidden; }
[data-page="methodology"] .approach { padding-top: clamp(120px, 13.4vw, 193px); } /* the 153px nav, then 40 */
.approach .pattern { top: -65px; filter: invert(1); opacity: .5; }
.approach > .starfield { height: 811px; bottom: auto; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.approach .wrap { position: relative; max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 11.1vw, 160px); }
.approach .w-head { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(32px, 3.65vw, 52.6px); line-height: 1.24; letter-spacing: -0.01em; }
.approach .w-sub { max-width: 663px; margin: 16px 0 0; font-size: 16px; line-height: 1.2; letter-spacing: -0.01em; opacity: .4; }

/* Phases: plain centred columns, a title, a line and decorative pause / replay / play pills */
.phases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; max-width: 1116px; margin-top: 80px; }
.phase { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 24px 32px; text-align: center; }
.phase h3 { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(28px, 2.22vw, 32px); line-height: 1.22; letter-spacing: -0.01em; }
.phase p { max-width: 216px; margin: 0; font-size: 16px; line-height: 1.2; letter-spacing: -0.01em; color: rgba(255,255,255,.4); }
.phase-ctrl { display: flex; gap: 6px; }
.phase-ctrl span { display: grid; place-items: center; width: 36px; height: 24px; border-radius: 900px; background: rgba(255,255,255,.05); color: rgba(255,255,255,.9); }
.phase-ctrl svg { width: 16px; height: 16px; }

/* Challenge -> Impact: two wide diamonds; each side is its own container so the whole drawing scales together */
.diagram { position: relative; display: grid; grid-template-columns: 1fr 1fr; max-width: 1120px; margin-top: clamp(80px, 19.4vw, 280px); }
.diagram .side { --u: calc(100cqw / 560); container-type: inline-size; position: relative; aspect-ratio: 1; }
.diagram .side > * { position: absolute; }
.diagram .diamond { left: 0; top: calc(var(--u) * 75); width: 100%; height: auto; overflow: visible; }
.diagram .tag {
  left: 50%; top: calc(var(--u) * 53); transform: translateX(-50%); padding: calc(var(--u) * 3) calc(var(--u) * 24);
  border-radius: calc(var(--u) * 24); background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-family: var(--display); font-weight: 300; font-size: calc(var(--u) * 24); line-height: calc(var(--u) * 50); text-transform: uppercase; letter-spacing: -0.01em; white-space: nowrap;
}
.diagram .impact .tag { background: rgba(20,20,20,.55); }
.diagram .nodes { left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; gap: calc(var(--u) * 4); }
.diagram .challenge .nodes { grid-template-columns: repeat(3, calc(var(--u) * 126)); grid-auto-rows: calc(var(--u) * 80); }
.diagram .impact .nodes { grid-template-columns: repeat(3, calc(var(--u) * 126)); grid-auto-rows: calc(var(--u) * 94); }
.diagram .node {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 12);
  border-radius: calc(var(--u) * 24); background: rgba(255,255,255,.05); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  font-size: calc(var(--u) * 12); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; text-transform: uppercase; text-align: center;
  transition: background .4s, transform .5s var(--ease-out);
}
.diagram .impact .node { background: rgba(255,255,255,.12); }
.diagram .node:hover { background: rgba(255,255,255,.16); transform: translateY(calc(var(--u) * -3)); }
.diagram .node svg { width: calc(var(--u) * 24); height: calc(var(--u) * 24); flex: none; }
.diagram .to {
  position: absolute; left: 50%; top: 50.4%; transform: translate(-50%, -50%); z-index: 2; display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%; background: rgba(30,30,40,.8); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.diagram .to img { width: 32px; height: 32px; animation: toNudge 2.4s ease-in-out infinite; }
@keyframes toNudge { 0%, 100% { transform: none; } 50% { transform: translateX(4px); } }
/* Figma 1653:3787: both diamonds are true squares (395px, r24, turned 45deg = 558x558) filling their side,
   the tag on the top corner, the nodes straight on the diamond (gradients live in the SVGs) */
.diagram { margin-top: 48px; }
.diagram .diamond { top: 0; height: 100%; }
.diagram .tag { top: calc(var(--u) * 2); }
.diagram .side .node, .diagram .side .node:hover { gap: calc(var(--u) * 10); background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- Pause / Pivot / Play (Figma 1652:10003): 120 top, 200 bottom, 48 between the blocks ---------- */
.ppp-tabs { position: relative; background: #0b0b0b; color: #fff; padding: clamp(80px, 8.33vw, 120px) 0 clamp(120px, 13.9vw, 200px); }
.ppp-tabs .wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 11.1vw, 160px); display: flex; flex-direction: column; align-items: flex-start; gap: 48px; }
.ppp-switch { position: relative; display: inline-flex; padding: 3px 0; border-radius: 24px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.ppp-switch button {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 24px; border: 0; border-radius: 900px;
  background: none; color: #fff; cursor: pointer; transition: background .35s var(--ease-out);
  font: 600 14px/14px var(--text); letter-spacing: .1em; text-transform: uppercase;
}
.ppp-switch button:hover { background: rgba(255,255,255,.06); }
.ppp-switch button { position: relative; z-index: 1; }
.ppp-switch:not(.has-thumb) button[aria-selected="true"] { background: #1340f1; } /* until methodology.js places the thumb */
/* The blue pill slides (and stretches a touch) to the selected tab; methodology.js sets its x and width */
.ppp-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: var(--w, 0); border-radius: 900px; background: #1340f1;
  transform: translateX(var(--x, 0)); transition: transform .55s cubic-bezier(.65, 0, .35, 1), width .55s cubic-bezier(.65, 0, .35, 1);
}
.ppp-switch:not(.has-thumb) .ppp-thumb { display: none; }
.ppp-switch.no-anim .ppp-thumb { transition: none; }
.ppp-switch svg { width: 16px; height: 16px; flex: none; }
.ppp-stage { display: grid; width: 100%; max-width: 1120px; }
.ppp-panel { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 48px; width: 100%; }
.ppp-panel[hidden] { display: none; }

/* Switching (methodology.js): the old panel drifts out against the direction of travel and blurs away;
   the new one builds in from the other side: the word's letters rise, the pixel glyph springs in with a
   little spin, then the line and the four rows follow 70ms apart. --dir is 1 going right, -1 going left. */
.ppp-panel.is-out { pointer-events: none; animation: pppOut .32s cubic-bezier(.4, 0, 1, 1) forwards; }
@keyframes pppOut { to { opacity: 0; transform: translateX(calc(var(--dir, 1) * -40px)); filter: blur(6px); } }
.ppp-panel.is-in .ppp-word > span { display: inline-block; animation: pppRise .7s cubic-bezier(.16, 1, .3, 1) both; }
.ppp-panel.is-in .ppp-word > span:last-child { animation-delay: .06s; }
.ppp-panel.is-in .ppp-glyph { animation: pppGlyph .8s cubic-bezier(.34, 1.56, .64, 1) .1s both; }
.ppp-panel.is-in :is(.ppp-sub, .ppp-row) { animation: pppSlide .7s cubic-bezier(.16, 1, .3, 1) both; }
.ppp-panel.is-in .ppp-sub { animation-delay: .16s; }
.ppp-panel.is-in .ppp-row:nth-child(1) { animation-delay: .22s; }
.ppp-panel.is-in .ppp-row:nth-child(2) { animation-delay: .29s; }
.ppp-panel.is-in .ppp-row:nth-child(3) { animation-delay: .36s; }
.ppp-panel.is-in .ppp-row:nth-child(4) { animation-delay: .43s; }
@keyframes pppRise { from { opacity: 0; transform: translateY(.35em); } }
@keyframes pppGlyph { from { opacity: 0; transform: scale(.3) rotate(calc(var(--dir, 1) * -25deg)); } }
@keyframes pppSlide { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 48px)); } }
/* The word: 120px light caps, one letter swapped for a 1em pixel glyph that sits 3px high */
.ppp-word {
  display: flex; align-items: flex-start; margin: 0; font-family: var(--display); font-weight: 300;
  font-size: clamp(56px, 8.33vw, 120px); line-height: 1; letter-spacing: -0.01em; text-transform: uppercase; white-space: nowrap;
}
.ppp-glyph { width: 1em; height: 1em; margin: -.025em -.06em 0; flex: none; image-rendering: pixelated; }
.ppp-sub { margin: -24px 0 0; font-family: var(--display); font-weight: 300; font-size: clamp(18px, 1.67vw, 24px); line-height: 1.2; letter-spacing: -0.01em; }
.ppp-rows { display: flex; flex-direction: column; margin: 0; }
.ppp-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-auto-rows: minmax(34px, auto); column-gap: 40px; padding: 24px 0; border-top: 1px solid rgba(255,255,255,.18); }
.ppp-row:first-child { padding-top: 0; border-top: 0; }
.ppp-row:last-child { padding-bottom: 0; }
.ppp-row dt { display: flex; align-items: flex-start; gap: 16px; color: #0041fb; font-size: 16px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; text-transform: uppercase; }
.ppp-row dt span { padding-top: 2px; }
.ppp-row dt svg { width: 24px; height: 24px; flex: none; }
.ppp-row dd { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -0.01em; }
.ppp-plug {
  display: flex; align-items: center; gap: 24px; width: 100%; max-width: 1120px; padding: 24px; border-radius: 24px;
  background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.ppp-plug-btns { display: flex; gap: 6px; flex: none; }
.ppp-plug-btns button {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.05); color: #fff; cursor: pointer; transition: background .3s;
}
.ppp-plug-btns button:hover, .ppp-plug-btns button.is-on { background: rgba(255,255,255,.14); }
.ppp-plug-btns svg { width: 21px; height: 21px; }
.ppp-plug p { margin: 0; font-size: 16px; line-height: 1.4; letter-spacing: -0.01em; color: rgba(255,255,255,.64); }
.ppp-plug strong { font-weight: 600; color: #fff; }

/* ---------- Why (Figma 1652:10068 at rest, 1708:17153 on hover): Rigour and Perspective down the left, Speed 350px lower on the right.
   At rest a card shows only its image, tag and title; hover (or keyboard focus) blurs and darkens the image and brings up the copy. ---------- */
.why { background: var(--paper); color: #000; padding: clamp(80px, 11.1vw, 160px) 0; }
.why .wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 11.1vw, 160px); }
.why h2 { max-width: 1120px; margin: 46px 0 0; font-family: var(--display); font-weight: 300; font-size: clamp(30px, 3.61vw, 52px); line-height: .96; letter-spacing: -0.01em; }
.why-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 1120px; margin-top: 64px; align-items: start; }
.why-card.rigour { grid-area: 1 / 1; }
.why-card.perspective { grid-area: 2 / 1; }
.why-card.speed { grid-area: 1 / 2 / span 2; margin-top: 63.6%; } /* 350 of the 550px card width */
.why-card {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 550 / 700; border-radius: 16px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 32px; color: #fff;
}
.why-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, .2); }
.why-card::after { /* the hover veil: 12px blur under 40% black */
  content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); opacity: 0; transition: opacity .6s var(--ease-out);
}
.why-card > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease-out); }
.why-card:hover > img { transform: scale(1.04); }
.why-card .tag { display: inline-block; padding: 4px 10px; border: 1px solid #fff; border-radius: 900px; font-size: 12px; line-height: 1.2; letter-spacing: -0.01em; }
.why-card h3 { margin: 16px 0 0; font-family: var(--display); font-weight: 300; font-size: clamp(30px, 3.33vw, 48px); line-height: 1; letter-spacing: -0.01em; }
.why-card p {
  margin: 0; font-size: clamp(18px, 1.67vw, 24px); line-height: 1.2; letter-spacing: -0.01em;
  opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease-out), transform .7s var(--ease-out);
}
.why-card:hover::after, .why-card:focus-visible::after, .why-card:hover p, .why-card:focus-visible p { opacity: 1; }
.why-card:hover p, .why-card:focus-visible p { transform: none; transition-delay: .08s; }
.why-card:focus-visible { outline: 2px solid var(--blue, #1340f1); outline-offset: 4px; }
@media (hover: none) { /* no hover on touch screens: keep the copy up */
  .why-card::after, .why-card p { opacity: 1; }
  .why-card p { transform: none; }
}

/* ---------- Contact + footer on white ---------- */
[data-page="methodology"] .contact { background: var(--paper); color: var(--ink-2, #0b0b0b); }
[data-page="methodology"] .contact h2 .dim { color: #c9c7c1; }
[data-page="methodology"] .contact .site-foot { border-top-color: rgba(11,11,11,.24); }
[data-page="methodology"] .contact .foot-links .sep { background: rgba(11,11,11,.24); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .phases { margin-top: 48px; }
  /* The diagram keeps its left-to-right orientation: too narrow to read at phone width, it holds
     740px (labels ~8px) and swipes sideways in a full-bleed strip; the page itself never scrolls sideways */
  .diagram-scroll {
    margin: 0 calc(-1 * clamp(16px, 11.1vw, 160px)); padding-left: 24px; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; display: flex;
  }
  .diagram-scroll::-webkit-scrollbar { display: none; }
  .diagram-scroll::after { content: ""; flex: 0 0 24px; } /* end padding the browser keeps when scrolled to the end */
  .diagram { flex: 0 0 max(740px, 100% - 24px); } /* 24px each side, swiping only below ~788px */
  .ppp-tabs .wrap, .ppp-panel { gap: 32px; }
  .ppp-sub { margin-top: -16px; }
  .ppp-row { grid-template-columns: 1fr; grid-auto-rows: auto; row-gap: 8px; padding: 20px 0; }
  .ppp-plug { flex-direction: column; align-items: flex-start; gap: 16px; }
  .why-cards { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
  .why-card { aspect-ratio: 4 / 5; padding: 24px; }
  .why-card.rigour, .why-card.perspective, .why-card.speed { grid-area: auto; margin-top: 0; }
}
@media (max-width: 600px) {
  .phases { grid-template-columns: 1fr; }
  .ppp-switch button { padding: 0 14px; gap: 6px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .diagram .to img, .ppp-panel.is-out, .ppp-panel.is-in * { animation: none !important; }
  .ppp-thumb { transition: none; }
}

/* Phones (Figma mobile Work, Approach 1726:20520): on the 24px gutter, 80px down to one
   column of 264px phases 8px apart, the diagram strip 48px under them */
@media (max-width: 600px) {
  .approach .wrap { padding: 0 var(--gutter); }
  [data-page="work"] .approach { padding: 40px 0 120px; }
  .approach .w-head { line-height: 2.03; } /* Figma sets "Approach" in a 65px line */
  .phases { justify-items: center; gap: 8px; margin-top: 80px; }
  .phase { width: 264px; }
  .diagram-scroll { margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); }
  .diagram-scroll::after { flex-basis: var(--gutter); }
}
