/* ---------------------------------------------------------------------------
   Eventstream on the AI-Interactive design system.
   Tokens are ai-interactive.dev's (website/src/styles/global.css): neutral
   surfaces, one light amber accent, Roboto. Indigo survives only inside the
   illustrations. build_page.py copies this file into both artboards and into
   the standalone page, so edit it here, never in a copy.

   Layout: two-column hero (copy + illustration), then a 1360px shell of
   alternating feature rows, an always-dark analytics card, four steps, a dark
   demo card, contact + form, and the original dark footer.
--------------------------------------------------------------------------- */
:root {
  --color-surface: hsl(0 0% 96%);
  --color-surface-alt: hsl(0 0% 92%);
  --color-ink: hsl(0 0% 15%);
  --color-ink-medium: hsl(0 0% 35%);
  --color-ink-low: hsl(0 0% 40%);
  --color-line: hsl(0 0% 85%);
  --color-success: hsl(153 62% 31%);
  --color-danger: hsl(6 63% 43%);

  /* Always-dark surfaces: the same in both themes. */
  --color-dark: hsl(0 1% 14%);
  --color-dark-alt: hsl(0 0% 19%);
  --color-on-dark: hsl(0 0% 96%);
  --color-on-dark-medium: hsl(0 0% 70%);
  /* Illustrations are indigo and orange on transparent; inside a dark card they
     sit on this fixed light panel so they keep their contrast. */
  --color-art-panel: hsl(0 0% 94%);

  /* Same amber in both themes, so its foreground never inverts. */
  --color-accent: hsl(37 99% 73%);
  --color-accent-strong: hsl(37 90% 62%);
  --color-on-accent: hsl(0 0% 12%);

  --font-sans: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-card: 24px;
  --radius-field: 14px;
  --radius-pill: 999px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --color-surface: hsl(0 1% 14%);
  --color-surface-alt: hsl(0 0% 19%);
  --color-ink: hsl(0 0% 96%);
  --color-ink-medium: hsl(0 0% 74%);
  --color-ink-low: hsl(0 0% 64%);
  --color-line: hsl(0 0% 27%);
  --color-success: hsl(153 55% 62%);
  --color-danger: hsl(6 90% 71%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --color-surface: hsl(0 1% 14%);
    --color-surface-alt: hsl(0 0% 19%);
    --color-ink: hsl(0 0% 96%);
    --color-ink-medium: hsl(0 0% 74%);
    --color-ink-low: hsl(0 0% 64%);
    --color-line: hsl(0 0% 27%);
    --color-success: hsl(153 55% 62%);
    --color-danger: hsl(6 90% 71%);
  }
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-ink);
}

.es {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  background: var(--color-surface);
  color: var(--color-ink);
  overflow-x: clip;
}

/* Base element rules sit in :where() so they carry no class weight and never
   outrank a component (`.es a` would beat `.btn-primary` and recolour it). */
:where(.es) h1, :where(.es) h2, :where(.es) h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.04;
  text-wrap: balance;
}
:where(.es) :is(p, ul, ol) { margin: 0; }
:where(.es) :is(ul, ol) { padding: 0; list-style: none; }
:where(.es) a { color: inherit; }
:where(.es) img { display: block; max-width: 100%; height: auto; }

.es :focus-visible {
  outline: 3px solid var(--color-accent-strong);
  outline-offset: 3px;
}
.es ::selection { background: var(--color-accent); color: var(--color-on-accent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* --- Layout -------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-left: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-right, 0px));
}

.section { padding-block: clamp(4.5rem, 9vw, 8rem) 0; }

/* --- Type ---------------------------------------------------------------- */
.display {
  font-size: clamp(2rem, 4vw, 4.8rem);
  letter-spacing: -0.015em;
}
@media (max-width: 600px) {
  .display { font-size: clamp(1.75rem, 8vw, 2.2rem); }
}
.display-sm {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}
.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink-medium);
}
.lede { color: var(--color-ink-medium); max-width: 58ch; }

/* "01." with the amber rule, as on the ai-interactive.dev service cards. */
.num {
  position: relative;
  padding-left: 0.85rem;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.num::before {
  content: '';
  position: absolute;
  left: 0; top: 0.1em; bottom: 0.1em;
  width: 3px;
  border-radius: 2px;
  background: var(--color-accent);
}

.dots { display: flex; flex-direction: column; gap: 0.6em; }
.dots li { position: relative; padding-left: 1.5em; line-height: 1.5; }
.dots li::before {
  content: '';
  position: absolute;
  left: 0.15em; top: 0.55em;
  width: 0.45em; height: 0.45em;
  border-radius: 50%;
  background: var(--color-accent-strong);
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0.9em 1.6em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.35s var(--ease-out-expo), background-color 0.25s, color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { flex: none; }

.btn-primary { background: var(--color-ink); color: var(--color-surface); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-ink) 85%, #000); color: var(--color-surface); }
.btn-ghost { background: var(--color-surface-alt); color: var(--color-ink); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-surface-alt) 88%, var(--color-ink)); color: var(--color-ink); }
.btn-accent { background: var(--color-accent); color: var(--color-on-accent); }
.btn-accent:hover { background: var(--color-accent-strong); color: var(--color-on-accent); }
.btn-sm { min-height: 40px; padding: 0.7em 1.25em; font-size: 0.875rem; }

/* --- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  transition: background-color 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
/* Paints the band above the sticky header on phones with a top inset. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: env(safe-area-inset-top, 0px);
  background: var(--color-surface);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--color-surface) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--color-ink) 8%, transparent);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.25rem;
}
.logo-link { display: flex; align-items: center; min-height: 44px; flex: none; }
/* The wordmark is one flat colour, so it is drawn as a mask and follows the
   ink token in both themes. */
.logo {
  display: block;
  width: 140px;
  aspect-ratio: 154 / 18;
  background: var(--color-ink);
  -webkit-mask: url('/assets/img/logo.svg') no-repeat center / contain;
  mask: url('/assets/img/logo.svg') no-repeat center / contain;
}
.site-nav { display: flex; align-items: center; gap: 2rem; font-size: 0.95rem; }
.site-nav a { text-decoration: none; padding-block: 0.6rem; transition: opacity 0.2s; }
.site-nav a:hover { opacity: 0.6; }
.site-header__tools { display: flex; align-items: center; gap: 0.75rem; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-line);
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
  transition: background-color 0.2s;
}
.icon-btn:hover { background: var(--color-surface-alt); }
.lang-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-line);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s;
}
.lang-pill:hover { background: var(--color-surface-alt); }

/* Moon while the page is light, sun while it is dark: the icon shows what
   pressing it gives you. */
.theme-sun { display: none; }
:root[data-theme='dark'] .theme-sun { display: block; }
:root[data-theme='dark'] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-sun { display: block; }
  :root:not([data-theme='light']) .theme-moon { display: none; }
}

.menu-btn { display: none; }
.mobile-nav { border-top: 1px solid var(--color-line); background: var(--color-surface); }
.mobile-nav ul { display: flex; flex-direction: column; padding-block: 0.75rem; }
.mobile-nav a { display: block; padding-block: 0.75rem; font-size: 1.125rem; text-decoration: none; }

@media (max-width: 860px) {
  .site-nav, .site-header__cta { display: none; }
  .menu-btn { display: flex; }
}
@media (min-width: 861px) {
  .mobile-nav { display: none; }
}

/* --- Hero ---------------------------------------------------------------- */
/* Eventstream's own composition: copy on the left, the hero illustration on the
   right, in the AI-Interactive type and buttons. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 3vw, 2rem);
}
.hero__copy { display: flex; flex-direction: column; gap: 1.5rem; }
.hero h1 { max-width: 16ch; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.hero__points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6em 1.5rem;
  margin-top: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
}
.hero__art img { width: 100%; max-width: 40rem; margin-inline: auto; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .hero__points { grid-template-columns: minmax(0, 1fr); }
}

/* --- Features ------------------------------------------------------------ */
.section-head { display: flex; flex-direction: column; gap: 1rem; max-width: 46rem; }
.section-head .lede { margin-top: 0.5rem; }

.features { display: flex; flex-direction: column; gap: clamp(4rem, 8vw, 6.5rem); margin-top: clamp(3rem, 6vw, 4.5rem); }

.feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}
.feature--flip .feature__media { order: 2; }
.feature__media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--radius-card);
  background: var(--color-surface-alt);
}
.feature__media img { width: 100%; max-width: 30rem; }
.feature__body { display: flex; flex-direction: column; gap: 1.25rem; }
.feature__body p { color: var(--color-ink-medium); max-width: 52ch; }
.feature__body .dots { margin-top: 0.25rem; font-size: 1rem; font-weight: 500; }

.feature-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: var(--radius-card);
  background: var(--color-surface-alt);
}
.feature-card img { width: 100%; max-width: 24rem; align-self: center; margin-bottom: 0.5rem; }
.feature-card h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.1; }
.feature-card p { color: var(--color-ink-medium); }

@media (max-width: 820px) {
  .feature, .feature-pair { grid-template-columns: minmax(0, 1fr); }
  .feature--flip .feature__media { order: 0; }
}

/* --- Dark cards (analytics, demo) ---------------------------------------- */
.dark-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
  padding: clamp(1.75rem, 4.5vw, 4rem);
  border-radius: var(--radius-card);
  background: var(--color-dark);
  color: var(--color-on-dark);
}
.dark-card__body { display: flex; flex-direction: column; gap: 1.25rem; }
.dark-card__body > p { color: var(--color-on-dark-medium); max-width: 52ch; }
.dark-card .eyebrow { color: var(--color-on-dark-medium); }
.dark-card__art {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: calc(var(--radius-card) - 6px);
  background: var(--color-art-panel);
}
.dark-card__art img { width: 100%; max-width: 28rem; }
.dark-card .btn-accent { align-self: flex-start; margin-top: 0.5rem; }
.dark-card :focus-visible { outline-color: var(--color-accent); }

.metrics-title { margin-top: 0.75rem; font-size: 1rem; font-weight: 500; color: var(--color-on-dark); }
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.metrics li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: 16px;
  background: var(--color-dark-alt);
  font-size: 0.95rem;
  line-height: 1.35;
}
.metrics__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--color-dark);
  color: var(--color-accent);
}

@media (max-width: 960px) {
  .dark-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
}

/* --- Steps --------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
.step {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
}
.step .num { font-size: 1.75rem; margin-bottom: 0.75rem; }
.step h3 { font-size: 1.25rem; line-height: 1.2; }
.step p { font-size: 1rem; color: var(--color-ink-medium); }

@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* --- Contact ------------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
.contact__intro { display: flex; flex-direction: column; gap: 1rem; }
.contact__lines { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.5rem; }
.contact__lines a {
  display: inline-flex;
  align-self: flex-start;
  min-height: 44px;
  align-items: center;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: opacity 0.2s;
}
.contact__lines a:hover { opacity: 0.6; }

.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  border-radius: var(--radius-card);
  background: var(--color-surface-alt);
}
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-medium);
}
.field input, .field textarea {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-field);
  background: var(--color-surface);
  font: inherit;
  font-size: 1rem;
  color: var(--color-ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--color-ink-low); }
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 55%, transparent);
}
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form__note { font-size: 0.85rem; color: var(--color-ink-low); }
/* Holds the Turnstile widget's height before it renders (site build only). */
.form__turnstile[data-sitekey] { min-height: 65px; }
.form__status { flex-basis: 100%; font-size: 0.95rem; font-weight: 500; }
.form__status:empty { display: none; }
.form__status.is-ok { color: var(--color-success); }
.form__status.is-error { color: var(--color-danger); }
.form button[disabled] { opacity: 0.6; pointer-events: none; }

@media (max-width: 900px) { .contact { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .form__row { grid-template-columns: minmax(0, 1fr); } }

/* --- Footer ------------------------------------------------------------- */
/* The original Eventstream footer (name + tagline, links, social icons, legal
   line) on an always-dark band. */
.site-footer {
  margin-top: clamp(5rem, 10vw, 9rem);
  border-top: 1px solid var(--color-line);
  background: var(--color-dark);
  color: var(--color-on-dark);
}
.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding-block: 2.5rem;
}
.site-footer__brand { display: flex; flex-direction: column; gap: 0.35rem; }
.site-footer__name { font-size: 1.375rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.site-footer__tagline { font-size: 0.875rem; color: var(--color-on-dark-medium); }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 0.95rem; }
.site-footer__nav a { padding-block: 0.6rem; text-decoration: none; transition: opacity 0.2s; }
.site-footer__nav a:hover { opacity: 0.6; }
.site-footer__social { display: flex; gap: 0.5rem; }
.site-footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-dark-alt);
  transition: background-color 0.2s;
}
.site-footer__social a:hover { background: color-mix(in srgb, var(--color-dark-alt) 80%, var(--color-on-dark)); }
.site-footer__legal { border-top: 1px solid var(--color-dark-alt); }
.site-footer__legal p { padding-block: 1.25rem; font-size: 0.8rem; color: var(--color-on-dark-medium); }
.site-footer :focus-visible { outline-color: var(--color-accent); }

/* --- Motion -------------------------------------------------------------- */
/* Box the page script puts in place of an illustration to play its Lottie. */
.lottie { width: 100%; margin-inline: auto; }
.lottie svg { display: block; }
.lottie[hidden], .es img[hidden] { display: none; }

/* Above the fold animates from CSS and paints on the first frame. */
[data-enter] { animation: enter-up 0.75s var(--ease-out-expo) both; }
[data-enter='2'] { animation-delay: 0.08s; }
[data-enter='3'] { animation-delay: 0.16s; }
@keyframes enter-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

/* Scroll reveal lifts sections into place as they arrive. Transform only:
   nothing is ever hidden waiting for the observer, so the page reads in full
   without JavaScript and in a still capture. */
.js-reveal [data-reveal]:not(.is-visible) { transform: translateY(32px); }
.js-reveal [data-reveal].is-visible { transition: transform 0.9s var(--ease-out-expo); }

@media (prefers-reduced-motion: reduce) {
  [data-enter] { animation: none; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
  .js-reveal [data-reveal]:not(.is-visible) { transform: none; }
}
