/* AstAi landing. Type: Unbounded (headings) + Onest (text), both Russian-made, self-hosted. */

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/static/fonts/onest-cyrillic.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/static/fonts/onest-latin.woff2') format('woff2-variations');
  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: 'Unbounded';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('/static/fonts/unbounded-cyrillic.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('/static/fonts/unbounded-latin.woff2') format('woff2-variations');
  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;
}

:root {
  --paper: #fafafc;
  --surface: #ffffff;
  --ink: #17152b;
  --muted: #6a6780;
  --line: #e7e5ef;
  --tint: #f2f1f8;
  --bubble: #efeef5;
  --accent: #4f46e5;
  --brand: linear-gradient(135deg, #4f46e5, #9333ea);

  --font-text: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Unbounded', 'Onest', ui-sans-serif, system-ui, sans-serif;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 10vw, 128px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121020;
    --surface: #1a1730;
    --ink: #edebf7;
    --muted: #9c98b3;
    --line: #2b2842;
    --tint: #19162b;
    --bubble: #2c2944;
    --accent: #a5a0ff;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
dl,
dd,
ul,
figure {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

/* ── Type ─────────────────────────────────────────────── */

.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lead {
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 34em;
}

.note {
  font-size: 14px;
  color: var(--muted);
}

/* ── Buttons ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 500 16px/1 var(--font-text);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.btn:hover {
  opacity: 0.86;
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover {
  opacity: 1;
  border-color: var(--ink);
}
.btn--small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 15px;
}

.link-quiet {
  text-decoration: none;
  font-size: 15px;
  color: var(--muted);
}
.link-quiet:hover {
  color: var(--ink);
}

/* ── Header ───────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.header__row {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 600 19px/1 var(--font-display);
  letter-spacing: -0.03em;
}
.nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
}
.nav a:hover {
  color: var(--ink);
}
.header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ── Hero ─────────────────────────────────────────────── */

.hero {
  padding-block: clamp(40px, 7vw, 96px) var(--section);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.hero__text {
  display: grid;
  gap: 28px;
  justify-items: start;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* the live conversation */
.demo {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px 18px 14px;
  display: grid;
  gap: 14px;
  min-height: 460px;
  grid-template-rows: auto 1fr auto;
}
.demo__bar span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bubble);
  font-size: 13px;
  color: var(--muted);
}
.demo__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 6px 6px 0;
  font-size: 15.5px;
  line-height: 1.55;
}
.msg--user {
  align-self: flex-end;
  max-width: 82%;
  display: grid;
  gap: 8px;
  justify-items: end;
}
.msg--user p {
  background: var(--bubble);
  padding: 10px 16px;
  border-radius: 20px;
}
.file {
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.msg--ai {
  display: grid;
  gap: 8px;
  max-width: 94%;
}
.demo__input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  color: var(--muted);
}

/* streaming state (set by hero.js) */
.msg--ai[data-state='waiting'] p {
  display: none;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--muted);
  animation: spin 0.8s linear infinite;
}
.caret {
  display: inline-block;
  width: 3px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  border-radius: 2px;
  background: var(--brand);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Sections ─────────────────────────────────────────── */

.section {
  padding-block: var(--section);
}
.section--tint {
  background: var(--tint);
}
.section__lead {
  margin-top: 16px;
  max-width: 38em;
}

/* capabilities: a typographic list, two columns on wide screens */
.features {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 6vw, 88px);
}
.feature {
  padding-block: 28px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.feature dt {
  font: 500 19px/1.3 var(--font-display);
  letter-spacing: -0.02em;
}
.feature dd {
  display: grid;
  gap: 14px;
  color: var(--muted);
  max-width: 36em;
}
.feature__example {
  justify-self: start;
  padding: 8px 14px;
  border-radius: 14px;
  background: var(--tint);
  color: var(--ink);
  font-size: 15px;
}

/* models */
.models {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.models__intro {
  display: grid;
  gap: 16px;
}
.models__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.models__table th,
.models__table td {
  text-align: left;
  vertical-align: top;
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--line);
}
.models__table thead th {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  padding-top: 0;
}
.models__table tbody th {
  font: 500 17px/1.4 var(--font-display);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.models__table td:last-child {
  white-space: nowrap;
  padding-right: 0;
}

/* pricing */
.plans {
  margin-block: 48px 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.plan {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.plan--featured {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.plan--featured .muted,
.plan--featured .plan__summary,
.plan--featured .plan__limits {
  color: color-mix(in srgb, var(--paper) 72%, transparent);
}
.plan__name {
  font: 600 22px/1.2 var(--font-display);
  letter-spacing: -0.03em;
}
.plan__summary {
  color: var(--muted);
  min-height: 3.2em;
}
.plan__amount {
  font: 600 clamp(34px, 3.6vw, 44px) / 1 var(--font-display);
  letter-spacing: -0.04em;
}
.plan__limits {
  font-size: 15px;
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.plan--featured .plan__limits {
  border-bottom-color: color-mix(in srgb, var(--paper) 18%, transparent);
}
.plan__features {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 16px;
  flex: 1;
  align-content: start;
}
.plan__features li {
  padding-left: 26px;
  position: relative;
}
.plan__features li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.7;
}
.plan__cta {
  width: 100%;
}
.plan--featured .plan__cta {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

/* FAQ */
.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.faq__item {
  border-bottom: 1px solid var(--line);
}
.faq__item:first-child {
  border-top: 1px solid var(--line);
}
.faq__item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
  font-weight: 500;
  font-size: 18px;
}
.faq__item summary::-webkit-details-marker {
  display: none;
}
.faq__item summary::after {
  content: '';
  flex: none;
  width: 11px;
  height: 11px;
  margin-top: 0.35em;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq__item[open] summary::after {
  transform: rotate(-135deg);
}
.faq__item p {
  padding-bottom: 22px;
  color: var(--muted);
  max-width: 40em;
}

/* closing */
.closing {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}
.closing .wrap {
  display: grid;
  gap: 32px;
  justify-items: start;
}
.display--closing {
  font-size: clamp(32px, 4.6vw, 56px);
  max-width: 14em;
}

.footer {
  border-top: 1px solid var(--line);
  padding-block: 28px;
  font-size: 14px;
}
.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.notfound {
  min-height: 70vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 20px;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 960px) {
  .hero__grid,
  .models,
  .faq {
    grid-template-columns: minmax(0, 1fr);
  }
  .plans {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
  }
  .plan__summary {
    min-height: 0;
  }
  .demo {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }
  .nav {
    display: none;
  }
  .header__actions {
    gap: 14px;
  }
  .features {
    grid-template-columns: minmax(0, 1fr);
  }
  .models__table td:last-child {
    white-space: normal;
  }
  .hero__cta .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .spinner {
    animation: none;
  }
}

/* paragraphs not yet reached by the stream take no space */
.msg--ai p:empty {
  display: none;
}
