/* ==========================================================================
   Base — reset, типографіка, атмосфера
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  min-height: 100dvh;
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  letter-spacing: -0.002em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--g-500); color: #04140d; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--fg-0);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

/* Заголовок гасне від чистого білого до напівпрозорого — головний прийом,
   через який сторінка читається як дорога. padding-bottom обовʼязковий:
   без нього background-clip зрізає хвостики літер. */
h1, h2 {
  background: linear-gradient(180deg, #ffffff 12%, rgba(200, 232, 218, 0.62) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.12em;
}

h1 { font-size: var(--t-h1); line-height: 0.98; }
h2 { font-size: var(--t-h2); line-height: 1.04; }
h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }

p { text-wrap: pretty; }
code, pre { font-family: var(--font-mono); font-size: var(--t-mono); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { position: relative; z-index: var(--z-content); padding-block: var(--sp-section); }

.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { margin-top: 0.85rem; font-size: var(--t-lead); color: var(--fg-2); max-width: 46ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--g-300);
  margin-bottom: 1.15rem;
}

.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--g-400);
  box-shadow: 0 0 12px var(--g-500);
}

.num { font-variant-numeric: tabular-nums; }

.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-chip);
  background: var(--g-500);
  color: #04140d;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--d-base) var(--e-out);
}

.skip-link:focus-visible { transform: translateY(0); }

/* ==========================================================================
   Атмосфера — шари навмисно не збігаються за розмиттям і контрастом,
   інакше око склеює їх в одну площину.
   ========================================================================== */

.atmo {
  position: fixed;
  inset: 0;
  z-index: var(--z-atmo);
  pointer-events: none;
  overflow: hidden;
  contain: paint;
  background: radial-gradient(125% 95% at 50% -12%, #0a2a20 0%, #04120c 52%, #020906 100%);
}

/* Сітка гасне маскою, а не обривається прямокутником */
.atmo__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(180, 255, 220, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 255, 220, 0.035) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(115% 80% at 50% 0%, #000 18%, transparent 72%);
  mask-image: radial-gradient(115% 80% at 50% 0%, #000 18%, transparent 72%);
}

/* Плями світяться, тому screen. Затухають на 68%, інакше під розмиттям
   видно край диска. Тривалості взаємно прості — цикл не читається. */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  mix-blend-mode: screen;
  will-change: transform;
}

.blob--a {
  width: 760px; height: 760px;
  top: -300px; left: -160px;
  background: radial-gradient(circle, rgba(15, 206, 124, 0.34), rgba(15, 206, 124, 0) 68%);
  animation: drift-a 37s var(--e-swift) infinite;
}

.blob--b {
  width: 620px; height: 620px;
  top: -140px; right: -170px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.24), rgba(20, 184, 166, 0) 68%);
  animation: drift-b 43s var(--e-swift) infinite;
  animation-delay: -13s;
}

.blob--c {
  width: 720px; height: 720px;
  top: 52%; left: 34%;
  background: radial-gradient(circle, rgba(10, 143, 88, 0.22), rgba(10, 143, 88, 0) 68%);
  animation: drift-c 53s var(--e-swift) infinite;
  animation-delay: -27s;
}

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(6vw, 5vh, 0) scale(1.18); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.1); }
  50%      { transform: translate3d(-7vw, 6vh, 0) scale(0.9); }
}
@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.94); }
  50%      { transform: translate3d(5vw, -7vh, 0) scale(1.22); }
}

/* Віньєтка зміщена вище центру — так дивиться об'єктив, а не фільтр */
.atmo__vig {
  position: absolute;
  inset: 0;
  background: radial-gradient(125% 95% at 50% 38%, transparent 45%, rgba(1, 8, 5, 0.72) 100%);
}

/* Зерно — не декор, а дизеринг: без нього темні градієнти йдуть смугами */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.15;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Поява ---------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--d-slow) var(--e-out),
    transform var(--d-slow) var(--e-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.reveal.in { opacity: 1; transform: none; }

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