/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  /* Surface */
  --bg: #050506;
  --bg-soft: #0B0B0D;
  --surface-1: #0F0F12;
  --surface-2: #15151A;
  --surface-3: #1B1B22;
  --line: #22222A;
  --line-strong: #2E2E38;

  /* Text */
  --text: #F4F4F2;
  --text-soft: #B5B5B0;
  --text-dim: #7A7A75;
  --text-muted: #4F4F4D;

  /* Brand & accents */
  --tiffany: #0ABAB5;
  --tiffany-bright: #2DD4CE;
  --tiffany-glow: rgba(10, 186, 181, 0.18);
  --tiffany-soft: rgba(10, 186, 181, 0.10);
  --tiffany-line: rgba(10, 186, 181, 0.32);

  --success: #22C55E;
  --success-bg: rgba(34, 197, 94, 0.10);
  --success-line: rgba(34, 197, 94, 0.32);
  --warning: #F5A524;
  --warning-bg: rgba(245, 165, 36, 0.10);
  --warning-line: rgba(245, 165, 36, 0.32);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.10);
  --danger-line: rgba(239, 68, 68, 0.32);

  /* Layout */
  --max-w: 1280px;
  --gutter: 28px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Motion */
  --t-fast: 140ms cubic-bezier(.4,0,.2,1);
  --t-base: 240ms cubic-bezier(.4,0,.2,1);
  --t-slow: 480ms cubic-bezier(.22,1,.36,1);

  /* Type */
  --f-display: "Unbounded", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  font-feature-settings: "ss01", "ss02", "cv11";
  letter-spacing: -0.005em;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--tiffany); color: #000; }

/* Подсветка фона — едва заметная */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 600px at 80% -10%, rgba(10,186,181,.06), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(10,186,181,.04), transparent 60%);
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.container {
  width: 100%; max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: 28px 0; }
.section + .section { padding-top: 0; }

/* ── Top bar ────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 6, 0.74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar__inner {
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 16px;
  color: var(--text);
}
.brand__mark {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tiffany);
  color: #000;
  border-radius: 7px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: -0.02em;
  flex: 0 0 28px;
  box-shadow: 0 0 14px rgba(10, 186, 181, 0.45);
}
.brand__name { font-weight: 700; }
.brand__name em { font-style: normal; color: var(--tiffany); }
.topbar__nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; color: var(--text-soft);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }

/* ── Headings (display) ─────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.025em; }
.h-display {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.h-display em { font-style: normal; color: var(--tiffany); }
.h-page {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.h-section {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px; line-height: 1.15; letter-spacing: -0.02em;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-body);
  font-size: 13px; font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-dim);
}
.eyebrow::before {
  content: ""; width: 18px; height: 1px; background: var(--text-dim);
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-1), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: border-color var(--t-base), transform var(--t-base);
}
.card--hover:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.card--accent {
  border-color: var(--tiffany-line);
  box-shadow: 0 0 0 1px var(--tiffany-soft) inset, 0 24px 50px -28px var(--tiffany-glow);
}
.card__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.card__title { font-family: var(--f-display); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.card__subtitle { color: var(--text-dim); font-size: 13px; line-height: 1.55; }

/* ── Button ─────────────────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  font-family: var(--f-body);
  font-size: 13px; font-weight: 600; letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn--primary {
  background: var(--tiffany); color: #000;
}
.btn--primary::after {
  content: ""; position: absolute; inset: -8px; border-radius: 999px;
  background: var(--tiffany); filter: blur(22px); opacity: 0.0;
  transition: opacity var(--t-base);
  z-index: -1;
}
.btn--primary:hover { background: var(--tiffany-bright); }
.btn--primary:hover::after { opacity: 0.55; }

.btn--ghost {
  background: var(--surface-2); color: var(--text); border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--tiffany-line); color: var(--tiffany-bright); }

.btn--outline {
  background: transparent; color: var(--text); border-color: var(--line-strong);
}
.btn--outline:hover { border-color: var(--tiffany); color: var(--tiffany); }

.btn--danger {
  background: rgba(239,68,68,0.10); color: var(--danger); border-color: var(--danger-line);
}
.btn--danger:hover { background: rgba(239,68,68,0.16); }

.btn--lg { padding: 14px 22px; font-size: 14px; }
.btn--sm { padding: 8px 12px; font-size: 12px; }
.btn--block { width: 100%; }

.btn .arrow {
  display: inline-block;
  transition: transform var(--t-base);
}
.btn:hover .arrow { transform: translateX(3px); }

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.field {
  display: block;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--f-body); font-size: 13px;
  transition: border-color var(--t-fast), background var(--t-fast);
  outline: none;
}
.field:hover { border-color: var(--line-strong); }
.field:focus { border-color: var(--tiffany); background: var(--surface-1); }
.field::placeholder { color: var(--text-muted); }

textarea.field { min-height: 96px; resize: vertical; }
select.field {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
                    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.field-label {
  display: block;
  font-family: var(--f-body);
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
  margin-bottom: 8px;
}

/* ── Pills / status ─────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: var(--f-body);
  font-size: 12px; font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  opacity: 0.85;
}
.pill--brand { color: var(--tiffany); background: var(--tiffany-soft); border-color: var(--tiffany-line); }
.pill--ok { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }
.pill--warn { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-line); }
.pill--bad { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }

/* ── Meta row ───────────────────────────────────────────────────────────── */
.meta-row { display: flex; flex-wrap: wrap; gap: 22px 28px; }
.meta { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.meta__label { font-family: var(--f-body); font-size: 12px; font-weight: 500; letter-spacing: -0.005em; color: var(--text-dim); }
.meta__val { font-size: 14px; font-weight: 500; color: var(--text); }
.meta__val a { color: var(--tiffany); text-decoration: none; border-bottom: 1px dashed currentColor; }
.meta__val a:hover { color: var(--tiffany-bright); }

/* ── List of items (uniform tiles) ──────────────────────────────────────── */
.tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.tile:hover { border-color: var(--line-strong); }
.tile__title { font-weight: 600; font-size: 14px; }
.tile__body { color: var(--text-dim); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.tile__meta { font-family: var(--f-body); font-size: 12px; font-weight: 500; letter-spacing: -0.005em; color: var(--text-dim); }

/* ── Url badge (copyable URL) ───────────────────────────────────────────── */
.url-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-family: var(--f-mono); font-size: 11px;
  word-break: break-all;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast-host {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 240px; max-width: 360px;
  padding: 12px 14px;
  background: var(--surface-1); border: 1px solid var(--line);
  border-left: 2px solid var(--tiffany);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13px; line-height: 1.45;
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.6);
  animation: toastIn var(--t-base) both;
}
.toast--ok { border-left-color: var(--success); }
.toast--warn { border-left-color: var(--warning); }
.toast--bad { border-left-color: var(--danger); }
.toast.is-out { animation: toastOut var(--t-base) both; }

@keyframes toastIn  { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { from { transform: none; opacity: 1; } to { transform: translateY(8px); opacity: 0; } }

/* ── Reveal on scroll ──────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--t-slow), transform var(--t-slow); }
.reveal.is-in { opacity: 1; transform: none; }

/* ── Custom cursor (desktop, fine pointer) ─────────────────────────────── */
.cur-dot, .cur-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 90; mix-blend-mode: difference; }
.cur-dot { width: 6px; height: 6px; background: #fff; border-radius: 50%; transform: translate(-50%, -50%); }
.cur-ring {
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width var(--t-fast), height var(--t-fast), border-color var(--t-fast);
}
.cur-ring.is-hot { width: 56px; height: 56px; border-color: rgba(10,186,181,.9); }
@media (hover: none), (pointer: coarse) { .cur-dot, .cur-ring { display: none !important; } body { cursor: auto; } }

/* ── Marquee (бегущая строка для брендинга) ─────────────────────────────── */
.marquee {
  display: flex;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--bg-soft);
}
.marquee__track {
  display: flex; align-items: center; gap: 56px;
  padding: 14px 0; padding-right: 56px;
  font-family: var(--f-display);
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  animation: marquee 28s linear infinite;
}
.marquee__track span { color: var(--text-soft); }
.marquee__track i { font-style: normal; color: var(--tiffany); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ── Grid helpers ──────────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

/* ── Utility ────────────────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1 1 auto; }
.dim { color: var(--text-dim); }
.soft { color: var(--text-soft); }
.mono { font-family: var(--f-mono); }
.sep { height: 1px; background: var(--line); border: 0; }
.hide-sm { display: initial; }
@media (max-width: 720px) { .hide-sm { display: none; } }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--f-body);
  letter-spacing: -0.005em;
}
.footer__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
