:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --paper-3: #fffdf8;
  --ink: #14161c;
  --ink-soft: #3d4250;
  --mute: #7a7f8c;
  --line: rgba(20, 22, 28, 0.1);
  --accent: #1f3dff;
  --accent-soft: rgba(31, 61, 255, 0.12);
  --copper: #b8874a;
  --ok: #1c7a4d;
  --r: 22px;
  --d: "Syne", ui-sans-serif, system-ui, sans-serif;
  --b: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --m: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 18px 50px rgba(20, 22, 28, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--b);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

body.booting .site { opacity: 0; }
.site { opacity: 1; transition: opacity 0.7s ease; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 90;
  mix-blend-mode: multiply;
  transition: transform 0.15s ease;
}
.cursor.wide { transform: scale(3.4); opacity: 0.35; }
@media (pointer: coarse) { .cursor { display: none; } }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  display: grid;
  place-items: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}
.boot.hide {
  opacity: 0;
  visibility: hidden;
}
.boot-mark {
  text-align: center;
}
.boot-orbit {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  position: relative;
}
.boot-orbit i {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  animation: spin 2.4s linear infinite;
}
.boot-orbit i:last-child {
  inset: 18px;
  border-color: var(--accent);
  animation-duration: 1.2s;
  animation-direction: reverse;
}
.boot-orbit b {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--accent);
  border-radius: 50%;
  animation: spin 2.4s linear infinite;
  transform-origin: 4px 40px;
}
.boot p {
  margin: 0;
  font-family: var(--m);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

@keyframes spin { to { transform: rotate(360deg); } }

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  backdrop-filter: blur(16px);
  background: rgba(244, 241, 234, 0.72);
  border-bottom: 1px solid transparent;
}
.nav.scrolled { border-bottom-color: var(--line); }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--d);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 18px;
}
.logo svg { display: block; }
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-soft);
}
.nav-links a:hover { color: var(--ink); }
.nav-end { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }

.langs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-3);
}
.langs button {
  appearance: none;
  background: none;
  border: 0;
  padding: 7px 11px;
  font-family: var(--m);
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
  color: var(--mute);
}
.langs button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  transition: transform 0.25s ease, background 0.2s, color 0.2s;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { background: var(--paper-3); }
.btn .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(31, 61, 255, 0.6);
  animation: ping 1.8s ease infinite;
}
@keyframes ping {
  70% { box-shadow: 0 0 0 8px rgba(31, 61, 255, 0); }
}

.hero {
  position: relative;
  min-height: calc(100svh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  padding: 24px 48px 80px;
  gap: 24px;
}
#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding-top: 4vh;
}
.kicker {
  font-family: var(--m);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 22px;
}
h1, h2, h3 { font-family: var(--d); font-weight: 800; letter-spacing: -0.045em; margin: 0; }
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 6.1rem);
  line-height: 0.92;
  margin-bottom: 22px;
  white-space: pre-line;
}
.hero h1 .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.hero h1 .word > span {
  display: inline-block;
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes rise {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}
.lede {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-meta {
  margin-top: 36px;
  font-family: var(--m);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
}

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
section { padding: 88px 0; }
.sec-head { max-width: 720px; margin-bottom: 42px; }
.sec-head h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.02;
  margin: 10px 0 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat strong {
  display: block;
  font-family: var(--d);
  font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: -0.05em;
}
.stat span { color: var(--mute); font-size: 13px; }

.bento {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
}
.card {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px;
  position: relative;
  overflow: hidden;
  min-height: 210px;
  box-shadow: var(--shadow);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(31, 61, 255, 0.28);
}
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    linear-gradient(120deg, transparent 30%, rgba(31, 61, 255, 0.18), transparent 70%);
  transform: translateX(-80%);
  transition: transform 0.7s ease;
  pointer-events: none;
}
.card:hover::before { transform: translateX(80%); }
.card.wide { grid-column: 1 / 2; grid-row: 1 / 3; min-height: 440px; }
.card .idx {
  font-family: var(--m);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.12em;
}
.card h3 { font-size: 1.55rem; margin: 18px 0 10px; }
.card p { margin: 0; color: var(--ink-soft); }
.card .trace {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 120px;
  height: 70px;
  opacity: 0.5;
}

.range-track {
  position: relative;
  margin-top: 48px;
  padding: 8px 0 28px;
}
.range-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 22px;
  height: 1px;
  background: var(--line);
}
.range-line i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.range-track.inview .range-line i { width: 100%; }
.range-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
}
.range-steps li {
  list-style: none;
  text-align: center;
}
.range-steps b {
  display: block;
  width: 12px;
  height: 12px;
  margin: 16px auto 14px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.range-steps li:last-child b { background: var(--accent); border-color: var(--accent); }
.range-steps span {
  font-family: var(--d);
  font-weight: 700;
  font-size: 15px;
}

.sys {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  align-items: stretch;
}
.sys-node {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 14px;
  text-align: center;
  position: relative;
  transform: translateY(16px);
  opacity: 0;
  transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.inview .sys-node { transform: none; opacity: 1; }
.sys-node:nth-child(2) { transition-delay: 0.08s; }
.sys-node:nth-child(3) { transition-delay: 0.16s; }
.sys-node:nth-child(4) { transition-delay: 0.24s; }
.sys-node:nth-child(5) { transition-delay: 0.32s; }
.sys-node:nth-child(6) { transition-delay: 0.4s; }
.sys-node strong { display: block; font-family: var(--d); font-size: 15px; }
.sys-node em {
  display: block;
  font-style: normal;
  font-family: var(--m);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 6px;
}

.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.step {
  padding: 8px 8px 0 0;
  border-top: 1px solid var(--ink);
}
.step .n {
  font-family: var(--m);
  font-size: 12px;
  color: var(--accent);
  margin: 16px 0 24px;
}
.step h3 { font-size: 1.6rem; margin-bottom: 12px; }
.step p { color: var(--ink-soft); margin: 0; }

.lab {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: start;
}
.lab-side { display: grid; gap: 12px; }
.lab p.lead { font-size: 1.15rem; color: var(--ink-soft); }

.contact-card {
  background:
    radial-gradient(700px 240px at 12% 0%, rgba(31, 61, 255, 0.1), transparent 55%),
    var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 48px;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: start;
  gap: 8px;
}
.contact-card h2 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  margin: 8px 0 10px;
}
.contact-card .lede { margin-bottom: 22px; }
.btn-tg { gap: 10px; }
.tg-handle {
  margin-top: 14px;
  font-family: var(--m);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.brief {
  background:
    radial-gradient(800px 280px at 80% 0%, rgba(31, 61, 255, 0.08), transparent 60%),
    var(--paper-2);
  border-radius: 32px;
  padding: 48px;
  border: 1px solid var(--line);
}
form {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label span {
  display: block;
  font-family: var(--m);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 8px;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-3);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { min-height: 140px; resize: vertical; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips label {
  border: 1px solid var(--line);
  background: var(--paper-3);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.chips input { display: none; }
.chips label:has(input:checked) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.form-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.note, .status { font-size: 14px; color: var(--mute); }
.status.ok { color: var(--ok); }
.status.err { color: #9a3b2f; }
.mail {
  font-family: var(--m);
  font-size: 13px;
  color: var(--accent);
}

footer {
  padding: 28px 0 48px;
  color: var(--mute);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
footer a { color: var(--accent); }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: none;
}
.reveal.inview {
  animation: fadeup 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes fadeup {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1 .word > span, .boot-orbit i, .boot-orbit b, .btn .dot { animation: none; }
  .reveal, .sys-node { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 32px 20px 72px; }
  #stage { opacity: 0.55; }
  .stats, .bento, .process, .sys, .lab, .range-steps, .row {
    grid-template-columns: 1fr 1fr;
  }
  .card.wide { grid-column: auto; grid-row: auto; min-height: 240px; }
  .sys { grid-template-columns: repeat(3, 1fr); }
  .wrap { width: min(1180px, calc(100% - 32px)); }
  .brief, .contact-card { padding: 28px 20px; }
  .nav { padding: 12px 16px; }
}

@media (max-width: 640px) {
  .stats, .bento, .process, .lab, .range-steps, .row, .sys {
    grid-template-columns: 1fr;
  }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero h1 { font-size: 2.45rem; }
  section { padding: 64px 0; }
}
