/* ==========================================================================
   Clever House Engineering — site stylesheet
   Hand-built. No framework. No build step.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Fonts — self-hosted variable webfonts (Inter + JetBrains Mono, OFL)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,
                 U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,
                 U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,
                 U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,
                 U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/inter-latin-wght-italic.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('../fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,
                 U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,
                 U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('../fonts/jetbrains-mono-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,
                 U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,
                 U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --ink:        #070A10;
  --ink-2:      #0C111A;
  --ink-3:      #121926;
  --ink-4:      #18202F;

  /* Type */
  --text:       #EDF1F7;
  --text-2:     #9FAABC;
  --text-3:     #828EA4;   /* ≥4.9:1 on every surface used here (WCAG AA) */

  /* Lines */
  --line:       rgba(255, 255, 255, 0.08);
  --line-2:     rgba(255, 255, 255, 0.14);

  /* Accent */
  --accent:     #4D8DFF;
  --accent-2:   #7FB0FF;
  --accent-dim: rgba(77, 141, 255, 0.10);
  --accent-line:rgba(77, 141, 255, 0.30);

  /* Type scale */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Rhythm */
  --gutter:     24px;
  --maxw:       1200px;
  --maxw-text:  68ch;
  --radius:     14px;
  --radius-sm:  8px;

  --section-y:  clamp(72px, 9vw, 140px);

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

  /* Theme-dependent surfaces. Every hard-coded colour lives here so that
     switching themes is one block of overrides, not a hunt through the file. */
  --accent-hover:       #6FA3FF;
  --accent-wash:        rgba(77, 141, 255, 0.10);
  --accent-wash-end:    rgba(77, 141, 255, 0.02);
  --accent-wash-strong: rgba(77, 141, 255, 0.15);
  --accent-wash-strong-end: rgba(77, 141, 255, 0.03);
  --hover:              rgba(255, 255, 255, 0.04);
  --hover-strong:       rgba(255, 255, 255, 0.05);
  --hover-soft:         rgba(255, 255, 255, 0.022);
  --raised:             rgba(255, 255, 255, 0.028);
  --header-bg:          rgba(7, 10, 16, 0.82);
  --drawer-bg:          rgba(7, 10, 16, 0.97);
  --grid-line:          rgba(255, 255, 255, 0.028);
  --glow:               rgba(77, 141, 255, 0.16);
  --watermark:          rgba(255, 255, 255, 0.018);
  --panel-shadow:       none;
  --btn-label:          var(--ink);
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.12; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: var(--btn-label); }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }
.section + .section { border-top: 1px solid var(--line); }

.section--tint { background: var(--ink-2); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: var(--btn-label);
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   4. Typography helpers
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-line), transparent);
  max-width: 180px;
}

.h-display {
  font-size: clamp(2.5rem, 6.2vw, 4.6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.02;
}
.h-section {
  font-size: clamp(2rem, 3.8vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.h-card { font-size: 1.28rem; letter-spacing: -0.02em; }

.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  color: var(--text-2);
  line-height: 1.6;
  max-width: 62ch;
  font-weight: 350;
}

.muted { color: var(--text-2); }
.dim   { color: var(--text-3); }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.section-head { max-width: 760px; margin-bottom: clamp(44px, 5vw, 72px); }
.section-head p { margin-top: 20px; }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: background .22s var(--ease), border-color .22s var(--ease),
              color .22s var(--ease), transform .22s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex: none; transition: transform .22s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

/* Dark label on the vivid accent: 6.2:1, versus 3.2:1 for white on the same blue.
   Keeps the brand colour at full strength and still clears WCAG AA. */
.btn--primary { background: var(--accent); color: var(--btn-label); font-weight: 600; }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn--ghost { border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-3); background: var(--hover); }

.btn--sm { padding: 10px 18px; font-size: 14px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent-2);
}
.link-arrow svg { width: 14px; height: 14px; transition: transform .22s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   6. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-stuck {
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 78px;
  transition: height .3s var(--ease);
}
.site-header.is-stuck .site-header__inner { height: 66px; }

/* Logo */
.logo { display: flex; align-items: center; gap: 11px; flex: none; }
.logo__mark { width: 28px; height: 28px; fill: var(--text); flex: none; }
.logo__type { display: flex; flex-direction: column; line-height: 1; }
.logo__name {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}
/* Tracked out so "ENGINEERING" optically spans "CleverHouse", as in the original mark.
   The negative margin removes the trailing letter-space so the two edges align. */
.logo__sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.50em;
  margin-right: -0.50em;
  color: var(--text-3);
  margin-top: 4px;
}

/* Nav */
.nav { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav a {
  display: block;
  padding: 8px 14px;
  font-size: 14.5px;
  font-weight: 450;
  color: var(--text-2);
  border-radius: 8px;
  transition: color .18s, background .18s;
}
.nav a:hover { color: var(--text); background: var(--hover-strong); }
.nav a.is-active { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 12px; flex: none; }

/* Mobile toggle */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 10px;
}
.nav-toggle span {
  display: block; position: relative;
  width: 17px; height: 1.5px; background: var(--text);
  transition: background .2s;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: ''; position: absolute; left: 0;
  width: 17px; height: 1.5px; background: var(--text);
  transition: transform .26s var(--ease);
}
.nav-toggle span::before { top: -5.5px; }
.nav-toggle span::after  { top:  5.5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-5.5px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  inset: 78px 0 auto 0;
  z-index: 99;
  background: var(--drawer-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 12px var(--gutter) 28px;
  display: none;
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; }
.mobile-nav a {
  display: block;
  padding: 15px 4px;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
}
.mobile-nav .btn { margin-top: 24px; width: 100%; justify-content: center; }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: clamp(140px, 17vw, 200px);
  padding-bottom: clamp(72px, 9vw, 120px);
  overflow: hidden;
  isolation: isolate;
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
}
.hero__glow {
  position: absolute;
  z-index: -2;
  top: -280px; left: 50%;
  width: min(1100px, 130vw); height: 720px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  pointer-events: none;
}
.hero__watermark {
  position: absolute;
  z-index: -1;
  right: -60px; bottom: -80px;
  width: clamp(280px, 40vw, 560px);
  fill: var(--watermark);
  pointer-events: none;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px 7px 11px;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--raised);
  margin-bottom: 30px;
}
.hero__badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 3px rgba(74,222,128,.16);
  flex: none;
}

.hero h1 { max-width: 17ch; }
.hero h1 em {
  font-style: normal;
  color: var(--accent-2);
}

.hero__lead { margin-top: 28px; max-width: 58ch; }

.hero__quote {
  margin-top: 34px;
  padding-left: 20px;
  border-left: 2px solid var(--accent-line);
  font-size: 1.02rem;
  color: var(--text-2);
  font-weight: 350;
  font-style: italic;
  max-width: 46ch;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* Hero facts strip */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: clamp(56px, 7vw, 90px);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.facts__item { background: var(--ink); padding: 26px 24px; }
.facts__k {
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.facts__v {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   8. Sector ribbon
   -------------------------------------------------------------------------- */
.ribbon {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
  padding-block: 26px;
}
.ribbon__inner {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3.5vw, 48px);
  flex-wrap: wrap;
  justify-content: center;
}
.ribbon__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.ribbon__item {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.ribbon__item::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 1px;
  background: var(--accent);
  transform: rotate(45deg);
  flex: none;
}

/* --------------------------------------------------------------------------
   9. Flagship case study
   -------------------------------------------------------------------------- */
.flagship {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(40px, 5vw, 76px);
  align-items: start;
}

.flagship__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.flagship h3 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  letter-spacing: -0.035em;
}
.flagship__sub {
  font-size: 1.05rem;
  color: var(--text-2);
  margin-top: 14px;
  font-weight: 350;
}

.kv { margin-top: 36px; display: grid; gap: 26px; }
.kv__row { display: grid; grid-template-columns: 132px 1fr; gap: 20px; align-items: start; }
.kv__k {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-top: 5px;
}
.kv__v { color: var(--text-2); font-size: 15.5px; line-height: 1.65; }
.kv__v strong { color: var(--text); font-weight: 550; }

/* Sticky evidence column beside the long flagship narrative */
.flagship__aside { position: sticky; top: 104px; }

/* Stats panel */
.panel {
  background: var(--ink-3);
  border: 1px solid var(--line);
  box-shadow: var(--panel-shadow);
  border-radius: var(--radius);
  padding: clamp(26px, 3vw, 36px);
}
.panel + .panel { margin-top: 16px; }
.panel__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 22px;
}

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 20px; }
.stat__k {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}
.stat__k span { font-size: .9rem; color: var(--text-3); font-weight: 450; letter-spacing: 0; }
.stat__v { font-size: 13px; color: var(--text-3); margin-top: 9px; line-height: 1.45; }

.feature-list { list-style: none; display: grid; gap: 14px; }
.feature-list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.feature-list svg { width: 15px; height: 15px; margin-top: 4px; stroke: var(--accent); flex: none; }

/* Tech chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  border: 1px solid var(--line);
  background: var(--raised);
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   10. Work grid
   -------------------------------------------------------------------------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: clamp(40px, 5vw, 64px);
}
.work-card {
  background: var(--ink);
  padding: clamp(28px, 3vw, 38px);
  display: flex;
  flex-direction: column;
  transition: background .25s var(--ease);
}
.work-card:hover { background: var(--ink-3); }
.work-card__no {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 18px;
}
.work-card__sector {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.work-card h4 {
  font-size: 1.16rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 14px;
}
.work-card p { font-size: 14.5px; color: var(--text-2); line-height: 1.6; flex: 1; }

/* --------------------------------------------------------------------------
   11. Services
   -------------------------------------------------------------------------- */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.svc {
  background: var(--ink-2);
  padding: clamp(28px, 3vw, 38px);
  transition: background .25s var(--ease);
}
.svc:hover { background: var(--ink-3); }
.svc--cta {
  background: linear-gradient(160deg, var(--accent-wash), var(--accent-wash-end) 60%), var(--ink-3);
}
.svc--cta:hover { background: linear-gradient(160deg, var(--accent-wash-strong), var(--accent-wash-strong-end) 60%), var(--ink-3); }
.svc__icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--accent-line);
  background: var(--accent-dim);
  border-radius: 10px;
  margin-bottom: 22px;
}
.svc__icon svg { width: 18px; height: 18px; stroke: var(--accent-2); }
.svc h3 { font-size: 1.14rem; margin-bottom: 12px; letter-spacing: -0.02em; }
.svc p { font-size: 14.5px; color: var(--text-2); line-height: 1.6; }
.svc ul {
  list-style: none;
  margin-top: 16px;
  display: grid;
  gap: 7px;
}
.svc li {
  font-size: 13.5px;
  color: var(--text-3);
  padding-left: 15px;
  position: relative;
  line-height: 1.5;
}
.svc li::before {
  content: '';
  position: absolute; left: 0; top: 8px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-3);
}

/* --------------------------------------------------------------------------
   12. Approach
   -------------------------------------------------------------------------- */
.steps { display: grid; border-top: 1px solid var(--line); }
.step {
  display: grid;
  grid-template-columns: 78px minmax(180px, 0.75fr) 1.25fr;
  gap: clamp(20px, 3vw, 44px);
  padding: clamp(26px, 3.2vw, 38px) clamp(8px, 1.4vw, 20px);
  margin-inline: clamp(-8px, -1.4vw, -20px);
  align-items: start;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: background .25s var(--ease);
}
.step:hover { background: var(--hover-soft); }
.step__no {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 6px;
}
.step h3 { font-size: 1.32rem; letter-spacing: -0.025em; }
.step p { color: var(--text-2); font-size: 15px; line-height: 1.65; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 44px);
  margin-top: clamp(40px, 5vw, 64px);
}

.principle-list { list-style: none; counter-reset: p; display: grid; gap: 11px; margin-top: 20px; }
.principle-list li {
  counter-increment: p;
  position: relative;
  padding-left: 34px;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.principle-list li::before {
  content: counter(p, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   13. Stack
   -------------------------------------------------------------------------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(28px, 3vw, 44px);
}
.stack-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  font-weight: 500;
}
.stack-col ul { list-style: none; display: grid; gap: 9px; }
.stack-col li { font-size: 14.5px; color: var(--text-2); line-height: 1.5; }

/* --------------------------------------------------------------------------
   14. Company / culture
   -------------------------------------------------------------------------- */
.culture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: clamp(40px, 5vw, 64px);
}
.culture {
  background: var(--ink-2);
  padding: clamp(28px, 3vw, 38px);
}
.culture h3 { font-size: 1.1rem; margin-bottom: 12px; letter-spacing: -0.02em; }
.culture p { font-size: 14.5px; color: var(--text-2); line-height: 1.6; }
.culture__mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   15. Contact
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(36px, 5vw, 80px);
  align-items: start;
}

.contact-lines { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.contact-line {
  background: var(--ink-3);
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 22px 24px;
  align-items: center;
  transition: background .22s var(--ease);
}
a.contact-line:hover { background: var(--ink-4); }
.contact-line__icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--raised);
}
.contact-line__icon svg { width: 16px; height: 16px; stroke: var(--accent-2); }
.contact-line__k {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 5px;
}
.contact-line__v {
  display: block;
  font-size: 15.5px;
  font-weight: 450;
  line-height: 1.45;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding-block: clamp(48px, 5vw, 72px) 34px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(28px, 4vw, 64px);
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line);
}
.footer-brand p { margin-top: 20px; font-size: 14px; color: var(--text-3); max-width: 38ch; line-height: 1.6; }
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a, .footer-col li { font-size: 14.5px; color: var(--text-2); transition: color .18s; }
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   17. Reveal animation
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

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

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .flagship { grid-template-columns: 1fr; }
  .flagship__aside { position: static; }
  .contact-grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 70px 1fr; }
  .step > p { grid-column: 2; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .nav, .header-actions .btn { display: none; }
  .nav-toggle { display: flex; }
  .facts { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  body { font-size: 16px; }
  html { scroll-padding-top: 76px; }
  .site-header__inner, .site-header.is-stuck .site-header__inner { height: 68px; }
  .mobile-nav { inset-block-start: 68px; }
  .kv__row { grid-template-columns: 1fr; gap: 6px; }
  .kv__k { padding-top: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 22px 16px; }
  .step { grid-template-columns: 1fr; gap: 12px; }
  .step__no { padding-top: 0; }
  .work-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .hero__watermark { display: none; }
  .ribbon__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    justify-content: start;
  }
  .ribbon__label { grid-column: 1 / -1; margin-bottom: 2px; }
  .ribbon__item { font-size: 13.5px; align-items: flex-start; }
  .ribbon__item::before { margin-top: 7px; }
}

@media (max-width: 420px) {
  .ribbon__inner { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .facts { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   19. Component modifiers
   These exist as classes rather than inline style="" attributes because the
   Content-Security-Policy in .htaccess sets `style-src 'self'`, which blocks
   both inline <style> blocks and style attributes. Keep it that way: if you
   need a one-off tweak, add a rule here instead of a style attribute.
   -------------------------------------------------------------------------- */

/* Off-screen holder for the reusable <symbol> sprite */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* A secondary heading block inside a section that already has one */
.section-head--sub { margin-top: clamp(72px, 8vw, 120px); margin-bottom: 0; }
.h-section--sm { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.lead--sm { font-size: 1rem; }

/* Lead paragraph directly after a section heading outside .section-head */
.h-section + .lead { margin-top: 22px; }

/* Link under the flagship narrative */
.flagship__link { margin-top: 26px; }

/* link-arrow used mid-sentence rather than as a standalone call to action */
.link-arrow--inline { display: inline; font-size: inherit; }

/* Emphasised lead-in inside a checklist */
.feature-list strong { color: var(--text); font-weight: 550; }
.panel h3 + .feature-list { margin-top: 20px; }

/* Services CTA cell */
.svc--cta p + p { margin-top: 20px; }

/* Paired notes below a grid */
.two-col--spaced { margin-top: clamp(40px, 5vw, 64px); }
.note h3 { margin-bottom: 16px; }
.note p { font-size: 15px; }

/* Button row in the contact section */
.hero__cta--spaced { margin-top: 36px; }

/* Secondary line inside a contact row */
.contact-line__meta { display: block; font-size: 13.5px; color: var(--text-3); }

/* Second heading in a footer column */
.footer-col ul + h5 { margin-top: 26px; }

/* --------------------------------------------------------------------------
   20. 404 page
   -------------------------------------------------------------------------- */
.nf {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 24px;
}
.nf__code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--accent);
  margin-bottom: 26px;
}
.nf h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.035em; }
.nf p { margin-top: 20px; color: var(--text-2); max-width: 44ch; margin-inline: auto; }
.nf .logo { justify-content: center; margin-bottom: 44px; }
.nf .btn { margin-top: 34px; }

/* --------------------------------------------------------------------------
   21. Light theme
   Set data-theme="light" on <html> to switch. Everything below is a token
   override — no layout or component rule changes between themes.
   Every pair below was contrast-checked; see tools/ for the checker.
   -------------------------------------------------------------------------- */
:root[data-theme="light"] {
  /* Surfaces */
  --ink:        #FFFFFF;
  --ink-2:      #F4F7FB;
  --ink-3:      #FFFFFF;
  --ink-4:      #EDF2F9;

  /* Type — 18.6:1, 7.4:1 and 5.5:1 on white */
  --text:       #0C1320;
  --text-2:     #4A5668;
  --text-3:     #5F6A7C;

  /* Lines */
  --line:       rgba(12, 19, 32, 0.10);
  --line-2:     rgba(12, 19, 32, 0.18);

  /* Accent — the dark theme's #4D8DFF is only 3.2:1 on white, so light mode
     uses a deeper blue for anything that carries text. */
  --accent:     #1F5FD6;
  --accent-2:   #1B56C4;
  --accent-dim: rgba(31, 95, 214, 0.07);
  --accent-line:rgba(31, 95, 214, 0.28);

  --accent-hover:       #1B56C4;
  --accent-wash:        rgba(31, 95, 214, 0.07);
  --accent-wash-end:    rgba(31, 95, 214, 0.015);
  --accent-wash-strong: rgba(31, 95, 214, 0.12);
  --accent-wash-strong-end: rgba(31, 95, 214, 0.025);
  --hover:              rgba(12, 19, 32, 0.035);
  --hover-strong:       rgba(12, 19, 32, 0.05);
  --hover-soft:         rgba(12, 19, 32, 0.022);
  --raised:             rgba(12, 19, 32, 0.028);
  --header-bg:          rgba(255, 255, 255, 0.86);
  --drawer-bg:          rgba(255, 255, 255, 0.98);
  --grid-line:          rgba(12, 19, 32, 0.045);
  --glow:               rgba(31, 95, 214, 0.09);
  --watermark:          rgba(12, 19, 32, 0.020);
  --panel-shadow:       0 1px 2px rgba(12, 19, 32, .04), 0 8px 24px -12px rgba(12, 19, 32, .10);
  --btn-label:          #FFFFFF;
}

/* A white panel on a white section needs its edge back. */
:root[data-theme="light"] .work-grid,
:root[data-theme="light"] .svc-grid,
:root[data-theme="light"] .culture-grid,
:root[data-theme="light"] .facts,
:root[data-theme="light"] .contact-lines {
  box-shadow: var(--panel-shadow);
}

/* The hero sits on the tinted surface rather than pure white, so the
   blueprint grid and the glow have something to register against. */
:root[data-theme="light"] .hero { background: linear-gradient(180deg, #F4F7FB, #FFFFFF 92%); }

/* Selection and the skip link keep white labels on the deeper blue. */
:root[data-theme="light"] ::selection { background: var(--accent); color: var(--btn-label); }
