:root {
  --signal-bg: #08090b;
  --signal-blue: #2ea8e0;
  --signal-pink: #e0188c;
  --ink: #f5f6f8;
  --muted-fog: #9aa0ab;
  --border-faint: rgba(255, 255, 255, 0.1);
  --border-mid: rgba(255, 255, 255, 0.14);
  --surface: rgba(255, 255, 255, 0.04);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 80px;
  --space-xl: 120px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --max-w: 1080px;
  /* System monospace stack for the terminal enquiry section — no extra webfont loaded. */
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  background: var(--signal-bg);
  color: var(--ink);
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ─── Skip link ─────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 10;
  background: var(--signal-blue);
  color: var(--signal-bg);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease-out-quart);
}

.skip-link:focus {
  top: 16px;
}

/* ─── Corner glow ────────────────────────────────── */

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.blob-field {
  position: absolute;
  inset: -10%;
  /* Plain CSS blur only — filter: url(#svg-filter) chained with feGaussianBlur/
     feColorMatrix renders unreliably on iOS Safari (hard edges instead of a
     soft merge), so the gooey metaball trick is intentionally not used here. */
  filter: blur(60px) saturate(150%);
}

.blob {
  position: absolute;
  opacity: 0.32;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  will-change: transform, border-radius;
}

.blob-1, .blob-3, .blob-5 { background: color-mix(in oklch, var(--signal-blue) 72%, black); }
.blob-2, .blob-4, .blob-6 { background: color-mix(in oklch, var(--signal-pink) 72%, black); }

.blob-1 {
  width: 42vw; height: 42vw;
  max-width: 520px; max-height: 520px;
  min-width: 320px; min-height: 320px;
  top: 8%; left: 6%;
  animation: orbit-a 9s ease-in-out infinite, morph-a 5s ease-in-out infinite;
}

.blob-2 {
  width: 34vw; height: 34vw;
  max-width: 420px; max-height: 420px;
  min-width: 260px; min-height: 260px;
  top: 55%; left: 62%;
  animation: orbit-b 12s ease-in-out infinite, morph-b 6s ease-in-out infinite;
}

.blob-3 {
  width: 30vw; height: 30vw;
  max-width: 380px; max-height: 380px;
  min-width: 220px; min-height: 220px;
  top: 30%; left: 40%;
  animation: orbit-c 14s linear infinite, morph-c 7s ease-in-out infinite;
}

.blob-4 {
  width: 40vw; height: 40vw;
  max-width: 500px; max-height: 500px;
  min-width: 300px; min-height: 300px;
  top: 60%; left: 8%;
  animation: orbit-d 10s ease-in-out infinite, morph-a 6s ease-in-out infinite reverse;
}

.blob-5 {
  width: 32vw; height: 32vw;
  max-width: 400px; max-height: 400px;
  min-width: 240px; min-height: 240px;
  top: 4%; left: 58%;
  animation: orbit-e 8s ease-in-out infinite, morph-b 7s ease-in-out infinite reverse;
}

.blob-6 {
  width: 26vw; height: 26vw;
  max-width: 340px; max-height: 340px;
  min-width: 200px; min-height: 200px;
  top: 42%; left: 20%;
  animation: orbit-f 15s linear infinite, morph-c 8s ease-in-out infinite;
}

/* Orbit paths — each blob drifts on its own route so none stay in sync */
@keyframes orbit-a {
  0%, 100% { transform: translate(0, 0); }
  25%      { transform: translate(10vw, 6vw); }
  50%      { transform: translate(4vw, 14vw); }
  75%      { transform: translate(-8vw, 5vw); }
}

@keyframes orbit-b {
  0%, 100% { transform: translate(0, 0); }
  30%      { transform: translate(-9vw, -7vw); }
  60%      { transform: translate(-3vw, 8vw); }
  85%      { transform: translate(6vw, -4vw); }
}

@keyframes orbit-c {
  0%, 100% { transform: translate(0, 0); }
  20%      { transform: translate(8vw, -6vw); }
  40%      { transform: translate(0, -10vw); }
  60%      { transform: translate(-8vw, -4vw); }
  80%      { transform: translate(-4vw, 6vw); }
}

@keyframes orbit-d {
  0%, 100% { transform: translate(0, 0); }
  33%      { transform: translate(7vw, -9vw); }
  66%      { transform: translate(-6vw, -3vw); }
}

@keyframes orbit-e {
  0%, 100% { transform: translate(0, 0); }
  40%      { transform: translate(-8vw, 9vw); }
  75%      { transform: translate(5vw, 4vw); }
}

@keyframes orbit-f {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(9vw, -7vw); }
}

/* Organic silhouette wobble — makes each blob's shape breathe, not just its position */
@keyframes morph-a {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%      { border-radius: 30% 70% 60% 40% / 40% 60% 30% 70%; }
}

@keyframes morph-b {
  0%, 100% { border-radius: 40% 60% 70% 30% / 50% 60% 40% 50%; }
  50%      { border-radius: 65% 35% 40% 60% / 30% 65% 35% 70%; }
}

@keyframes morph-c {
  0%, 100% { border-radius: 55% 45% 50% 50% / 40% 40% 60% 60%; }
  50%      { border-radius: 45% 55% 60% 40% / 60% 50% 50% 40%; }
}

@media (prefers-reduced-motion: reduce) {
  .blob {
    animation: none;
    border-radius: 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-glow::before,
  .bg-glow::after {
    animation: none;
  }
}

/* ─── Nav ────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(24px, 5vw, 64px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 11, 0.6);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.3s var(--ease-out-quart), border-color 0.3s var(--ease-out-quart), padding 0.3s var(--ease-out-quart);
  /* position:sticky + backdrop-filter can stop repainting on scroll-direction
     changes in some browsers (the header visually "freezes"). Promoting it
     to its own compositor layer keeps it repainting correctly. */
  transform: translateZ(0);
  will-change: background;
}

.nav.is-scrolled {
  background: rgba(8, 9, 11, 0.86);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.logo {
  display: inline-flex;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.logo-signal {
  color: var(--signal-blue);
}

.logo-accent {
  color: var(--signal-pink);
}

.logo-ink {
  color: var(--ink);
  font-weight: 400;
  margin-left: 4px;
}

.nav nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-fog);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-left: 36px;
  transition: color 0.2s var(--ease-out-quart);
}

.nav-contact-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
  opacity: 0.85;
}

.nav nav a:hover,
.nav nav a:focus-visible {
  color: var(--ink);
}

.nav-links a.nav-phone:hover,
.nav-links a.nav-phone:focus-visible {
  color: var(--signal-blue);
}

.nav-links a.nav-email:hover,
.nav-links a.nav-email:focus-visible {
  color: var(--signal-pink);
}

.nav-links {
  display: flex;
  align-items: center;
  position: relative;
}

.nav-info-cta {
  display: none;
}

.nav-info-cta svg {
  display: block;
  width: 22px;
  height: 22px;
  opacity: 0.8;
  fill: currentColor;
}

.nav-links a.is-active {
  color: var(--ink);
}

.nav-indicator {
  position: absolute;
  bottom: -9px;
  height: 2px;
  border-radius: 999px;
  background: var(--signal-blue);
  opacity: 0;
  transition: transform 0.35s var(--ease-out-quart), width 0.35s var(--ease-out-quart), opacity 0.2s var(--ease-out-quart);
  pointer-events: none;
}

.nav-indicator.is-visible {
  opacity: 1;
}

/* Persistent nav CTA */
.nav .nav-cta {
  position: relative;
  z-index: 0;
  margin-left: 32px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
  transition: color 0.2s var(--ease-out-quart), translate 0.2s var(--ease-out-quart);
}

.nav .nav-cta:hover,
.nav .nav-cta:focus-visible {
  color: #fff;
  translate: 0 -1px;
}

/* Fallback press feedback if the Motion script fails to load/is blocked */
html:not(.motion-ready) .nav .nav-cta:active {
  scale: 0.96;
}

.nav nav a:focus-visible,
.logo:focus-visible {
  outline: 2px solid var(--signal-blue);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ─── Hero ───────────────────────────────────────── */

.hero {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  /* Equal top/bottom padding keeps nav-to-content and content-to-next-section
     gaps the same, matching the stats-to-"What we do" gap below. */
  padding: clamp(40px, 6vw, 88px) 24px;
  text-align: center;
}

.hero-logo {
  margin-bottom: 40px;
}

.hero-logo svg {
  width: clamp(200px, 34vw, 440px);
  height: auto;
}

.hero-heading {
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: 24px;
  /* Reserves the full two-line height up front so the type/scramble intro
     never shifts the content below it when the text wraps onto line two. */
  min-height: 2.2em;
}

.signal-blue {
  color: var(--signal-blue);
}

.signal-pink {
  color: var(--signal-pink);
}

.hero-heading [data-scramble],
.hero-heading [data-type] {
  transition: opacity 0.4s var(--ease-out-quart);
}

.type-caret {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  margin-left: 2px;
  background: currentColor;
  vertical-align: -0.1em;
  animation: type-caret-blink 0.9s steps(1) infinite;
}

@keyframes type-caret-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .type-caret {
    display: none;
  }
}

.hero-subtitle {
  color: var(--muted-fog);
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 400;
  line-height: 1.7;
  max-width: 54ch;
  margin: 0 auto 40px;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

@media (min-width: 641px) {
  .home-hero .hero-logo {
    margin-bottom: 36px;
  }

  .home-hero .hero-heading {
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    min-height: 0;
    margin-bottom: 36px;
  }
}

/* ─── Entrance reveal ────────────────────────────── */

.reveal {
  animation: reveal-up 700ms var(--ease-out-strong) both;
  animation-delay: var(--reveal-delay, 0ms);
}

.reveal-mark {
  animation: reveal-mark 800ms var(--ease-out-strong) both;
  animation-delay: var(--reveal-delay, 0ms);
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-mark {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─── Scroll reveal ──────────────────────────────── */

.scroll-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms var(--ease-out-strong), transform 700ms var(--ease-out-strong);
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fade-in-place variant — for quote/testimonial content that shouldn't "slide" like a list item */
.scroll-reveal-fade {
  opacity: 0;
  transition: opacity 900ms var(--ease-out-strong);
}

.scroll-reveal-fade.is-visible {
  opacity: 1;
}

/* ─── Buttons ────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  /* translate/scale are independent transform properties — they compose
     without conflicting with the JS-driven press animation (Motion), which
     animates `scale` only. */
  transition:
    background-color 0.25s var(--ease-out-quart),
    color 0.25s var(--ease-out-quart),
    translate 0.16s var(--ease-out-quart),
    border-color 0.25s var(--ease-out-quart);
}

.btn-primary {
  background: var(--signal-blue);
  color: var(--signal-bg);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--signal-pink);
  color: #fff;
  translate: 0 -2px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--ink);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.28);
  translate: 0 -2px;
}

/* Outline variant — gradient ring only, fully transparent interior.
   Shared by .btn-outline and .nav-cta (both solid-color buttons converted to this style). */
.btn-outline {
  position: relative;
  z-index: 0;
  background: transparent;
  border: 2px solid transparent;
  color: var(--ink);
  padding: 12px 26px;
  transition:
    color 0.25s var(--ease-out-quart),
    translate 0.16s var(--ease-out-quart);
}

.btn-outline::before,
.nav .nav-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--signal-blue), var(--signal-pink));
  background-size: 250% 250%;
  animation: liquid-move 4s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s var(--ease-out-quart);
}

/* Solid hover fill — separate full-box layer, aligned exactly with the ring above so no seam shows at the edges */
.btn-outline::after,
.nav .nav-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--signal-blue), var(--signal-pink));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out-quart);
}

@media (prefers-reduced-motion: reduce) {
  .btn-outline::before,
  .nav .nav-cta::before {
    animation: none;
  }
}

.btn-outline:hover,
.btn-outline:focus-visible {
  color: #fff;
  translate: 0 -2px;
}

.btn-outline:hover::before,
.btn-outline:focus-visible::before,
.nav .nav-cta:hover::before,
.nav .nav-cta:focus-visible::before {
  opacity: 0;
}

.btn-outline:hover::after,
.btn-outline:focus-visible::after,
.nav .nav-cta:hover::after,
.nav .nav-cta:focus-visible::after {
  opacity: 1;
}

/* Fallback press feedback if the Motion script fails to load/is blocked */
html:not(.motion-ready) .btn:active {
  scale: 0.97;
}

.btn:focus-visible {
  outline: 2px solid var(--signal-blue);
  outline-offset: 3px;
}

.btn-icon {
  display: none;
}

/* ─── Stats strip ────────────────────────────────── */

.stats {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 860px;
  margin: 0 auto clamp(56px, 8vw, 96px);
  padding: 0 24px;
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 16px;
  gap: 8px;
}

/* Rated-studio stat links out to our Google reviews */
a.stat-item-link {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out-strong, ease);
}
a.stat-item-link:hover,
a.stat-item-link:focus-visible {
  transform: translateY(-2px);
}
a.stat-item-link:hover .stat-label,
a.stat-item-link:focus-visible .stat-label {
  color: var(--ink);
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1;
}

.stat-num {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.stat-suffix {
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  font-weight: 600;
  color: var(--muted-fog);
}

.stat-item:nth-child(1) .stat-num { color: var(--signal-blue); }
.stat-item:nth-child(3) .stat-num { color: var(--signal-pink); }
.stat-item:nth-child(5) .stat-num { color: var(--signal-blue); }
.stat-item:nth-child(7) .stat-num { color: var(--signal-pink); }

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-fog);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.stat-label-bristol {
  display: inline-flex;
  justify-content: center;
  gap: 0.35em;
  text-align: center;
}

.stat-divider {
  width: 1px;
  height: 52px;
  background: var(--border-faint);
  flex-shrink: 0;
}

/* ─── Capability cards ───────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px var(--space-lg);
  scroll-margin-top: 100px;
}

.card {
  position: relative;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 36px 32px 32px;
  overflow: hidden;
  transition:
    transform 0.25s var(--ease-out-quart),
    border-color 0.25s var(--ease-out-quart),
    background 0.25s var(--ease-out-quart);
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

.card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-signal {
  border-color: color-mix(in oklch, var(--signal-pink) 30%, var(--border-faint));
}

.card-signal::after {
  background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--signal-pink) 40%, transparent), transparent);
}

.card-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted-fog);
  opacity: 0.5;
  margin-bottom: 20px;
}

.card h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.card p {
  color: var(--muted-fog);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
}

/* ─── Services ───────────────────────────────────── */

.services {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px var(--space-lg);
  scroll-margin-top: 100px;
}

.section-heading {
  /* Matches .cta-inner h2 ("Ready to build something extraordinary?") so
     every section heading reads at one consistent size. */
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-align: center;
  margin-bottom: var(--space-lg);
}

/* Heading + supporting intro group */
.section-head {
  max-width: 620px;
  margin: 0 auto var(--space-lg);
  text-align: center;
}

.section-head .section-heading {
  margin-bottom: 14px;
}

.section-intro {
  color: var(--muted-fog);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  max-width: 52ch;
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 900px;
  margin: 0 auto;
  row-gap: 24px;
  column-gap: 24px;
}

/* "Got Questions?" is a mobile-only CTA tile — desktop already surfaces
   contact via the header/footer, so it's hidden there to keep the grid
   purely service-focused. */
.service-item.service-item-faq {
  display: none;
}

/* ─── Service item — glass box with cutout icon ──── */

.service-item {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-align: center;
  text-decoration: none;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  padding: 32px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid var(--border-faint);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 1s var(--ease-out-quart), border-color 1s var(--ease-out-quart);
}

/* Gradient ring — same drifting liquid gradient + masked-ring technique as .btn-outline, revealed on hover */
.service-item::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 22px;
  padding: 2px;
  background: linear-gradient(135deg, var(--signal-blue), var(--signal-pink));
  background-size: 250% 250%;
  animation: liquid-move 4s ease infinite;
  animation-play-state: paused;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s var(--ease-out-quart);
}

@media (prefers-reduced-motion: reduce) {
  .service-item::before {
    animation: none;
  }
}

.service-item:hover,
.service-item:active {
  background: rgba(255, 255, 255, 0.03);
  border-color: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.service-item:hover::before,
.service-item:active::before {
  opacity: 1;
  animation-play-state: running;
}

/* Icon */
.service-icon {
  width: 38px;
  height: 38px;
  color: var(--muted-fog);
  fill: currentColor;
  stroke: none;
  mix-blend-mode: normal;
  transition: color 1s var(--ease-out-quart);
}

.service-icon.icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-item:hover .service-icon,
.service-item:active .service-icon {
  color: #fff;
  fill: #fff;
}

.service-item:hover .service-icon.icon-stroke,
.service-item:active .service-icon.icon-stroke {
  fill: #fff;
  stroke: #fff;
}

/* Label */
.service-item span {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-fog);
  letter-spacing: 0.01em;
  transition: color 1s var(--ease-out-quart);
}

.service-item:hover span,
.service-item:active span {
  color: #fff;
}

@keyframes liquid-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Staggered grid reveal */
.services-grid:not(.is-visible) .service-item {
  opacity: 0;
  translate: 0 16px;
}

.services-grid.is-visible .service-item {
  transition:
    transform 0.25s var(--ease-out-quart),
    opacity 600ms var(--ease-out-strong),
    translate 600ms var(--ease-out-strong),
    background 1s var(--ease-out-quart),
    border-color 1s var(--ease-out-quart);
}

.services-grid.is-visible .service-item:nth-child(1) { transition-delay: 0ms; }
.services-grid.is-visible .service-item:nth-child(2) { transition-delay: 40ms; }
.services-grid.is-visible .service-item:nth-child(3) { transition-delay: 80ms; }
.services-grid.is-visible .service-item:nth-child(4) { transition-delay: 120ms; }
.services-grid.is-visible .service-item:nth-child(5) { transition-delay: 160ms; }
.services-grid.is-visible .service-item:nth-child(6) { transition-delay: 200ms; }
.services-grid.is-visible .service-item:nth-child(7) { transition-delay: 240ms; }
.services-grid.is-visible .service-item:nth-child(8) { transition-delay: 280ms; }
.services-grid.is-visible .service-item:nth-child(9) { transition-delay: 320ms; }

/* ─── Process ────────────────────────────────────── */

.process {
  /* Matches .gallery's width (900px) rather than the wider default --max-w,
     so "How we work" reads at the same width as "Featured projects". */
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px var(--space-lg);
  scroll-margin-top: 100px;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.process-step {
  padding: 36px 28px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-faint);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease-out-quart), border-color 0.25s var(--ease-out-quart);
}

.process-step::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.process-step:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.12);
}

.step-index {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--signal-blue);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.process-step:nth-child(3) .step-index {
  color: var(--signal-pink);
}

.process-step h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.process-step p {
  color: var(--muted-fog);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.75;
}

/* ─── About ──────────────────────────────────────── */

.about {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px var(--space-lg);
  text-align: center;
  scroll-margin-top: 100px;
}

.about h2 {
  /* Matches .cta-inner h2 ("Ready to build something extraordinary?") so
     every section heading reads at one consistent size. */
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
  line-height: 1.2;
}

.about p {
  color: var(--muted-fog);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
  max-width: 58ch;
  margin: 0 auto;
}

.about-p2 {
  margin-top: 20px !important;
}

/* ─── Testimonial ────────────────────────────────── */

.testimonial {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px var(--space-lg);
}

.quote-slider {
  position: relative;
}

.quote-track {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.quote-block {
  padding: 76px 44px 52px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-faint);
  text-align: center;
}

/* Slider mode: stack all quotes in the same grid cell.
   Default = waiting fully off-screen right. Active = centered. Leaving = exits fully past the left edge. */
.quote-track .quote-block {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
  transition: transform 1.1s cubic-bezier(0.65, 0, 0.35, 1), opacity 1.1s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s linear 1.1s;
  pointer-events: none;
}

.quote-track .quote-block.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: transform 1.1s cubic-bezier(0.65, 0, 0.35, 1), opacity 1.1s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: auto;
}

.quote-track .quote-block.is-leaving {
  opacity: 0;
  visibility: visible;
  transform: translateX(-100%);
  transition: transform 1.1s cubic-bezier(0.65, 0, 0.35, 1), opacity 1.1s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
}

.quote-track .quote-block.no-transition {
  transition: none !important;
}

.quote-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
}

.quote-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out-quart), background 0.2s var(--ease-out-quart), transform 0.2s var(--ease-out-quart);
}

.quote-arrow:hover {
  border-color: var(--signal-blue);
  background: rgba(46, 168, 224, 0.08);
  transform: translateY(-1px);
}

.quote-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quote-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border-mid);
  cursor: pointer;
  transition: background 0.25s var(--ease-out-quart), transform 0.25s var(--ease-out-quart);
}

.quote-dot:hover {
  background: var(--muted-fog);
}

.quote-dot.is-active {
  background: linear-gradient(135deg, var(--signal-blue), var(--signal-pink));
  transform: scale(1.3);
}

.quote-block::before {
  content: '\201C';
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 96px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  color: var(--signal-blue);
  opacity: 1;
  pointer-events: none;
  user-select: none;
}

.quote-text {
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 36px;
}

.quote-attr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 36px;
}

.quote-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--signal-blue), var(--signal-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-style: normal;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.quote-details {
  text-align: left;
}

@media (min-width: 641px) {
  .quote-details {
    text-align: center;
  }
}

.quote-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  font-style: normal;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.quote-role {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-fog);
}

/* ─── CTA strip ──────────────────────────────────── */

.cta-strip {
  /* Matches .gallery/.process's width (900px) rather than the wider
     --max-w, so the final CTA box reads at the same width as the site's
     other boxed sections instead of standing out as noticeably wider. */
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px var(--space-lg);
}

.cta-inner {
  padding: clamp(52px, 8vw, 88px) clamp(32px, 6vw, 72px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 15% 50%, rgba(46, 168, 224, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 50%, rgba(224, 24, 140, 0.1) 0%, transparent 55%),
    rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-faint);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(46, 168, 224, 0.4), rgba(224, 24, 140, 0.4), transparent);
}

.cta-inner h2 {
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.cta-inner p {
  font-size: 16px;
  font-weight: 400;
  color: var(--muted-fog);
  margin-bottom: 36px;
}

/* ─── Contact ────────────────────────────────────── */

.contact {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px var(--space-lg);
  text-align: center;
  scroll-margin-top: 100px;
  border-top: 1px solid var(--border-faint);
  padding-top: var(--space-lg);
}

.contact h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.contact p {
  color: var(--muted-fog);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* ─── Footer ─────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border-faint);
  margin-top: 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px 24px 48px;
}

.footer-brand {}

.footer-logo {
  display: inline-flex;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-bottom: 16px;
}

.footer-tagline {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted-fog);
  line-height: 1.65;
  max-width: 34ch;
}

.footer-col-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-fog);
  margin-bottom: 20px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
}

.footer-nav a {
  color: var(--muted-fog);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 12px;
  transition: color 0.2s var(--ease-out-quart);
}

.footer-nav a:hover {
  color: var(--ink);
}

.footer-nav a:nth-of-type(odd):hover {
  color: var(--signal-blue);
}

.footer-nav a:nth-of-type(even):hover {
  color: var(--signal-pink);
}

.footer-contact-col {
  display: flex;
  flex-direction: column;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-fog);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 10px;
  transition: color 0.2s var(--ease-out-quart);
}

.footer-email:hover {
  color: var(--signal-pink);
}

.footer-email.footer-phone:hover {
  color: var(--signal-blue);
}

.footer-email.footer-whatsapp:hover {
  color: #25d366;
}

.footer-location {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted-fog);
}

.footer-contact-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
  opacity: 0.85;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-fog);
}

/* ─── Footer signature (hover text effect) ──────────────────────────────────── */

.footer-signature {
  position: relative;
  height: clamp(140px, 20vw, 260px);
  margin-top: -12px;
  overflow: hidden;
}

.signature-svg {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
}

.sig-text-base,
.sig-text-draw,
.sig-text-gradient {
  font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  font-size: 92px;
  letter-spacing: 2px;
  fill: transparent;
}

.sig-text-base {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 0.6;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out-quart);
}

.footer-signature:hover .sig-text-base {
  opacity: 1;
}

.sig-text-draw {
  stroke: var(--signal-blue);
  stroke-opacity: 0.55;
  stroke-width: 0.6;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
}

.sig-text-draw.is-drawn {
  animation: sig-draw 3.2s var(--ease-out-quart) forwards;
}

@keyframes sig-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.sig-text-gradient {
  stroke-width: 0.6;
}

@media (max-width: 640px) {
  .footer-signature {
    display: none;
  }
}

/* ─── Project gallery ────────────────────────────── */
/* Terminal-window showcase: reuses .terminal / .terminal-glow / .terminal-window /
   .terminal-bar / .terminal-dot / .terminal-title from the enquiry section so the
   two feel like one system — only the two-column body below is gallery-specific. */

.gallery {
  /* Matches .services-grid's rendered width (900px), not just the wider
     .services wrapper — that's the actual visual width other sections read at. */
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px var(--space-xl);
  scroll-margin-top: 100px;
}

.gallery-head {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.gallery-head .section-heading {
  margin-bottom: 12px;
}

.gallery-head p {
  color: var(--muted-fog);
  font-size: 15px;
  line-height: 1.6;
  max-width: 46ch;
  margin: 0 auto;
}

.gallery-terminal {
  position: relative;
}

/* Index column is a fixed width (not fr-based) so its content — thumbnail,
   project name, category — can never expand past its share and steal width
   from the hero, which was what threw off the hero's square ratio and
   caused visible letterbox bands. */
.gallery-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  align-items: start;
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Hero — active project preview, a plain 1:1 image with no text overlay.
   Its height is matched onto .gallery-index by the syncHeight() script
   (inline script in index.html) — CSS grid can't derive that on its own,
   since the index list's content would otherwise inflate the shared row. */
.gallery-hero {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  background: rgba(10, 11, 14, 0.6);
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition:
    border-color 0.3s var(--ease-out-quart),
    box-shadow 0.3s var(--ease-out-quart);
}

.gallery-hero:hover,
.gallery-hero:focus-visible {
  border-color: rgba(46, 168, 224, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(46, 168, 224, 0.2),
    0 0 46px rgba(154, 95, 206, 0.16);
  outline: none;
}

.gallery-hero-media {
  position: absolute;
  inset: 0;
}

.gallery-hero-media img {
  width: 100%;
  height: 100%;
  /* contain, not cover — source art varies from square logos to tall social
     ad mockups; cropping was cutting off headlines and card edges. */
  object-fit: contain;
  display: block;
}

/* Faint dark wash — softens the raw source art (often bright/high-contrast
   ad mockups) so it sits quietly against the dark panel instead of glaring. */
.gallery-hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 11, 0.16);
  pointer-events: none;
}

/* Index — scrollable project navigator */
.gallery-index {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(10, 11, 14, 0.6);
}

.gallery-index-head {
  padding: clamp(18px, 2.4vw, 24px) clamp(18px, 2.4vw, 24px) 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-index-head h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 4px;
}

.gallery-index-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-fog);
  letter-spacing: 0.02em;
}

.gallery-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 168, 224, 0.35) transparent;
}

.gallery-list::-webkit-scrollbar {
  width: 6px;
}

.gallery-list::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-list::-webkit-scrollbar-thumb {
  background: rgba(46, 168, 224, 0.3);
  border-radius: 999px;
}

.gallery-list::-webkit-scrollbar-thumb:hover {
  background: rgba(46, 168, 224, 0.5);
}

.gallery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  outline-offset: 2px;
  outline-color: var(--signal-blue);
  transition:
    border-color 0.25s var(--ease-out-quart),
    background 0.25s var(--ease-out-quart),
    translate 0.25s var(--ease-out-quart);
}

.gallery-item:hover,
.gallery-item:focus-visible {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  translate: 2px 0;
}

.gallery-item.is-active {
  border-color: rgba(46, 168, 224, 0.5);
  background: rgba(46, 168, 224, 0.08);
  box-shadow:
    0 0 0 1px rgba(46, 168, 224, 0.15),
    0 0 24px rgba(46, 168, 224, 0.12);
}

.gallery-item-thumb {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: calc(var(--radius-sm) - 4px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.gallery-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.gallery-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-item-category {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-fog);
}

.gallery-item.is-active .gallery-item-category {
  color: var(--signal-blue);
}

@media (max-width: 900px) {
  /* Stacked layout: hero and index become separate rows (syncHeight() in
     index.html leaves .gallery-index unset here, so this cap governs). */
  .gallery-body {
    grid-template-columns: 1fr;
  }

  .gallery-index {
    max-height: 380px;
  }
}

@media (max-width: 560px) {
  .gallery-item-thumb {
    width: 44px;
    height: 44px;
  }

  /* Bring the title back into the dot bar (small, so it clears the dots)
     instead of the generic hide below — the "Project index" heading is
     dropped too (redundant with the title), leaving just a slim
     "Scroll to explore" strip between the hero and the list. */
  .gallery-window .terminal-title {
    display: block;
    font-size: 10px;
  }

  .gallery-index-head {
    display: block;
    padding: 8px 16px;
    text-align: center;
  }

  .gallery-index-head h3 {
    display: none;
  }

  .gallery-index-label {
    font-size: 10.5px;
  }

  /* Exactly 4 items visible (40px "Scroll to explore" strip + list); the
     rest sit below and need a scroll. */
  .gallery-index {
    max-height: 316px;
  }
}

/* ─── Redesign: rhythm, proof band, CTA actions ──── */

/* Vertical rhythm — give the work-first flow room to breathe */
.gallery {
  /* Matches .section-heading's margin-bottom (var(--space-lg)) so "How we
     work" sits centered between the terminal above and its grid below. */
  padding-bottom: var(--space-lg);
}

.services {
  padding-top: 0;
  /* Match .gallery-head's margin-bottom so "Featured projects" sits centered
     between the services cards above and the terminal window below. */
  padding-bottom: var(--space-lg);
}

/* Proof band — stats + testimonial read as one trust moment */
.stats {
  margin-top: 0;
  margin-bottom: var(--space-lg);
}

.testimonial {
  padding-top: 0;
  padding-bottom: var(--space-lg);
}

/* Final CTA — closing breathing room */
.cta-strip {
  padding-top: 8px;
  padding-bottom: var(--space-xl);
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* ─── Responsive ─────────────────────────────────── */

@media (max-width: 900px) {
  .process-grid {
    grid-template-columns: 1fr;
    max-width: 540px;
    margin: 0 auto;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nav {
    position: static;
    padding: 16px 20px;
  }

  /* On mobile keep the header clean: logo plus a single contact info shortcut. */
  .nav-links {
    display: none;
  }

  .nav .nav-cta {
    display: none;
  }

  .nav-info-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #3f3f3f;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s var(--ease-out-quart);
  }

  .nav-info-cta:hover,
  .nav-info-cta:focus-visible {
    color: var(--signal-pink);
  }

  .hero-heading {
    line-height: 1.3;
    min-height: 2.6em;
  }

  .stats {
    flex-wrap: wrap;
    border-radius: var(--radius-md);
    margin-top: 0;
    margin-left: 24px;
    margin-right: 24px;
    /* Was a hardcoded clamp() that didn't match .section-head's margin-bottom
       — kept in sync via var(--space-lg) so "What we do" stays centered. */
    margin-bottom: var(--space-lg);
  }

  .stat-item {
    flex: 1 1 40%;
    padding: 28px 12px;
  }

  .stat-label-bristol {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1.35;
  }

  .stat-divider {
    display: none;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  /* Smaller min sizes so blobs don't dominate narrow viewports */
  .blob {
    min-width: 220px;
    min-height: 220px;
  }

  .blob-field {
    filter: blur(40px) saturate(150%);
  }

  /* Faster background drift on mobile */
  .blob-1 { animation: orbit-a 5.5s ease-in-out infinite, morph-a 3s ease-in-out infinite; }
  .blob-2 { animation: orbit-b 7s ease-in-out infinite, morph-b 3.5s ease-in-out infinite; }
  .blob-3 { animation: orbit-c 8s linear infinite, morph-c 4s ease-in-out infinite; }
  .blob-4 { animation: orbit-d 6s ease-in-out infinite, morph-a 3.5s ease-in-out infinite reverse; }
  .blob-5 { animation: orbit-e 5s ease-in-out infinite, morph-b 4s ease-in-out infinite reverse; }
  .blob-6 { animation: orbit-f 9s linear infinite, morph-c 4.5s ease-in-out infinite; }

  /* Tighter section spacing on mobile (a bit more breathing room than
     before, so heading + description reads centered in a visible gap) */
  :root {
    --space-lg: 56px;
    --space-xl: 72px;
  }

  /* Matches .cta-inner h2 ("Ready to build something extraordinary?") —
     every section heading reads at one consistent size on mobile, except
     the hero, which keeps its own larger treatment below. */
  .section-heading,
  .about h2 {
    font-size: clamp(1.75rem, 4vw, 2.8rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
  }

  .hero-logo {
    margin-bottom: 24px;
  }

  .hero-logo svg {
    width: clamp(220px, 52vw, 320px);
  }

  .hero-heading {
    font-size: clamp(1.8rem, 7.5vw, 2.15rem);
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 16px;
    column-gap: 16px;
  }

  .service-item.service-item-faq {
    display: flex;
  }

  .quote-block {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 24px;
  }

  .quote-block::before {
    position: static;
    transform: none;
    font-size: 80px;
    line-height: 0.6;
  }

  .quote-text {
    width: 100%;
    margin-bottom: 0;
  }

  .quote-attr {
    width: 100%;
    margin-top: 20px;
    padding-top: 28px;
    border-top: 1px solid var(--border-faint);
  }

  .cta-inner {
    padding: 48px 24px;
  }
}

/* ─── Touch / pointer coarse ─────────────────────── */

@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .nav .nav-cta:hover {
    translate: 0;
  }

  .card:hover,
  .nav nav a:hover,
  .process-step:hover {
    transform: none;
  }
}

/* ─── Reduced motion ─────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .btn,
  .card,
  .skip-link,
  .btn-icon,
  .service-item,
  .process-step,
  .gallery-hero,
  .gallery-hero-media img,
  .gallery-item,
  .accordion-item,
  .accordion-panel,
  .accordion-icon svg {
    transition-duration: 0.01ms !important;
  }

  .btn:hover,
  .nav .nav-cta:hover {
    translate: 0;
  }

  html:not(.motion-ready) .btn:active,
  html:not(.motion-ready) .nav .nav-cta:active {
    scale: 1;
  }

  .card:hover {
    transform: none;
  }

  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .services-grid:not(.is-visible) .service-item,
  .services-grid.is-visible .service-item {
    opacity: 1;
    translate: 0;
    transition: none;
    transition-delay: 0ms;
  }
}

/* ─── Mobile expandable tabs ─────────────────────── */

.mtabs {
  display: none;
}

@media (max-width: 640px) {
  .mtabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: fixed;
    left: 50%;
    bottom: 16px;
    padding: 6px;
    background: rgba(20, 22, 26, 0.55);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid var(--border-mid);
    border-radius: 999px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 60;
    opacity: 0;
    transform: translate(-50%, calc(100% + 24px));
    transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.5s ease-out;
    will-change: transform;
  }

  .mtabs.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  .mtab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px;
    color: var(--muted-fog);
    text-decoration: none;
    border-radius: 999px;
    max-width: 44px;
    overflow: hidden;
    transition: max-width 0.45s cubic-bezier(0.65, 0, 0.35, 1),
                gap 0.45s cubic-bezier(0.65, 0, 0.35, 1),
                padding 0.45s cubic-bezier(0.65, 0, 0.35, 1),
                background 0.25s var(--ease-out-quart),
                color 0.25s var(--ease-out-quart);
    white-space: nowrap;
  }

  .mtab.is-active {
    max-width: 200px;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(46, 168, 224, 0.14);
    color: var(--signal-blue);
  }

  /* Same per-channel colours as the footer's contact links (.footer-email,
     .footer-phone, .footer-whatsapp) so this menu matches on hover. */
  .mtab-phone:hover {
    color: var(--signal-blue);
  }

  .mtab-whatsapp:hover {
    color: #25d366;
  }

  .mtab-email:hover {
    color: var(--signal-pink);
  }

  .mtab-info:hover {
    color: var(--ink);
  }

  .mtab-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
  }

  .mtab-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.45s cubic-bezier(0.65, 0, 0.35, 1),
                opacity 0.35s var(--ease-out-quart);
  }

  .mtab.is-active .mtab-label {
    max-width: 140px;
    opacity: 1;
  }

  .mtab-sep {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: var(--border-mid);
    margin: 0 2px;
    flex-shrink: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mtab,
  .mtab-label {
    transition: none;
  }
}

/* ─── Contact page ───────────────────────────────── */

.contact-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(72px, 13vw, 150px) 24px 40px;
  text-align: center;
}

.contact-hero .hero-heading {
  margin-bottom: 18px;
  /* Explicit (not just inherited from .contact-hero) so the type/scramble
     intro's own inline text-align never has a chance to leave this off-centre. */
  text-align: center;
}

@media (min-width: 641px) {
  .contact-hero {
    max-width: 1080px;
  }

  .contact-hero .hero-heading {
    font-size: clamp(2.4rem, 4vw, 3.25rem);
    min-height: 0;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .contact-hero.hero {
    /* Keep the heading optically centred between the mobile nav and the
       first contact card: 56px above, and 24px + the grid's 32px below. */
    padding: 56px 24px 24px;
    /* .contact-hero shares the plain .hero class, which the shared #main
       flex-reorder rule above (line ~2965, for index.html's sections) sets to
       order:10 — with #main also flex here, that put the contact form
       (.contact-grid, default order 0) ahead of this heading. Force it back
       to the front on the contact page specifically. */
    order: -10;
  }

  .contact-hero .hero-heading {
    margin-bottom: 0;
  }

  .contact-hero .hero-subtitle {
    display: none;
  }
}

.contact-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px var(--space-xl);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: start;
  /* #main is display:flex on mobile (see the #main flex-reorder rule below).
     As a flex item, a grid container's default intrinsic width can still be
     pulled wide by a descendant's content (the "send message" terminal-intro
     text, which animates its own width in on load/typing) instead of
     stretching to fill the flex line — visible as the whole form area
     growing horizontally mid-animation. width:100% + min-width:0 force it to
     always fill the available width regardless of that descendant's size. */
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* .contact-side is a real grid item of .contact-grid, so reordering it
     here to show contact info before the form makes sense. .contact-hero
     is NOT part of this grid (it's a preceding sibling section) — an
     "order: 20" rule here had no effect on its layout within .contact-grid,
     but did leak into the unrelated #main flex-reorder context at ≤640px
     (see below), silently pushing the whole contact-hero section after the
     form. Removed; contact-hero's mobile order now lives with its own rule
     in the ≤640px block instead. */
  .contact-side {
    order: -1;
  }
}

/* The contact form is the same .terminal component used by the homepage's
   enquiry section (see the "TERMINAL ENQUIRY" styles further down) — it
   supplies its own window chrome, so this wrapper needs no visual styling
   of its own beyond sitting as the grid's first column. */
.contact-terminal {
  min-width: 0;
}

@media (max-width: 640px) {
  .contact-grid {
    padding-top: 32px;
    row-gap: 32px;
  }
}


.form-note {
  font-size: 12px;
  color: var(--muted-fog);
  margin-top: 12px;
}

.form-status {
  margin-top: 16px;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: none;
  background: rgba(46, 168, 224, 0.12);
  border: 1px solid rgba(46, 168, 224, 0.3);
  color: var(--ink);
}

.form-status.is-visible {
  display: block;
}

.recaptcha-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 78px;
  margin: 24px 0;
}

.recaptcha-wrap[hidden] {
  display: none;
}

.terminal-form .recaptcha-wrap {
  justify-content: flex-start;
  margin: 20px 0;
}

.term-recaptcha {
  margin: 20px auto 8px;
}

@media (max-width: 360px) {
  .recaptcha-wrap {
    min-height: 144px;
  }
}

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-info-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--ease-out-quart), background 0.2s var(--ease-out-quart), translate 0.2s var(--ease-out-quart);
}

.contact-icon-badge {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 11px;
  background: rgba(46, 168, 224, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-info-card:hover {
  border-color: var(--border-mid);
  background: rgba(255, 255, 255, 0.05);
  translate: 0 -2px;
}

.contact-info-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.contact-info-card p {
  font-size: 14px;
  color: var(--muted-fog);
}

.contact-hours-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.contact-hours-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}

.contact-hours-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.contact-hours-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-fog);
}

.contact-hours-list li span:last-child {
  color: var(--ink);
  font-weight: 500;
}

/* ─── Legal pages (Privacy Policy) ───────────────── */

.legal-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(72px, 13vw, 150px) 24px 28px;
  text-align: center;
}

.legal-category {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal-blue);
  margin-bottom: 14px;
}

.legal-hero .hero-heading {
  margin-bottom: 14px;
}

.legal-dates {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted-fog);
  font-size: 14px;
}

.legal-dates-sep {
  opacity: 0.5;
}

.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px var(--space-xl);
}

.legal-intro {
  color: var(--muted-fog);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: clamp(40px, 6vw, 56px);
}

.legal-intro-title {
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

.legal-intro p + p {
  margin-top: 14px;
}

.legal-intro a {
  color: var(--signal-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Accordion — plain button + CSS grid-rows trick for a smooth, JS-measurement-free
   open/close animation. Each item stays independent (no single-open constraint). */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.accordion-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.25s var(--ease-out-quart);
}

.accordion-item.is-open {
  border-color: var(--border-mid);
}

.accordion-heading {
  margin: 0;
}

.accordion-trigger {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 22px 24px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  transition: background 0.2s var(--ease-out-quart);
}

.accordion-trigger:hover {
  background: rgba(255, 255, 255, 0.03);
}

.accordion-trigger:focus-visible {
  outline: 2px solid var(--signal-blue);
  outline-offset: -2px;
}

.accordion-num {
  flex-shrink: 0;
  width: 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted-fog);
  opacity: 0.6;
}

.accordion-title {
  flex: 1;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.accordion-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--muted-fog);
}

.accordion-icon svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease-out-quart);
}

.accordion-item.is-open .accordion-icon svg {
  transform: rotate(180deg);
  color: var(--signal-blue);
}

.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease-out-quart);
}

.accordion-item.is-open .accordion-panel {
  grid-template-rows: 1fr;
}

.accordion-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.accordion-body {
  padding: 0 24px 24px 60px;
  color: var(--muted-fog);
  font-size: 14.5px;
  line-height: 1.75;
}

.accordion-body p + p,
.accordion-body ul + p,
.accordion-body p + ul {
  margin-top: 12px;
}

.accordion-body ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.accordion-body li + li {
  margin-top: 6px;
}

.accordion-body strong {
  color: var(--ink);
  font-weight: 600;
}

.accordion-body a {
  color: var(--signal-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 640px) {
  .accordion-trigger {
    padding: 18px 16px;
    gap: 12px;
  }

  .accordion-title {
    font-size: 15px;
  }

  .accordion-body {
    padding: 0 16px 20px;
  }
}

/* ─── Preloader ──────────────────────────────────── */

/* Scroll-lock while the preloader is up. The base html rule keeps `overflow-y: scroll`
   at ALL times (scrollbar gutter always reserved) so hiding the preloader never changes
   the content-area width — that prevents the centred chip jumping left as the scrollbar
   returns. We only pin the body (position: fixed) to actually lock scrolling; we must NOT
   set overflow:hidden on <html>, which would drop the scrollbar and reintroduce the shift. */
body.preloading {
  overflow: hidden;
  height: 100%;
  position: fixed;
  inset: 0;
  width: 100%;
}

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--signal-bg);
  transition: opacity 0.9s var(--ease-out-strong), visibility 0.9s var(--ease-out-strong);
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-svg {
  width: min(420px, 78vw);
  height: auto;
  overflow: visible;
}

@media (min-width: 900px) {
  .preloader-svg {
    width: min(840px, 78vw);
  }

  .preloader-label {
    font-size: 16px;
    letter-spacing: 0.32em;
  }
}

/* Mobile: the diagram is wide/landscape by design — rotate it 90° left so it fills a
   tall/portrait screen better. The chip text is counter-rotated so "UX" still reads normally. */
@media (max-width: 640px) {
  .preloader-svg {
    width: min(1008px, 166vh, 158vw);
    transform: rotate(-90deg);
    transform-origin: center;
  }

  #plChipGroup {
    transform-box: fill-box;
    transform-origin: center;
    transform: rotate(90deg);
  }

  .preloader-label {
    position: absolute;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%);
  }
}

.preloader-label {
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted-fog);
  opacity: 0;
  animation: pl-label-fade 0.7s var(--ease-out-quart) 1s forwards;
  animation-play-state: paused;
}

/* Both this and .pl-dot below stay paused until JS flips .is-playing on the
   preloader root. Their animation-delay/duration is wall-clock based, so if we
   let them free-run from the moment the stylesheet applies, any main-thread
   delay between parsing this markup and the first real paint (slow first
   load, cold cache, etc.) burns through the delay/duration invisibly — the
   preloader then appears frozen and, once JS finally catches up, jumps
   straight to a later (or finished) frame instead of playing from the start.
   Pausing means the clock only starts once we know a frame has actually been
   painted (see the double-rAF gate in the inline preloader script). */
.preloader.is-playing .preloader-label {
  animation-play-state: running;
}

@keyframes pl-label-fade {
  to { opacity: 1; }
}

/* Chip letters — grey base always visible; the coloured layer clip-reveals bottom-up as pins fire */
.pl-letter-u,
.pl-letter-x {
  fill: #5b6572;
}

.pl-fill-u {
  fill: #2ea8e0;
}

.pl-fill-x {
  fill: #e0188c;
}

/* Bottom-up reveal — JS raises this rect's top edge (y down, height up) on each pin hit */
#plFillRect {
  transition: y 0.5s var(--ease-out-quart), height 0.5s var(--ease-out-quart);
}

/* Site content fade-in, synced with the preloader fade-out
   (.mtabs excluded — it owns its own scroll-driven slide/fade transition,
   which this rule was silently overriding via higher specificity) */
body.preloading > *:not(.preloader) {
  opacity: 0;
}

body > *:not(.preloader):not(.mtabs) {
  transition: opacity 0.9s var(--ease-out-strong);
}

/* Traveling lights — CSS motion-path, same technique/geometry as the paths above */
.pl-dot {
  offset-anchor: 10px 0px;
  animation-name: pl-move;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  animation-timing-function: cubic-bezier(0.75, -0.01, 0, 0.99);
  animation-play-state: paused;
}

.preloader.is-playing .pl-dot {
  animation-play-state: running;
}

.pl-line-1 {
  offset-path: path("M 10 20 h 79.5 q 5 0 5 5 v 30");
  animation-duration: 2.6s;
  animation-delay: 1s;
}

.pl-line-2 {
  offset-path: path("M 180 10 h -69.7 q -5 0 -5 5 v 40");
  animation-duration: 2.6s;
  animation-delay: 1.15s;
}

.pl-line-3 {
  offset-path: path("M 130 20 v 21.8 q 0 5 -5 5 h -25");
  animation-duration: 2.6s;
  animation-delay: 1.3s;
}

.pl-line-4 {
  offset-path: path("M 170 80 v -21.8 q 0 -5 -5 -5 h -65");
  animation-duration: 2.6s;
  animation-delay: 1.45s;
}

.pl-line-5 {
  offset-path: path("M 135 65 h 15 q 5 0 5 5 v 10 q 0 5 -5 5 h -39.8 q -5 0 -5 -5 v -35");
  animation-duration: 2.6s;
  animation-delay: 1.6s;
}

.pl-line-6 {
  offset-path: path("M 94.8 95 v -46");
  animation-duration: 2.6s;
  animation-delay: 1.75s;
}

.pl-line-7 {
  offset-path: path("M 88 88 v -15 q 0 -5 -5 -5 h -10 q -5 0 -5 -5 v -5 q 0 -5 5 -5 h 28");
  animation-duration: 2.6s;
  animation-delay: 1.9s;
}

.pl-line-8 {
  offset-path: path("M 30 30 h 25 q 5 0 5 5 v 6.5 q 0 5 5 5 h 35");
  animation-duration: 2.6s;
  animation-delay: 2.05s;
}

@keyframes pl-move {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-dot,
  .preloader-label,
  .pl-paths animate {
    animation: none !important;
  }
}

/* ─── Terminal enquiry section ───────────────────────
   A deliberate glassmorphism moment (client sign-off), scoped entirely to
   .enquiry / .terminal so it can't leak into the flat-by-default system. */

.enquiry {
  max-width: 760px;
  margin: 0 auto;
  /* Top spacing is owned by whichever section precedes it (.process on
     mobile, .testimonial on desktop) so "Have a project in mind?" stays
     centered instead of stacking two paddings. */
  padding: 0 24px var(--space-lg);
  scroll-margin-top: 100px;
}

@media (min-width: 641px) {
  .testimonial {
    /* Match .enquiry-head's margin-bottom so "Have a project in mind?" sits
       centered between the testimonials above and the terminal below. */
    padding-bottom: var(--space-lg);
  }
}

.enquiry-head {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.enquiry-head h2 {
  /* Matches .cta-inner h2 ("Ready to build something extraordinary?") so
     every section heading reads at one consistent size. */
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 12px;
}

/* Placed after the base rule above (not the shared 640px block near
   .section-heading) so it actually wins the cascade at equal specificity —
   a media query earlier in source order loses to a later unconditional
   rule of the same specificity. */
@media (max-width: 640px) {
  .enquiry-head h2 {
    font-size: clamp(1.75rem, 4vw, 2.8rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
  }
}

.enquiry-head p {
  color: var(--muted-fog);
  font-size: 15px;
  line-height: 1.6;
  max-width: 46ch;
  margin: 0 auto;
}

/* Mobile: move the enquiry ("Have a project in mind?") section above the
   testimonials, so visitors hit the call-to-action before client quotes.
   #main becomes a flex column purely so `order` can reshuffle without
   touching the DOM (desktop keeps the original source order). None of these
   sections rely on margin-collapsing for their spacing (all use padding or
   bottom-only margins), so switching to flex doesn't affect their gaps. */
@media (max-width: 640px) {
  #main {
    display: flex;
    flex-direction: column;
  }

  .hero { order: 10; }
  .stats { order: 20; }
  .services { order: 30; }
  .gallery { order: 40; }
  .process { order: 50; }
  .enquiry { order: 55; }
  .testimonial { order: 60; }
  .about { order: 70; }
  .cta-strip { order: 80; }
}

/* Glow + window wrapper */
.terminal {
  position: relative;
}

.terminal-glow {
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: calc(var(--radius-lg) + 8px);
  background:
    radial-gradient(ellipse at 12% 0%, rgba(46, 168, 224, 0.22), transparent 55%),
    radial-gradient(ellipse at 88% 100%, rgba(224, 24, 140, 0.20), transparent 55%);
  filter: blur(38px);
  opacity: 0.65;
  pointer-events: none;
}

.terminal-window {
  position: relative;
  border-radius: var(--radius-lg);
  background: rgba(14, 16, 20, 0.72);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

/* Cyan→magenta hairline along the very top edge, echoing .cta-inner — kept
   subtle (low alpha) so it reads as a quiet accent on the window's existing
   border rather than a separate bright glow/shine sitting on top of it. */
.terminal-window::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(46, 168, 224, 0.16), rgba(224, 24, 140, 0.16), transparent);
  pointer-events: none;
}

/* Title bar with macOS traffic-light dots */
.terminal-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
  background: rgba(8, 29, 44, 0.55);
  backdrop-filter: blur(4px) saturate(160%);
  -webkit-backdrop-filter: blur(4px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.35);
}

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--muted-fog);
  white-space: nowrap;
}

.terminal-body {
  padding: clamp(20px, 4vw, 30px);
}

/* Intro prompt line */
.terminal-intro {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
  white-space: nowrap;
  overflow: hidden;
}

.terminal-prompt {
  color: var(--signal-blue);
  margin-right: 8px;
}

.terminal-typed {
  display: inline-block;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  width: 13ch;
  animation: term-type 1.1s steps(13, end) 0.3s both;
}

/* Contact page's typed line ("send message") is one character shorter than
   the homepage's ("start enquiry") — needs its own width/step count so the
   type-in animation lands exactly on the text instead of over/under-shooting.
   Starts paused — the inline script below only starts it once the hero
   heading's own type/scramble intro has finished, so the two don't type at
   the same time. */
.terminal-typed-contact {
  width: 12ch;
  animation: term-type-contact 1.1s steps(12, end) 0.3s both;
  animation-play-state: paused;
}

.terminal-typed-contact.is-playing {
  animation-play-state: running;
}

@keyframes term-type {
  from { width: 0; }
  to { width: 13ch; }
}

@keyframes term-type-contact {
  from { width: 0; }
  to { width: 12ch; }
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--signal-blue);
  animation: term-blink 1.05s steps(1, end) infinite;
}

.terminal-intro-cursor {
  display: none;
}

@media (max-width: 640px) {
  .contact-terminal .terminal-intro-cursor {
    display: inline-block;
  }
}

@media (min-width: 641px) {
  .terminal-intro-cursor {
    display: inline-block;
  }
}

@keyframes term-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* Form layout */
.terminal-form .term-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.terminal-form .term-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.terminal-form label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-fog);
  letter-spacing: 0.01em;
}

.term-caret {
  color: var(--signal-pink);
  font-weight: 700;
  margin-right: 4px;
}

.term-optional {
  color: rgba(154, 160, 171, 0.7);
  font-weight: 400;
}

.terminal-form input,
.terminal-form select,
.terminal-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-mono);
  /* 16px is the minimum iOS Safari won't auto-zoom the page in on focus for. */
  font-size: 16px;
  transition:
    border-color 0.2s var(--ease-out-quart),
    background 0.2s var(--ease-out-quart),
    box-shadow 0.2s var(--ease-out-quart);
}

.terminal-form select {
  cursor: pointer;
  color-scheme: dark;
}

.terminal-form select option {
  background: #12141a;
  color: var(--ink);
}

.terminal-form input::placeholder,
.terminal-form textarea::placeholder {
  color: rgba(154, 160, 171, 0.55);
}

/* Cyan focus glow */
.terminal-form input:focus,
.terminal-form select:focus,
.terminal-form textarea:focus {
  outline: none;
  border-color: var(--signal-blue);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 1px var(--signal-blue), 0 0 18px rgba(46, 168, 224, 0.25);
}

.terminal-form textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.6;
}

.terminal-form button[type="submit"] {
  margin-top: 6px;
}

/* Error state for the shared .form-status pill */
.form-status.is-error {
  background: rgba(224, 24, 140, 0.12);
  border-color: rgba(224, 24, 140, 0.4);
}

@media (max-width: 560px) {
  .terminal-form .term-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-typed {
    width: 13ch;
    animation: none;
  }

  .terminal-typed-contact {
    width: 12ch;
    animation: none;
  }

  .terminal-cursor {
    animation: none;
    opacity: 0.7;
  }
}

/* ─── Mobile step-by-step terminal flow ──────────────
   Desktop (>640px, the project's existing mobile breakpoint) keeps the static
   .terminal-form above with every field visible. Mobile (<=640px) hides that
   form and drives .term-flow instead — one question revealed at a time. */

.term-flow {
  display: none;
}

/* Next/Back (and Back/Enter on review) — inside .terminal-window, on their
   own centred row below the input rather than beside it. */
.term-controls {
  display: none;
}

@media (max-width: 640px) {
  .terminal-form {
    display: none;
  }

  .term-flow {
    display: block;
  }

  .term-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
  }

  /* The contact page reuses .terminal-form for its look but has no .term-flow
     step-wizard (that JS lives only in index.html, built for a different
     field set) — so keep its static form visible here instead of hiding it
     into a blank window. */
  .contact-terminal .terminal-form {
    display: block;
  }
}

.term-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

/* Starts hidden — revealActiveStep() in the flow script adds .term-enter only
   once the container has finished growing to fit it, so it never fades in
   while still clipped by the container's mid-resize overflow:hidden. */
.term-line {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted-fog);
  opacity: 0;
  transform: translateY(4px);
}

.term-line.term-enter {
  animation: term-line-in 0.3s var(--ease-out-strong) both;
}

/* Review-step summary lines aren't revealed individually — they're static
   content that appears together as part of the whole .term-active block's
   own term-step-in reveal, so they need to stay visible from the start. */
.term-line.term-line-static {
  opacity: 1;
  transform: none;
}

@keyframes term-line-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.term-line.term-success {
  color: var(--signal-blue);
}

/* Replayed on every step via classList.remove/add so each new question
   fades and slides in rather than popping. */
.term-active {
  opacity: 0;
  transform: translateY(8px);
}

.term-active.term-enter {
  animation: term-step-in 0.4s var(--ease-out-strong) both;
}

@keyframes term-step-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.term-question {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Holds just the input now — Next/Back live in #termControls, underneath
   .terminal-window, not beside the field. */
.term-active-field {
  margin-bottom: 8px;
}

.term-active-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-mono);
  /* 16px is the minimum iOS Safari won't auto-zoom the page in on focus for —
     this field is mobile-only, so it's the one that actually matters here. */
  font-size: 16px;
  transition:
    border-color 0.2s var(--ease-out-quart),
    background 0.2s var(--ease-out-quart),
    box-shadow 0.2s var(--ease-out-quart);
}

textarea.term-active-input {
  resize: vertical;
  min-height: 56px;
  line-height: 1.5;
}

.term-active-input::placeholder {
  color: rgba(154, 160, 171, 0.55);
}

.term-active-input:focus {
  outline: none;
  border-color: var(--signal-blue);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 1px var(--signal-blue), 0 0 18px rgba(46, 168, 224, 0.25);
}

/* Shared sizing for every step-flow action button (Next / Back / Enter),
   rendered together in #termControls underneath the terminal window.
   Kept separate from .term-next-btn so that class can uniquely identify the
   actual "Next" button — it used to double as this shared sizing rule, which
   meant .term-back-btn (appended before Next in the DOM) also matched any
   `.term-next-btn` selector and could be picked up in its place. */
.term-step-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12px;
  min-height: 36px;
}

/* Icon-only "go back one step" button — sized to match the other step
   buttons' height, square rather than pill-wide since it holds only the icon. */
.term-back-btn {
  flex-shrink: 0;
  width: 36px;
  min-height: 36px;
  padding: 0;
  justify-content: center;
}

.term-back-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.term-error {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal-pink);
  margin-bottom: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .term-active,
  .term-line {
    opacity: 1;
    transform: none;
  }

  .term-active.term-enter,
  .term-line.term-enter {
    animation: none;
  }
}
