/* LaevZanjir public site (landing + /kirish). Reference mockup: public/design/sayt-v2/.
 * Brand tokens follow ADR-0009 (deep blue -> bright blue, navy surfaces, Inter).
 * Dark is the brand default; light follows prefers-color-scheme or the toggle. */

:root {
  --brand-1: #1e40af;
  --brand-2: #3b82f6;
  --brand-3: #60a5fa;
  --grad: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);

  --bg: #0b1220;
  --bg-2: #0f172a;
  --surface: #131d33;
  --surface-2: #1a2640;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --muted: #a5b4cb;
  --faint: #6b7a93;
  --ok: #34d399;
  --warn: #fbbf24;
  --glow: rgba(59, 130, 246, 0.35);
  --shadow: 0 24px 60px -24px rgba(2, 6, 23, 0.8);
  --radius: 18px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f8fc;
    --bg-2: #eef2fa;
    --surface: #ffffff;
    --surface-2: #f1f5fd;
    --line: rgba(15, 23, 42, 0.09);
    --line-strong: rgba(15, 23, 42, 0.16);
    --text: #0f172a;
    --muted: #475569;
    --faint: #8391a7;
    --glow: rgba(59, 130, 246, 0.22);
    --shadow: 0 24px 60px -28px rgba(30, 64, 175, 0.35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-2: #eef2fa;
  --surface: #ffffff;
  --surface-2: #f1f5fd;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --muted: #475569;
  --faint: #8391a7;
  --glow: rgba(59, 130, 246, 0.22);
  --shadow: 0 24px 60px -28px rgba(30, 64, 175, 0.35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* ── Top bar ─────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 18px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 6px 18px -6px var(--glow); }
.nav { display: none; gap: 26px; margin-left: 28px; font-size: 14.5px; color: var(--muted); }
.nav a:hover { color: var(--text); }
@media (min-width: 900px) { .nav { display: flex; } }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
}
.lang button {
  border: 0; background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 9px; border-radius: 999px; color: var(--muted);
}
.lang button[aria-pressed="true"] { background: var(--grad); color: #fff; }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.theme-sun { display: none; }
:root[data-theme="light"] .theme-sun { display: block; }
:root[data-theme="light"] .theme-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-moon { display: none; }
}
@media (max-width: 420px) { .icon-btn.theme { display: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 28px -12px var(--glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -12px var(--glow); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand-2); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }

/* ── Sections ────────────────────────────────────────────── */
section { padding: 72px 0; }
@media (min-width: 900px) { section { padding: 104px 0; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-3);
}
:root[data-theme="light"] .eyebrow { color: var(--brand-1); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .eyebrow { color: var(--brand-1); } }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--grad); }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(28px, 4.2vw, 42px); font-weight: 750; }
.lead-p { color: var(--muted); font-size: 17px; max-width: 620px; margin: 14px 0 0; }
.sec-head { margin-bottom: 44px; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { position: relative; padding: 56px 0 72px; overflow: hidden; }
@media (min-width: 900px) { .hero { padding: 88px 0 112px; } }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto 40%; height: 720px;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  pointer-events: none; filter: blur(10px);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 20%, transparent 75%);
  opacity: .55; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; display: grid; gap: 48px; align-items: center; }
@media (min-width: 980px) { .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; } }
.hero h1 { font-size: clamp(36px, 6vw, 62px); font-weight: 800; margin-top: 18px; }
.hero h1 .grad {
  background: linear-gradient(120deg, #60a5fa 0%, #3b82f6 45%, #93c5fd 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="light"] .hero h1 .grad { background-image: linear-gradient(120deg, #1e40af, #3b82f6); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .hero h1 .grad { background-image: linear-gradient(120deg, #1e40af, #3b82f6); } }
.hero .lead-p { font-size: 18px; margin-top: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-notes { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 28px; color: var(--muted); font-size: 14px; }
.hero-notes span { display: inline-flex; align-items: center; gap: 8px; }
.hero-notes svg { width: 16px; height: 16px; color: var(--ok); }

/* Chain visual — the product's flow, link by link */
.chain {
  position: relative; border-radius: 24px; padding: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), var(--surface));
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.chain-row {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
}
.chain-row + .chain-row { margin-top: 26px; }
.chain-row + .chain-row::before {
  content: ""; position: absolute; left: 35px; top: -27px; width: 6px; height: 28px;
  border-radius: 6px; background: var(--grad); opacity: .9;
}
.chain-row + .chain-row::after {
  content: ""; position: absolute; left: 32px; top: -18px; width: 12px; height: 10px;
  border: 2px solid var(--brand-2); border-radius: 6px; background: var(--surface);
}
.chain-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #fff;
}
.chain-ico svg { width: 22px; height: 22px; }
.chain-row b { display: block; font-size: 15px; font-weight: 650; }
.chain-row small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.pill {
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: rgba(59, 130, 246, 0.14); color: var(--brand-3); white-space: nowrap;
}
.pill.ok { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
:root[data-theme="light"] .pill { color: var(--brand-1); }
:root[data-theme="light"] .pill.ok { color: #047857; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .pill { color: var(--brand-1); }
  :root:not([data-theme="dark"]) .pill.ok { color: #047857; }
}
.chain-row.live { animation: pulse 3.2s ease-in-out infinite; }
.chain-row.live:nth-child(2) { animation-delay: .8s; }
.chain-row.live:nth-child(3) { animation-delay: 1.6s; }
.chain-row.live:nth-child(4) { animation-delay: 2.4s; }
@keyframes pulse {
  0%, 70%, 100% { border-color: var(--line); box-shadow: none; }
  15% { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12); }
}
@media (prefers-reduced-motion: reduce) { .chain-row.live { animation: none; } html { scroll-behavior: auto; } }

/* ── Capabilities ─────────────────────────────────────────── */
.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  position: relative; padding: 26px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card .ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(59, 130, 246, 0.12); color: var(--brand-2); margin-bottom: 18px;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.card .ico svg { width: 22px; height: 22px; }
.card h3 { font-size: 18.5px; font-weight: 700; }
.card p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

/* ── Steps ────────────────────────────────────────────────── */
.steps { display: grid; gap: 14px; counter-reset: st; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
.step {
  position: relative; padding: 24px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
}
.step .num {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 750; font-size: 15px; color: #fff; background: var(--grad); margin-bottom: 16px;
}
.step h3 { font-size: 17px; font-weight: 700; }
.step p { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }
@media (min-width: 900px) {
  .step:not(:last-child)::after {
    content: ""; position: absolute; top: 42px; right: -18px; width: 18px; height: 2px;
    background: var(--grad); opacity: .7;
  }
}

/* ── Panel band ───────────────────────────────────────────── */
.band {
  border-radius: 26px; padding: 32px; display: grid; gap: 28px; align-items: center;
  background: var(--grad); color: #fff; position: relative; overflow: hidden;
}
.band::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
  border: 40px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 900px) { .band { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); padding: 48px; } }
.band h2 { color: #fff; }
.band p { color: rgba(255, 255, 255, 0.85); margin: 12px 0 0; max-width: 520px; }
.band .btn-light { background: #fff; color: #1e3a8a; }
.band .btn-light:hover { transform: translateY(-1px); }
.tabs-preview { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.tabs-preview span {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22);
}

/* ── Contact ──────────────────────────────────────────────── */
.contact { display: grid; gap: 32px; }
@media (min-width: 900px) { .contact { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; } }
.form {
  padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); display: grid; gap: 16px;
}
.field { display: grid; gap: 7px; }
.field span { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input { height: 120px; padding: 12px 14px; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16); }
.note {
  display: none; padding: 12px 14px; border-radius: 12px; font-size: 14px;
  background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.3);
}
.note.show { display: block; }
.points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.points li { display: flex; gap: 12px; color: var(--muted); }
.points svg { flex: none; width: 20px; height: 20px; color: var(--brand-2); margin-top: 3px; }

/* ── Footer ───────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding: 28px 0 34px; color: var(--faint); font-size: 13.5px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }

/* ── Login page ───────────────────────────────────────────── */
.auth { min-height: calc(100vh - 64px - 90px); display: grid; }
@media (min-width: 960px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.auth-side {
  display: none; position: relative; overflow: hidden; padding: 56px;
  background: var(--grad); color: #fff;
}
@media (min-width: 960px) { .auth-side { display: flex; flex-direction: column; justify-content: center; } }
.auth-side::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .6;
}
.auth-side > * { position: relative; }
.auth-side h2 { color: #fff; font-size: 34px; max-width: 420px; }
.auth-side p { color: rgba(255, 255, 255, 0.85); max-width: 420px; }
.auth-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; max-width: 420px; }
.auth-list li {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); font-weight: 550;
}
.auth-list svg { width: 20px; height: 20px; flex: none; }
.auth-main { display: grid; place-items: center; padding: 40px 16px 56px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .logo-big { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 12px 30px -10px var(--glow); }
.auth-card h1 { font-size: 30px; font-weight: 800; margin-top: 22px; }
.auth-card .sub { color: var(--muted); margin: 8px 0 28px; }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw button {
  position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: 9px;
  background: transparent; color: var(--faint); cursor: pointer; display: grid; place-items: center;
}
.pw button:hover { color: var(--text); }
.pw button svg { width: 18px; height: 18px; }
.err {
  display: none; padding: 11px 14px; border-radius: 12px; font-size: 14px;
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.32); color: #fca5a5;
}
:root[data-theme="light"] .err { color: #b91c1c; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .err { color: #b91c1c; } }
.err.show { display: block; }
.forgot {
  margin-top: 18px; padding: 14px 16px; border-radius: 14px; font-size: 14px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line-strong);
}
.forgot b { color: var(--text); display: block; margin-bottom: 2px; }
.btn-block { width: 100%; height: 50px; }
.spin {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff; animation: rot .8s linear infinite; display: none;
}
.loading .spin { display: block; }
.loading .lbl { display: none; }
@keyframes rot { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.done-ico {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(52, 211, 153, 0.14); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.35);
}
.done-ico svg { width: 28px; height: 28px; }
.panel-peek {
  margin-top: 22px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface);
  overflow: hidden;
}
.panel-peek .bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel-peek .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.panel-peek ul { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.panel-peek li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14.5px;
}
.panel-peek li:first-child { background: rgba(59, 130, 246, 0.12); color: var(--brand-3); font-weight: 600; }
:root[data-theme="light"] .panel-peek li:first-child { color: var(--brand-1); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .panel-peek li:first-child { color: var(--brand-1); } }
.panel-peek svg { width: 18px; height: 18px; }
.note.bad { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.32); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 360px) { .brand span { display: none; } }

/* Narrow phones (320px and below, down to 280px). A grid track sized `auto`
   grows to its children's min-content width, which pushed the hero 10px past a
   320px viewport. Every single-column grid gets an explicit shrinkable track,
   grid/flex children may shrink, and long words wrap instead of overflowing. */
.hero .wrap, .grid, .steps, .contact, .band, .auth { grid-template-columns: minmax(0, 1fr); }
.hero .wrap > *, .grid > *, .steps > *, .contact > *, .band > *, .auth > *, .chain-row > * { min-width: 0; }
h1, h2, h3, p, b, small, li, span { overflow-wrap: break-word; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .band { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .contact { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
}
@media (min-width: 960px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 980px) { .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); } }
@media (max-width: 360px) {
  .hero h1 { font-size: 30px; }
  .auth-card h1 { font-size: 26px; }
  .top .wrap { gap: 8px; }
  .top-actions { gap: 6px; }
  .lang button { padding: 5px 7px; }
  .btn-sm { padding: 0 11px; }
  .chain { padding: 14px; }
  .chain-row { grid-template-columns: 40px minmax(0, 1fr); }
  .chain-row .pill { grid-column: 2; justify-self: start; }
  .chain-ico { width: 40px; height: 40px; }
  .chain-row + .chain-row::before { left: 31px; }
  .chain-row + .chain-row::after { left: 28px; }
  .band { padding: 24px 18px; }
  .form, .card, .step { padding: 20px 16px; }
}
