:root {
  color-scheme: dark;
  --ink: #f1f0eb;
  --muted: #8a8984;
  --bg: #0a0a09;
  --signal: #ff4a17;
  --gutter: clamp(22px, 3.3vw, 64px);
}

@font-face {
  font-family: "Instrument Sans";
  src: url("assets/fonts/instrument-sans-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("assets/fonts/instrument-sans-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

/* Cyrillic companion. Instrument Sans ships no Cyrillic glyphs, so Russian text
   would drop to a system font. Inter is registered under the same family name
   but limited to a Cyrillic unicode-range: Latin keeps rendering in Instrument
   Sans, only Cyrillic characters come from this file. */
@font-face {
  font-family: "Instrument Sans";
  src: url("assets/fonts/inter-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  font-family: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

::selection { background: var(--signal); color: var(--bg); }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
}
.skip-link:focus { transform: translateY(0); }

.stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  isolation: isolate;
  padding: max(24px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom));
}

.stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) var(--gutter) 0 / calc((100vw - 2 * var(--gutter)) / 6) 100%;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
  opacity: .28;
}

.topbar,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -.025em;
}

.wordmark {
  font-size: clamp(23px, 2vw, 34px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.07em;
}
/* The dot: a single orange dot at rest. On pointer movement a cyan and a
   magenta copy drift apart along the direction of travel, then slide back
   together more slowly. */
.wordmark .dot {
  position: relative;
  z-index: 0;
  isolation: isolate;
  display: inline-block;
  color: var(--signal);
}

.wordmark .dot::before,
.wordmark .dot::after {
  content: ".";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .5s ease;
}
.wordmark .dot::before { color: #25f4ee; }
.wordmark .dot::after { color: #fe2c55; }

body.is-split .wordmark .dot::before,
body.is-split .wordmark .dot::after {
  opacity: 1;
  transition-duration: .18s;
}
body.is-split .wordmark .dot::before {
  transform: translate(calc(var(--dx, 0em) * -1), calc(var(--dy, 0em) * -1));
}
body.is-split .wordmark .dot::after {
  transform: translate(var(--dx, 0em), var(--dy, 0em));
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 26px);
}

.langs { display: flex; align-items: center; }

.lang {
  margin: 0;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: clamp(11px, .85vw, 14px);
  font-weight: 500;
  letter-spacing: .055em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .3s ease;
}
.lang:first-child { padding-left: 0; }
.lang:last-child { padding-right: 0; }
.lang + .lang { border-left: 1px solid rgba(255,255,255,.14); }
.lang:hover { color: var(--ink); }
.lang.is-active { color: var(--ink); }
.lang:focus-visible { outline: 1px solid rgba(255,255,255,.5); outline-offset: 3px; }

.status,
.footer {
  color: var(--muted);
  font-size: clamp(11px, .85vw, 14px);
  font-weight: 500;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.status { display: flex; gap: 9px; align-items: center; }
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 14px rgba(255,74,23,.75);
  animation: breathe 2.8s ease-in-out infinite;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 24vw);
  align-items: end;
  align-self: center;
  min-height: min(76svh, 900px);
  padding: 8svh 0 5svh;
}

h1 {
  z-index: 1;
  grid-column: 1 / -1;
  align-self: center;
  margin: 0;
  font-size: clamp(70px, 12.3vw, 236px);
  font-weight: 500;
  line-height: .78;
  letter-spacing: -.085em;
}

.line { display: block; }
.line--quiet { color: var(--muted); font-weight: 400; }
.line--strong { white-space: nowrap; }

.manifesto {
  z-index: 2;
  grid-column: 2;
  align-self: end;
  justify-self: end;
  margin: 0 0 .5vw;
  color: var(--ink);
  font-size: clamp(16px, 1.55vw, 28px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.045em;
  text-align: right;
  white-space: pre-line;
}

.signal {
  --x: 50%;
  --y: 50%;
  position: absolute;
  z-index: 3;
  top: 47%;
  right: clamp(2vw, 7vw, 130px);
  width: clamp(108px, 15vw, 280px);
  aspect-ratio: 1;
  transform: translate3d(calc((var(--x) - 50%) * .035), calc((var(--y) - 50%) * .035), 0);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.signal:focus-visible {
  outline: 1px solid rgba(255,255,255,.68);
  outline-offset: 12px;
  border-radius: 50%;
}

.signal-core,
.signal-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.signal-core {
  width: 8px;
  height: 8px;
  background: var(--signal);
  box-shadow: 0 0 30px 8px rgba(255,74,23,.2), 0 0 90px 28px rgba(255,74,23,.08);
}

.signal-ring {
  width: 46%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.16);
}
.signal-ring--two { width: 100%; border-color: rgba(255,255,255,.07); }

.signal:hover .signal-ring--one,
.signal:focus-visible .signal-ring--one {
  border-color: rgba(255,255,255,.32);
}

body.is-listening .signal-core {
  animation: listen-core 1.8s cubic-bezier(.2,.8,.2,1) both;
}
body.is-listening .signal-ring--one { animation: listen-ring 1.5s ease-out both; }
body.is-listening .signal-ring--two { animation: listen-ring 1.5s .12s ease-out both; }
body.is-listening .line--quiet { color: var(--ink); }

.footer { align-items: flex-end; gap: 14px; }

.mail {
  color: var(--muted);
  text-decoration: none;
  text-transform: none;
  letter-spacing: .01em;
  border-bottom: 1px solid rgba(255,255,255,.16);
  padding-bottom: 2px;
  transition: color .3s ease, border-color .3s ease;
}
.mail:hover { color: var(--ink); border-color: var(--signal); }
.mail:focus-visible {
  color: var(--ink);
  outline: 1px solid rgba(255,255,255,.5);
  outline-offset: 4px;
}

body.is-ready .topbar,
body.is-ready .footer,
body.is-ready .manifesto { animation: rise .8s .12s both; }
body.is-ready .line--quiet { animation: rise .9s .05s both; }
body.is-ready .line--strong { animation: rise 1s .16s both; }
body.is-ready .signal { animation: reveal 1.2s .25s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes reveal {
  from { opacity: 0; transform: scale(.7); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes breathe {
  0%, 100% { opacity: .45; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes listen-core {
  0% { transform: translate(-50%, -50%) scale(1); }
  25% { transform: translate(-50%, -50%) scale(2.1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes listen-ring {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.28); }
}

@media (max-width: 720px) {
  .stage::before { background-size: calc((100vw - 2 * var(--gutter)) / 3) 100%; }
  .status span:last-child { display: none; }
  .hero {
    grid-template-columns: 1fr;
    min-height: 72svh;
    padding: 10svh 0 4svh;
  }
  h1 {
    align-self: center;
    font-size: clamp(62px, 21vw, 128px);
    line-height: .84;
  }
  .line--strong { white-space: normal; }
  .manifesto {
    grid-column: 1;
    justify-self: start;
    margin: 0;
    font-size: 18px;
    line-height: 1.18;
    text-align: left;
  }
  .signal {
    top: 40%;
    right: -4vw;
    width: 34vw;
  }
  .footer { gap: 10px; font-size: 10px; }
  .lang { padding: 0 7px; }
}

@media (max-height: 640px) and (orientation: landscape) {
  .hero { min-height: 68svh; padding: 4svh 0 2svh; }
  h1 { font-size: clamp(62px, 16vh, 126px); }
  .manifesto { font-size: 15px; }
}

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