/* ==========================================================================
   MJAF — estilos
   ========================================================================== */

@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/geist-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../assets/fonts/geist-mono-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #08090b;
  --bg-2: #101216;
  --bg-3: #191c21;
  --fg: #f2f3f5;
  --muted: #9298a3;
  --faint: #7c828c; /* ≥ 4.5:1 on --bg and --bg-2 */
  --accent: #c9cdd3;
  --line: rgba(242, 243, 245, 0.08);
  --line-2: rgba(242, 243, 245, 0.14);
  --line-3: rgba(242, 243, 245, 0.28);
  --danger: #e8a0a0;

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --radius: 4px;
  --radius-lg: 8px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --header-h: 68px;
  --section-y: clamp(96px, 14vw, 176px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-top: var(--header-h);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--fg); color: var(--bg); }

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

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

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius);
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

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

/* ---------- type primitives ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 450;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow__idx {
  color: var(--fg);
  padding-right: 10px;
  border-right: 1px solid var(--line-2);
}
.eyebrow__sep { color: var(--faint); }

.section-title {
  font-size: clamp(2rem, 4.6vw, 3.75rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 18ch;
}
.section-lead {
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.65;
  max-width: 56ch;
  text-wrap: pretty;
}

/* ---------- buttons ---------- */
.btn {
  --h: 48px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--h);
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  background: none;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn--sm { --h: 40px; padding: 0 16px; font-size: 0.875rem; }
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary:hover { background: #fff; }
.btn--ghost { border-color: var(--line-2); color: var(--fg); }
.btn--ghost:hover { border-color: var(--line-3); background: rgba(242, 243, 245, 0.04); }
.btn:active { transform: translateY(1px); }
.btn__icon {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}
.btn__icon--fill { fill: currentColor; stroke: none; }
.btn:hover .btn__icon:not(.btn__icon--fill) { transform: translateY(2px); }

/* ---------- header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(8, 9, 11, 0.72);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.logo__mark { width: 22px; height: 22px; fill: var(--fg); }
.logo__word {
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.14em;
}

.nav { display: flex; align-items: center; }
.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: 6px;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav__link:hover,
.nav__link[aria-current='true'] { color: var(--fg); }
.nav__link[aria-current='true']::after { transform: scaleX(1); }
.nav__link--cta {
  margin-left: 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--fg);
  padding: 0 16px;
}
.nav__link--cta::after { display: none; }
.nav__link--cta:hover { border-color: var(--line-3); }

.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  align-items: center;
  justify-content: center;
}
.nav__toggle-bars { position: relative; width: 20px; height: 8px; }
.nav__toggle-bars span {
  position: absolute; left: 0; right: 0;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}
.nav__toggle-bars span:first-child { top: 0; }
.nav__toggle-bars span:last-child { top: 6.5px; }
.nav__toggle[aria-expanded='true'] .nav__toggle-bars span:first-child { top: 3.25px; transform: rotate(45deg); }
.nav__toggle[aria-expanded='true'] .nav__toggle-bars span:last-child { top: 3.25px; transform: rotate(-45deg); }

@media (max-width: 899px) {
  .nav__toggle { display: inline-flex; }
  .nav__list {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    height: calc(100dvh - var(--header-h));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 24px var(--gutter) max(32px, env(safe-area-inset-bottom));
    background: var(--bg);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }
  .nav__list.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  }
  .nav__list li { border-bottom: 1px solid var(--line); }
  .nav__link {
    width: 100%;
    min-height: 64px;
    padding: 0;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--fg);
  }
  .nav__link::after { display: none; }
  .nav__link[aria-current='true']::before {
    content: '';
    width: 6px; height: 6px;
    margin-right: 14px;
    background: var(--fg);
    border-radius: 50%;
  }
  .nav__link--cta { margin: 24px 0 0; padding: 0 20px; justify-content: center; min-height: 56px; font-size: 1.0625rem; }
  .nav__list li:last-child { border-bottom: 0; }
  html.menu-open { overflow: hidden; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding-top: var(--header-h);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  /* fine engineering grid, faded at the edges */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 65% 45%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 65% 45%, #000 0%, transparent 75%);
  opacity: 0.55;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 45% at 68% 48%, rgba(201, 205, 211, 0.07), transparent 70%);
}

.hero__visual {
  position: absolute;
  z-index: -1;
  inset: var(--header-h) 0 0 34%;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero__visual canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hero__visual.is-live canvas { opacity: 1; }

.hero-fallback {
  width: min(78%, 560px);
  height: auto;
  transition: opacity 0.8s var(--ease);
}
.hero__visual.is-live .hero-fallback { opacity: 0; }
.hero-fallback .f-top { fill: #2a2e35; stroke: rgba(242, 243, 245, 0.12); stroke-width: 0.6; }
.hero-fallback .f-front { fill: #14171b; stroke: rgba(242, 243, 245, 0.06); stroke-width: 0.6; }
.hero-fallback .f-side { fill: #1d2026; stroke: rgba(242, 243, 245, 0.06); stroke-width: 0.6; }
.hero-fallback .led { stroke: rgba(242, 243, 245, 0.75); stroke-width: 1.4; stroke-linecap: round; }
.hero-fallback .link { stroke: rgba(242, 243, 245, 0.28); stroke-width: 0.8; stroke-dasharray: 3 4; fill: none; }
.hero-fallback .node { fill: var(--fg); }

.hero__inner {
  display: flex;
  align-items: center;
  padding-block: clamp(48px, 8vh, 96px);
}
.hero__content { max-width: 640px; }
.hero__eyebrow { margin-bottom: 28px; }
.hero__title {
  font-size: clamp(2.6rem, 6.4vw, 5.75rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero__lead {
  margin-top: 28px;
  max-width: 50ch;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.35vw, 1.1875rem);
  line-height: 1.6;
  text-wrap: pretty;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}
.hero__foot {
  padding-bottom: clamp(24px, 4vh, 40px);
}
.hero__areas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__areas span[aria-hidden] { color: var(--faint); }

/* word-level headline reveal */
.word { display: inline-block; overflow: clip; overflow-clip-margin: 0.12em; vertical-align: top; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.word > span { display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  .hero__eyebrow, .hero__lead, .hero__actions, .hero__areas {
    animation: rise 1s var(--ease) both;
  }
  .hero__eyebrow { animation-delay: 0.05s; }
  .hero__lead { animation-delay: 0.45s; }
  .hero__actions { animation-delay: 0.55s; }
  .hero__areas { animation-delay: 0.7s; }
  .word > span {
    animation: word-up 1.1s var(--ease) both;
    animation-delay: calc(0.12s + var(--w, 0) * 0.055s);
  }
  .hero-fallback { animation: fade 1.4s var(--ease) 0.2s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes word-up { from { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; } }

@media (min-width: 900px) and (max-width: 1279px) {
  .hero__visual { left: 42%; }
}
@media (max-width: 899px) {
  .hero { grid-template-rows: auto 1fr auto; }
  .hero__visual {
    position: relative;
    inset: auto;
    height: clamp(260px, 42svh, 420px);
    margin-top: 8px;
  }
  .hero::before {
    -webkit-mask-image: radial-gradient(ellipse 90% 40% at 50% 25%, #000 0%, transparent 80%);
    mask-image: radial-gradient(ellipse 90% 40% at 50% 25%, #000 0%, transparent 80%);
  }
  .hero::after { background: radial-gradient(ellipse 70% 30% at 50% 25%, rgba(201, 205, 211, 0.07), transparent 70%); }
  .hero-fallback { width: min(70%, 340px); }
  .hero__inner { align-items: flex-start; padding-block: 8px 40px; }
  .hero__eyebrow { margin-bottom: 18px; }
  .hero__lead { margin-top: 20px; }
  .hero__actions { margin-top: 28px; }
}
@media (max-width: 479px) {
  .hero__actions .btn { flex: 1 1 100%; }
}

/* ---------- sections ---------- */
.section {
  position: relative;
  padding-block: var(--section-y);
  border-top: 1px solid var(--line);
}
.section--alt { background: var(--bg-2); }
.section-head {
  display: grid;
  gap: 20px;
  margin-bottom: clamp(48px, 7vw, 88px);
}
.section-head--tight { margin-bottom: 32px; }

/* reveal on scroll (activated by JS via .reveal-ready) */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: var(--reveal-delay, 0s);
  }
  .reveal-ready [data-reveal].is-visible { opacity: 1; transform: none; }
}

/* ---------- services ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.service {
  position: relative;
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 320px;
  padding: clamp(24px, 3vw, 40px);
  background: var(--bg);
  transition: background-color 0.4s var(--ease);
}
.service::before {
  /* hairline that draws in on hover */
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--fg), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.service:hover { background: #0c0d10; }
.service:hover::before { transform: scaleX(1); }
.service--wide { grid-column: span 7; }
.service--narrow { grid-column: span 4; }
.service--feature {
  grid-column: span 8;
  display: grid;
  grid-template-columns: 1fr minmax(200px, 0.8fr);
  gap: clamp(24px, 4vw, 56px);
}
.service--feature .service__body { display: flex; flex-direction: column; gap: 16px; }
.service--row {
  grid-column: span 6;
  min-height: 0;
}
.service__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: auto;
  padding-bottom: 32px;
}
.service__icon {
  width: 40px; height: 40px;
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.6s var(--ease);
}
.service__icon circle[r='.6'], .service__icon circle[r='.7'] { fill: var(--fg); }
.service:hover .service__icon { transform: translateY(-3px); }
.service__idx {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
  letter-spacing: 0.1em;
}
.service__title {
  font-size: clamp(1.25rem, 1.8vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.service--wide .service__title { font-size: clamp(1.5rem, 2.6vw, 2.25rem); letter-spacing: -0.03em; }
.service__text { color: var(--muted); max-width: 48ch; text-wrap: pretty; }
.service__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  min-height: 44px;
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
}
.service__link span[aria-hidden] { transition: transform 0.35s var(--ease); }
.service__link:hover span[aria-hidden] { transform: translateX(4px); }

.spec {
  align-self: end;
  border-top: 1px solid var(--line-2);
  font-size: 0.875rem;
}
.spec li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.spec__k {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: right;
}
.services__also {
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 1023px) {
  .service, .service--wide, .service--narrow, .service--row { grid-column: span 6; }
  .service--feature { grid-column: span 12; }
}
@media (max-width: 679px) {
  .services { grid-template-columns: 1fr; }
  .service, .service--wide, .service--narrow, .service--row, .service--feature { grid-column: auto; min-height: 0; }
  .service--feature { grid-template-columns: 1fr; }
  .service__top { padding-bottom: 20px; }
}

/* ---------- infrastructure diagram ---------- */
.infra {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(48px, 7vw, 112px);
  align-items: start;
}
.infra__copy { position: sticky; top: calc(var(--header-h) + 48px); }
.infra__note {
  padding-left: 16px;
  border-left: 1px solid var(--line-3);
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: 52ch;
}

.arch {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 1px 1px, rgba(242, 243, 245, 0.05) 1px, transparent 1.5px) 0 0 / 16px 16px,
    var(--bg);
  overflow: hidden;
}
.arch__caption {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.arch__legend { display: inline-flex; align-items: center; gap: 8px; }
.arch__swatch { width: 14px; height: 0; border-top: 1.5px solid var(--fg); }
.arch__swatch--res { border-top-style: dashed; border-top-color: var(--accent); }
.arch__status { margin-left: auto; color: var(--fg); min-width: 12ch; text-align: right; }

.arch__grid {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 44px;
  padding: 12px 0 12px 20px;
}
.arch__track {
  position: relative;
  margin: 26px 0;
}
.arch__track::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1px;
  background: var(--line-2);
}
.arch__packet {
  position: absolute;
  left: 50%; top: 0;
  width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 4px rgba(242, 243, 245, 0.08), 0 0 16px rgba(242, 243, 245, 0.5);
  opacity: 0;
}
.arch__layers { position: relative; }
.arch__layer {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-areas: 'id name' 'id tech';
  column-gap: 12px;
  row-gap: 2px;
  align-items: baseline;
  padding: 14px 16px 14px 0;
  margin-left: 14px;
  border-bottom: 1px solid var(--line);
  transition: color 0.4s var(--ease);
}
.arch__layer:last-child { border-bottom: 0; }
.arch__node {
  /* centred on the track: grid padding 20 + track 28/2 - (track 28 + layer margin 14 + padding 20) - 9/2 */
  position: absolute;
  left: -32.5px;
  top: 50%;
  width: 9px; height: 9px;
  margin-top: -4.5px;
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: var(--bg);
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.arch__node::after {
  /* connector from the track node to the layer */
  content: '';
  position: absolute;
  left: calc(100% + 2px);
  top: 50%;
  width: 18px;
  height: 1px;
  background: var(--line-2);
}
.arch__id { grid-area: id; font-family: var(--mono); font-size: 0.6875rem; color: var(--faint); letter-spacing: 0.08em; }
.arch__name { grid-area: name; font-size: 0.9875rem; font-weight: 500; letter-spacing: -0.01em; color: var(--muted); transition: color 0.35s var(--ease); }
.arch__tech { grid-area: tech; font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.04em; color: var(--faint); }
.arch__layer.is-active .arch__name { color: var(--fg); }
.arch__layer.is-active .arch__node {
  background: var(--fg);
  border-color: var(--fg);
  box-shadow: 0 0 12px rgba(242, 243, 245, 0.45);
}
.arch.is-static .arch__name { color: var(--fg); }

.arch__monitor {
  position: relative;
  display: flex;
  justify-content: center;
  border-left: 1px solid var(--line);
  margin-block: -12px;
}
.arch__monitor-line {
  position: absolute;
  top: 26px; bottom: 26px;
  left: 50%;
  width: 0;
  border-left: 1px dashed var(--line-3);
}
.arch__monitor-label {
  position: relative;
  align-self: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 12px 0;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

@media (max-width: 959px) {
  .infra { grid-template-columns: 1fr; }
  .infra__copy { position: static; }
}
@media (max-width: 479px) {
  .arch__caption { gap: 14px; padding-inline: 16px; flex-wrap: wrap; }
  .arch__status { display: none; }
  .arch__grid { padding-left: 12px; grid-template-columns: 22px 1fr 36px; }
  .arch__layer { grid-template-columns: 26px 1fr; column-gap: 8px; margin-left: 12px; padding-right: 10px; }
  .arch__node { left: -27.5px; }
  .arch__node::after { width: 13px; }
}

/* ---------- methodology ---------- */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 3vw, 48px);
  padding-top: 0;
}
.steps::before, .steps::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 46px;
  height: 1px;
  background: var(--line-2);
}
.steps::after {
  background: var(--fg);
  transform: scaleX(var(--progress, 1));
  transform-origin: left;
}
.step { position: relative; }
.step__num {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 20px;
}
.step__dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 11px; height: 11px;
  margin-bottom: 36px;
  border: 1px solid var(--fg);
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 6px var(--bg);
  transition: background-color 0.4s var(--ease);
}
.step__title {
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}
.step__text { color: var(--muted); max-width: 30ch; text-wrap: pretty; }

@media (prefers-reduced-motion: no-preference) {
  .reveal-ready .steps::after { transform: scaleX(0); transition: transform 2.2s var(--ease-io) 0.2s; }
  .reveal-ready .steps.is-visible::after { transform: scaleX(1); }
  .reveal-ready .steps .step__dot { background: var(--bg); transition: background-color 0.5s var(--ease); }
  .reveal-ready .steps.is-visible .step__dot { background: var(--fg); }
  .reveal-ready .steps .step:nth-child(1) .step__dot { transition-delay: 0.25s; }
  .reveal-ready .steps .step:nth-child(2) .step__dot { transition-delay: 0.85s; }
  .reveal-ready .steps .step:nth-child(3) .step__dot { transition-delay: 1.45s; }
  .reveal-ready .steps .step:nth-child(4) .step__dot { transition-delay: 2.05s; }
  .reveal-ready .steps .step > :not(.step__dot) { opacity: 0; transform: translateY(10px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
  .reveal-ready .steps.is-visible .step > :not(.step__dot) { opacity: 1; transform: none; }
  .reveal-ready .steps .step:nth-child(2) > :not(.step__dot) { transition-delay: 0.6s; }
  .reveal-ready .steps .step:nth-child(3) > :not(.step__dot) { transition-delay: 1.2s; }
  .reveal-ready .steps .step:nth-child(4) > :not(.step__dot) { transition-delay: 1.8s; }
  /* the list itself shouldn't fade as a block */
  .reveal-ready .steps[data-reveal] { opacity: 1; transform: none; }
}

@media (max-width: 899px) {
  .steps { grid-template-columns: 1fr; gap: 0; padding-left: 36px; }
  .steps::before, .steps::after {
    left: 5px; right: auto;
    top: 8px; bottom: 8px;
    width: 1px; height: auto;
  }
  .steps::after { transform: scaleY(var(--progress, 1)); transform-origin: top; }
  .step { padding-bottom: 40px; }
  .step:last-child { padding-bottom: 0; }
  .step__dot { position: absolute; left: -36px; top: 4px; margin: 0; }
  .step__num { margin-bottom: 10px; }
}
@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  .reveal-ready .steps::after { transform: scaleY(0); }
  .reveal-ready .steps.is-visible::after { transform: scaleY(1); }
}

/* ---------- projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.project {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.4s var(--ease);
}
.project:hover { border-color: var(--line-3); }
.project__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.project__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.project:hover .project__media img { transform: scale(1.02); }
.project__badge {
  position: absolute;
  bottom: 14px; left: 14px;
  padding: 5px 9px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: rgba(8, 9, 11, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.project__body { display: grid; gap: 14px; padding: clamp(20px, 2.6vw, 32px); }
.project__cat {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.project__name { font-size: clamp(1.375rem, 2vw, 1.75rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.project__problem { color: var(--muted); max-width: 60ch; }
.project__problem strong { color: var(--fg); font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 4px 9px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--accent);
}
.project__details { border-top: 1px solid var(--line); padding-top: 6px; }
.project__details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.project__details summary::-webkit-details-marker { display: none; }
.project__details summary::after {
  content: '+';
  font-family: var(--mono);
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.3s var(--ease);
}
.project__details[open] summary::after { transform: rotate(45deg); }
.project__details p { color: var(--muted); padding: 4px 0 8px; max-width: 64ch; }
.project__links { display: flex; flex-wrap: wrap; gap: 10px; }

.project-slot {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-height: 320px;
  padding: clamp(24px, 3vw, 36px);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(242, 243, 245, 0.018) 14px 15px);
}
.project-slot__k { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.project-slot__title { font-size: 1.375rem; font-weight: 500; letter-spacing: -0.025em; line-height: 1.2; margin: 14px 0 10px; }
.project-slot__text { color: var(--muted); font-size: 0.9375rem; }

@media (max-width: 959px) {
  .project, .project-slot { grid-column: span 12; }
  .project-slot { min-height: 0; }
}

/* ---------- about ---------- */
.about {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
}
.about__head { grid-column: 1 / span 5; margin-bottom: 0; align-content: start; }
.about__body { grid-column: 7 / span 6; display: grid; gap: 24px; color: var(--muted); font-size: 1.0625rem; }
.about__lead {
  color: var(--fg);
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
.principles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(64px, 9vw, 120px);
  border-top: 1px solid var(--line-2);
}
.principles li {
  display: grid;
  gap: 10px;
  padding: 28px 24px 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}
.principles li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.principles__k { color: var(--fg); font-weight: 500; letter-spacing: -0.01em; font-size: 1rem; }

@media (max-width: 899px) {
  .about__head, .about__body { grid-column: 1 / -1; }
  .about__body { margin-top: 32px; }
  .principles { grid-template-columns: 1fr 1fr; }
  .principles li { padding: 24px 16px 24px 0; border-bottom: 1px solid var(--line); }
  .principles li + li { padding-left: 0; border-left: 0; }
  .principles li:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
}
@media (max-width: 479px) {
  .principles { grid-template-columns: 1fr; }
  .principles li:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* ---------- contact ---------- */
.section--contact {
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, rgba(201, 205, 211, 0.05), transparent 70%),
    var(--bg);
}
.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(48px, 6vw, 96px);
  align-items: start;
}
.contact__intro { display: grid; gap: 20px; align-content: start; }
.channels { display: grid; gap: 0; margin-top: 24px; border-top: 1px solid var(--line-2); }
.channel { padding: 24px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.channel__label { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.channel__value {
  justify-self: start;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--fg), var(--fg)) left bottom / 0 1px no-repeat;
  transition: background-size 0.45s var(--ease);
  user-select: all;
}
.channel__value:hover { background-size: 100% 1px; }
.channel__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btn.is-copied { border-color: var(--fg); }

.contact__form-wrap {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  padding: clamp(20px, 3.4vw, 44px);
}
.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 20px;
}
.field { display: grid; gap: 8px; align-content: start; }
.field--full { grid-column: 1 / -1; }
.field__label { font-size: 0.875rem; font-weight: 500; }
.field__opt { color: var(--faint); font-weight: 400; font-size: 0.8125rem; margin-left: 4px; }
.field__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 1rem; /* ≥16px avoids iOS zoom */
  line-height: 1.4;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  appearance: none;
}
.field__input::placeholder { color: var(--faint); }
.field__input:hover { border-color: var(--line-3); }
.field__input:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px rgba(242, 243, 245, 0.1); }
.field__input[aria-invalid='true'] { border-color: var(--danger); }
.field__textarea { resize: vertical; min-height: 148px; }
.field__select { position: relative; }
.field__select::after {
  content: '';
  position: absolute;
  right: 16px; top: 50%;
  width: 7px; height: 7px;
  margin-top: -6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.field__select select { padding-right: 40px; cursor: pointer; }
.field__select option { background: var(--bg-2); color: var(--fg); }
.field__hint { font-family: var(--mono); font-size: 0.6875rem; color: var(--faint); letter-spacing: 0.04em; }
.field__error { font-size: 0.8125rem; color: var(--danger); }
.field__error:empty { display: none; }
.field--hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.field--check {
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: start;
  font-size: 0.875rem;
  color: var(--muted);
}
.field--check .field__error { grid-column: 1 / -1; }
.field--check a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-3); }
.check {
  appearance: none;
  width: 20px; height: 20px;
  margin: 1px 0 0;
  border: 1px solid var(--line-3);
  border-radius: 3px;
  background: var(--bg);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.check::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 1.5px solid var(--bg);
  border-bottom: 1.5px solid var(--bg);
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform 0.2s var(--ease);
}
.check:checked { background: var(--fg); border-color: var(--fg); }
.check:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.check[aria-invalid='true'] { border-color: var(--danger); }

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-top: 32px;
}
.form__fine { flex-basis: 100%; font-size: 0.8125rem; color: var(--faint); }
.btn--submit { min-width: 200px; }
.btn__spinner {
  display: none;
  width: 14px; height: 14px;
  border: 1.5px solid rgba(8, 9, 11, 0.25);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn--submit[aria-busy='true'] .btn__spinner { display: block; }
.btn--submit[aria-busy='true'] { cursor: progress; }
.btn--submit:disabled { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.form__alert {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(232, 160, 160, 0.35);
  border-radius: var(--radius);
  background: rgba(232, 160, 160, 0.05);
}
.form__alert:focus { outline: none; }
.form__alert-title { font-weight: 500; margin-bottom: 4px; }
.form__alert-text { color: var(--muted); font-size: 0.9375rem; }
.form__alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.form-success {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: clamp(8px, 2vw, 24px) 0;
}
.form-success[hidden] { display: none; }
.form-success:focus { outline: none; }
.form-success__icon { width: 44px; height: 44px; fill: none; stroke: var(--fg); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px; }
.form-success__title { font-size: 1.75rem; font-weight: 500; letter-spacing: -0.03em; }
.form-success__text { color: var(--muted); max-width: 52ch; margin-bottom: 12px; }
.form-success__actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .form-success:not([hidden]) { animation: rise 0.7s var(--ease) both; }
  .form-success__icon path { stroke-dasharray: 24; animation: draw 0.8s var(--ease) 0.2s both; }
}
@keyframes draw { from { stroke-dashoffset: 24; } }

.contact__direct {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}
.contact__direct-label { color: var(--muted); }
.contact__direct a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s var(--ease);
}
.contact__direct a:hover { text-decoration-color: var(--fg); }

@media (max-width: 959px) {
  .contact { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .form__grid { grid-template-columns: 1fr; }
  .btn--submit { width: 100%; }
  .channel__actions .btn { flex: 1 1 auto; }
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(64px, 9vw, 112px) 0 32px;
  font-size: 0.875rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr;
  gap: 40px 32px;
}
.footer__desc { margin-top: 16px; color: var(--muted); max-width: 32ch; }
.footer__title {
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.footer__col ul { display: grid; gap: 2px; }
.footer__col a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
  overflow-wrap: anywhere;
  transition: color 0.2s var(--ease);
}
.footer__col a:hover { color: var(--fg); }
.footer__plain li { color: var(--muted); padding: 5px 0; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer__claim { color: var(--fg); }
@media (max-width: 899px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 419px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .btn__spinner { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .hero__visual, .contact__form-wrap { display: none; }
  body { background: #fff; color: #000; }
}

/* ---------- standalone text pages (privacy notice, 404) ---------- */
.legal {
  max-width: calc(760px + var(--gutter) * 2);
  padding-top: calc(var(--header-h) + clamp(56px, 9vw, 112px));
  padding-bottom: clamp(72px, 10vw, 128px);
}
.legal .section-title { margin: 18px 0 12px; max-width: none; }
.legal__meta { font-family: var(--mono); font-size: 0.75rem; color: var(--faint); letter-spacing: 0.06em; margin-bottom: 48px; }
.legal h2 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; margin: 40px 0 10px; }
.legal p { color: var(--muted); max-width: 68ch; }
.legal a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-3); }
.legal a:hover { text-decoration-color: var(--fg); }
.legal .btn { text-decoration: none; margin-top: 32px; }
.footer--simple .footer__bottom { margin-top: 0; border-top: 0; padding-top: 0; }
