/* ------------------------------------------------------------------
   Tokens, reset, typography, primitives
   ------------------------------------------------------------------ */
:root {
  /* colour */
  --bg: #ffffff;
  --ink: #000000;
  --inv: #ffffff;
  --muted: #6e6e6e;
  --muted-inv: #8a8a88;
  --media: #2e2e2e;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.82);
  --line-inv: rgba(255, 255, 255, 0.5);
  --brand: #ff0063;
  --brand-hover: #ff2c7d;
  --brand-cursor: #ff004d;
  --error: #d4213a;

  /* rhythm */
  --g: 10px;
  --header-h: 55px;
  --top: 112px;
  --section: clamp(96px, 12vw, 200px);

  /* type */
  --font: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --serif: 'Cormorant', 'Times New Roman', Times, serif;
  --fs-h1: clamp(40px, 6.67vw, 128px);
  --fs-h2: clamp(28px, 4.45vw, 86px);
  --fs-h3: clamp(18px, 2.22vw, 44px);
  --fs-sub: clamp(16px, 1.39vw, 28px);
  --fs-text: clamp(15px, 1.12vw, 20px);
  --fs-body: 12px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-wipe: cubic-bezier(0.76, 0, 0.24, 1);
}

@media (min-width: 1921px) {
  :root { --fs-body: 16px; --g: 14px; --header-h: 72px; --top: 150px; }
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none;
}
html::-webkit-scrollbar { display: none; }

body {
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.03em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { background: none; border: 0; border-radius: 0; cursor: pointer; text-align: inherit; }
a, button, input, select, label { touch-action: manipulation; }
ul, ol { list-style: none; }
img, video { display: block; max-width: 100%; }
fieldset { border: 0; min-width: 0; }
sup { font-size: 0.6em; vertical-align: top; position: relative; top: -0.1em; }
em { font-family: var(--serif); font-style: italic; font-weight: 300; letter-spacing: -0.035em; }
:lang(ru) em { letter-spacing: -0.02em; }

::selection { background: #ce0758; color: #72f9c8; }

:focus-visible { outline: 1px solid var(--brand); outline-offset: 3px; }

/* --- type scale ---------------------------------------------------- */
.h1 { font-size: var(--fs-h1); line-height: 0.85; letter-spacing: -0.03em; text-transform: uppercase; font-weight: 700; }
.h1 em { font-size: 0.98em; line-height: 0.8; }
.h2 { font-size: var(--fs-h2); line-height: 0.9; text-transform: uppercase; }
.h3 { font-size: var(--fs-h3); line-height: 0.9; text-transform: uppercase; }
.sub { font-size: var(--fs-sub); line-height: 0.98; letter-spacing: -0.03em; font-weight: 700; }
.text { font-size: var(--fs-text); line-height: 1.18; letter-spacing: -0.02em; font-weight: 500; }
.body { font-size: var(--fs-body); line-height: 1.05; font-weight: 700; }
.upper { text-transform: uppercase; }
.muted { color: var(--muted); }
.muted-inv { color: var(--muted-inv); }

/* --- primitives ---------------------------------------------------- */
.sq { display: inline-block; flex: none; width: 6px; height: 6px; background: var(--ink); }
.sq--white { background: var(--inv); }
.sq--brand { background: var(--brand); }

/* bracket links: [ WORK ] */
.br {
  display: inline-flex; align-items: center; gap: 0.22em;
  white-space: nowrap; text-transform: uppercase;
  transition: opacity 0.32s var(--ease);
}
.br::before, .br::after {
  display: inline-block; opacity: 0.68;
  transition: transform 0.48s var(--ease-expo), color 0.36s var(--ease), opacity 0.36s var(--ease);
}
.br::before { content: '['; }
.br::after { content: ']'; }
.br:focus-visible::before, .br.is-active::before { transform: translateX(-0.34em); color: var(--brand-hover); opacity: 1; }
.br:focus-visible::after, .br.is-active::after { transform: translateX(0.34em); color: var(--brand-hover); opacity: 1; }
/* hover styles only where there is a real hover, so nothing sticks after a tap */
@media (hover: hover) {
  .br:hover::before { transform: translateX(-0.34em); color: var(--brand-hover); opacity: 1; }
  .br:hover::after { transform: translateX(0.34em); color: var(--brand-hover); opacity: 1; }
}

/* black label button */
.label {
  display: inline-flex; align-items: center; gap: 6px;
  width: fit-content; padding: 9px 10px 8px;
  background: var(--ink); color: var(--inv);
  font-size: var(--fs-body); line-height: 1; white-space: nowrap;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.label .sq { transition: background-color 0.3s var(--ease), transform 0.5s var(--ease-expo); }
.label:focus-visible .sq { background: var(--brand); transform: rotate(90deg) scale(1.3); }
.label--white { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (hover: hover) {
  .label:hover .sq { background: var(--brand); transform: rotate(90deg) scale(1.3); }
  .label--white:hover { background: var(--ink); color: var(--inv); }
}
.label[disabled] { opacity: 0.42; cursor: not-allowed; }

/* media box with flat placeholder */
.media { position: relative; overflow: hidden; background: var(--media); }
.media > video, .media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* timecode with brand square */
.tc { display: inline-flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* cursor-following border light */
.spot { position: relative; }
.spot::after {
  content: ''; position: absolute; inset: 0; padding: 1px; pointer-events: none; z-index: 3;
  background: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), var(--brand), transparent 62%);
  -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 exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
[data-spot-group]:hover .spot::after { opacity: 1; }

/* --- reveal -------------------------------------------------------- */
/* The mask is a clip-path, not overflow: it reaches above the line box, so the
   breve of Й and the tails of Ц, Д, Щ and commas are not cut. */
.ln { display: block; padding-bottom: 0.14em; margin-bottom: -0.14em; clip-path: inset(-0.17em -0.1em 0 -0.1em); }
.ln > span { display: block; transform: translateY(140%); transition: transform 1s var(--ease-expo); }
.is-in .ln > span, .ln.is-in > span { transform: none; }
.ln:nth-child(2) > span { transition-delay: 0.07s; }
.ln:nth-child(3) > span { transition-delay: 0.14s; }

[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.9s var(--ease-expo); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* The first screen waits for the intro stripes, then rises behind them. */
body.is-loading .is-in .ln > span { transform: translateY(140%); }
body.is-loading [data-reveal].is-in { opacity: 0; transform: translateY(20px); }
.hero .ln > span { transition-delay: 0.4s; }
.hero .ln:nth-child(2) > span { transition-delay: 0.47s; }
.hero .ln:nth-child(3) > span { transition-delay: 0.54s; }
.hero [data-reveal] { transition-delay: 0.6s; }

/* Failsafe: if the scripts did not finish, show everything without motion. */
.no-reveal [data-reveal] { opacity: 1; transform: none; }
.no-reveal .ln > span { transform: none; }

/* --- intro stripes -------------------------------------------------- */
.intro { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; pointer-events: none; }
.intro i { flex: 1; background: var(--ink); transform: scaleX(1); transform-origin: right center; transition: transform 0.6s var(--ease-wipe); }
.intro i:nth-child(1) { transition-delay: 0.16s; }
.intro i:nth-child(2) { transition-delay: 0.12s; }
.intro i:nth-child(3) { transition-delay: 0.08s; }
.intro i:nth-child(4) { transition-delay: 0.04s; }
body:not(.is-loading) .intro i { transform: scaleX(0); }

/* --- toast ---------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 300;
  padding: 9px 12px 8px; background: var(--ink); color: var(--inv); white-space: nowrap;
  transform: translate(-50%, 200%); transition: transform 0.5s var(--ease-expo);
}
.toast.is-on { transform: translate(-50%, 0); }
.toast::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; background: var(--brand); }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .ln > span { transform: none; }
}
