:root {
  --bg: #ffffff;
  --bg-alt: #f6f5fb;
  --surface: #ffffff;
  --text: #17152b;
  --muted: #6b6884;
  --border: #e7e4f2;
  --accent: #6d4dff;
  --accent-2: #ff5c9d;
  --accent-soft: #efeaff;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --radius: 18px;
  --shadow: 0 10px 30px rgba(40, 20, 120, 0.08);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e1a;
    --bg-alt: #151324;
    --surface: #1b1930;
    --text: #f1effa;
    --muted: #a19dbb;
    --border: #2b2845;
    --accent: #8d74ff;
    --accent-soft: #262044;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    17px/1.6 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.small {
  font-size: 0.875rem;
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.logo:hover {
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  /* The same corner as .logo-image, so the letter and a configured logo look alike. */
  border-radius: 7px;
  background: var(--gradient);
  color: #fff;
  font-weight: 800;
}

/* A configured logo stands where the letter would: as tall, as wide as its proportions ask.
   LOGO_HEIGHT and LOGO_MAX_WIDTH in site/build.mjs mirror this box. */
.logo-image {
  display: block;
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  /* About an iPhone icon's corner: 22.5% of the 32px height. In pixels rather than percent, which a
     wide logo would turn into elliptical corners. */
  border-radius: 7px;
  /* The nav competes for the header's width on a phone; the logo keeps its size and the nav wraps. */
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Buttons */

.button {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(109, 77, 255, 0.3);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(109, 77, 255, 0.38);
}

.button-small {
  padding: 9px 18px;
  font-size: 0.9rem;
}

.button-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--border);
}

.button-ghost:hover {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.button-light {
  background: #fff;
  color: var(--accent);
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 96px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto auto;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, rgba(141, 116, 255, 0.28), transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.badge {
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 16px;
}

/* A sketch of the bot's chat, drawn rather than screenshotted so it follows the theme */

.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 28px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.92rem;
  background: var(--surface);
  border: 1px solid var(--border);
}

.bubble-user {
  align-self: flex-end;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.bubble-bot {
  border-bottom-left-radius: 6px;
}

.quote {
  margin: 8px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.keys span {
  padding: 6px;
  border-radius: 8px;
  background: var(--accent-soft);
  text-align: center;
  font-size: 0.85rem;
}

/* A picture on its own, framed thinly the way Telegram frames a photo */
.bubble-result {
  /* The whole width of the chat, past the 85% other bubbles stop at: the picture is the point */
  width: 100%;
  max-width: none;
  padding: 4px;
}

/* The generated sample, shown at its own proportions */
.result-photo {
  display: block;
  width: 100%;
  height: auto;
  /* The bubble's 18px less its 4px frame, so the two corners run parallel */
  border-radius: 14px;
}

.result-image {
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background:
    radial-gradient(circle at 70% 46%, #ffd36e 0 12%, transparent 13%),
    linear-gradient(180deg, #ff9a8b 0%, #ff6a88 45%, #6d4dff 46%, #2b1b7a 100%);
}

/* Sections */

.section {
  padding: 88px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-lead {
  max-width: 720px;
  color: var(--muted);
  margin-bottom: 36px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-packages {
  grid-template-columns: repeat(6, 1fr);
}

.card {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.section:not(.section-alt) .card {
  box-shadow: var(--shadow);
}

.card p {
  color: var(--muted);
  margin: 0;
}

.icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.group-title {
  margin: 40px 0 16px;
  font-size: 1.3rem;
}

.model {
  display: flex;
  flex-direction: column;
}

.model p {
  flex: 1;
  margin-bottom: 18px;
}

.model-price b {
  font-size: 1.2rem;
}

.package {
  text-align: center;
  padding: 22px 12px;
}

.package-rub {
  font-size: 1.4rem;
  font-weight: 700;
}

.package-tokens {
  color: var(--accent);
  font-weight: 600;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 16px;
}

.steps p {
  color: var(--muted);
  margin: 0;
}

.step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
}

/* A section of running text: lines kept readable, the left edge in line with the other sections */
.narrow > * {
  max-width: 760px;
}

.list {
  padding-left: 1.2em;
  margin: 0 0 1.2em;
}

.list li {
  margin-bottom: 0.6em;
}

.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  margin: 0;
}

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

.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The offer and the privacy policy */

.legal {
  max-width: 800px;
}

.legal h2 {
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  margin: 1.6em 0 0.6em;
}

.legal h2:first-child {
  margin-top: 0;
}

.legal h3 {
  font-size: 1.3rem;
  margin: 1.8em 0 0.6em;
}

.legal h4 {
  margin: 1.2em 0 0.4em;
}

.legal p,
.legal li {
  color: var(--text);
}

.legal ul,
.legal ol {
  padding-left: 1.4em;
  margin: 0 0 1em;
}

/* Call to action */

.cta {
  background: var(--gradient);
  color: #fff;
  text-align: center;
}

.cta-inner p {
  opacity: 0.9;
  margin-bottom: 28px;
}

/* Success, failure and 404 */

.message {
  min-height: calc(100vh - 64px - 140px);
  display: grid;
  align-items: center;
}

.message-inner {
  max-width: 560px;
  text-align: center;
}

.message-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

/* Footer */

.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.logo-footer {
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Narrow screens */

@media (max-width: 960px) {
  .grid-packages {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .hero {
    padding: 48px 0 64px;
  }

  .hero-inner,
  .steps,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    gap: 40px;
  }

  .chat {
    transform: none;
  }

  .nav {
    display: none;
  }

  .header-inner .button {
    margin-left: auto;
  }

  .section {
    padding: 64px 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .grid-packages {
    grid-template-columns: repeat(2, 1fr);
  }
}
