/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #05060a;
  --bg-2: #0b0d14;
  --line: rgba(233, 236, 242, 0.1);
  --line-2: rgba(233, 236, 242, 0.2);
  --text: #e9ecf2;
  --muted: #8b91a1;
  --accent: #ff6a3d;
  --accent-glow: rgba(255, 106, 61, 0.35);

  --font: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(16px, 5vw, 64px);
  --max: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 300; line-height: 1.05; }
p { margin: 0; }
em { font-style: normal; color: var(--accent); }
::selection { background: var(--accent); color: var(--bg); }

#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Shared ---------- */
.label, .eyebrow, .mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font: 500 15px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s, color 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px var(--accent-glow); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn span { transition: transform 0.3s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--text); box-shadow: none; }
.btn--small { padding: 10px 18px; font-size: 14px; }
.btn--full { width: 100%; }

.link { color: var(--accent); text-decoration: none; font-weight: 500; }
.link span { display: inline-block; transition: transform 0.3s var(--ease); }
.link:hover span { transform: translateX(4px); }

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

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--pad);
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(5, 6, 10, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}
.nav__logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  font: 600 15px/1 var(--font);
  font-stretch: 125%;
  letter-spacing: 0.2em;
}
.logo { width: 44px; height: 22px; fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; }
.nav__links { display: flex; gap: 32px; }
.nav__links a {
  position: relative;
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.3s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__actions { display: flex; align-items: center; gap: 20px; }
.lang { display: flex; gap: 2px; font: 12px var(--mono); letter-spacing: 0.08em; }
.lang > * { padding: 6px 7px; border-radius: 4px; color: var(--muted); text-decoration: none; }
.lang [aria-current] { color: var(--text); background: rgba(233, 236, 242, 0.08); }
.lang a { transition: color 0.3s; }
.lang a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--pad) 40px;
  max-width: var(--max);
  margin: 0 auto;
}
.hero__content { position: relative; z-index: 1; }
.hero__title {
  margin: 28px 0 32px;
  font-size: clamp(36px, 7.4vw, 112px);
  font-weight: 250;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__title .line > span {
  display: inline-block;
  transform: translateY(105%);
  animation: rise 1.2s var(--ease) forwards;
}
.hero__title .line:nth-child(2) > span { animation-delay: 0.12s; }
.hero__title .line:nth-child(3) > span { animation-delay: 0.24s; }
.line--accent { color: var(--accent); font-weight: 400; }
@keyframes rise { to { transform: translateY(0); } }

.hero__lead {
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
  opacity: 0;
  animation: fade 1s var(--ease) 0.6s forwards;
}
.hero__cta {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 40px;
  opacity: 0;
  animation: fade 1s var(--ease) 0.8s forwards;
}
.eyebrow { opacity: 0; animation: fade 1s var(--ease) 0.1s forwards; }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.hero__orbit {
  position: absolute;
  top: 50%;
  right: calc(var(--pad) * -1 - 120px);
  width: min(78vw, 820px);
  aspect-ratio: 1;
  transform: translateY(-50%) rotateX(62deg) rotateZ(-18deg);
  opacity: 0;
  animation: fade-only 2.4s var(--ease) 0.4s forwards;
  pointer-events: none;
}
@keyframes fade-only { to { opacity: 1; } }
.hero__orbit svg { width: 100%; height: 100%; overflow: visible; }
.ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.ring--dash { stroke-dasharray: 2 8; stroke: rgba(233, 236, 242, 0.3); }
.sat { transform-origin: 300px 300px; }
.sat circle { fill: var(--text); }
.sat--a { animation: orbit 60s linear infinite; }
.sat--a circle { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.sat--b { animation: orbit 34s linear infinite reverse; }
.sat--c { animation: orbit 20s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }

.telemetry {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 80px 0 0;
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: fade 1s var(--ease) 1s forwards;
}
.telemetry > div { padding: 20px 20px 0 0; }
.telemetry > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.telemetry dt { font: 11px var(--mono); color: var(--accent); letter-spacing: 0.15em; }
.telemetry dd { margin: 0; }
.telemetry dd:not(.unit) { font-size: 28px; font-weight: 300; font-stretch: 112%; margin-top: 6px; }
.telemetry .unit { font: 12px var(--mono); color: var(--muted); }

/* ---------- Sections ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 160px) var(--pad);
}
.section__head { max-width: 860px; margin-bottom: 64px; }
.section__head h2, .project h2, .contact h2 {
  margin-top: 20px;
  font-size: clamp(32px, 4.6vw, 60px);
  font-weight: 300;
  font-stretch: 108%;
  letter-spacing: -0.015em;
}

/* Services */
.services {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.service {
  position: relative;
  padding: 32px 28px 40px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 300px;
  display: flex; flex-direction: column;
  background: rgba(5, 6, 10, 0.5);
  transition: background 0.5s var(--ease);
  overflow: hidden;
}
.service::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 106, 61, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.service:hover::before { opacity: 1; }
.service__num { font: 12px var(--mono); color: var(--muted); }
.service__icon {
  width: 44px; height: 44px;
  margin: 40px 0 auto;
  fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.4s, transform 0.6s var(--ease);
}
.service:hover .service__icon { stroke: var(--accent); transform: translateY(-4px); }
.service h3 { margin-top: 32px; font-size: 21px; font-weight: 500; font-stretch: 105%; }
.service p { margin-top: 10px; color: var(--muted); font-size: 15px; }
.service--cta { justify-content: flex-end; background: var(--bg-2); }
.service--cta .link { margin-top: 20px; }

/* Clients */
.clients {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) var(--pad) 0;
}
.clients__title { text-align: center; margin-bottom: 28px; }
.clients__list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.client {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 36px 16px 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.4s, background 0.4s;
}
.client:hover { color: var(--text); background: rgba(255, 255, 255, 0.015); }
.client__mark {
  width: 56px; height: 56px;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.6s var(--ease);
}
.client__mark .faint { opacity: 0.45; }
.client__mark .accent { stroke: var(--accent); }
.client:hover .client__mark { transform: translateY(-3px) rotate(-4deg); }
.client__name { font-size: 22px; line-height: 1; letter-spacing: 0.02em; }
.client__tag { font: 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.6; }

.client__name--spin { font-weight: 400; font-stretch: 100%; letter-spacing: 0.06em; }
.client__name--spin span { color: var(--accent); }
.client__name--safire { font-weight: 300; font-stretch: 112%; display: inline-flex; align-items: center; gap: 6px; }
.client__name--safire b {
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
  transition: -webkit-text-stroke-color 0.4s;
}
.client:hover .client__name--safire b { -webkit-text-stroke-color: var(--accent); }
.client__name--safire small {
  font: 9px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.client__name--quadsat { font-weight: 250; font-stretch: 120%; letter-spacing: 0.04em; }
.client__name--quadsat b { font-weight: 500; color: var(--text); }
.client__name--wiser { font-weight: 300; font-stretch: 125%; letter-spacing: 0.3em; margin-right: -0.3em; }

/* Countdown */
.countdown {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}
.countdown::before {
  content: "";
  position: absolute; top: 18px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--line-2), var(--accent));
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  transition: transform 1.6s var(--ease);
}
.countdown li { padding: 0 24px 0 0; }
.countdown .t {
  position: relative;
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg);
  font: 12px var(--mono);
  letter-spacing: 0.1em;
}
.countdown .t--go { border-color: var(--accent); color: var(--accent); }
.countdown h3 { margin-top: 28px; font-size: 20px; font-weight: 500; }
.countdown p { margin-top: 8px; color: var(--muted); font-size: 15px; }

/* Project */
.project {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.project__media {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}
.project__media img { transition: transform 1.2s var(--ease); }
.project__media:hover img { transform: scale(1.03); }
.project__media::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.025) 3px 4px);
  pointer-events: none;
}
.hud {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  display: flex; justify-content: space-between; gap: 12px;
  font: 11px var(--mono); letter-spacing: 0.12em; color: var(--muted);
}
.hud span:last-child { color: var(--accent); }
.project__text > p:not(.label) { margin-top: 24px; color: var(--muted); }
.project__text strong { color: var(--text); font-weight: 500; }
.specs { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.specs li { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.specs span { display: block; font: 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); margin-bottom: 2px; }

/* About */
.acronym b { font-weight: 500; color: var(--accent); }
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 6vw, 96px);
  color: var(--muted);
}
.about__lead { color: var(--text); font-size: clamp(20px, 2vw, 26px); font-weight: 300; line-height: 1.4; }

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.contact h2 { font-size: clamp(44px, 7vw, 96px); font-stretch: 112%; text-transform: uppercase; }
.contact__intro > p:not(.label) { margin-top: 24px; color: var(--muted); max-width: 440px; }
.contact__info { margin: 48px 0 0; display: grid; gap: 24px; }
.contact__info dt { font: 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.contact__info dd { margin: 4px 0 0; font-size: 18px; }
.contact__info a { text-decoration: none; border-bottom: 1px solid var(--line-2); transition: border-color 0.3s; }
.contact__info a:hover { border-color: var(--accent); }

.form {
  display: grid; gap: 22px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 13, 20, 0.75);
  backdrop-filter: blur(6px);
}
.field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-size: 14px; color: var(--muted); padding: 0; }
.field legend { margin-bottom: 10px; }
.opt { opacity: 0.6; }
input, textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: 16px var(--font);
  transition: border-color 0.3s, box-shadow 0.3s;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.15); }
input::placeholder, textarea::placeholder { color: #575d6c; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.25s var(--ease);
}
.chips label:hover span { color: var(--text); border-color: var(--text); }
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); cursor: pointer; }
.consent input { width: 16px; height: 16px; margin-top: 3px; padding: 0; accent-color: var(--accent); flex-shrink: 0; }
.hp { position: absolute; left: -9999px; }
.form__status { font: 13px var(--mono); min-height: 1em; }
.form__status.ok { color: #6ee7a8; }
.form__status.err { color: var(--accent); }

/* Footer */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--pad) 48px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  color: var(--muted);
  font-size: 14px;
}
.footer__brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 500; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.services .reveal:nth-child(4n+2) { transition-delay: 0.08s; }
.services .reveal:nth-child(4n+3) { transition-delay: 0.16s; }
.services .reveal:nth-child(4n+4) { transition-delay: 0.24s; }
.countdown .reveal:nth-child(2) { transition-delay: 0.1s; }
.countdown .reveal:nth-child(3) { transition-delay: 0.2s; }
.countdown .reveal:nth-child(4) { transition-delay: 0.3s; }
.countdown .reveal:nth-child(5) { transition-delay: 0.4s; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .services .reveal { transition-delay: 0s !important; }
  .project, .contact { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .countdown { grid-template-columns: 1fr; gap: 36px; padding-left: 28px; }
  .countdown::before { top: 0; bottom: 0; left: 0; right: auto; width: 1px; height: auto; transform: scaleY(var(--progress, 0)); transform-origin: top; background: linear-gradient(180deg, var(--line-2), var(--accent)); }
  .countdown h3 { margin-top: 14px; }
  .telemetry { grid-template-columns: repeat(2, 1fr); }
  .clients__list { grid-template-columns: repeat(2, 1fr); }
  .telemetry > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .about__grid { grid-template-columns: 1fr; }
  .hero__orbit { right: -60%; width: 150vw; }
}
@media (max-width: 560px) {
  .services { grid-template-columns: 1fr; }
  .service { min-height: 0; }
  .service__icon { margin: 28px 0 0; }
  .nav .btn--small { padding: 9px 14px; font-size: 13px; }
  .nav__logo span { display: none; }
  .nav__actions { gap: 10px; }
  .client__name--safire { flex-direction: column; }
  .hud span:nth-child(2) { display: none; }
}

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