/* I MADE A BUG: Studio page (studio-v1). Built on the approved Home/Work system: same tokens, type, colours, nav,
   footer, texture rules and Toon V1 Bug. Section rhythm: dark hero (grain + light) → dark (who) → dark with pattern
   (values) → deep green pause (process, like the homepage's "Why we build") → dark (what we make) → lime CTA. */

.page-studio .s-title { font: 700 clamp(36px, 4.6vw, 68px)/.98 var(--display); text-transform: uppercase; letter-spacing: .005em; text-wrap: balance; }
.page-studio section { scroll-margin-top: 72px; }

/* ---------- 01 · HERO ---------- */
.s-hero { position: relative; }
.s-hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); align-items: center; gap: clamp(16px, 3vw, 48px);
  padding-top: clamp(40px, 5vw, 80px); padding-bottom: clamp(56px, 6vw, 96px); min-height: min(calc(100vh - 64px), 820px); }
.s-hero h1 { position: relative; z-index: 55; font: 700 clamp(44px, 6vw, 96px)/.92 var(--display); text-transform: uppercase; letter-spacing: .004em; }
.s-hero h1 .l { display: block; }
.s-hero h1 .l:nth-child(2) { padding-left: .9em; }                               /* a small editorial stagger */
.s-hero h1 .dot { display: inline-block; color: var(--lime); transform-origin: 50% 80%; }
.s-hero .lead { margin-top: 22px; font-size: clamp(16.5px, 1.3vw, 19px); line-height: 1.62; max-width: 31em; color: var(--muted); }
.s-hero .lead + .lead { margin-top: 14px; }
.hero-stage { position: relative; justify-self: center; width: min(112%, 480px); aspect-ratio: 1; }
.hero-still { position: absolute; inset: 0; width: 100%; height: 100%; }
html.studio-bug-live .hero-still, html.studio-bug-pending .hero-still { visibility: hidden; }
/* the flight trail from the full stop to the Bug (drawn by studio-bug.js in page coordinates) */
.trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.trail-path { fill: none; stroke: var(--lime); stroke-width: 1.4; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .55; }
.trail-reveal { fill: none; stroke: #fff; stroke-width: 14; stroke-dasharray: 1; stroke-dashoffset: 0; }
html.trail-drawing .trail-reveal { animation: trail-draw var(--trail-dur, 1.1s) cubic-bezier(.65,0,.35,1) both; }
@keyframes trail-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
/* the full stop: anticipation squash → pops out as the Bug → pops back once the Bug has landed */
html.dot-pop .s-hero h1 .dot { animation: dot-pop .32s cubic-bezier(.5,0,.6,1) both; }
@keyframes dot-pop { 0% { transform: scale(1, 1); } 55% { transform: scale(1.5, .5); } 100% { transform: scale(.6, 1.9) translateY(-.15em); opacity: 0; } }
html.dot-gone .s-hero h1 .dot { opacity: 0; }
html.dot-back .s-hero h1 .dot { animation: dot-back .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes dot-back { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.35, .8); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- 02 · WHO WE ARE (centred) ---------- */
.s-who .wrap { text-align: center; padding-top: clamp(64px, 8vw, 120px); padding-bottom: clamp(64px, 8vw, 120px); }
.page-studio .s-who .s-title { margin: 0 auto; max-width: 12em; }
/* the three Bugs, complete (antennae, wings, body) at their true 1:1 proportions: no fixed-height box, no stretching */
.crew { display: flex; justify-content: center; align-items: flex-end; gap: clamp(12px, 3vw, 48px); margin: clamp(28px, 4vw, 52px) auto clamp(24px, 3vw, 40px); }
.crew img { flex: 0 0 auto; align-self: flex-end; width: clamp(110px, 15vw, 220px); height: auto; aspect-ratio: 1 / 1; object-fit: contain; max-width: none; transition: transform .5s var(--ease); }
.crew img:nth-child(2) { transform: translateY(-6%); }                            /* a little rhythm, never a distortion */
.s-who:hover .crew img:nth-child(1) { transform: translateY(-4%) rotate(-3deg); } .s-who:hover .crew img:nth-child(2) { transform: translateY(-10%); } .s-who:hover .crew img:nth-child(3) { transform: translateY(-4%) rotate(3deg); }
.who-body { max-width: 38em; margin: 0 auto; }
.who-body p { font-size: clamp(16.5px, 1.25vw, 18.5px); line-height: 1.68; color: rgba(237,237,237,.84); }
.who-body p + p { margin-top: 16px; }
.who-body p:last-child { color: var(--white); }

/* ---------- 03 · WHAT MAKES US TICK (centred, three even columns) ---------- */
.s-values .wrap { text-align: center; padding-top: clamp(64px, 8vw, 120px); padding-bottom: clamp(72px, 9vw, 140px); }
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 64px); margin-top: clamp(36px, 5vw, 72px); align-items: start; }
.value { display: flex; flex-direction: column; align-items: center; }
.value .v-bug { width: clamp(200px, 19vw, 280px); height: auto; aspect-ratio: 1 / 1; object-fit: contain; max-width: 100%; position: relative; z-index: 0; transform-origin: 50% 90%; }
.value h3 { position: relative; z-index: 1; margin-top: -0.55em; font: 700 clamp(38px, 4.2vw, 62px)/.95 var(--display); text-transform: uppercase;
  -webkit-text-stroke: .07em var(--charcoal); paint-order: stroke fill; }           /* the word overlaps its Bug (Work page language) */
.value p { margin: 14px auto 0; color: rgba(237,237,237,.8); font-size: 16.5px; line-height: 1.62; max-width: 21em; }
.value:hover .v-bug { animation: v-hop .7s cubic-bezier(.3,0,.3,1); }
@keyframes v-hop {                                                               /* anticipation squash, stretch up, land squash, settle */
  0% { transform: translateY(0) scale(1, 1); } 18% { transform: translateY(2%) scale(1.08, .9); } 42% { transform: translateY(-14%) scale(.94, 1.1) rotate(-3deg); }
  64% { transform: translateY(0) scale(1.06, .92); } 80% { transform: translateY(-2%) scale(.99, 1.02); } 100% { transform: translateY(0) scale(1, 1); } }

/* ---------- 04 · HOW WE WORK (deep green pause) ---------- */
.s-process { background: var(--deep); }
.s-process .wrap { padding-top: clamp(64px, 8vw, 116px); padding-bottom: clamp(64px, 8vw, 116px); }
.s-process .s-title { text-align: center; }
.process { margin-top: clamp(28px, 4vw, 56px); }
.flight { display: block; width: 100%; height: auto; overflow: visible; }
.flight-path { fill: none; stroke: var(--lime); stroke-width: 1.4; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .6; vector-effect: non-scaling-stroke; }
.flight-dot { fill: var(--deep); stroke: var(--lime); stroke-width: 2; vector-effect: non-scaling-stroke; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 40px); margin-top: 6px; }
.steps li { text-align: center; padding: 0 4px; }
.steps .n { font: 500 12px/1 var(--mono); letter-spacing: .16em; color: var(--lime); }
.steps h3 { margin-top: 10px; font: 700 clamp(24px, 2.2vw, 32px)/1 var(--display); text-transform: uppercase; }
.steps p { margin: 10px auto 0; color: rgba(237,237,237,.78); font-size: 15.5px; line-height: 1.6; max-width: 17em; }

/* ---------- 05 · WHAT WE MAKE (centred, three even columns, no links) ---------- */
.s-make .wrap { text-align: center; padding-top: clamp(64px, 8vw, 120px); padding-bottom: clamp(64px, 8vw, 120px); }
.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3.5vw, 56px); margin-top: clamp(36px, 4.5vw, 64px); }
.area { border-top: 1px solid var(--line); padding-top: 26px; position: relative; }
.area::before { content: ""; position: absolute; left: 50%; top: -1px; width: 36px; height: 1px; background: var(--lime); transform: translateX(-50%); }
.area h3 { font: 700 clamp(24px, 2.2vw, 32px)/1.02 var(--display); text-transform: uppercase; }
.area p { margin: 14px auto 0; color: rgba(237,237,237,.8); font-size: 16px; line-height: 1.62; max-width: 22em; }

/* ---------- 06 · CTA (lime band; left-aligned, the Bug waves from the edge) ---------- */
.studio-cta { text-align: left; overflow: hidden; }
.studio-cta .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
.studio-cta .h2 { font-size: clamp(36px, 4.6vw, 66px); line-height: .98; max-width: 11em; }
.studio-cta .lead { margin-top: 16px; font-size: clamp(17px, 1.4vw, 20px); }
.studio-cta .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 28px; }
.studio-cta .mail { margin-top: 0; font-size: clamp(18px, 1.6vw, 22px); }
.studio-cta .cta-bug { width: clamp(150px, 17vw, 250px); height: auto; margin-bottom: calc(var(--sec) * -1 - 6px); transform-origin: 50% 100%; }
.studio-cta:hover .cta-bug { animation: v-hop .7s cubic-bezier(.3,0,.3,1); }

/* ---------- texture (the homepage's rules: hero = grain + light; values = Bug-line pattern; process = the "why" grain) ---------- */
.tex .s-hero, .tex .s-values, .tex .s-process { position: relative; }
.tex .s-hero::before, .tex .s-values::before, .tex .s-process::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.tex2 .s-hero::before { background: radial-gradient(circle 190px at var(--lx) var(--ly), rgba(237,237,237,.035), rgba(237,237,237,0) 100%),
  radial-gradient(ellipse 820px 560px at var(--lx) var(--ly), rgba(237,237,237,.055), rgba(237,237,237,.018) 45%, rgba(237,237,237,0) 72%),
  radial-gradient(ellipse 460px 320px at var(--lx) calc(var(--ly) - 10px), rgba(165,255,61,.03), rgba(165,255,61,0) 70%); }
.s-hero { --lx: 72%; --ly: 48%; }
.tex .s-hero::before, .tex .s-hero::after { -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }
.tex .s-process { isolation: isolate; }                                          /* own background: the grain sits on the deep green */

@media (prefers-reduced-motion: reduce) { .value:hover .v-bug, .studio-cta:hover .cta-bug { animation: none; } .crew img, .s-who:hover .crew img { transition: none; } }

/* ---------- tablet ---------- */
@media (max-width: 1000px) {
  .s-hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, .7fr); min-height: 0; }
  .s-hero h1 { font-size: clamp(40px, 6.4vw, 64px); }
  .values { gap: 20px; }
  .value .v-bug { width: clamp(170px, 22vw, 220px); }
  .value h3 { font-size: clamp(32px, 4.6vw, 44px); }
}
/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .s-hero .wrap { grid-template-columns: 1fr; padding-top: 28px; }
  .hero-stage { order: -1; width: min(70vw, 280px); justify-self: end; margin-bottom: 4px; }
  .s-hero h1 .l:nth-child(2) { padding-left: .5em; }
  .values { grid-template-columns: 1fr; gap: 44px; }
  .value .v-bug { width: min(56vw, 210px); }
  .value h3 { font-size: 40px; }
  .crew { gap: 6px; }
  .crew img { width: min(29vw, 120px); }
  .flight { display: none; }
  /* centred stack: a lime dot above each number, a short dashed connector down to the next step */
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps li { text-align: center; position: relative; padding: 0 0 52px; }
  .steps li:last-child { padding-bottom: 0; }
  .steps li::before { content: ""; display: block; width: 12px; height: 12px; margin: 0 auto 12px; border-radius: 50%; background: var(--deep); border: 2px solid var(--lime); box-sizing: border-box; }
  .steps li:not(:last-child)::after { content: ""; position: absolute; left: 50%; bottom: 8px; height: 34px; border-left: 1px dashed rgba(165,255,61,.5); }
  .areas { grid-template-columns: 1fr; }
  .studio-cta .wrap { grid-template-columns: 1fr; }
  .studio-cta .cta-bug { justify-self: end; width: 150px; margin-top: -20px; }
}
html.studio-bug-pending .trail-reveal { stroke-dashoffset: 1; }                 /* motion: the trail waits for the Bug */
