/* ============================================================
   WebFi — digital studio · webfi.online
   Dark-tech premium. Mobile-first. No frameworks.
   ============================================================ */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: 'Unbounded';
  src: url('../assets/fonts/unbounded-cyr.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  src: url('../assets/fonts/unbounded-lat.woff2') format('woff2');
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Onest';
  src: url('../assets/fonts/onest-cyr.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  src: url('../assets/fonts/onest-lat.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jbmono-cyr.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jbmono-lat.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #04060d;
  --bg-2: #070c17;
  --bg-card: rgba(13, 21, 38, 0.55);
  --ink: #e9f0fa;
  --mut: #91a0b8;
  --cy: #37e6ff;
  --cy-deep: #129fdd;
  --gd: #ffc24a;
  --line: rgba(148, 178, 222, 0.13);
  --line-bright: rgba(55, 230, 255, 0.35);
  --font-d: 'Unbounded', system-ui, sans-serif;
  --font-b: 'Onest', system-ui, sans-serif;
  --font-m: 'JetBrains Mono', ui-monospace, monospace;
  --rad: 18px;
  --pad: clamp(18px, 4.5vw, 56px);
  --header-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-b);
  font-size: clamp(15px, 1vw + 11px, 17px);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: rgba(55, 230, 255, .25); }

h1, h2, h3 {
  font-family: var(--font-d);
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; }

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

/* ---------- Background layers ---------- */
#core {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  transition: opacity .9s ease, filter .9s ease;
  will-change: opacity, filter;
}
/* за пределами hero ядро становится мягкой «авророй»: размыто и приглушено */
#core.calm {
  opacity: .38;
  filter: blur(26px) saturate(1.35);
}
.glow {
  position: fixed;
  z-index: 0;
  width: 60vmax; height: 60vmax;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
  opacity: .5;
}
.glow--a { top: -28vmax; right: -22vmax; background: radial-gradient(circle, rgba(18,90,160,.30), transparent 62%); }
.glow--b { bottom: -32vmax; left: -25vmax; background: radial-gradient(circle, rgba(11,52,98,.28), transparent 62%); }
.noise {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

/* Scroll progress (decorative, native scroll-driven only) */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 60;
  background: linear-gradient(90deg, var(--cy), var(--gd));
  transform-origin: 0 50%;
  scale: 0 1;
}
@supports (animation-timeline: scroll()) {
  .progress {
    animation: grow auto linear both;
    animation-timeline: scroll(root);
  }
  @keyframes grow { from { scale: 0 1; } to { scale: 1 1; } }
}

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  padding-inline: var(--pad);
  gap: 18px;
  transition: background .35s, border-color .35s;
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: rgba(4, 6, 13, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.logo {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .02em;
  text-decoration: none;
  display: flex; align-items: baseline; gap: 2px;
}
.logo b { font-weight: 700; }
.logo span {
  background: linear-gradient(120deg, var(--cy), var(--cy-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo em {
  font-style: normal;
  font-family: var(--font-m);
  font-size: 10px;
  color: var(--mut);
  margin-left: 8px;
  letter-spacing: .14em;
  text-transform: uppercase;
  align-self: center;
  white-space: nowrap;
}
.nav {
  display: none;
  gap: 26px;
  margin-inline: auto;
}
.nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--mut);
  transition: color .25s;
}
.nav a:hover { color: var(--ink); }
.header__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav + .header__right { margin-left: 0; }

.lang {
  font-family: var(--font-m);
  font-size: 12px;
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--mut);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  transition: color .25s, border-color .25s;
}
.lang:hover { color: var(--ink); border-color: var(--line-bright); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-b);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-radius: 999px;
  padding: 15px 30px;
  cursor: pointer;
  border: 0;
  transition: transform .25s cubic-bezier(.2,.9,.3,1.4), box-shadow .3s, background .3s;
  touch-action: manipulation;
}
.btn:active { transform: scale(.96); }
.btn--primary {
  color: #02141c;
  background: linear-gradient(120deg, var(--cy) 10%, var(--cy-deep) 90%);
  box-shadow: 0 8px 30px -8px rgba(55, 230, 255, .55), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 42px -8px rgba(55, 230, 255, .7), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn--ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}
.btn--ghost:hover { border-color: var(--line-bright); }
.btn--sm { padding: 10px 20px; font-size: 14px; }
.btn svg { flex: none; }

/* ---------- Layout primitives ---------- */
.wrap {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--pad);
}
.section {
  position: relative;
  padding-block: clamp(76px, 13vh, 150px);
}
/* точечная сетка — фактура, чтобы тёмные секции не были «пустотой» */
.section::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(150, 185, 235, .10) 1px, transparent 1.4px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 0%, transparent 100%);
  pointer-events: none;
}
.section > .wrap { position: relative; }
.kicker {
  font-family: var(--font-m);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cy);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.kicker::before {
  content: '';
  width: 26px; height: 1px;
  background: var(--cy);
  opacity: .7;
}
.section h2 {
  font-size: clamp(1.55rem, 3.4vw + .4rem, 2.7rem);
  max-width: 17ch;
  margin-bottom: 14px;
}
.section .lead {
  color: var(--mut);
  max-width: 56ch;
  font-size: clamp(15px, 1vw + 11px, 17.5px);
}
/* Giant ghost numeral */
.num {
  position: absolute;
  top: clamp(20px, 6vh, 64px);
  right: var(--pad);
  font-family: var(--font-d);
  font-weight: 800;
  font-size: clamp(64px, 14vw, 170px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(146, 180, 230, .14);
  user-select: none;
  pointer-events: none;
}

/* ---------- Reveal (JS adds .in) ---------- */
.rv {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s cubic-bezier(.2,.65,.25,1), transform .8s cubic-bezier(.2,.65,.25,1);
  transition-delay: var(--d, 0s);
}
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-block: calc(var(--header-h) + 40px) clamp(48px, 9vh, 96px);
}
.hero .wrap { width: 100%; }
.hero__tag {
  font-family: var(--font-m);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mut);
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 26px;
  background: rgba(7, 12, 23, .4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hero__tag::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cy);
  box-shadow: 0 0 12px var(--cy);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.hero h1 {
  font-size: clamp(1.9rem, 6.2vw + .4rem, 4.7rem);
  font-weight: 700;
  max-width: 15ch;
  margin-bottom: 22px;
}
.hero h1 .grad {
  background: linear-gradient(115deg, #1fc9ef 5%, #7ef2ff 55%, #b9f8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  color: var(--mut);
  font-size: clamp(15.5px, 1.4vw + 10px, 19px);
  max-width: 48ch;
  margin-bottom: 36px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero__hint {
  margin-top: 30px;
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: .12em;
  color: rgba(145, 160, 184, .65);
  display: flex; align-items: center; gap: 10px;
}
.hero__hint svg { opacity: .6; animation: drift 2.6s ease-in-out infinite; }
@keyframes drift { 50% { transform: translateY(5px); } }

/* gyro chip (iOS) */
.gyro-chip {
  position: absolute;
  top: calc(var(--header-h) + 18px);
  right: var(--pad);
  z-index: 5;
  display: none;
  align-items: center; gap: 8px;
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--cy);
  background: rgba(7, 14, 26, .6);
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.gyro-chip.show { display: inline-flex; }

/* ---------- Services (bento) ---------- */
.bento {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin-top: 44px;
}
.card {
  position: relative;
  border-radius: var(--rad);
  padding: 26px 24px;
  background:
    linear-gradient(165deg, rgba(26, 42, 74, .45), rgba(9, 14, 26, .65)) padding-box;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(176, 215, 255, .07);
  overflow: hidden;
  transition: border-color .35s, transform .35s;
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(420px 200px at var(--mx, 80%) -20%, rgba(55, 230, 255, .12), transparent 65%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.card:hover { border-color: rgba(55, 230, 255, .3); transform: translateY(-3px); }
.card:hover::before { opacity: 1; }
.card__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  margin-bottom: 18px;
  color: var(--cy);
  background: rgba(55, 230, 255, .08);
  border: 1px solid rgba(55, 230, 255, .18);
}
.card h3 {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: .01em;
  margin-bottom: 9px;
}
.card p { color: var(--mut); font-size: 14.5px; }
.card--wide .card__icon { background: rgba(255, 194, 74, .09); border-color: rgba(255, 194, 74, .22); color: var(--gd); }

/* ---------- Process ---------- */
.steps {
  margin-top: 48px;
  display: grid;
  gap: 0;
  counter-reset: step;
}
.step {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step__n {
  font-family: var(--font-m);
  font-size: 13px;
  color: var(--cy);
  padding-top: 3px;
}
.step h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; font-family: var(--font-b); }
.step p { color: var(--mut); font-size: 14.5px; max-width: 60ch; }
.pay-note {
  margin-top: 30px;
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px dashed rgba(255, 194, 74, .35);
  background: rgba(255, 194, 74, .05);
  border-radius: var(--rad);
  padding: 18px 20px;
  font-size: 14.5px;
  color: var(--mut);
}
.pay-note b { color: var(--gd); font-weight: 600; }
.pay-note svg { flex: none; color: var(--gd); margin-top: 2px; }

/* ---------- Cases ---------- */
.cases {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin-top: 44px;
}
.case {
  position: relative;
  border-radius: var(--rad);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(14, 24, 44, .65), rgba(7, 11, 21, .65));
  padding: 28px 24px;
  overflow: hidden;
  transition: border-color .35s, transform .35s;
}
.case:hover { border-color: rgba(55, 230, 255, .3); transform: translateY(-3px); }
.case__metric {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 38px);
  background: linear-gradient(120deg, var(--cy), #8df3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}
.case__metric small {
  font-size: .45em;
  font-family: var(--font-m);
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--mut);
  -webkit-text-fill-color: var(--mut);
}
.case h3 { font-size: 17px; font-weight: 600; font-family: var(--font-b); margin: 10px 0 8px; }
.case p { color: var(--mut); font-size: 14.5px; margin-bottom: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span {
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--mut);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
  background: rgba(10, 16, 30, .5);
}
.case__nda {
  position: absolute;
  top: 20px; right: 20px;
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: .16em;
  color: rgba(255, 194, 74, .8);
  border: 1px solid rgba(255, 194, 74, .3);
  border-radius: 5px;
  padding: 4px 8px;
}

/* ---------- Infrastructure ---------- */
.infra {
  margin-top: 44px;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: linear-gradient(165deg, rgba(26, 42, 74, .4), rgba(9, 14, 26, .6));
  box-shadow: inset 0 1px 0 rgba(176, 215, 255, .07);
  padding: 24px;
  text-align: left;
}
.stat__v {
  font-family: var(--font-d);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 42px);
  color: var(--ink);
}
.stat__v i { font-style: normal; color: var(--cy); }
.stat p { color: var(--mut); font-size: 14px; margin-top: 6px; }
.infra-modes { margin-top: 26px; display: grid; gap: 14px; grid-template-columns: 1fr; }
.mode {
  border-radius: var(--rad);
  border: 1px solid var(--line);
  padding: 24px;
  background: linear-gradient(150deg, rgba(13, 22, 40, .6), rgba(6, 10, 19, .6));
}
.mode h3 { font-family: var(--font-b); font-weight: 600; font-size: 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.mode h3 svg { color: var(--cy); flex: none; }
.mode p { color: var(--mut); font-size: 14.5px; }

/* ---------- Why ---------- */
.why {
  margin-top: 44px;
  display: grid;
  gap: 0;
}
.why__item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 16px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
}
.why__item:last-child { border-bottom: 1px solid var(--line); }
.why__item svg { color: var(--gd); margin-top: 3px; }
.why__item h3 { font-family: var(--font-b); font-weight: 600; font-size: 16px; margin-bottom: 5px; }
.why__item p { color: var(--mut); font-size: 14.5px; max-width: 62ch; }

/* ---------- Final CTA ---------- */
.cta {
  text-align: center;
  padding-block: clamp(90px, 16vh, 170px);
}
.cta h2 {
  font-size: clamp(1.7rem, 5vw + .4rem, 3.4rem);
  max-width: 20ch;
  margin-inline: auto;
  margin-bottom: 18px;
}
.cta .lead { margin-inline: auto; margin-bottom: 38px; }
.cta .btn--primary { padding: 18px 40px; font-size: 16.5px; }
.cta__resp {
  margin-top: 18px;
  font-family: var(--font-m);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--mut);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 30px var(--pad) 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
  color: var(--mut);
  font-size: 13px;
  background: rgba(4, 6, 13, .6);
}
.footer .logo { font-size: 16px; }
.footer a { color: var(--mut); text-decoration: none; transition: color .25s; }
.footer a:hover { color: var(--ink); }

/* ---------- Native scroll-driven garnish (decorative) ---------- */
@supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
  .num {
    animation: num-slide auto linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 55%;
  }
  @keyframes num-slide {
    from { transform: translateY(60px); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

/* ---------- Breakpoints ---------- */
@media (max-width: 560px) {
  .logo em { display: none; }
  .header { gap: 10px; }
  .header .btn--sm { padding: 9px 14px; font-size: 13px; }
  .lang { padding: 7px 11px; }
}
@media (min-width: 700px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .cases { grid-template-columns: repeat(3, 1fr); }
  .infra { grid-template-columns: repeat(4, 1fr); }
  .infra-modes { grid-template-columns: 1fr 1fr; }
  .why { grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .why__item:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}
@media (min-width: 1020px) {
  .nav { display: flex; }
  .bento { grid-template-columns: repeat(3, 1fr); }
  .card--wide { grid-column: span 2; }
  .hero { align-items: center; }
  .hero h1 { max-width: 14ch; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .progress, .hero__tag::before, .hero__hint svg { animation: none !important; }
  .btn, .card, .case { transition: none; }
}

/* ============================================================
   v2: theme toggle, hero stats, tech ticker, timeline glow,
   card upgrades, LIGHT THEME
   ============================================================ */

/* ---------- theme toggle ---------- */
.theme-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mut);
  cursor: pointer;
  transition: color .25s, border-color .25s, transform .4s;
}
.theme-btn:hover { color: var(--ink); border-color: var(--line-bright); }
.theme-btn:active { transform: rotate(40deg) scale(.9); }
.theme-btn .ico-sun { display: none; }
[data-theme="light"] .theme-btn .ico-sun { display: block; }
[data-theme="light"] .theme-btn .ico-moon { display: none; }

/* ---------- hero stats ---------- */
.hero__stats {
  display: flex; gap: clamp(20px, 5vw, 48px);
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 560px;
}
.hero__stats b {
  display: block;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: clamp(19px, 2.6vw, 26px);
  background: linear-gradient(120deg, var(--cy), #8df3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="light"] .hero__stats b {
  background: linear-gradient(120deg, #0a7fb8, #0aa6d6);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero__stats span {
  font-size: 12.5px;
  color: var(--mut);
  letter-spacing: .02em;
}

/* ---------- tech ticker ---------- */
.ticker {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: 14px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker__track {
  display: flex; align-items: center; gap: 28px;
  width: max-content;
  animation: tick 36s linear infinite;
}
.ticker span {
  font-family: var(--font-m);
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--mut);
  white-space: nowrap;
}
.ticker i { font-style: normal; font-size: 8px; color: var(--cy); opacity: .7; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } }

/* ---------- process timeline glow ---------- */
.steps { position: relative; }
.steps::before {
  content: '';
  position: absolute;
  left: 14px; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--cy) 12%, var(--cy) 88%, transparent);
  opacity: .35;
}
.step { padding-left: 40px; grid-template-columns: 52px 1fr; }
.step::before {
  content: '';
  position: absolute;
  left: 10px; top: 30px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cy);
  box-shadow: 0 0 12px rgba(55, 230, 255, .55);
}
.step { position: relative; }
.step:hover h3 { color: var(--cy); transition: color .3s; }

/* ---------- card v2: gradient border + interactive tilt ---------- */
.card, .case, .mode, .stat {
  background-clip: padding-box;
}
.card::after, .case::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(55,230,255,.45), transparent 30%, transparent 70%, rgba(255,194,74,.25));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.card:hover::after, .case:hover::after { opacity: 1; }
.card, .case { will-change: transform; transform-style: preserve-3d; }

/* ============================================================
   LIGHT THEME
   ============================================================ */
[data-theme="light"] {
  --bg: #f3f6fb;
  --bg-2: #e9eef7;
  --bg-card: rgba(255, 255, 255, 0.72);
  --ink: #0c1626;
  --mut: #44546e;
  --cy: #0894c4;
  --cy-deep: #0a6fa8;
  --gd: #b97a10;
  --line: rgba(18, 44, 86, 0.14);
  --line-bright: rgba(8, 148, 196, 0.45);
}
[data-theme="light"] body { background: var(--bg); }
[data-theme="light"] .noise { opacity: .035; mix-blend-mode: multiply; }
[data-theme="light"] .glow--a { background: radial-gradient(circle, rgba(108, 196, 255, .35), transparent 62%); }
[data-theme="light"] .glow--b { background: radial-gradient(circle, rgba(140, 170, 255, .28), transparent 62%); }

[data-theme="light"] .header.scrolled {
  background: rgba(243, 246, 251, 0.78);
  border-bottom-color: var(--line);
}
[data-theme="light"] .logo span {
  background: linear-gradient(120deg, #0894c4, #0a6fa8);
  -webkit-background-clip: text;
  background-clip: text;
}
[data-theme="light"] .hero__tag { background: rgba(255,255,255,.55); }
[data-theme="light"] .hero h1 .grad {
  background: linear-gradient(115deg, #067cb0 5%, #0aa6d6 60%, #3ec3e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
[data-theme="light"] .btn--primary {
  color: #ffffff;
  background: linear-gradient(120deg, #0aa2d8 10%, #086fa6 90%);
  box-shadow: 0 8px 26px -8px rgba(10, 130, 180, .55), inset 0 1px 0 rgba(255,255,255,.3);
}
[data-theme="light"] .btn--primary:hover {
  box-shadow: 0 14px 36px -8px rgba(10, 130, 180, .65), inset 0 1px 0 rgba(255,255,255,.3);
}

[data-theme="light"] .section::before {
  background-image: radial-gradient(rgba(30, 64, 120, .16) 1px, transparent 1.4px);
}
[data-theme="light"] .num { -webkit-text-stroke-color: rgba(30, 64, 120, .15); }

[data-theme="light"] .card,
[data-theme="light"] .stat {
  background: linear-gradient(165deg, rgba(255,255,255,.92), rgba(244,248,254,.88));
  box-shadow: 0 10px 30px -16px rgba(24, 50, 94, .25), inset 0 1px 0 #fff;
}
[data-theme="light"] .case,
[data-theme="light"] .mode {
  background: linear-gradient(160deg, rgba(255,255,255,.95), rgba(238,244,252,.9));
  box-shadow: 0 10px 30px -16px rgba(24, 50, 94, .25), inset 0 1px 0 #fff;
}
[data-theme="light"] .card::before {
  background: radial-gradient(420px 200px at var(--mx, 80%) -20%, rgba(8, 148, 196, .10), transparent 65%);
}
[data-theme="light"] .card__icon {
  color: var(--cy);
  background: rgba(8, 148, 196, .08);
  border-color: rgba(8, 148, 196, .22);
}
[data-theme="light"] .card--wide .card__icon {
  color: var(--gd);
  background: rgba(185, 122, 16, .08);
  border-color: rgba(185, 122, 16, .25);
}
[data-theme="light"] .case__metric {
  background: linear-gradient(120deg, #067cb0, #0aa6d6);
  -webkit-background-clip: text;
  background-clip: text;
}
[data-theme="light"] .case__metric small { -webkit-text-fill-color: var(--mut); }
[data-theme="light"] .case__nda { color: #a26a0a; border-color: rgba(162, 106, 10, .4); }
[data-theme="light"] .tags span { background: rgba(255,255,255,.7); }
[data-theme="light"] .pay-note {
  border-color: rgba(185, 122, 16, .4);
  background: rgba(255, 215, 130, .12);
}
[data-theme="light"] .step::before { background: var(--bg); box-shadow: 0 0 10px rgba(8, 148, 196, .4); }
[data-theme="light"] .card::after,
[data-theme="light"] .case::after {
  background: linear-gradient(135deg, rgba(8,148,196,.5), transparent 30%, transparent 70%, rgba(185,122,16,.3));
}
[data-theme="light"] .footer { background: rgba(243, 246, 251, .7); }
[data-theme="light"] .progress { background: linear-gradient(90deg, #0894c4, #b97a10); }
[data-theme="light"] ::selection { background: rgba(8, 148, 196, .2); }
[data-theme="light"] .gyro-chip { background: rgba(255,255,255,.7); color: var(--cy); }

/* ============================================================
   v3: HACKER LAYER — terminal, scanlines, HUD, glitch, decode
   ============================================================ */

/* ---------- CRT scanlines ---------- */
.scan {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(0deg,
    transparent 0 2px, rgba(2, 10, 22, .16) 2px 4px);
  opacity: .55;
}
[data-theme="light"] .scan {
  background: repeating-linear-gradient(0deg,
    transparent 0 2px, rgba(20, 50, 100, .045) 2px 4px);
}

/* ---------- HUD-метки в hero ---------- */
.hud {
  position: absolute;
  z-index: 4;
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--mut);
  opacity: .65;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}
.hud--tl { top: calc(var(--header-h) + 16px); left: var(--pad); }
.hud--br { bottom: 18px; right: var(--pad); }
@media (max-width: 700px) { .hud--br { display: none; } .hud { font-size: 9px; } }

/* ---------- терминал ---------- */
.term {
  max-width: 480px;
  margin-top: 30px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(3, 8, 16, .78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow: hidden;
  box-shadow: 0 16px 44px -18px rgba(0, 0, 0, .6);
}
[data-theme="light"] .term {
  background: rgba(13, 24, 38, .92); /* терминал остаётся тёмным и в светлой теме — это монитор */
}
.term__bar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}
.term__bar i {
  width: 9px; height: 9px; border-radius: 50%;
  background: #3a4757;
}
.term__bar i:nth-child(1) { background: #ff5f57; }
.term__bar i:nth-child(2) { background: #febc2e; }
.term__bar i:nth-child(3) { background: #28c840; }
.term__bar span {
  margin-left: 8px;
  font-family: var(--font-m);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: #5d7290;
}
.term__body {
  margin: 0;
  padding: 14px 16px 16px;
  font-family: var(--font-m);
  font-size: 12.5px;
  line-height: 1.75;
  color: #9fe8c5;
  min-height: 132px;
  white-space: pre-wrap;
}
.term__body .tc { color: #56e1ff; }
.term__body .tok { color: #4af2a1; }
.term__body .caret {
  display: inline-block;
  width: 7px; height: 13px;
  background: #4af2a1;
  vertical-align: -2px;
  animation: caretblink 1s steps(1) infinite;
}
@keyframes caretblink { 50% { opacity: 0; } }

/* ---------- kicker → терминальный промпт ---------- */
.kicker::before {
  content: '>';
  width: auto; height: auto;
  background: none;
  opacity: 1;
  font-family: var(--font-m);
}
.kicker::after {
  content: '_';
  animation: caretblink 1.1s steps(1) infinite;
}

/* ---------- периодический глитч H1 ---------- */
.hero h1 { animation: glitch 8s steps(1) infinite; }
@keyframes glitch {
  0%, 92%, 100% { text-shadow: none; transform: none; }
  93% { text-shadow: -3px 0 rgba(255, 60, 100, .8), 3px 0 rgba(60, 220, 255, .8); transform: translateX(2px) skewX(-1deg); }
  95% { text-shadow: 3px 0 rgba(255, 60, 100, .8), -3px 0 rgba(60, 220, 255, .8); transform: translateX(-2px); }
  97% { text-shadow: -2px 0 rgba(60, 220, 255, .7), 2px 0 rgba(255, 60, 100, .7); transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 { animation: none; }
  .kicker::after, .term__body .caret { animation: none; }
}

/* ============================================================
   v4: hero grid (desktop), footer v2, button shine, nav detail
   ============================================================ */

/* hero: на десктопе текст слева, терминал справа */
@media (min-width: 1020px) {
  .hero .wrap {
    display: grid;
    grid-template-columns: minmax(0, 600px) minmax(320px, 430px);
    column-gap: clamp(36px, 6vw, 90px);
    align-items: center;
    justify-content: space-between;
  }
  .hero__tag, .hero h1, .hero__sub, .hero__cta, .hero__stats, .hero__hint { grid-column: 1; }
  .term {
    grid-column: 2;
    grid-row: 2 / span 4;
    align-self: center;
    margin-top: 0;
    max-width: none;
  }
}

/* кнопка: пробегающий блик */
.btn--primary { position: relative; overflow: hidden; }
.btn--primary::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -80%;
  width: 50%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
  pointer-events: none;
}
.btn--primary:hover::after { left: 130%; }
@media (prefers-reduced-motion: reduce) { .btn--primary::after { display: none; } }

/* nav: анимированное подчёркивание */
.nav a { position: relative; }
.nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -5px;
  width: 100%; height: 1px;
  background: var(--cy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.nav a:hover::after { transform: scaleX(1); }

/* ---------- footer v2 ---------- */
.footer {
  display: block;
  text-align: left;
  padding: 48px var(--pad) 28px;
  overflow: hidden;
  position: relative;
}
.footer__grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  max-width: 1180px;
  margin-inline: auto;
}
.footer__brand p {
  margin-top: 12px;
  max-width: 38ch;
  font-size: 13.5px;
  color: var(--mut);
}
.footer__nav { display: flex; flex-direction: column; gap: 9px; }
.footer__nav a {
  text-decoration: none;
  color: var(--mut);
  font-size: 13.5px;
  transition: color .25s;
  width: fit-content;
}
.footer__nav a:hover { color: var(--ink); }
.footer__label {
  display: block;
  font-family: var(--font-m);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 12px;
}
.footer__bottom {
  max-width: 1180px;
  margin: 36px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--mut);
}
.footer__bottom a { color: var(--mut); text-decoration: none; }
.footer__bottom a:hover { color: var(--ink); }
.footer__mark {
  position: absolute;
  left: 50%;
  bottom: -.18em;
  transform: translateX(-50%);
  font-family: var(--font-d);
  font-weight: 800;
  font-size: clamp(90px, 18vw, 230px);
  line-height: 1;
  letter-spacing: .04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(146, 180, 230, .09);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
[data-theme="light"] .footer__mark { -webkit-text-stroke-color: rgba(30, 64, 120, .10); }
@media (min-width: 700px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* ---------- 404 ---------- */
.err {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--pad);
  position: relative;
  z-index: 2;
}
.err__code {
  font-family: var(--font-m);
  font-size: clamp(64px, 18vw, 160px);
  font-weight: 600;
  color: var(--cy);
  text-shadow: 0 0 38px rgba(55, 230, 255, .35);
  line-height: 1;
}
.err h1 { font-size: clamp(1.2rem, 3vw, 1.8rem); margin: 18px 0 8px; }
.err p { color: var(--mut); margin-bottom: 26px; }
.err .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (min-width: 1020px) {
  .hero { padding-block: calc(var(--header-h) + 20px) 36px; }
  .hero__stats { margin-top: 24px; padding-top: 16px; }
  .hero h1 { margin-bottom: 16px; }
  .hero__sub { margin-bottom: 28px; }
  .hero__hint { margin-top: 22px; }
}
/* цифры разделов — заметнее (фидбек: «еле-еле прозрачные») */
.num {
  -webkit-text-stroke: 1.5px rgba(150, 195, 245, .34);
  color: rgba(86, 180, 235, .05);
}
[data-theme="light"] .num {
  -webkit-text-stroke: 1.5px rgba(30, 70, 130, .30);
  color: rgba(30, 70, 130, .04);
}

/* ============================================================
   v5: больше хакинга — глитч лого, hex-дамп инфраструктуры
   ============================================================ */
@keyframes glitch-once {
  0% { text-shadow: none; transform: none; }
  25% { text-shadow: -2px 0 rgba(255,60,100,.85), 2px 0 rgba(60,220,255,.85); transform: translateX(1px) skewX(-2deg); }
  50% { text-shadow: 2px 0 rgba(255,60,100,.85), -2px 0 rgba(60,220,255,.85); transform: translateX(-1px); }
  75% { text-shadow: -1px 0 rgba(60,220,255,.7), 1px 0 rgba(255,60,100,.7); }
  100% { text-shadow: none; transform: none; }
}
.logo:hover { animation: glitch-once .4s steps(2) 1; }

/* hex-дамп как фоновая декорация инфраструктуры */
#infra::after {
  content: '0x7F4A  0xC93E  0x01BD  0xE5A2  0x88F1  0x3C07  0xAD64  0x52E9\A0xB3D8  0x6F12  0x9A4C  0xE07B  0x24A6  0xFD93  0x71C5  0x0E38';
  white-space: pre;
  position: absolute;
  bottom: 22px;
  right: var(--pad);
  font-family: var(--font-m);
  font-size: 10px;
  line-height: 2.1;
  letter-spacing: .14em;
  color: var(--cy);
  opacity: .18;
  pointer-events: none;
  user-select: none;
}
[data-theme="light"] #infra::after { opacity: .22; }
@media (max-width: 700px) { #infra::after { display: none; } }

/* ============================================================
   v6: направленные reveal-эффекты + мокапы кейсов + серверный арт
   ============================================================ */
.rv--l { transform: translateX(-44px); }
.rv--r { transform: translateX(44px); }
.rv--zoom { transform: scale(.9) translateY(14px); }
.rv--l.in, .rv--r.in, .rv--zoom.in { transform: none; }

/* мокапы в карточках кейсов */
.case__shot {
  display: block;
  width: calc(100% + 48px);
  max-width: none;
  height: auto;
  margin: -28px -24px 18px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
[data-theme="light"] .case__shot { opacity: .96; }

/* серверный арт в секции инфраструктуры (только широкие экраны) */
/* мобила/планшет: сервер по центру над заголовком секции */
.infra-art {
  display: block;
  position: static;
  width: clamp(150px, 40vw, 220px);
  height: auto;
  margin: 0 auto 6px;
  pointer-events: none;
  filter: drop-shadow(0 18px 40px rgba(20, 120, 180, .35));
  animation: levitate 7s ease-in-out infinite;
}
@keyframes levitate { 50% { transform: translateY(-12px); } }
/* десктоп: справа от контента */
@media (min-width: 1100px) {
  .infra-art {
    position: absolute;
    top: clamp(120px, 16vh, 190px);
    right: calc(var(--pad) * 0.6);
    width: clamp(200px, 19vw, 300px);
    margin: 0;
  }
}
@media (prefers-reduced-motion: reduce) { .infra-art { animation: none; } }
.case__nda { z-index: 2; background: rgba(7, 12, 22, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* ============================================================
   v7: 3D-иконки секций (3dicons, CC0, premium-стиль: графит+золото)
   ============================================================ */
.sec-art {
  display: block;
  width: clamp(110px, 28vw, 160px);
  height: auto;
  margin: 0 auto 4px;
  pointer-events: none;
  filter: drop-shadow(0 14px 30px rgba(15, 90, 150, .35));
  animation: levitate 7s ease-in-out infinite;
}
@media (min-width: 1100px) {
  .sec-art {
    position: absolute;
    right: calc(var(--pad) * 1.3);
    top: clamp(170px, 26vh, 260px);
    width: clamp(140px, 13vw, 200px);
    margin: 0;
  }
  .sec-art--center {
    position: static;
    margin: 0 auto 20px;
    width: clamp(110px, 10vw, 150px);
  }
}
@media (prefers-reduced-motion: reduce) { .sec-art { animation: none; } }
