/* ==========================================================================
   Kyte Digital
   All colours are custom properties on .page. Themes override them.
   See docs/HANDOFF.md for the full spec.
   ========================================================================== */

/* Fonts (self-hosted, latin subset, only the weights in use) */
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/rubik-latin-700-normal.woff2') format('woff2') }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/rubik-latin-800-normal.woff2') format('woff2') }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2') }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2') }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2') }

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --font-display: 'Rubik', Arial, sans-serif;
  --font-body: 'Inter', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --container: 1248px;
  --gutter: 24px;
  --section-pad: clamp(64px, 9vw, 128px);
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Plum (shipping theme) */
.page {
  --bg: #1E0229; --fg: #FFFFFF; --muted: #DCCBE8; --panel: #2A0A3B; --line: #4A2362;
  --g1: #C247C4; --g2: #EE6490; --g3: #FFA352; --hi: #FFA352; --btn: #FFA352; --btn-fg: #1E0229; --btn-side: #C2651C;
  --side: #B9A3C9; --kside: #7A2A86; --n-l: #B9A3C9; --n-r: #DCCBE8; --n-t: #FFFFFF; --shadow: rgba(0, 0, 0, 0.45); --ghost-o: 0.075;
  --f1: #4B2468; --f1s: #2F1444; --f2: #5E2552; --f2s: #3A1332; --f3: #3B2D74; --f3s: #241A4C;
  --err: #FF8FA3;
}
/* Alternative themes, kept so the palette can be swapped by changing the class on .page */
.t-forest {
  --bg: #0B2B26; --fg: #F1FFF8; --muted: #B9D9CD; --panel: #113A33; --line: #23594E;
  --g1: #12A594; --g2: #5FD08A; --g3: #C9F26B; --hi: #C9F26B; --btn: #C9F26B; --btn-fg: #0B2B26; --btn-side: #86AD35;
  --side: #8FB8A9; --kside: #0B6E63; --n-l: #8FB8A9; --n-r: #C4E3D7; --n-t: #F1FFF8; --shadow: rgba(0, 0, 0, 0.45);
  --f1: #1F5C4F; --f1s: #113A32; --f2: #2E6548; --f2s: #1A402D; --f3: #1B5664; --f3s: #0F3841;
  --err: #FFA08F;
}
.t-electric {
  --bg: #F3F5FF; --fg: #0A1045; --muted: #3F4675; --panel: #FFFFFF; --line: #D6DCFA;
  --g1: #1D3FE0; --g2: #2A66F5; --g3: #1E90E6; --hi: #1D3FE0; --btn: #1D3FE0; --btn-fg: #FFFFFF; --btn-side: #0E2291;
  --side: #3A4190; --kside: #142B9E; --n-l: #0A1045; --n-r: #1A2160; --n-t: #2C3480; --shadow: rgba(10, 16, 69, 0.22); --ghost-o: 0.06;
  --f1: #CCD4F9; --f1s: #A7B3EC; --f2: #D7CEF7; --f2s: #B4A8E6; --f3: #C4DEF7; --f3s: #9DC2E8;
  --err: #B3122E;
}
.t-sunrise {
  --bg: #FFFFFF; --fg: #1B1230; --muted: #5A5168; --panel: #FBF4EE; --line: #EADDD2;
  --g1: #F23A4C; --g2: #F7602B; --g3: #F58A16; --hi: #D8321C; --btn: #F7602B; --btn-fg: #1B1230; --btn-side: #B33E12;
  --side: #4A3B66; --kside: #B32233; --n-l: #1B1230; --n-r: #2B1F47; --n-t: #40325F; --shadow: rgba(27, 18, 48, 0.2); --ghost-o: 0.06;
  --f1: #F7DDCC; --f1s: #E6BFA6; --f2: #F5D3D3; --f2s: #E2ADAD; --f3: #F7E4BE; --f3s: #E5C88F;
  --err: #A3101C;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box }
html { scroll-behavior: smooth; scroll-padding-top: 88px }
body { margin: 0 }
a { color: inherit }
a:hover { color: inherit }
h1, h2, h3, p { margin: 0 }
button, input, textarea { font: inherit }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: clip; /* ribbons, fragments and the exploded mark bleed off the sides on purpose. clip, not hidden, so the sticky header works */
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.section { padding: var(--section-pad) 0; position: relative }
.above { position: relative; z-index: 2 }
.main { display: flex; flex-direction: column; flex-grow: 1 }
.main:focus { outline: none }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: var(--gutter); top: 12px; z-index: 20; transform: translateY(-200%) }
.skip-link:focus { transform: none }

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */
.h1 {
  display: flex; flex-direction: column;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(40px, 9vw, 120px); /* capped at 120px by request */
  line-height: 0.92; letter-spacing: -0.035em;
}
.h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 4.4vw, 60px); line-height: 1.04; letter-spacing: -0.025em;
  text-wrap: balance;
}
.h2--contact { font-weight: 800; font-size: clamp(36px, 6vw, 84px); line-height: 0.96; letter-spacing: -0.035em }
.h3 { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em }
.h3--step { font-weight: 800; font-size: clamp(36px, 4.4vw, 56px); line-height: 1; letter-spacing: -0.03em }
.h3--sent { font-size: 34px }
.lead { max-width: 620px; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.55; color: var(--muted) }
.body { font-size: 18px; line-height: 1.6; color: var(--muted) }
.small { font-size: 14px; line-height: 1.5; color: var(--muted) }
.mono { font-family: var(--font-mono); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted) }
.hi { color: var(--hi) }

.heading-group { display: flex; flex-direction: column; gap: 20px; max-width: 860px }

/* --------------------------------------------------------------------------
   SVG fills
   -------------------------------------------------------------------------- */
.f-fg { fill: var(--fg) } .f-side { fill: var(--side) } .f-kside { fill: var(--kside) }
.f-hi { fill: var(--hi); stroke: var(--hi); stroke-width: 2; stroke-linejoin: round }
.f-on { fill: var(--btn-fg); stroke: var(--btn-fg); stroke-width: 2; stroke-linejoin: round }
.g1 { stop-color: var(--g1) } .g2 { stop-color: var(--g2) } .g3 { stop-color: var(--g3) }
.i-t { fill: var(--g3); stroke: var(--g3) } .i-l { fill: var(--g1); stroke: var(--g1) } .i-r { fill: var(--g2); stroke: var(--g2) }
.n-t { fill: var(--n-t); stroke: var(--n-t) } .n-l { fill: var(--n-l); stroke: var(--n-l) } .n-r { fill: var(--n-r); stroke: var(--n-r) }
.ft1 { fill: var(--f1) } .fs1 { fill: var(--f1s) } .ft2 { fill: var(--f2) } .fs2 { fill: var(--f2s) } .ft3 { fill: var(--f3) } .fs3 { fill: var(--f3s) }
.iso { display: block; width: auto; overflow: visible }
.iso polygon { stroke-width: 0.12; stroke-linejoin: round }
.kite-glyph { display: block; width: auto; height: 18px; flex-shrink: 0 }

/* --------------------------------------------------------------------------
   Background pieces
   -------------------------------------------------------------------------- */
.glow {
  position: absolute; left: 0; right: 0; top: 0; height: 920px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 70% at 84% 26%, color-mix(in srgb, var(--g2) 30%, transparent), transparent 70%);
}
.progress {
  position: fixed; left: 0; top: 0; right: 0; height: 4px; z-index: 10;
  background: var(--hi); transform-origin: left; transform: scaleX(0);
}

/* --------------------------------------------------------------------------
   Buttons and links
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 24px; border: 0; border-radius: var(--radius);
  background: var(--btn); color: var(--btn-fg);
  font-family: var(--font-body); font-weight: 600; font-size: 17px; text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--btn-side);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); box-shadow: 0 8px 0 var(--btn-side) }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--btn-side) }
.btn svg { display: block; width: 20px; height: 20px; transition: transform 0.2s ease-out }
.btn:hover svg { transform: translateX(4px) }
.btn--sm { min-height: 48px; font-size: 16px }
.btn[disabled] { cursor: progress; transform: none; box-shadow: 0 6px 0 var(--btn-side) }
.btn[disabled] svg { transform: none }

.btn:focus-visible, .navlink:focus-visible, .textlink:focus-visible, .logo-link:focus-visible,
.menu-toggle:focus-visible, .ribbon-toggle:focus-visible { outline: 2px solid var(--hi); outline-offset: 4px }

.textlink {
  padding: 12px 0; font-weight: 600; font-size: 17px;
  text-decoration: underline; text-decoration-color: var(--hi); text-decoration-thickness: 2px; text-underline-offset: 6px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 8;
  margin-bottom: 0;
  transition: background-color 0.25s, box-shadow 0.25s, margin 0.25s var(--ease);
}
.site-header__inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-top: 24px; padding-bottom: 24px;
  transition: padding 0.25s var(--ease);
}
/* Once scrolled, the bar gets a background and tightens up. The margin keeps the
   header's total height constant so nothing below it jumps. */
.site-header.is-stuck {
  margin-bottom: 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.site-header.is-stuck .site-header__inner { padding-top: 14px; padding-bottom: 14px }
.logo-link { display: block; text-decoration: none }
.logo { display: block; width: auto; height: 44px }
.logo--mark { display: none }
.logo--sm { height: 32px }
.header-actions { display: flex; align-items: center; gap: 8px }
.navlinks { display: flex; align-items: center; gap: 36px; font-weight: 600; font-size: 16px }
.navlink { position: relative; padding: 12px 0; text-decoration: none }
.navlink::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px;
  background: var(--hi); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease-out;
}
.navlink:hover::after, .navlink:focus-visible::after { transform: scaleX(1) }

/* Mobile menu (below 860px only) */
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--fg); cursor: pointer;
  box-shadow: 0 6px 0 var(--line); /* same raised edge as the button beside it */
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.menu-toggle:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--line) }
.menu-toggle:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line) }
.menu-toggle svg { display: block; width: 24px; height: 24px }
.menu-toggle .i-close { display: none }
.menu-toggle[aria-expanded="true"] .i-open { display: none }
.menu-toggle[aria-expanded="true"] .i-close { display: block }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; z-index: 1; padding-top: clamp(32px, 6vw, 88px); padding-bottom: clamp(40px, 6vw, 80px) }
.hero__inner { position: relative; display: flex; flex-direction: column; gap: 28px }
.hero__foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; padding-top: 12px }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px }

/* 3D logo mark: each piece is 8 stacked SVG layers 5px apart on Z */
.hero .h1, .hero__foot { position: relative; z-index: 1 }
.stage { position: absolute; z-index: 0; right: 48px; top: -28px; width: min(32%, 372px); aspect-ratio: 1 / 1; perspective: 1200px; pointer-events: none }
.rig { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(20deg) rotateY(-24deg) }
.piece { position: absolute; inset: 0; transform-style: preserve-3d }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible }
.z0 { transform: translateZ(0px) } .z1 { transform: translateZ(5px) } .z2 { transform: translateZ(10px) } .z3 { transform: translateZ(15px) }
.z4 { transform: translateZ(20px) } .z5 { transform: translateZ(25px) } .z6 { transform: translateZ(30px) } .z7 { transform: translateZ(35px) }
.p-kite { transform: translateZ(56px) }
.ground {
  position: absolute; inset: 12% 4% 0 12%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--shadow), transparent);
  transform: translateZ(-90px) translateY(18%);
}

/* --------------------------------------------------------------------------
   Ribbons
   -------------------------------------------------------------------------- */
.ribbons { position: relative; padding: 28px 0 44px }
.ribbon {
  display: flex; overflow: hidden; width: 106%; margin-left: -3%; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em;
}
.ribbon--a { position: relative; z-index: 1; transform: rotate(-2deg); padding: 20px 0; background: var(--btn); color: var(--btn-fg); font-size: 28px }
.ribbon--b {
  transform: rotate(1.5deg); margin-top: -16px; padding: 18px 0;
  background: var(--panel); color: var(--fg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 20px;
}
.track { display: flex; align-items: center; gap: 40px; padding-right: 40px; flex-shrink: 0; margin: 0; list-style: none }
.track li { display: flex; align-items: center; gap: 40px }

/* Pause control for the tickers (WCAG 2.2.2) */
.ribbon-toggle {
  position: absolute; right: var(--gutter); bottom: 0; z-index: 2;
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--muted); cursor: pointer;
}
.ribbon-toggle:hover { color: var(--fg) }
.ribbon-toggle svg { display: block; width: 18px; height: 18px }
.ribbon-toggle .i-play { display: none }
.ribbon-toggle[aria-pressed="true"] .i-pause { display: none }
.ribbon-toggle[aria-pressed="true"] .i-play { display: block }
.ribbons.is-paused .track { animation-play-state: paused !important }

/* --------------------------------------------------------------------------
   Services
   -------------------------------------------------------------------------- */
.section__inner { display: flex; flex-direction: column; gap: 56px }
.section__inner--tight { gap: 48px }
.cards { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 24px }
.cardwrap { display: flex; perspective: 1200px }
.card {
  flex-grow: 1; display: flex; flex-direction: column; gap: 20px; padding: 32px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  transform-style: preserve-3d; box-shadow: 0 0 0 var(--line);
  transition: transform 0.3s var(--ease), rotate 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.c1 { rotate: -1.4deg } .c2 { rotate: 0.9deg } .c3 { rotate: -0.7deg } .c4 { rotate: 1.3deg }
.card:hover { rotate: 0deg; transform: translateY(-10px) rotateX(7deg) rotateY(-7deg); box-shadow: 12px 16px 0 var(--line); border-color: var(--hi) }
.card__icon { height: 112px; display: flex; align-items: flex-end }
.card .iso { transition: transform 0.35s var(--ease) }
.card:hover .iso { transform: translateZ(48px) translateY(-6px) scale(1.1) }

/* Exploding background mark (points up and to the left, stays faint) */
.ghostwrap { position: absolute; z-index: 1; pointer-events: none }
.boom { left: calc(50% - 210px); top: 64px; width: 660px; aspect-ratio: 1 / 1; transform: rotate(5deg) }
.bm { position: absolute; inset: 0 }
.bm svg { display: block; width: 100%; height: 100%; overflow: visible }
.bm-stem { transform: translate(9%, 1%) rotate(2deg) }
.bm-kite { transform: translate(-7%, -7%) rotate(-1deg) }
.bm-leg { transform: translate(-2%, 9%) rotate(-2deg) }
/* With JS, the pieces start together and pull apart as the section scrolls through
   the viewport (--p goes 0 to 1), reassembling when scrolling back. */
.boom.is-live .bm-stem { transform: translate(calc(24% * var(--p, 0)), calc(3% * var(--p, 0))) rotate(calc(5deg * var(--p, 0))) }
.boom.is-live .bm-kite { transform: translate(calc(-18% * var(--p, 0)), calc(-18% * var(--p, 0))) rotate(calc(-3deg * var(--p, 0))) }
.boom.is-live .bm-leg { transform: translate(calc(-5% * var(--p, 0)), calc(24% * var(--p, 0))) rotate(calc(-5deg * var(--p, 0))) }
.ghost-soft { fill: var(--fg); opacity: calc(var(--ghost-o) * 0.6) }

/* --------------------------------------------------------------------------
   Slanted dotted panels (Approach, Contact)
   -------------------------------------------------------------------------- */
.slant { position: relative }
.slant::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-color: var(--panel);
  background-image: radial-gradient(circle, var(--line) 1.5px, transparent 1.7px);
  background-size: 24px 24px;
}
.slant--a::before { transform: skewY(-2deg) }
.slant--b::before { transform: skewY(1.5deg) }

.split { display: grid; gap: 56px 72px }
.split--approach { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); align-items: start }
.split--contact { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); align-items: center }
.approach__intro { display: flex; flex-direction: column; gap: 20px }
.approach__intro .body { max-width: 460px }
.approach__intro .btn { align-self: flex-start; margin-top: 12px }

/* Principles on a line */
.plist { position: relative; padding-left: 48px }
.plist__items { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none }
.tether, .tether-fill { position: absolute; left: 9px; top: 12px; bottom: 12px; width: 2px }
.tether { background: var(--line) }
.tether-fill { background: var(--hi); transform-origin: top }
.principle { position: relative; display: flex; gap: 24px; align-items: flex-start; padding: 20px 0 28px }
.principle__body { display: flex; flex-direction: column; gap: 12px }
.node { position: absolute; left: -48px; top: 30px; width: 20px; display: flex; justify-content: center }
.node svg { height: 22px; transition: transform 0.4s var(--ease) }
.num { flex-shrink: 0; padding-top: 8px; color: var(--hi); font-size: 15px; transition: transform 0.25s ease-out }
.principle:hover .num { transform: translateX(8px) }
.principle:hover .node svg { transform: rotate(45deg) scale(1.15) }

/* --------------------------------------------------------------------------
   Process
   -------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 40px; margin: 0; padding: 0; list-style: none }
.step { display: flex }
.step__inner { flex-grow: 1; display: flex; flex-direction: column; gap: 16px }
.step__block { height: 132px; display: flex; align-items: flex-end }
.step__stack { display: flex; flex-direction: column; align-items: center; gap: 6px }
.step__stack .kite-glyph { height: 24px }

/* Floating fragments */
.frag--a { left: -130px; top: -70px; width: 400px }
.frag--b { right: -40px; top: 120px; width: 240px }
.frag--c { left: 56%; bottom: -90px; width: 250px }
.fstage { position: relative; perspective: 900px }
.frag--a .fstage { aspect-ratio: 137.0 / 75.2 }
.frag--b .fstage { aspect-ratio: 104.6 / 45.9 }
.frag--c .fstage { aspect-ratio: 93.9 / 77.0 }
.frig { position: absolute; inset: 0; transform-style: preserve-3d }
.fr1 { transform: rotateX(24deg) rotateY(-22deg) } .fr2 { transform: rotateX(-18deg) rotateY(24deg) } .fr3 { transform: rotateX(22deg) rotateY(20deg) }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact { flex-grow: 1; display: flex; align-items: center }
.contact__intro { display: flex; flex-direction: column; gap: 24px; align-items: flex-start }
.contact__intro .body { max-width: 480px }
.contact__intro a { text-decoration-color: var(--hi); text-decoration-thickness: 2px; text-underline-offset: 4px }
.contact__intro a:focus-visible { outline: 2px solid var(--hi); outline-offset: 4px }

.tilt { perspective: 1400px }
.formcard {
  display: flex; flex-direction: column; gap: 20px; padding: 32px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  transform: rotateY(-7deg) rotateX(3deg); transform-origin: left center;
  box-shadow: 18px 18px 0 var(--line);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.tilt:hover .formcard, .formcard:focus-within { transform: none; box-shadow: 8px 8px 0 var(--line) }
.formcard--sent { padding: 48px 32px; align-items: flex-start }
.formcard--sent .kite-glyph { height: 44px }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 20px }
.field { display: flex; flex-direction: column; gap: 8px }
.lbl { font-weight: 600; font-size: 15px; line-height: 1.4 }
.lbl .opt { font-weight: 400; color: var(--muted) }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 1px solid var(--muted); border-radius: var(--radius);
  background: var(--panel); color: var(--fg);
  font-family: var(--font-body); font-size: 17px; line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea.input { resize: vertical }
.input:focus { outline: none; border-color: var(--hi); box-shadow: 0 0 0 3px var(--hi) }

.chips { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0 }
.chips legend { padding: 0; margin-bottom: 8px }
.chips__list { display: flex; flex-wrap: wrap; gap: 10px }
.chip {
  position: relative; display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 16px; border: 1px solid var(--muted); border-radius: var(--radius);
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: transform 0.15s ease-out, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer }
.chip:hover { transform: translateY(-2px) }
.chip:has(input:checked) { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); transform: translateY(-3px); box-shadow: 0 4px 0 var(--btn-side) }
.chip:has(input:focus-visible) { outline: 2px solid var(--hi); outline-offset: 3px }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding-top: 4px }
.honeypot { display: none }
.privacy-note { padding-top: 16px; border-top: 1px solid var(--line) }

/* Validation, loading and error states (--hi is reserved for focus, so errors use --err) */
.input[aria-invalid="true"] { border-color: var(--err); border-width: 2px; padding: 11px 15px }
.input[aria-invalid="true"]:focus { border-color: var(--hi) }
.field-error, .form-error {
  display: flex; align-items: flex-start; gap: 8px;
  color: var(--err); font-size: 14px; line-height: 1.5; font-weight: 600;
}
.field-error[hidden], .form-error[hidden] { display: none }
.field-error svg, .form-error svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px }
.form-error { padding: 12px 16px; border: 1px solid var(--err); border-radius: var(--radius); font-size: 15px }
.spinner { display: none; width: 20px; height: 20px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50% }
.is-sending .spinner { display: block }
.is-sending .i-arrow { display: none }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-top: 32px; padding-bottom: 32px }

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes rig { from { transform: rotateX(24deg) rotateY(-32deg) rotateZ(2deg) } to { transform: rotateX(12deg) rotateY(-10deg) rotateZ(-2deg) } }
@keyframes lift { from { transform: translateZ(34px) } to { transform: translateZ(92px) } }
@keyframes bob { from { transform: translateZ(0px) } to { transform: translateZ(14px) } }
@keyframes rise { from { opacity: 0; transform: perspective(900px) rotateX(-50deg) translateY(48px) } to { opacity: 1; transform: perspective(900px) rotateX(0deg) translateY(0) } }
@keyframes marquee { to { transform: translateX(-100%) } }
@keyframes reveal { from { opacity: 0; transform: translateY(48px) } to { opacity: 1; transform: none } }
@keyframes flip { from { opacity: 0; transform: perspective(900px) rotateX(-55deg) translateY(40px) } to { opacity: 1; transform: perspective(900px) rotateX(0deg) translateY(0) } }
@keyframes blk { from { transform: translateY(0.15px) } to { transform: translateY(-0.45px) } }
@keyframes blkacc { from { transform: translateY(0.2px) } to { transform: translateY(-1.5px) } }
@keyframes hop { 0% { transform: translateY(0) rotate(0deg) } 60% { transform: translateY(-16px) rotate(14deg) } 100% { transform: translateY(0) rotate(0deg) } }
@keyframes growx { from { transform: scaleX(0) } to { transform: scaleX(1) } }
@keyframes growy { from { transform: scaleY(0) } to { transform: scaleY(1) } }
@keyframes fl-a { from { transform: translate(0px, 0px) rotate(0deg) } to { transform: translate(22px, -30px) rotate(8deg) } }
@keyframes fl-b { from { transform: translate(0px, 0px) rotate(0deg) } to { transform: translate(-18px, 24px) rotate(-10deg) } }
@keyframes fl-c { from { transform: translate(0px, 0px) rotate(0deg) } to { transform: translate(26px, 14px) rotate(6deg) } }
@keyframes fr1 { from { transform: rotateX(28deg) rotateY(-26deg) } to { transform: rotateX(10deg) rotateY(-6deg) } }
@keyframes fr2 { from { transform: rotateX(-22deg) rotateY(28deg) } to { transform: rotateX(-6deg) rotateY(8deg) } }
@keyframes fr3 { from { transform: rotateX(26deg) rotateY(12deg) } to { transform: rotateX(8deg) rotateY(30deg) } }
@keyframes pop { from { opacity: 0; transform: scale(0) rotate(-120deg) } to { opacity: 1; transform: scale(1) rotate(0deg) } }
@keyframes spin { to { transform: rotate(360deg) } }

/* --------------------------------------------------------------------------
   Motion (only when the visitor has not asked for reduced motion)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .rig { animation: rig 9s ease-in-out infinite alternate }
  .p-kite { animation: lift 4.5s ease-in-out infinite alternate }
  .p-stem { animation: bob 5.5s ease-in-out infinite alternate }
  .p-leg { animation: bob 6.5s ease-in-out 0.8s infinite alternate }
  .rise { transform-origin: 50% 100%; animation: rise 0.9s var(--ease) both }
  .d1 { animation-delay: 0.08s } .d2 { animation-delay: 0.2s } .d3 { animation-delay: 0.32s } .d4 { animation-delay: 0.5s }
  .track { animation: marquee 36s linear infinite }
  .ribbon--b .track { animation-direction: reverse; animation-duration: 48s }
  .ribbon-toggle { display: inline-flex }
  .blk { animation: blk 2.8s ease-in-out infinite alternate }
  .b1 { animation-delay: 0.35s } .b2 { animation-delay: 0.7s } .b3 { animation-delay: 1.05s }
  .acc { animation: blkacc 2.1s ease-in-out infinite alternate }
  .still .blk { animation: none } /* process blocks are static by request */
  .hop { animation: hop 2.4s ease-in-out infinite }
  .fr1 { animation: fr1 11s ease-in-out infinite alternate }
  .fr2 { animation: fr2 9s ease-in-out 0.8s infinite alternate }
  .fr3 { animation: fr3 13s ease-in-out 0.4s infinite alternate }
  .fl-a { animation: fl-a 13s ease-in-out infinite alternate }
  .fl-b { animation: fl-b 10s ease-in-out 1.2s infinite alternate }
  .fl-c { animation: fl-c 15s ease-in-out 0.6s infinite alternate }
  .is-sending .spinner { animation: spin 0.8s linear infinite }
}

/* Scroll-driven effects. Where unsupported, elements show in their final state. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 70% }
    .flip { transform-origin: 50% 100%; animation: flip linear both; animation-timeline: view(); animation-range: entry 0% entry 90% }
    .plist { view-timeline-name: --plist }
    .tether-fill { animation: growy linear both; animation-timeline: --plist; animation-range: entry 10% cover 42% }
    .node { animation: pop linear both; animation-timeline: view(); animation-range: entry 0% cover 28% }
    .progress { animation: growx linear both; animation-timeline: scroll(root) }
  }
}

/* --------------------------------------------------------------------------
   860px and below
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  /* The mark stays top right and sits behind the headline */
  .stage { right: -8px; top: -12px; width: min(46%, 340px) }
  .hero .lead { max-width: 58% } /* headline may overlap the mark; body copy stays clear of it */
  .formcard { transform: none; box-shadow: 8px 8px 0 var(--line) }
  .frag { scale: 0.6 }

  /* Without JS the links simply hide, as designed. With JS they become a toggle menu. */
  .navlinks { display: none }
  .js .menu-toggle { display: inline-flex }
  .js .navlinks.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; top: calc(100% - 8px); left: var(--gutter); right: var(--gutter);
    padding: 8px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 8px 8px 0 var(--line);
  }
  .js .navlinks.is-open .navlink { padding: 14px 0; font-size: 18px }
  .js .navlinks.is-open .navlink + .navlink { border-top: 1px solid var(--line) }
  .js .navlinks.is-open .navlink::after { bottom: 8px; right: auto; width: 48px }
}
@media (max-width: 860px) {
  .site-header__inner { gap: 12px }
}

/* Services in one column: cards sit straight */
@media (max-width: 591px) {
  .c1, .c2, .c3, .c4 { rotate: 0deg }
}

/* Process in one column: block on the left, text on the right */
@media (max-width: 647px) {
  .step__inner { display: grid; grid-template-columns: 80px 1fr; column-gap: 24px; row-gap: 12px; align-items: start }
  .step__inner > * { grid-column: 2 }
  .step__block { grid-column: 1; grid-row: 1 / span 3; height: auto; justify-content: center; padding-top: 4px }
  .step__stack { zoom: 0.72 }
}

/* Small screens: larger headline, faded mark behind it */
@media (max-width: 560px) {
  .h1 { font-size: clamp(40px, 13vw, 76px) }
  .stage { right: -14%; top: -8px; width: min(80%, 320px); opacity: 0.35 }
  .hero .lead { max-width: none }
}

@media (max-width: 420px) {
  .header-actions .btn--sm { padding: 0 16px }
}
/* Smallest screens: show the mark only so the header stays on one line */
@media (max-width: 374px) {
  .logo--full { display: none }
  .logo--mark { display: block }
}
