/* ============================================================
   AI.DEVLABS — shared stylesheet
   Dark / premium minimal / geometric-futuristic
   ============================================================ */

:root {
  /* --- surfaces (cool near-black) --- */
  --bg:        #07080a;
  --bg-2:      #0a0c0f;
  --bg-3:      #0e1116;
  --surface:   rgba(255,255,255,0.025);
  --surface-2: rgba(255,255,255,0.045);
  --line:      rgba(255,255,255,0.08);
  --line-2:    rgba(255,255,255,0.14);

  /* --- text --- */
  --ink:       #f2f4f6;
  --ink-2:     #b7bdc6;
  --ink-3:     #767d88;
  --ink-4:     #4c525c;

  /* --- accent (tweakable) --- */
  --accent:        #00ff9d;
  --accent-soft:   #19f49a;
  --accent-deep:   oklch(0.78 0.18 162);
  --accent-glow:   rgba(0, 255, 157, 0.40);
  --accent-ink:    #052b1d;          /* text on accent */

  /* --- brand blue (logo) --- */
  --blue:      #3a86ff;
  --blue-glow: rgba(58, 134, 255, 0.45);

  /* --- type --- */
  --sans: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: "Space Mono", "JetBrains Mono", ui-monospace, monospace;

  /* --- layout --- */
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --nav-h: 76px;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
ul { list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- ambient backdrop ---------- */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(1100px 700px at 78% -8%, rgba(58,134,255,0.10), transparent 60%),
    radial-gradient(900px 620px at 8% 102%, rgba(0,255,157,0.07), transparent 62%);
  pointer-events: none; z-index: 0;
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .035; mix-blend-mode: screen;
  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='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- shared layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
main { position: relative; z-index: 2; }
section { position: relative; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--accent); opacity: .7;
}
.eyebrow.center::before { display: none; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.04; }
.display {
  font-size: clamp(40px, 7.2vw, 92px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.h-sec { font-size: clamp(30px, 4.4vw, 54px); letter-spacing: -0.03em; }
.lead { font-size: clamp(16px, 1.5vw, 20px); color: var(--ink-2); max-width: 56ch; }

.muted { color: var(--ink-3); }
.accent-text { color: var(--accent); }
.mono { font-family: var(--mono); }

/* section rhythm */
.section-pad { padding-block: clamp(72px, 11vw, 150px); }
.section-head { max-width: 720px; }
.section-head .h-sec { margin-top: 18px; }
.section-head p { margin-top: 20px; }

/* hairline divider */
.rule { height: 1px; background: var(--line); border: 0; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7,8,10,0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; }

.brand { display: flex; align-items: center; gap: 13px; margin-right: auto; }
.brand__mark {
  width: 38px; height: 38px; object-fit: contain;
  mix-blend-mode: screen;            /* knocks out the logo's black bg */
  filter: saturate(1.05) brightness(1.05);
}
.brand__txt { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-weight: 600; font-size: 17px; letter-spacing: .02em;
}
.brand__name b { color: var(--accent); font-weight: 600; }
.brand__sub {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em;
  color: var(--ink-3); text-transform: uppercase; margin-top: 4px;
}

.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  font-size: 14.5px; color: var(--ink-2); white-space: nowrap;
  padding: 9px 14px; border-radius: 9px;
  position: relative; transition: color .2s;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.active { color: var(--ink); }
.nav__links a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 1.5px; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
}

.nav__actions { display: flex; align-items: center; gap: 14px; }

.lang {
  display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px;
  overflow: hidden; font-family: var(--mono); font-size: 11.5px;
}
.lang button {
  padding: 6px 11px; color: var(--ink-3); letter-spacing: .08em;
  transition: color .2s, background .2s;
}
.lang button.on { color: var(--accent-ink); background: var(--accent); }

/* buttons */
.btn {
  --pad: 12px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: var(--pad); border-radius: 999px;
  font-size: 14.5px; font-weight: 500; letter-spacing: .01em;
  transition: transform .25s var(--ease), box-shadow .35s, background .25s, border-color .25s, color .25s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 0 var(--accent-glow), 0 8px 30px -10px var(--accent-glow);
}
.btn--primary:hover {
  box-shadow: 0 0 26px -2px var(--accent-glow), 0 10px 34px -8px var(--accent-glow);
  transform: translateY(-2px);
}
.btn--ghost {
  border: 1px solid var(--line-2); color: var(--ink);
  background: var(--surface);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--lg { --pad: 15px 30px; font-size: 15.5px; }
.btn .ico { width: 16px; height: 16px; }

/* mobile menu button */
.burger { display: none; width: 42px; height: 42px; border: 1px solid var(--line-2); border-radius: 10px; align-items: center; justify-content: center; }
.burger span { width: 17px; height: 1.6px; background: var(--ink); position: relative; transition: .3s; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; width: 17px; height: 1.6px; background: var(--ink); transition: .3s; }
.burger span::before { top: -6px; } .burger span::after { top: 6px; }
.burger.open span { background: transparent; }
.burger.open span::before { top: 0; transform: rotate(45deg); }
.burger.open span::after { top: 0; transform: rotate(-45deg); }

/* mobile sheet */
.mobile {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 49;
  background: rgba(7,8,10,0.96); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; padding: 28px var(--gutter);
  gap: 6px; transform: translateY(-12px); opacity: 0; pointer-events: none;
  transition: .35s var(--ease);
}
.mobile.open { transform: none; opacity: 1; pointer-events: auto; }
.mobile a { font-size: 26px; font-weight: 600; letter-spacing: -.02em; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mobile .btn { margin-top: 22px; }

/* ============================================================
   HERO 3D canvas
   ============================================================ */
.scene { position: absolute; inset: 0; z-index: 0; }
.scene canvas { width: 100% !important; height: 100% !important; }

/* ============================================================
   CARDS / GRID
   ============================================================ */
.card {
  position: relative; border: 1px solid var(--line);
  background: var(--surface); border-radius: var(--r);
  padding: 28px; transition: border-color .35s, background .35s, transform .35s var(--ease);
  overflow: hidden;
}
.card:hover { border-color: var(--line-2); background: var(--surface-2); }
.card__num { font-family: var(--mono); font-size: 12px; color: var(--ink-4); letter-spacing: .15em; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); background: var(--surface);
}
.chip--accent { color: var(--accent); border-color: rgba(0,255,157,0.3); }

/* reveal — JS/rAF-driven via inline styles (declarative CSS anims are throttled here) */
[data-reveal] { opacity: 0; transform: translateY(26px); will-change: opacity, transform; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); padding-block: 64px 40px; margin-top: 40px; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.footer__brand { max-width: 300px; }
.footer__brand .brand { margin-bottom: 18px; }
.footer h4 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; font-weight: 400; }
.footer__col a, .footer__col p { color: var(--ink-2); font-size: 14.5px; padding: 6px 0; transition: color .2s; }
.footer__col a:hover { color: var(--accent); }
.msgr { display: flex; gap: 10px; margin-top: 6px; }
.msgr a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-2);
  transition: .25s; letter-spacing: .02em;
}
.msgr a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.footer__bot { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.footer__bot p { font-size: 13px; color: var(--ink-3); }
.footer__bot .mono { font-size: 12px; color: var(--ink-4); }

/* ============================================================
   FORM
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 9px; }
.field label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field textarea, .field select {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 14px 16px; color: var(--ink); font: inherit; font-size: 15px;
  transition: border-color .25s, box-shadow .25s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,255,157,0.12);
}
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 12.5px; color: var(--ink-3); }
.form-ok {
  display: none; align-items: center; gap: 12px; padding: 16px 18px;
  border: 1px solid rgba(0,255,157,0.35); background: rgba(0,255,157,0.06);
  border-radius: var(--r); color: var(--accent); font-size: 14.5px;
}
.form-ok.show { display: flex; }

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.page-head { padding-top: calc(var(--nav-h) + clamp(56px, 9vw, 120px)); padding-bottom: clamp(40px, 6vw, 80px); position: relative; }
.page-head .display { max-width: 16ch; }
.page-head .lead { margin-top: 24px; }

/* stat row */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stat { background: var(--bg); padding: 30px 26px; }
.stat__n { font-size: clamp(30px, 4vw, 46px); font-weight: 600; letter-spacing: -.03em; }
.stat__n .accent-text { font-family: var(--sans); }
.stat__l { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .footer__top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 920px) {
  .nav__links { display: none; }
  .nav__actions .btn--primary { display: none; }
  .burger { display: inline-flex; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  :root { --nav-h: 66px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .brand__sub { display: none; }
  .footer__top { grid-template-columns: 1fr; }
  .footer__bot { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   RESPONSIVE — extended mobile (≤720 / ≤480 / ≤380)
   ============================================================ */

/* tablet portrait & smaller — softer nav spacing, tighter sections */
@media (max-width: 720px) {
  .nav__actions { gap: 10px; }
  .nav .wrap { gap: 14px; }
  .footer__bot { gap: 8px; }
  .footer__bot .mono { order: 2; }
  .marquee { margin-top: 28px; padding: 14px 0; }
  .marquee__track { animation-duration: 32s; gap: 22px; }
  .marquee__track span { font-size: 13px; }
}

/* phones */
@media (max-width: 480px) {
  :root { --gutter: 18px; --nav-h: 60px; }

  /* type ramp */
  .display { font-size: clamp(32px, 9vw, 44px); letter-spacing: -0.025em; line-height: 1.04; }
  .h-sec   { font-size: clamp(26px, 7.5vw, 34px); }
  .lead    { font-size: 15.5px; line-height: 1.55; }

  /* hero: stop hogging the full viewport — let content size it */
  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 56px); padding-bottom: 44px; }
  .hero__cta { gap: 10px; margin-top: 28px; flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .btn { --pad: 12px 18px; font-size: 14px; }
  .btn--lg { --pad: 14px 24px; font-size: 14.5px; }

  /* nav: compact lang switcher (don't hide — users still need RU/EN) */
  .lang button { padding: 5px 9px; font-size: 11px; }
  .nav__links + .nav__actions { gap: 8px; }

  /* section rhythm */
  .section-pad { padding-block: 60px; }

  /* cards: less padding */
  .card { padding: 22px 20px; }
  .svc { min-height: auto; padding: 24px 20px 26px; }
  .svc h3 { font-size: 19px; }

  /* svc-extra: stack vertically */
  .svc-extra { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px 20px; }
  .svc-extra__link { margin-left: 0; }

  /* about-strip + chips */
  .about-strip { padding: 28px 22px; gap: 22px; }
  .about-strip__r p { font-size: 15.5px; margin-bottom: 18px; }
  .chips { gap: 7px; }
  .chip  { font-size: 11.5px; padding: 6px 11px; }

  /* stats compact */
  .stat { padding: 22px 16px; }
  .stat__n { font-size: 28px; }
  .stat__l { font-size: 12.5px; }

  /* process card cleaner */
  .proc__step { padding: 26px 22px 30px; }
  .proc__n    { margin-bottom: 18px; }

  /* page header (inner pages) */
  .page-head { padding-top: calc(var(--nav-h) + 40px); padding-bottom: 32px; }
  .page-head .display { font-size: clamp(32px, 9vw, 44px); max-width: 100%; }
  .page-head .lead    { margin-top: 18px; }

  /* CTA card */
  .cta { padding: 48px 22px; }

  /* contact info + form */
  .contact__h { margin-bottom: 18px; font-size: 22px; }
  .cinfo__v   { font-size: 19px; }
  .contact__form { padding: 22px 18px; }
  .form-actions { flex-direction: column; align-items: stretch; gap: 14px; }
  .form-actions .btn { width: 100%; }
  .form-note  { text-align: center; font-size: 12px; }

  /* footer */
  .footer { padding-block: 48px 28px; margin-top: 24px; }
  .footer__top { gap: 28px; }
  .footer h4 { margin-bottom: 14px; }
}

/* very narrow phones — tighten nav so brand + lang + burger stay on one line */
@media (max-width: 380px) {
  :root { --gutter: 14px; }
  .brand__mark { width: 32px; height: 32px; }
  .brand__name { font-size: 15.5px; }
  .lang button { padding: 4px 8px; }
  .nav__actions { gap: 8px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
