/* ---------------------------------------------
   ailab.team — b/w hi-tech coming-soon
   --------------------------------------------- */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/plexmono-300-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/plexmono-300-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plexmono-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plexmono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #030304;
  --fg: #f2f2f4;
  --dim: #6a6a70;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-weight: 400;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #fff; color: #000; }

/* ---------- фоновые слои ---------- */

.grid,
.grid--focus {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
}

.grid--focus {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(circle 420px at var(--fx, -999px) var(--fy, -999px), #000 0%, transparent 100%);
  mask-image: radial-gradient(circle 420px at var(--fx, -999px) var(--fy, -999px), #000 0%, transparent 100%);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.65));
}

.glow {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3;
  width: 56vmax;
  height: 56vmax;
  pointer-events: none;
  mix-blend-mode: screen;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.055) 0%,
    rgba(255, 255, 255, 0.02) 38%,
    transparent 66%);
  will-change: transform;
}

/* киноплёнка — дискретные скачки каждые ~80мс */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 40;
  pointer-events: none;
  opacity: 0.095;
  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.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: film 0.8s steps(1) infinite;
  will-change: transform;
}

@keyframes film {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-2%, -3%); }
  20%  { transform: translate(-4%, 2%); }
  30%  { transform: translate(2%, -5%); }
  40%  { transform: translate(-1%, 4%); }
  50%  { transform: translate(-5%, -2%); }
  60%  { transform: translate(3%, 3%); }
  70%  { transform: translate(-3%, -4%); }
  80%  { transform: translate(4%, -1%); }
  90%  { transform: translate(-2%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---------- каркас ---------- */

.stage {
  position: relative;
  z-index: 10;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(20px, 3.5vw, 44px) clamp(22px, 4vw, 52px);
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.status { display: inline-flex; align-items: center; gap: 10px; }

.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.25; transform: scale(0.72); }
}

/* ---------- герой ---------- */

.hero {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 300;
  font-size: clamp(40px, 8.6vw, 120px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--fg);
  white-space: nowrap;
  user-select: none;
}

.w-outline {
  color: transparent;
  -webkit-text-stroke: 1.4px rgba(242, 242, 244, 0.85);
  transition: color 0.6s var(--ease), -webkit-text-stroke-color 0.6s var(--ease);
}

.wordmark:hover .w-outline {
  color: rgba(242, 242, 244, 0.95);
  -webkit-text-stroke-color: rgba(242, 242, 244, 0.95);
}

@supports not (-webkit-text-stroke: 1px #fff) {
  .w-outline { color: var(--fg); }
}

.caret {
  font-weight: 300;
  font-size: 0.92em;
  color: var(--fg);
  margin-left: 0.05em;
  animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink { to { visibility: hidden; } }

.rule {
  width: clamp(140px, 30vw, 320px);
  height: 1px;
  margin-top: clamp(26px, 4vh, 42px);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform-origin: center;
  animation: grow 1s 0.55s var(--ease) both;
}

@keyframes grow {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

.tagline {
  margin-top: clamp(22px, 3.4vh, 36px);
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 400;
  letter-spacing: 0.48em;
  text-indent: 0.48em;
  color: #a9a9b0;
  white-space: nowrap;
}

/* ---------- появление ---------- */

.reveal {
  opacity: 0;
  animation: rise 1s var(--d, 0s) var(--ease) forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- кастомный курсор ---------- */

.cursor-dot,
.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 120;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  will-change: transform;
}

.cursor-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s;
}

html.custom-cursor body.hovering .cursor-ring {
  width: 58px;
  height: 58px;
  border-color: rgba(255, 255, 255, 0.95);
}

body.cursor-on .cursor-dot,
body.cursor-on .cursor-ring { opacity: 1; }

html.custom-cursor,
html.custom-cursor * { cursor: none !important; }

@media (pointer: coarse) {
  .cursor-dot, .cursor-ring, .glow, .grid--focus { display: none; }
}

/* ---------- адаптив ---------- */

@media (max-width: 640px) {
  .grid, .grid--focus { background-size: 54px 54px; }
  .tagline { letter-spacing: 0.32em; text-indent: 0.32em; }
  .wordmark { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .caret, .status i { animation: none; }
  .reveal, .rule {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
  }
}
