/* ==========================================================================
   Khi-Lab — Option C (technical)

   Dark is the design's native identity and the default. Light is served
   two ways: `prefers-color-scheme` for visitors who have expressed no
   preference here (including those without JavaScript), and a
   `data-theme` attribute for the header toggle. Plain CSS has no way to
   share one declaration block between a media query and an attribute
   selector, so the light palette is written out twice below — keep the
   two copies in step.
   ========================================================================== */

/* --- Theme-independent tokens ------------------------------------------- */
:root {
  /* Type */
  --font-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rhythm — fluid so nothing needs a breakpoint just to breathe */
  --gutter:    clamp(20px, 4.2vw, 44px);
  --band-y:    clamp(64px, 10vw, 110px);
  --stack-lg:  clamp(32px, 5vw, 60px);
  --stack-md:  clamp(24px, 3.4vw, 40px);

  --radius:    6px;
  --radius-sm: 4px;
  --maxw:      1320px;
  --tap:       44px; /* minimum comfortable touch target */
}

/* --- Dark palette (default) --------------------------------------------- */
:root {
  color-scheme: dark;

  --bg:            #0B0D0F;
  --bg-raised:     #0E1113;
  --panel:         #0F1214;
  --panel-head:    #12161A;
  --stripe:        #101316;

  --line:          #1C2024;
  --line-2:        #232830;
  --line-3:        #2A3038;
  --grid-line:     #12161A;

  --text:          #EDEFF0;
  --muted:         #8C9398;
  --dim:           #5F676C;
  --ghost:         #4A525C;
  --faint:         #3A4048;

  --accent:        #00BCC5;
  --accent-hover:  #5DDAE0;
  --accent-link:   #4ECCD3;
  --accent-link-h: #8CEAEF;
  --accent-dim:    #00656B;
  --on-accent:     #06181C;

  --selection-bg:  #00656B;
  --selection-fg:  #FFFFFF;
  --danger:        #C4564E;
  --danger-text:   #E08A83;

  --header-veil:   rgba(11, 13, 15, .86);
  --scrim:         rgba(4, 6, 7, .6);
  --shadow:        rgba(0, 0, 0, .5);
}

@supports (color: oklch(0.5 0.1 200)) {
  :root {
    --accent:        oklch(0.72 0.13 200);
    --accent-hover:  oklch(0.82 0.11 200);
    --accent-link:   oklch(0.78 0.11 200);
    --accent-link-h: oklch(0.88 0.09 200);
    --accent-dim:    oklch(0.45 0.10 200);
    --selection-bg:  oklch(0.45 0.10 200);
  }
}

/* --- Light palette : copy 1 of 2, for an unstated preference ------------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --bg:            #FFFFFF;
    --bg-raised:     #F4F6F8;
    --panel:         #F9FAFB;
    --panel-head:    #EFF2F4;
    --stripe:        #EDF0F2;

    --line:          #E2E7EA;
    --line-2:        #D3DADE;
    --line-3:        #C0C8CD;
    --grid-line:     #E6EAED;

    --text:          #0B0D0F;
    --muted:         #4E585E;
    --dim:           #667077;
    --ghost:         #6E787E;
    --faint:         #A8B0B5;

    --accent:        #00767E;
    --accent-hover:  #00646C;
    --accent-link:   #00767E;
    --accent-link-h: #00585F;
    --accent-dim:    #009BA3;
    --on-accent:     #FFFFFF;

    --selection-bg:  #B8E9EB;
    --selection-fg:  #06181C;
    --danger:        #B4322A;
    --danger-text:   #96271F;

    --header-veil:   rgba(255, 255, 255, .86);
    --scrim:         rgba(11, 13, 15, .45);
    --shadow:        rgba(11, 13, 15, .16);
  }

  @supports (color: oklch(0.5 0.1 200)) {
    :root:not([data-theme="dark"]) {
      --accent:        oklch(0.50 0.12 200);
      --accent-hover:  oklch(0.44 0.12 200);
      --accent-link:   oklch(0.50 0.12 200);
      --accent-link-h: oklch(0.40 0.11 200);
      --accent-dim:    oklch(0.62 0.12 200);
      --selection-bg:  oklch(0.90 0.05 200);
    }
  }
}

/* --- Light palette : copy 2 of 2, for the header toggle ------------------ */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:            #FFFFFF;
  --bg-raised:     #F4F6F8;
  --panel:         #F9FAFB;
  --panel-head:    #EFF2F4;
  --stripe:        #EDF0F2;

  --line:          #E2E7EA;
  --line-2:        #D3DADE;
  --line-3:        #C0C8CD;
  --grid-line:     #E6EAED;

  --text:          #0B0D0F;
  --muted:         #4E585E;
  --dim:           #667077;
  --ghost:         #6E787E;
  --faint:         #A8B0B5;

  --accent:        #00767E;
  --accent-hover:  #00646C;
  --accent-link:   #00767E;
  --accent-link-h: #00585F;
  --accent-dim:    #009BA3;
  --on-accent:     #FFFFFF;

  --selection-bg:  #B8E9EB;
  --selection-fg:  #06181C;
  --danger:        #B4322A;
  --danger-text:   #96271F;

  --header-veil:   rgba(255, 255, 255, .86);
  --scrim:         rgba(11, 13, 15, .45);
  --shadow:        rgba(11, 13, 15, .16);
}

@supports (color: oklch(0.5 0.1 200)) {
  :root[data-theme="light"] {
    --accent:        oklch(0.50 0.12 200);
    --accent-hover:  oklch(0.44 0.12 200);
    --accent-link:   oklch(0.50 0.12 200);
    --accent-link-h: oklch(0.40 0.11 200);
    --accent-dim:    oklch(0.62 0.12 200);
    --selection-bg:  oklch(0.90 0.05 200);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  /* The off-canvas nav is fixed; clip keeps stray overflow out of the scroll
     area without turning <html> into a scroll container (which `hidden`
     would do, breaking the sticky header). */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* fallback for browsers without overflow: clip */
}
@supports (overflow: clip) {
  body { overflow-x: clip; }
}

body.is-nav-open { overflow: hidden; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

img, picture, svg, video { max-width: 100%; height: auto; }

a { color: var(--accent-link); text-decoration: none; }
a:hover { color: var(--accent-link-h); }

::selection { background: var(--selection-bg); color: var(--selection-fg); }

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

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; color: var(--on-accent); }

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn--lg { padding: 15px 28px; font-size: 16px; }

.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: var(--accent-hover); color: var(--on-accent); }

.btn--outline {
  border-color: var(--line-3);
  color: var(--text);
  font-weight: 500;
}
.btn--outline:hover { border-color: var(--ghost); color: var(--text); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
}

/* The translucent blur lives on a pseudo-element rather than on the header
   itself: `backdrop-filter` makes an element the containing block for its
   `position: fixed` descendants, which would trap the off-canvas nav inside
   the header box. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--header-veil);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .site-header::before { background: color-mix(in srgb, var(--bg) 82%, transparent); }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 44px);
  padding-block: 12px;
}

.brand {
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 20px);
  letter-spacing: -0.03em;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand__dot { color: var(--accent); }
.brand--footer { font-size: 16px; }

.nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.nav__list { display: flex; gap: clamp(18px, 2.4vw, 30px); }
.nav__link {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  color: var(--muted);
}
.nav__link:hover,
.nav__link.is-current { color: var(--text); }
.nav__cta { display: none; }

.site-header__aside {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 18px);
  /* Keeps the toggle painted above the open drawer so the close affordance
     stays visible. */
  position: relative;
  z-index: 59;
}

.lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}
.lang__current { color: var(--text); }

/* Negative margins let the hit area grow past the 12px text without
   disturbing the header's spacing. */
.lang__alt {
  color: var(--dim);
  padding: 12px 6px;
  margin: -12px -6px;
}
.lang__alt:hover { color: var(--text); }

/* --- Theme toggle -------------------------------------------------------
   Hidden until JavaScript confirms it can do anything: without a script the
   theme follows `prefers-color-scheme` and the button would be inert. */
.theme-toggle { display: none; }

.has-js .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}
.has-js .theme-toggle:hover {
  color: var(--text);
  border-color: var(--line-3);
}

/* No `display` here — it would outrank the icon switching below on
   specificity and paint both icons at once. */
.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Show the icon for the theme the button switches *to*. */
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

/* Hamburger — hidden until the nav collapses */
.nav-toggle {
  display: none;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--panel);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  transition: transform .22s ease, opacity .18s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after  { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { transform: translateY(-6px) rotate(-45deg); }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--scrim);
  backdrop-filter: blur(2px);
}
.nav-scrim[hidden] { display: none; }

/* --- Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120% 90% at 25% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(120% 90% at 25% 0%, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  padding-top: clamp(56px, 9vw, 120px);
  padding-bottom: clamp(56px, 8vw, 100px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  margin-bottom: var(--stack-md);
  border: 1px solid var(--line-2);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-wrap: balance;
}
.badge__dot {
  flex: 0 0 auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero__title {
  font-weight: 800;
  font-size: clamp(38px, 8.4vw, 86px);
  line-height: 1.0;
  letter-spacing: -0.045em;
  margin-bottom: 28px;
  max-width: 17ch;
  text-wrap: balance;
}

.hero__lede {
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: var(--stack-md);
  max-width: 64ch;
  text-wrap: pretty;
}

.capabilities {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(48px, 7vw, 80px);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.capability {
  background: var(--panel);
  padding: clamp(20px, 2.4vw, 26px) clamp(20px, 2.6vw, 28px);
}
.capability__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.capability__text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

/* --- Placeholders (awaiting real assets) -------------------------------- */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ghost);
  border: 1px dashed var(--line-2);
  border-radius: 3px;
  background: repeating-linear-gradient(45deg,
    var(--stripe), var(--stripe) 8px,
    var(--bg) 8px, var(--bg) 16px);
}
.placeholder--shot {
  min-height: 210px;
  margin: 0 clamp(20px, 2.6vw, 32px) clamp(20px, 2.6vw, 32px);
  border-radius: var(--radius-sm);
}

/* --- Section scaffold --------------------------------------------------- */
.band { padding-block: var(--band-y); }
.band--raised {
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.band + .band:not(.band--raised) { border-top: 1px solid var(--line); }

.section__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.section__title {
  font-weight: 700;
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 22ch;
  text-wrap: balance;
}
.section__title--tight { max-width: 18ch; font-size: clamp(28px, 4.2vw, 44px); }

.section__lede {
  margin-top: 20px;
  font-size: clamp(16px, 1.9vw, 18px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 70ch;
  text-wrap: pretty;
}

/* --- Approche : stage cards --------------------------------------------- */
.stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: var(--stack-lg);
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(24px, 3vw, 34px) clamp(20px, 2.6vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg));
  transition: border-color .18s ease;
}
.stage:hover { border-color: var(--accent-dim); }

.stage__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stage__title {
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 24px);
  letter-spacing: -0.02em;
}
.stage__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

.stage__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  color: var(--muted);
}
.stage__list li {
  display: flex;
  gap: 12px;
}
.stage__list li::before {
  content: "›";
  flex: 0 0 auto;
  font-family: var(--font-mono);
  color: var(--accent);
}

.stage__foot {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
}

/* --- Produits ----------------------------------------------------------- */
.products {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  margin-top: var(--stack-lg);
}

.product {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}
.product__body { padding: clamp(24px, 3vw, 32px) clamp(20px, 2.6vw, 32px) 24px; }
.product__head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.product__name {
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 26px);
  letter-spacing: -0.025em;
}
.product__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 9px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.product__text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 52ch;
}
.product .placeholder--shot { margin-top: auto; }

/* --- Support ------------------------------------------------------------ */
.support__head {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: end;
  margin-bottom: var(--stack-md);
}
.support__lede {
  font-size: clamp(16px, 1.9vw, 18px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 64ch;
  text-wrap: pretty;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.tiers {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.tiers th,
.tiers td {
  padding: 22px clamp(18px, 2vw, 26px);
  vertical-align: top;
  border-top: 1px solid var(--line);
}
.tiers thead th {
  padding-block: 15px;
  background: var(--panel-head);
  border-top: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.tiers tbody th {
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
}
.tiers tbody td { font-size: 16px; color: var(--muted); }

/* Column proportions only make sense while this is still a table; below the
   stacking breakpoint they would outrank the block-layout reset. */
@media (min-width: 721px) {
  .tiers tbody th { width: 22%; }
  .tiers tbody td:last-child { width: 28%; }
}
.tiers__badge {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

.scope {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 40px);
  margin-top: 26px;
}
.scope__item {
  flex: 1 1 280px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}
.scope__item strong { color: var(--text); font-weight: 600; }
.scope__item--muted { color: var(--dim); }
.scope__item--muted strong { color: var(--dim); }

/* --- La maison ---------------------------------------------------------- */
.house {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.house__lede {
  margin-top: 22px;
  font-size: clamp(16px, 1.8vw, 17px);
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
  text-wrap: pretty;
}

.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.skill {
  background: var(--bg);
  padding: clamp(20px, 2.6vw, 28px);
}
.skill__title { font-weight: 600; font-size: 17px; margin-bottom: 8px; }
.skill__text { font-size: 14px; line-height: 1.6; color: var(--muted); }

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

.contact__title {
  font-weight: 800;
  font-size: clamp(32px, 5.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  max-width: 13ch;
  text-wrap: balance;
}
.contact__lede {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: var(--stack-md);
  max-width: 46ch;
  text-wrap: pretty;
}
.contact__list { display: flex; flex-direction: column; gap: 14px; }
.contact__row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 16px;
  color: var(--muted);
}
.contact__key {
  flex: 0 0 auto;
  min-width: 90px;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

/* --- Form --------------------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(24px, 3.2vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.field { display: flex; flex-direction: column; gap: 8px; }

.field__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.field__input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  color: var(--text);
  transition: border-color .18s ease;
}
.field__input::placeholder { color: var(--ghost); }
.field__input:focus {
  outline: none;
  border-color: var(--accent-dim);
}
.field__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field__input--area { resize: vertical; min-height: 110px; }

.field.is-invalid .field__input { border-color: var(--danger); }
.field.is-invalid .field__label { color: var(--danger-text); }

.form__submit { padding: 16px; }

.form__status {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.form__status:empty { display: none; }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  flex-wrap: wrap;
  padding-block: 36px;
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2.4vw, 26px);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}
.site-footer__nav a { color: var(--dim); }
.site-footer__nav a:hover { color: var(--text); }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet landscape */
@media (max-width: 1024px) {
  .capabilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage:last-child { grid-column: 1 / -1; }
}

/* Collapse the desktop nav and the two-column section heads */
@media (max-width: 900px) {
  html { scroll-padding-top: 72px; }

  .site-header__cta { display: none; }
  .nav-toggle { display: inline-flex; }

  /* The nav leaves the flex flow once it is fixed, so the aside takes over
     the job of holding the right edge. */
  .site-header__aside { margin-left: auto; }

  /* Slide-in panel */
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 58;
    width: min(340px, 86vw);
    margin: 0;
    padding: 80px var(--gutter) 32px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: var(--bg-raised);
    border-left: 1px solid var(--line);
    box-shadow: -20px 0 60px var(--shadow);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* The panel itself never leaves the viewport — a fixed element parked
       off-screen is not clipped by overflow on an ancestor, so it would add
       horizontal scroll of its own. The slide happens on the contents, which
       the panel clips. */
    opacity: 0;
    visibility: hidden;
    transition: opacity .24s ease, visibility 0s linear .24s;
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity .24s ease, visibility 0s;
  }
  .nav > * {
    transform: translateX(18px);
    transition: transform .28s cubic-bezier(.22, .61, .36, 1);
  }
  .nav.is-open > * { transform: translateX(0); }

  .nav__list { flex-direction: column; gap: 0; }
  .nav__link {
    display: block;
    padding: 14px 0;
    font-size: 18px;
    color: var(--text);
    border-bottom: 1px solid var(--line);
  }
  .nav__cta {
    display: inline-flex;
    margin-top: 24px;
    align-self: flex-start;
  }

  .products { grid-template-columns: minmax(0, 1fr); }
  .support__head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .house { grid-template-columns: minmax(0, 1fr); }
  .contact { grid-template-columns: minmax(0, 1fr); }
}

/* Phones */
@media (max-width: 720px) {
  .hero__grid-bg { background-size: 40px 40px; }
  .stages { grid-template-columns: minmax(0, 1fr); }
  .stage:last-child { grid-column: auto; }

  /* The support table becomes one card per row: the header row is dropped
     and each cell carries its own label. */
  .table-wrap { border: none; border-radius: 0; }
  .tiers thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tiers, .tiers tbody, .tiers tr, .tiers th, .tiers td { display: block; width: auto; }
  .tiers tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 6px 0;
  }
  .tiers tr + tr { margin-top: 12px; }
  .tiers th, .tiers td {
    border-top: none;
    padding: 10px clamp(18px, 4vw, 22px);
  }
  .tiers tbody th { padding-top: 16px; }
  .tiers tbody td:last-child { padding-bottom: 16px; }
  .tiers td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
  }

  .contact__row { gap: 4px 16px; }
  .contact__key { min-width: 0; flex-basis: 100%; padding-top: 0; }

  .site-footer__inner { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .capabilities { grid-template-columns: minmax(0, 1fr); }
  .skills { grid-template-columns: minmax(0, 1fr); }
  .btn-row .btn { flex: 1 1 100%; }
  .placeholder--shot { min-height: 160px; }
}

/* --- Motion / print ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .site-header, .nav-scrim, .hero__grid-bg, .form__submit { display: none !important; }
  body { background: #fff; color: #000; }
  .band--raised, .site-footer, .stage, .product, .form { background: #fff; }
}
