:root {
  --bg: #060a18;
  --surface: rgba(255, 255, 255, .045);
  --border: rgba(255, 255, 255, .1);
  --text: #e9edf9;
  --muted: #a1abc8;
  --c1: #22d3ee;
  --c2: #8b5cf6;
  --c3: #f472b6;
  --ok: #34d399;
  --grad: linear-gradient(120deg, var(--c1), var(--c2) 55%, var(--c3));
  --radius: 20px;
  --max: 1160px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
svg { display: block; }

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: .7rem 1.1rem; border-radius: 10px;
  background: var(--text); color: var(--bg); font-weight: 700; text-decoration: none;
  transition: top .2s;
}
.skip:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--c1); outline-offset: 3px; border-radius: 6px; }

/* ---------- Animated background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 75%);
}
.blob {
  position: absolute; width: 44vmax; aspect-ratio: 1; border-radius: 50%;
  filter: blur(90px); opacity: .32;
  animation: drift 24s ease-in-out infinite alternate;
}
.blob--1 { background: var(--c1); top: -20vmax; left: -12vmax; }
.blob--2 { background: var(--c2); top: 8vmax; right: -16vmax; animation-delay: -8s; }
.blob--3 { background: var(--c3); bottom: -26vmax; left: 25vmax; opacity: .18; animation-delay: -16s; }
@keyframes drift { to { transform: translate(7vmax, 5vmax) scale(1.15); } }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 10, 24, .62);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 2rem; height: 72px; }

.brand {
  display: flex; align-items: center; gap: .65rem;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; text-decoration: none;
}
.brand svg { width: 34px; height: 34px; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover svg { transform: rotate(-12deg) scale(1.08); }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav { display: flex; gap: 1.75rem; margin-left: auto; }
.nav a {
  position: relative; color: var(--muted); font-weight: 500; font-size: .95rem; text-decoration: none;
  transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }

.lang {
  display: flex; gap: 2px; padding: 4px; margin: 0; list-style: none;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.lang a {
  display: block; padding: .32rem .72rem; border-radius: 999px;
  font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-decoration: none;
  color: var(--muted); transition: color .2s, background .2s;
}
.lang a:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.lang a[aria-current="page"] { background: var(--grad); color: var(--bg); }

@media (max-width: 760px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
}

@media (max-width: 400px) {
  .header__inner { gap: .75rem; }
  .brand { font-size: 1rem; gap: .5rem; }
  .brand svg { width: 30px; height: 30px; }
  .lang a { padding: .3rem .5rem; letter-spacing: .04em; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3.5rem, 8vw, 6rem); }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .4rem .95rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600;
}
.eyebrow i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  animation: ping 2s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
}

h1 {
  margin: 1.2rem 0;
  font-size: clamp(2.15rem, 6.5vw, 4.6rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 850;
  overflow-wrap: normal; word-break: normal; -webkit-hyphens: none; hyphens: none;
}
.grad {
  background: linear-gradient(120deg, var(--c1), var(--c2), var(--c3), var(--c1));
  background-size: 300% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: 300% center; } }

.lead { margin: 0; max-width: 36em; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.22rem); }

.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .9rem 1.5rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  transition: transform .25s, box-shadow .25s, background .25s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.btn:hover svg { transform: translateX(3px); }
.btn--primary { background: var(--grad); color: var(--bg); box-shadow: 0 12px 32px -12px rgba(139, 92, 246, .8); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 42px -12px rgba(139, 92, 246, .95); }
.btn--ghost { border: 1px solid var(--border); background: var(--surface); }
.btn--ghost:hover { background: rgba(255, 255, 255, .09); transform: translateY(-2px); }

.ticks { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; padding: 0; margin: 2.2rem 0 0; list-style: none; color: var(--muted); font-size: .93rem; }
.ticks li { display: flex; align-items: center; gap: .45rem; }
.ticks svg { width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Server rack illustration */
.rack-wrap { position: relative; display: grid; place-items: center; min-height: 380px; }
.rack-glow {
  position: absolute; width: 75%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .5), transparent 65%); filter: blur(24px);
}
.orbit {
  position: absolute; width: 360px; max-width: 96%; aspect-ratio: 1;
  border: 1px dashed rgba(255, 255, 255, .14); border-radius: 50%;
  animation: spin 32s linear infinite;
}
.orbit span {
  position: absolute; top: -6px; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%;
  background: var(--c1); box-shadow: 0 0 18px var(--c1);
}
.orbit span:nth-child(2) { top: auto; bottom: 12%; left: 5%; background: var(--c3); box-shadow: 0 0 18px var(--c3); }
.orbit span:nth-child(3) { top: 32%; left: auto; right: -6px; background: var(--c2); box-shadow: 0 0 18px var(--c2); }
@keyframes spin { to { transform: rotate(360deg); } }

.rack {
  position: relative; z-index: 2; width: min(300px, 82%); padding: 18px;
  border-radius: 22px; border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02));
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .1);
  transform: perspective(900px) rotateY(-14deg) rotateX(6deg);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { transform: perspective(900px) rotateY(-14deg) rotateX(6deg) translateY(-14px); } }
.unit {
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px; margin-bottom: 12px;
  border-radius: 12px; background: #0d1530; border: 1px solid rgba(255, 255, 255, .07);
}
.unit:last-child { margin-bottom: 0; }
.unit i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: blink 1.6s infinite; }
.unit i:nth-child(2) { background: var(--c1); box-shadow: 0 0 10px var(--c1); animation-delay: .4s; }
.unit i:nth-child(3) { background: var(--c2); box-shadow: 0 0 10px var(--c2); animation-delay: .9s; }
.unit:nth-child(2) i { animation-duration: 1.1s; }
.unit:nth-child(3) i { animation-duration: 2.1s; }
.unit:nth-child(4) i { animation-duration: .8s; }
.unit b {
  margin-left: auto; width: 45%; height: 6px; border-radius: 3px; opacity: .65;
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3), var(--c1)); background-size: 300% 100%;
  animation: load 3s linear infinite;
}
.unit:nth-child(2) b { width: 30%; animation-duration: 2.2s; }
.unit:nth-child(3) b { width: 52%; animation-duration: 4s; }
.unit:nth-child(4) b { width: 38%; animation-duration: 2.7s; }
@keyframes blink { 50% { opacity: .25; } }
@keyframes load { to { background-position: -300% 0; } }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .rack-wrap { min-height: 300px; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section__head { max-width: 660px; margin-bottom: 3rem; }
.kicker { color: var(--c1); font-weight: 800; letter-spacing: .16em; text-transform: uppercase; font-size: .8rem; }
h2 {
  margin: .6rem 0 1rem;
  font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.12; letter-spacing: -.03em;
  overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto;
}
.section__head p { margin: 0; color: var(--muted); font-size: 1.1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.25rem; padding: 0; margin: 0; list-style: none; }
.cards > li { display: flex; }
.card {
  position: relative; flex: 1; padding: 1.9rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); overflow: hidden;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), border-color .4s;
}
.card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(139, 92, 246, .2), transparent 45%);
}
.card:hover { transform: translateY(-6px); border-color: rgba(139, 92, 246, .5); }
.card:hover::before { opacity: 1; }
.card__icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 1.3rem; border-radius: 14px;
  background: linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(139, 92, 246, .2));
  border: 1px solid rgba(255, 255, 255, .09);
  transition: transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.card:hover .card__icon { transform: rotate(-8deg) scale(1.08); }
.card__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--c1); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin: 0 0 .5rem; font-size: 1.2rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.step {
  position: relative; padding: 2rem 1.75rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: linear-gradient(180deg, rgba(255, 255, 255, .06), transparent);
}
.step::before {
  counter-increment: step; content: "0" counter(step); display: block; margin-bottom: 1rem;
  font-size: 3rem; font-weight: 850; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.step h3 { margin: 0 0 .5rem; font-size: 1.25rem; }
.step p { margin: 0; color: var(--muted); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 5vw, 4rem);
  border-radius: 32px; border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(34, 211, 238, .1), rgba(139, 92, 246, .13) 50%, rgba(244, 114, 182, .08));
}
.contact h2 { max-width: 20ch; margin-inline: auto; }
.contact > p { max-width: 34em; margin: 0 auto; color: var(--muted); font-size: 1.1rem; }
.reveal-zone { display: grid; justify-items: center; gap: 1.5rem; margin-top: 2.5rem; padding-top: 4.5rem; }
.hint { margin: 0; color: var(--muted); font-size: .95rem; min-height: 1.6em; }

/* Envelope button */
.env {
  position: relative; width: 136px; height: 92px; padding: 0; border: 0; border-radius: 12px;
  background: none; cursor: pointer; perspective: 700px; -webkit-tap-highlight-color: transparent;
  animation: nudge 3.6s ease-in-out infinite;
  transition: transform .3s;
}
.env:hover { animation: none; transform: translateY(-5px) scale(1.04); }
.env:focus-visible { outline-offset: 12px; border-radius: 16px; }
.env > span { position: absolute; display: block; pointer-events: none; }
.env__ring { inset: -12px; z-index: 0; border-radius: 22px; border: 2px solid rgba(34, 211, 238, .6); animation: ring 2.2s ease-out infinite; }
.env__back { inset: 0; z-index: 1; border-radius: 12px; background: #141c3a; box-shadow: 0 22px 44px -14px rgba(0, 0, 0, .8); }
.env > .env__letter {
  left: 10px; right: 10px; top: 6px; height: 78px; z-index: 2; border-radius: 8px;
  display: grid; place-items: center; background-color: #f8fafc;
  background-image: repeating-linear-gradient(180deg, transparent 0 13px, rgba(15, 23, 42, .07) 13px 14px);
  transition: transform .75s cubic-bezier(.2, 1.5, .4, 1) .35s;
}
.env__letter svg { width: 34px; height: 34px; fill: none; stroke: #7c3aed; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.env__front {
  inset: 0; z-index: 3; border-radius: 12px;
  background: linear-gradient(135deg, var(--c1), var(--c2) 60%, var(--c3));
  clip-path: polygon(0 34%, 50% 70%, 100% 34%, 100% 100%, 0 100%);
}
.env__flap {
  left: 0; right: 0; top: 0; height: 64%; z-index: 4;
  background: linear-gradient(180deg, #a78bfa, #6d28d9);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transition: transform .5s cubic-bezier(.6, 0, .3, 1), z-index 0s linear .25s;
}
.env__spark { left: 50%; top: 35%; z-index: 5; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: var(--c1); opacity: 0; }
.env__spark:nth-child(3n) { background: var(--c3); }
.env__spark:nth-child(3n + 1) { background: var(--c2); }

.env.is-open { cursor: default; animation: none; transform: none; }
.env.is-open .env__flap { transform: rotateX(180deg); z-index: 1; }
.env.is-open .env__letter { transform: translateY(-64px) rotate(-3deg); }
.env.is-open .env__ring { animation: burst .9s ease-out forwards; }
.env.is-open .env__spark { animation: spark 1s cubic-bezier(.1, .8, .3, 1) .45s forwards; }

@keyframes nudge {
  0%, 78%, 100% { transform: none; }
  82% { transform: rotate(-6deg); }
  86% { transform: rotate(5deg); }
  90% { transform: rotate(-3deg); }
  94% { transform: rotate(2deg); }
}
@keyframes ring { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes burst { 0% { transform: scale(1); opacity: 1; border-color: var(--c3); } 100% { transform: scale(2); opacity: 0; } }
@keyframes spark {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-110px) scale(.3); }
}

/* Revealed address */
.mail {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem;
  max-width: 100%; padding: .55rem .55rem .55rem 1.4rem; border-radius: 999px;
  background: rgba(6, 10, 24, .78); border: 1px solid rgba(139, 92, 246, .55);
  box-shadow: 0 0 0 6px rgba(139, 92, 246, .09), 0 22px 50px -20px rgba(139, 92, 246, .85);
  clip-path: inset(0 50% 0 50% round 999px); opacity: 0;
  transition: clip-path .75s cubic-bezier(.7, 0, .2, 1) .6s, opacity .3s .6s;
}
.mail[hidden] { display: none; }
.mail.is-visible { clip-path: inset(0 0 0 0 round 999px); opacity: 1; }
.mail__link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(.95rem, 2.6vw, 1.3rem); font-weight: 600; letter-spacing: .01em;
  color: var(--text); text-decoration: none; overflow-wrap: anywhere;
  transition: color .2s;
}
.mail__link:hover { color: var(--c1); }
.mail__copy {
  padding: .55rem 1.05rem; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 800;
  background: var(--grad); color: var(--bg); transition: transform .2s;
}
.mail__copy:hover { transform: scale(1.05); }
@media (max-width: 480px) {
  .mail { border-radius: 22px; padding: .9rem 1rem; clip-path: inset(0 50% 0 50% round 22px); }
  .mail.is-visible { clip-path: inset(0 0 0 0 round 22px); }
}

.no-js .env, .no-js .hint { display: none; }

/* ---------- Footer ---------- */
.footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .92rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer b { color: var(--text); }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js .cards > [data-reveal]:nth-child(3n + 2), .js .steps > [data-reveal]:nth-child(2) { transition-delay: .1s; }
.js .cards > [data-reveal]:nth-child(3n), .js .steps > [data-reveal]:nth-child(3) { transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
