/* ==========================================================================
   Alchemy Logic Consulting: site styles
   One stylesheet for every page. Dark theme, blue + green accents.
   ========================================================================== */

:root {
  /* Color */
  --bg: #05080f;
  --bg-raised: #0a101d;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);
  --text: #d9e0ea;
  --text-muted: #aab5c7;
  --heading: #f5f7fb;
  --blue: #3b82f6;
  --blue-bright: #60a5fa;
  --green: #10b981;
  --green-bright: #34d399;
  --gradient: linear-gradient(120deg, #3b82f6 0%, #10b981 100%);
  --gradient-text: linear-gradient(100deg, #60a5fa 0%, #34d399 100%);

  /* Type */
  --font-display: "Manrope", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --container: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-y: clamp(4.5rem, 9vw, 7.5rem);
  --header-h: 72px;
  --radius: 16px;
  --radius-lg: 24px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: rgba(59, 130, 246, 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 3px; border-radius: 6px; }

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -0.035em; line-height: 1.05; }
h2 { font-size: clamp(1.875rem, 3.6vw, 2.75rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.3; }
p { max-width: 68ch; }
strong { color: var(--heading); font-weight: 600; }

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-bright);
}
.eyebrow::before {
  content: "";
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
}
.lead { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--text); line-height: 1.65; }
.muted { color: var(--text-muted); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); position: relative; }
.section--flush-top { padding-top: 0; }
.section--raised { background: var(--bg-raised); border-block: 1px solid var(--border); }
.section-head { display: grid; gap: 1rem; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); max-width: 720px; }
.section-head--center { max-width: none; text-align: center; justify-items: center; }
.section-head--center > * { max-width: 720px; }
.section-head--center > .eyebrow { justify-self: start; }
.section-head p { color: var(--text-muted); font-size: 1.0625rem; }

.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding-inline: 1.375rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn i { font-size: 0.8125rem; transition: transform 0.25s var(--ease); }
.btn:hover i { transform: translateX(3px); }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(59, 130, 246, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 32px -8px rgba(16, 185, 129, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--heading); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { background: var(--surface-hover); border-color: rgba(148, 163, 184, 0.4); }
.btn-sm { height: 40px; padding-inline: 1.125rem; font-size: 0.875rem; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--blue-bright);
}
.link-arrow i { font-size: 0.75rem; transition: transform 0.25s var(--ease); }
.link-arrow:hover i { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(5, 8, 15, 0.78);
  border-bottom-color: var(--border);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }

.brand { display: inline-flex; align-items: center; gap: 0.75rem; font-family: var(--font-display); color: var(--heading); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; line-height: 1.1; }
.brand-name span { display: block; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }

.nav { display: flex; align-items: center; gap: 1.125rem; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a {
  position: relative;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--heading); background: var(--surface-hover); }
.nav-links a[aria-current="page"] { color: var(--heading); }
.nav-indicator {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 2px;
  margin-left: -8px;
  border-radius: 2px;
  background: var(--gradient);
  view-transition-name: nav-indicator;
}

/* On the contact page the underline sits (invisibly) in the "Get in touch" button at the same height
   as the tab underlines, so it slides straight across into / out of the button */
.nav .btn { position: relative; }
.nav-indicator--btn { bottom: 5px; opacity: 0; pointer-events: none; }
/* Keep the underline visible for most of its slide, then let it fade out at the end */
::view-transition-old(nav-indicator) { animation-name: nav-indicator-out; }
@keyframes nav-indicator-out { 0%, 65% { opacity: 1; } 100% { opacity: 0; } }

/* Page-to-page transition: the underline glides to the new tab, the page cross-fades */
@media (min-width: 821px) {
  @view-transition { navigation: auto; }
}
::view-transition-group(nav-indicator) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.2s; }

.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); align-items: center; justify-content: center; }
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--heading);
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}
.menu-toggle span { position: relative; }
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }
.is-open .menu-toggle span { background: transparent; }
.is-open .menu-toggle span::before { transform: translateY(6px) rotate(45deg); }
.is-open .menu-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(4rem, 10vw, 8rem));
  padding-bottom: clamp(4rem, 8vw, 6.5rem);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
}
/* Soft glows drawn with gradients (much cheaper for phones to paint than a large blur filter) */
.glow { position: absolute; border-radius: 50%; opacity: 0.55; }
.glow--blue { width: 760px; height: 760px; top: -340px; left: calc(8% - 120px); background: radial-gradient(closest-side, rgba(59, 130, 246, 0.85), rgba(59, 130, 246, 0.35) 50%, transparent); }
.glow--green { width: 660px; height: 660px; top: -230px; right: calc(4% - 110px); background: radial-gradient(closest-side, rgba(16, 185, 129, 0.7), rgba(16, 185, 129, 0.25) 50%, transparent); }

.hero-inner { display: grid; justify-items: center; text-align: center; gap: 1.75rem; }
.hero h1 { max-width: 18ch; }
.hero .lead { max-width: 54ch; color: var(--heading); font-weight: 500; }
.hero-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 0.5rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(3.5rem, 7vw, 5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(10, 16, 29, 0.72);
  overflow: hidden;
}
.stat { padding: 1.75rem 1.5rem; text-align: center; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.03em; color: var(--heading); line-height: 1.1; }
.stat-label { margin-top: 0.375rem; font-size: 0.875rem; color: var(--text-muted); line-height: 1.4; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3.5rem, 8vw, 6rem));
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--border);
}
.page-hero .glow--blue { width: 640px; height: 640px; top: -350px; left: -170px; }
.page-hero .glow--green { width: 560px; height: 560px; top: -300px; right: -140px; opacity: 0.4; }
.page-hero-inner { display: grid; gap: 1.25rem; text-align: center; justify-items: center; }
.page-hero-inner > * { max-width: 820px; }
.page-hero-inner > .eyebrow { justify-self: start; }
.page-hero h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }

/* ---------- Logo strip ---------- */
.logos { padding-block: 2.5rem; border-block: 1px solid var(--border); background: var(--bg-raised); }
.logos-label { max-width: none; text-align: center; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.5rem; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 3.5rem; width: max-content; animation: marquee 45s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; color: var(--text-muted); white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Cards ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background-color 0.3s var(--ease);
}
.card p { color: var(--text-muted); font-size: 0.9688rem; }
a.card:hover { border-color: rgba(96, 165, 250, 0.4); transform: translateY(-3px); }
.card .link-arrow { margin-top: auto; padding-top: 0.5rem; }

/* On larger screens the card body is invisible to layout; on phones it collapses (see below) */
.card-body, .card-body > div { display: contents; }

.icon-badge {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.125rem;
  color: #fff;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(16, 185, 129, 0.22));
  border: 1px solid rgba(96, 165, 250, 0.28);
}
.icon-badge i { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Split / feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.split--top { align-items: start; }
.stack { display: grid; gap: 1.25rem; }
.stack--tight { gap: 0.5rem; }

.steps { display: grid; gap: 0.75rem; counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.125rem;
  align-items: start;
  padding: 1.25rem 1.375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--green-bright);
  padding-top: 0.125rem;
}
.step h3 { font-size: 1.0625rem; margin-bottom: 0.25rem; }
.step p { font-size: 0.9375rem; color: var(--text-muted); }

.check-list { display: grid; gap: 0.75rem; }
.check-list li { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: baseline; }
.check-list li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--green-bright);
}

/* ---------- Services page ---------- */
.services-layout { display: grid; grid-template-columns: 240px 1fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 2rem); display: grid; gap: 0.25rem; }
.toc-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.75rem; }
.toc a {
  padding: 0.5rem 0.875rem;
  border-left: 2px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.toc a:hover { color: var(--heading); }
.toc a.is-active { color: var(--heading); border-left-color: var(--green); }

.service-block { display: grid; gap: 1.5rem; padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.service-block + .service-block { padding-top: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--border); }
.service-block-head { display: flex; gap: 1.25rem; align-items: center; }
.service-block h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); }
.service-tagline { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; color: var(--blue-bright); letter-spacing: -0.01em; }
.service-block-head > div { display: grid; gap: 0.375rem; }
.service-block .check-list li { color: var(--heading); }
.service-more > div { display: grid; gap: 1.25rem; }
.service-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.service-actions .link-arrow { margin-left: auto; }
.more-toggle { display: none; }
.service-block p { color: var(--text); }
.sub-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 0.5rem; }
.sub-cards .card { padding: 1.5rem; gap: 0.625rem; }
.sub-cards .card h3 { font-size: 1.0625rem; }
.sub-cards .card .sub-tag { font-size: 0.875rem; font-weight: 600; color: var(--green-bright); }

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags + .client-grid { margin-top: 2rem; }
.tag { padding: 0.4rem 0.875rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 0.875rem; color: var(--text); }

/* ---------- About ---------- */
.facts { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.fact { display: grid; gap: 0.25rem; padding: 1.5rem 1.75rem; }
.fact + .fact { border-top: 1px solid var(--border); }
.fact-label { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.fact-value { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--heading); letter-spacing: -0.015em; }

.client-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.client {
  display: grid;
  place-items: center;
  min-height: 104px;
  padding: 1.25rem;
  text-align: center;
  background: var(--bg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9688rem;
  color: var(--text-muted);
  line-height: 1.35;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.client:hover { color: var(--heading); background: var(--bg-raised); }

/* ---------- Contact ---------- */
.contact-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.contact-main { padding: clamp(2rem, 5vw, 3.5rem); display: grid; gap: 1.5rem; align-content: start; }
.contact-email {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.375rem, 3vw, 2rem);
  letter-spacing: -0.025em;
  color: var(--heading);
  overflow-wrap: anywhere;
  transition: color 0.2s var(--ease);
}
.contact-email:hover { color: var(--blue-bright); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.contact-side { padding: clamp(2rem, 5vw, 3.5rem); border-left: 1px solid var(--border); background: rgba(10, 16, 29, 0.6); display: grid; gap: 1.25rem; align-content: start; }
.contact-side h3 { font-size: 1.0625rem; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
  padding: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 5vw, 4rem);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 60% 80% at 15% 0%, rgba(59, 130, 246, 0.28), transparent 70%),
    radial-gradient(ellipse 60% 80% at 85% 100%, rgba(16, 185, 129, 0.24), transparent 70%),
    var(--bg-raised);
}
.cta-band h2 { max-width: 20ch; }
.cta-band p { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-raised); padding-top: clamp(3.5rem, 7vw, 5rem); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 2.5rem; padding-bottom: 3rem; }
.footer-grid p { color: var(--text); font-size: 0.9375rem; margin-top: 1rem; max-width: 34ch; }
.footer-title { font-family: var(--font-body); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--heading); margin-bottom: 1.125rem; }
.footer-links { display: grid; gap: 0.625rem; }
.footer-links a { font-size: 0.9375rem; color: var(--text); transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--heading); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; border-top: 1px solid var(--border); font-size: 0.875rem; color: #c0c9d8; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Content at the top of the page animates on load, not on scroll */
.hero .reveal, .page-hero .reveal { opacity: 1; transform: none; transition: none; animation: fade-up 0.7s var(--ease) both; }
.hero-inner > :nth-child(2), .page-hero-inner > :nth-child(2) { animation-delay: 0.08s; }
.hero-inner > :nth-child(3), .page-hero-inner > :nth-child(3) { animation-delay: 0.16s; }
.hero .stats { animation-delay: 0.24s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Phones and tablets: no entrance or scroll fade-ins, so each page is there the moment it opens */
@media (max-width: 820px) {
  .hero .reveal, .page-hero .reveal { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .client-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .services-layout { grid-template-columns: 1fr; gap: 2rem; }
  /* Services index becomes a sticky row of chips under the header */
  .toc {
    position: sticky;
    top: var(--header-h);
    z-index: 5;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin: calc(-1 * var(--section-y)) calc(-1 * var(--gutter)) 0;
    padding: 0.75rem var(--gutter);
    background: rgba(5, 8, 15, 0.88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc-label { display: none; }
  .toc a {
    flex: none;
    padding: 0.4375rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    white-space: nowrap;
  }
  .toc a.is-active { color: var(--heading); border-color: rgba(52, 211, 153, 0.5); background: rgba(16, 185, 129, 0.1); }
  .service-block { scroll-margin-top: calc(var(--header-h) + 72px); }
}

@media (max-width: 820px) {
  :root { --header-h: 64px; }
  .menu-toggle { display: inline-flex; }
  .nav { gap: 0.75rem; }
  .nav .btn { display: none; }
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    height: calc(100dvh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1.25rem var(--gutter) 2rem;
    background: var(--bg);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s;
  }
  .is-open .nav-links { opacity: 1; visibility: visible; }
  /* Open menu: the header turns the same solid black as the panel at once, so they read as one surface */
  .site-header { transition: none; }
  .site-header.is-open { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav-links li { display: block; }
  .nav-links li + li { border-top: 1px solid var(--border); }
  .nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 0.25rem;
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    border-radius: 0;
  }
  .nav-links a:hover { background: none; color: var(--heading); }
  .nav-links a::after { content: "\f054"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.75rem; color: var(--text-muted); }
  .nav-indicator { display: none; }
  .nav-links a[aria-current="page"] { color: var(--heading); }
  .nav-links a[aria-current="page"]::after {
    content: "";
    position: static;
    width: 8px;
    height: 8px;
    margin: 0;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  }
  /* "Get in touch" is a row like the others, marked out by its gradient text and arrow */
  .nav-links .nav-cta { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .nav-links .nav-cta::after { content: "\f061"; color: var(--green-bright); font-size: 0.875rem; }

  .grid-3, .split, .contact-card, .sub-cards { grid-template-columns: 1fr; }
  .contact-side { border-left: 0; border-top: 1px solid var(--border); }
  .stat { padding: 1.25rem 0.5rem; }
  .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 821px) {
  .nav-links li:has(> .nav-cta) { display: none; }
}

/* Services page on phones: summary first, details behind "Read more" */
@media (max-width: 820px) {
  :root { --section-y: 3.5rem; }
  .service-block { gap: 1.125rem; padding-bottom: 2.25rem; }
  .service-block + .service-block { padding-top: 2.25rem; }
  .service-block-head { gap: 1rem; align-items: center; }
  .service-block-head .icon-badge { width: 44px; height: 44px; flex: none; }
  .service-block h2 { font-size: 1.375rem; }
  .service-tagline { font-size: 0.9375rem; }
  .service-more {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: -1.125rem;
    visibility: hidden;
    transition: grid-template-rows 0.4s var(--ease), visibility 0.4s;
  }
  .service-more > div { overflow: hidden; min-height: 0; padding-top: 1.125rem; }
  .service-block.is-expanded .service-more { grid-template-rows: 1fr; visibility: visible; }
  .more-toggle { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--heading); font-size: 0.9375rem; font-weight: 600; line-height: inherit; }
  .more-toggle i { font-size: 0.6875rem; transition: transform 0.3s var(--ease); }
  .service-block.is-expanded .more-toggle i { transform: rotate(180deg); }
}

/* Phones: shorter page headers, desktop-only extras hidden, compact About layout */
@media (max-width: 820px) {
  .desktop-only { display: none !important; }
  .approach-link { text-align: right; }
  .page-hero { padding-top: calc(var(--header-h) + 2.25rem); padding-bottom: 2.25rem; }
  .page-hero-inner { gap: 0.875rem; }
  .split .steps .step p { display: none; }
  .split .steps .step h3 { margin-bottom: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact { padding: 1.125rem 1.25rem; align-content: start; }
  .fact + .fact { border-top: 0; }
  .fact:nth-child(2) { border-left: 1px solid var(--border); }
  .fact:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--border); }
  .fact-value { font-size: 1.0625rem; }
  .value-cards { gap: 0.625rem; }
  .value-cards .card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    padding: 1.125rem;
    border-radius: var(--radius);
  }
  .value-cards .icon-badge { grid-row: span 2; width: 44px; height: 44px; }
  .value-cards p { font-size: 0.9375rem; }
  .client { min-height: 72px; padding: 0.875rem; font-size: 0.875rem; }
}

/* Home service cards on phones: compact rows; the card at the reading line expands */
@media (max-width: 820px) {
  .service-cards { gap: 0.625rem; overflow-anchor: none; }
  .service-cards .card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0 1rem;
    padding: 1rem 1.125rem;
    border-radius: var(--radius);
    transition: border-color 0.45s var(--ease), background-color 0.45s var(--ease), opacity 0.8s var(--ease), transform 0.8s var(--ease);
  }
  .service-cards .card:hover { transform: none; }
  .service-cards .card::after {
    content: "\f061";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.8125rem;
    color: var(--text-muted);
    grid-column: 3;
    grid-row: 1;
    transition: color 0.45s var(--ease);
  }
  .service-cards .icon-badge { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }
  .service-cards h3 { font-size: 1.0625rem; }
  .service-cards .card-body {
    display: grid;
    grid-column: 1 / -1;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.45s var(--ease), opacity 0.35s var(--ease);
  }
  .service-cards .card-body > div { display: block; overflow: hidden; min-height: 0; }
  .service-cards .card-body p { padding-top: 0.875rem; }
  .service-cards .card-body .link-arrow { display: none; }
  .service-cards .card.is-active { border-color: rgba(96, 165, 250, 0.45); background-color: rgba(59, 130, 246, 0.06); }
  .service-cards .card.is-active::after { color: var(--green-bright); }
  .service-cards .card.is-active .card-body { grid-template-rows: 1fr; opacity: 1; }
}

/* Services on tablets and desktop: name and actions on the left, key points in a panel on the right */
@media (min-width: 641px) {
  .service-block { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 2rem; align-items: start; }
  .service-block-head { grid-column: 1; grid-row: 1; align-items: flex-start; }
  .service-actions { grid-column: 1; grid-row: 2; align-self: start; flex-direction: column; align-items: flex-start; gap: 1rem; margin-top: 0.5rem; }
  .service-actions .link-arrow { margin-left: 0; }
  .service-block > .check-list {
    grid-column: 2;
    grid-row: 1 / span 2;
    gap: 0.875rem;
    padding: 1.25rem 1.375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
  }
  .service-more { grid-column: 1 / -1; grid-row: 3; }
}

/* Services page on desktop: slimmer index column, less empty space under the header */
@media (min-width: 1025px) {
  .section:has(> .services-layout) { padding-top: clamp(3rem, 5vw, 4rem); }
  .services-layout { grid-template-columns: 190px minmax(0, 1fr); gap: clamp(2.5rem, 4vw, 3.5rem); }
}

/* Footer on tablets: brand across the top, then three link columns */
@media (min-width: 561px) and (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1.4fr; gap: 2.5rem 2rem; }
  .footer-grid > :first-child {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--border);
  }
  .footer-grid > :first-child p { margin-top: 0; }
}

@media (max-width: 560px) {
  /* Footer on phones: centered brand, two link columns side by side, centered contact */
  .site-footer { text-align: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.25rem 1rem; padding-bottom: 2.5rem; }
  .footer-grid > :first-child,
  .footer-grid > :last-child { grid-column: 1 / -1; }
  .footer-grid > :first-child { display: grid; justify-items: center; }
  .footer-grid p { margin-inline: auto; }
  .footer-grid > :last-child { padding-top: 1.75rem; border-top: 1px solid var(--border); }
  .footer-bottom { flex-direction: column; align-items: center; gap: 0.375rem; }
  .hero-ctas { width: 100%; }
  .hero-ctas .btn { flex: 1 1 100%; }
  .brand-name span { display: none; }
}
