/* AgentUX landing — dark, value-forward, short for mobile.
 *
 * Palette matches the catalogue app (designer/) so the landing → app
 * transition feels continuous, not like crossing into a different
 * product. Indigo accent + cream highlights mirror the brand mark.
 *
 * Goals:
 *  - Single-fold hero on desktop, ~1 viewport on mobile
 *  - ~3 mobile-viewports total page height (was ~10 on the old site)
 *  - No expanded <details>, no FAQ accordion, no telegram band
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  --bg:           #0a0a0c;
  --surface:      #0f0f10;
  --surface-2:    #16161a;
  --line:         #2a2a30;
  --line-soft:    #1a1a1f;
  --ink:          #fafafa;
  --ink-muted:    #a1a1aa;
  --ink-dim:      #71717a;
  --accent:       #6366f1;   /* indigo — matches catalogue brand */
  --accent-hover: #818cf8;
  --accent-soft:  rgba(99, 102, 241, 0.16);
  --cream:        #F8EFE3;   /* glyph cream — used sparingly for headline lift */

  --radius-pill: 999px;
  --radius-lg:   18px;
  --radius-md:   12px;

  --max-width:   1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
  /* Subtle indigo glow behind the hero — anchors the page brand-wise
   * without being loud. Single radial, vignette-falloff. */
  background-image:
    radial-gradient(
      ellipse 60% 50% at 50% 0%,
      rgba(99, 102, 241, 0.10) 0%,
      rgba(99, 102, 241, 0.04) 35%,
      transparent 75%
    );
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

.site {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Topbar ───────────────────────────────────────────────────────── */
/* Single centered brand — header has no nav, no CTA. The whole page is
 * the call to action; the centered logo just anchors the brand. */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand img { display: block; }

/* ─── Buttons ──────────────────────────────────────────────────────── */
/* Single chunky 56px button used in the hero — neutral Deploy-style
 * (dark glossy gradient with inset highlight + offset bottom shadow).
 * Borrowed from a shared design reference. */
.button-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  min-width: 176px;
  padding: 0 22px;
  border-radius: 16px;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: filter 0.15s ease-out, transform 0.15s ease-out, box-shadow 0.15s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.button-hero:hover {
  filter: brightness(1.04);
  transform: translateY(-2px);
}
.button-hero:active {
  transform: translateY(1px);
}
.button-hero:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

/* Deploy — dark glossy gradient with inset highlight + offset shadow */
.button-deploy {
  border-color: #111116;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(180deg, #5a5a63 0%, #303038 45%, #111116 100%);
  color: #ffffff;
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.20),
    inset 0 -3px 0 rgba(0, 0, 0, 0.22),
    0 5px 0 #09090d,
    0 8px 12px rgba(0, 0, 0, 0.24);
}

/* ─── Eyebrow tag ──────────────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 16px;
}

/* ─── Hero ─────────────────────────────────────────────────────────── */
.hero {
  padding: 96px 0 80px;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.hero h1 {
  /* Instrument Serif italic for the headline gives the landing a
   * "library / atlas" character — a deliberate contrast against the
   * catalogue's UI-dense Inter, while still feeling sibling. */
  font-family: "Instrument Serif", "Inter", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 24px;
}
.hero-text {
  font-size: clamp(16px, 1.6vw, 18px);
  color: var(--ink-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── Group masonry ────────────────────────────────────────────────── */
/* CSS-columns masonry of brand icons fetched from
 * catalogue_group_appearance (anon-readable). Decorative — visitors
 * see real apps they recognise as a credibility signal. Each tile
 * links to that group's detail page in the catalogue. */
.group-masonry {
  /* CSS Grid (not columns) — explicit column count gives us reliable
   * per-column nth-child math for the zigzag. 50 tiles across 10
   * columns at desktop, fewer at narrower viewports. */
  --cols: 10;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 12px;
  max-width: 1440px;
  margin: 64px auto 0;
  padding: 0 24px;
  /* Fade the masonry into the background at the edges so it reads as
   * texture, not a hard-edged section. */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 14%,
    #000 86%,
    transparent 100%
  );
}

.group-tile {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  aspect-ratio: 1 / 1;
  transition: transform 0.18s ease-out, border-color 0.18s ease-out;
}

/* Per-column zigzag — whole columns shifted up/down so the wall reads
 * as deliberately staggered. Each nth-child(10n+K) selects every tile
 * in column K (since there are exactly 10 columns at desktop). The
 * pattern: even columns shifted down ~20px; column 4 + 8 shifted a
 * little extra so the rhythm reads as wave-like, not pure on/off. */
.group-masonry .group-tile:nth-child(10n+1)  { transform: translateY(0); }
.group-masonry .group-tile:nth-child(10n+2)  { transform: translateY(18px); }
.group-masonry .group-tile:nth-child(10n+3)  { transform: translateY(6px); }
.group-masonry .group-tile:nth-child(10n+4)  { transform: translateY(24px); }
.group-masonry .group-tile:nth-child(10n+5)  { transform: translateY(0); }
.group-masonry .group-tile:nth-child(10n+6)  { transform: translateY(18px); }
.group-masonry .group-tile:nth-child(10n+7)  { transform: translateY(6px); }
.group-masonry .group-tile:nth-child(10n+8)  { transform: translateY(24px); }
.group-masonry .group-tile:nth-child(10n+9)  { transform: translateY(0); }
.group-masonry .group-tile:nth-child(10n)    { transform: translateY(18px); }

.group-tile:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(99, 102, 241, 0.40);
}

.group-tile img {
  display: block;
  width: 100%;
  height: auto;
  /* The cards in the app render icons on a tinted square. Here we
   * trust the icons to carry themselves; no aspect-ratio lock so
   * non-square icons still feel native to the wall. */
}

/* Narrower viewports reduce the column count. The per-column zigzag
 * rules above are written for 10 columns; at smaller column counts
 * they still create a staggered look but the rhythm shifts (since
 * nth-child(10n+K) maps to different physical columns once the grid
 * reflows). That's fine — the wall still reads as staggered. */
@media (max-width: 1280px) { .group-masonry { --cols: 8; } }
@media (max-width: 1024px) { .group-masonry { --cols: 7; } }
@media (max-width: 768px)  {
  .group-masonry { --cols: 5; gap: 8px; max-width: 480px; padding: 0 12px; }
  .group-tile { border-radius: 10px; }
  /* Tighter zigzag on mobile — full 24px shift looks broken at small sizes. */
  .group-masonry .group-tile { transform: translateY(0); }
  .group-masonry .group-tile:nth-child(5n+2) { transform: translateY(10px); }
  .group-masonry .group-tile:nth-child(5n+4) { transform: translateY(10px); }
}
@media (max-width: 480px)  { .group-masonry { --cols: 4; } }

/* ─── Footer ───────────────────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--ink-dim);
  flex-wrap: wrap;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-brand img { display: block; opacity: 0.8; }
.footer-brand strong {
  color: var(--ink-muted);
  font-weight: 500;
}
.footer-sep { color: var(--line); }
.footer-author { color: var(--ink-dim); }
.footer-links {
  display: inline-flex;
  gap: 16px;
}
.footer-links a {
  color: var(--ink-dim);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--ink); }

/* ─── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site { padding: 0 16px; }

  .topbar { padding: 18px 0; }

  .hero { padding: 56px 0 48px; }
  .hero h1 { font-size: clamp(36px, 9vw, 48px); }
  .hero-actions .button-hero { width: 100%; }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 0 32px;
  }
}

/* ─── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button-hero { transition: none; }
  .button-hero:hover { transform: none; }
}
