/* ============================================================
   TIZMEK — Coming soon
   Self-hosted variable fonts (latin / latin-ext / cyrillic / cyrillic-ext).
   Only the subsets needed for RU/EN are shipped; unicode-range keeps
   the browser from downloading any subset a given page doesn't use.
   ============================================================ */

/* Bricolage Grotesque — display (latin only; no cyrillic subset exists) */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/bricolage-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: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/bricolage-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Manrope — body + display fallback for Cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/manrope-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: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/manrope-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* JetBrains Mono — labels (status / footer / seg controls) */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../assets/fonts/jetbrainsmono-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: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../assets/fonts/jetbrainsmono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../assets/fonts/jetbrainsmono-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../assets/fonts/jetbrainsmono-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --terra: #C2410C;
  --amber: #F59E0B;
  --warm-paper: #FFEDD5;
  --font-display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html[data-theme="light"] {
  --bg: #FBF8F1;
  --glow: rgba(245, 158, 11, .16);
  --fg: #0F172A;
  --wm: #0F172A;
  --muted: #64748B;
  --line: #E7E2D5;
  --field-bg: #FFFFFF;
  --field-line: #E1DACB;
  --field-fg: #0F172A;
  --btn-fg: #FFEDD5;
  --err: #B91C1C;
}

html[data-theme="dark"] {
  --bg: #171009;
  --glow: rgba(194, 65, 12, .30);
  --fg: #FFEDD5;
  --wm: #FFEDD5;
  --muted: rgba(255, 237, 213, .52);
  --line: rgba(255, 237, 213, .14);
  --field-bg: rgba(255, 237, 213, .05);
  --field-line: rgba(255, 237, 213, .16);
  --field-fg: #FFEDD5;
  --btn-fg: #FFEDD5;
  --err: #FCA5A5;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background .45s ease, color .45s ease;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 80% at 50% -10%, var(--glow) 0%, transparent 60%);
  pointer-events: none;
  transition: background .45s ease;
  z-index: 0;
}

/* ---- Controls ---- */
.controls {
  position: fixed;
  top: 22px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 5;
}
.seg {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field-bg);
  backdrop-filter: blur(6px);
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 6px 11px;
  border-radius: 999px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s ease, background .2s ease;
}
.seg button:hover { color: var(--fg); }
.seg button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.seg button[aria-pressed="true"] {
  background: var(--terra);
  color: var(--warm-paper);
}
#themeSeg button { padding: 6px 9px; }
.swatch {
  width: 15px; height: 15px; border-radius: 50%;
  display: block; border: 1.5px solid currentColor;
}
.swatch.light { background: #FBF8F1; color: #C9A96B; }
.swatch.dark { background: #171009; color: #8A6B4A; }
#themeSeg button[aria-pressed="true"] .swatch {
  box-shadow: 0 0 0 2px var(--terra), 0 0 0 3.5px var(--amber);
  border-color: var(--warm-paper);
}

/* ---- Main ---- */
main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 96px 24px 40px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 44px;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, .6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); }
  70% { box-shadow: 0 0 0 9px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Horizontal lockup — tile + wordmark (latin glyphs, Bricolage) */
.lockup {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 40px;
}
.tile {
  width: 100px; height: 100px;
  background: var(--terra);
  border-radius: 23px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 24px 48px -26px rgba(194, 65, 12, .7);
  flex: 0 0 auto;
}
.glyph {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 52px;
  letter-spacing: -.02em;
  line-height: .9;
  display: inline-flex;
  align-items: baseline;
  color: var(--warm-paper);
}
.wm {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 54px;
  letter-spacing: -.03em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  color: var(--wm);
  transition: color .45s ease;
}
.dot { color: var(--amber); margin-left: .01em; }

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(56px, 11vw, 120px);
  letter-spacing: -.055em;
  line-height: .92;
  margin: 0 0 18px;
  color: var(--fg);
}
.sub {
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 44ch;
  margin: 0 0 40px;
  font-weight: 500;
}

/* ---- Loading indicator (under the logo) ---- */
.loader {
  position: relative;
  width: min(240px, 62vw);
  height: 6px;
  margin: 4px 0 0;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}
.loader-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--terra), var(--amber));
  box-shadow: 0 0 12px -2px var(--amber);
  animation: loaderSlide 1.5s cubic-bezier(.65, .05, .36, 1) infinite;
  will-change: transform;
}
@keyframes loaderSlide {
  0%   { transform: translateX(-115%); }
  100% { transform: translateX(240%); }
}
@media (prefers-reduced-motion: reduce) {
  .loader-bar {
    animation: none;
    width: 100%;
    opacity: .55;
  }
}

/* ---- Notify form ---- */
.form-wrap { width: 100%; max-width: 440px; display: flex; justify-content: center; }
.notify {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  padding: 5px;
  border: 1px solid var(--field-line);
  border-radius: 999px;
  background: var(--field-bg);
  transition: border-color .2s ease, background .45s ease;
}
.notify:focus-within { border-color: var(--amber); }
.notify input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--field-fg);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 0 14px 0 18px;
  outline: none;
}
.notify input::placeholder { color: var(--muted); }
.notify button {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--terra);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -.01em;
  padding: 12px 22px;
  border-radius: 999px;
  transition: background .2s ease, transform .1s ease, opacity .2s ease;
}
.notify button:hover { background: #A83309; }
.notify button:active { transform: scale(.97); }
.notify button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.notify[aria-busy="true"] button { opacity: .6; cursor: progress; }

/* Honeypot — visually and programmatically hidden, still in the DOM for bots */
.hp {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Form status message */
.msg {
  display: none;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
  min-height: 52px;
  text-align: left;
}
.msg.show { display: inline-flex; }
.msg.is-error { color: var(--err); }
.msg .check {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--amber);
  color: #171009;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex: 0 0 auto;
}
.msg.is-error .check { display: none; }

footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact {
  color: var(--muted);
  text-decoration: none;
  text-transform: none;
  letter-spacing: .02em;
  transition: color .2s ease;
}
.contact:hover { color: var(--fg); }
.contact:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

/* ---- Entrance (visible is the base state; animate FROM hidden only under .preload) ---- */
.status, .lockup, h1, .sub, .loader, .form-wrap {
  opacity: 1;
  transform: none;
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}
html.preload .status,
html.preload .lockup,
html.preload h1,
html.preload .sub,
html.preload .loader,
html.preload .form-wrap {
  opacity: 0;
  transform: translateY(14px);
}
.lockup { transition-delay: .06s; }
h1 { transition-delay: .14s; }
.sub { transition-delay: .2s; }
.loader { transition-delay: .2s; }
.form-wrap { transition-delay: .26s; }

@media (prefers-reduced-motion: reduce) {
  .status, .lockup, h1, .sub, .form-wrap,
  body, body::before, .wm, .notify, .seg button, .notify button {
    transition: none !important;
    animation: none !important;
  }
  html.preload .status,
  html.preload .lockup,
  html.preload h1,
  html.preload .sub,
  html.preload .loader,
  html.preload .form-wrap {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 520px) {
  .lockup { gap: 16px; }
  .tile { width: 76px; height: 76px; border-radius: 18px; }
  .glyph { font-size: 40px; }
  .wm { font-size: 42px; }
  .controls { top: 16px; right: 16px; }
  .notify { flex-direction: column; border-radius: 20px; padding: 8px; }
  .notify input { padding: 12px 14px; text-align: center; }
  .notify button { width: 100%; padding: 13px; }
}
