/* ════════════════════════════════════════════════════════════════════════════
   ImageHalo — Landing page  ·  Aesthetic: "Foundry Noir"
   ────────────────────────────────────────────────────────────────────────────
   A premium dark atelier. Reuses the workspace's Linear/Vercel dark palette so
   the marketing page and the product feel like one object — but earns a memory
   anchor the workspace doesn't have:
     1. an editorial SERIF display headline (Fraunces / Song) against the
        utilitarian Inter UI, and
     2. a "living gallery wall" — real generated art scrolling in staggered
        vertical columns behind the hero.
   A single restrained warm-gold accent (drawn from the posters) threads through
   eyebrows and hairlines; everything else stays monochrome.

   Self-contained: does NOT import styles.css. The workspace stylesheet locks the
   body to 100vh / overflow:hidden, which would break a scrolling page — so the
   palette tokens are redeclared here and the body is free to scroll.
   ════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&display=swap');

:root {
  --page-bg: #0e0e0e;
  --panel-bg: #171717;
  --card-bg: #1c1c1c;
  --raised-bg: #242424;

  --text-primary: #ededed;
  --text-secondary: #8c8c8c;
  --text-tertiary: #5c5c5c;

  --gold: #d8b48a;          /* the one accent — used sparingly */
  --gold-faint: rgba(216, 180, 138, 0.14);

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --radius: 16px;
  --radius-sm: 12px;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fraunces', 'Songti SC', 'Song', 'STSong', Georgia, serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --maxw: 1200px;
}

* { box-sizing: border-box; }
/* The HTML `hidden` attribute must win over flex/inline display rules so
   feature-flagged links (e.g. community) stay hidden when the flag is off. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

.eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin: 0 0 18px;
  font-weight: 500;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--text-primary); color: #0e0e0e; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,255,255,0.12); }
.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.btn-lg { padding: 15px 30px; font-size: 0.98rem; }

/* ════════════════════════════════════════════════════════════════════════════
   TOP BAR — fixed, frosted
   ════════════════════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: 68px;
  display: flex; align-items: center;
  background: rgba(14, 14, 14, 0.6);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--line); background: rgba(14,14,14,0.82); }
.topbar .wrap { display: flex; align-items: center; gap: 24px; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-word { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }

.nav-links { display: flex; gap: 4px; margin-left: 18px; }
.nav-links a {
  font-size: 0.86rem; color: var(--text-secondary);
  padding: 8px 12px; border-radius: 8px; transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.link-login { font-size: 0.86rem; color: var(--text-secondary); padding: 8px 10px; transition: color 0.15s; }
.link-login:hover { color: var(--text-primary); }

/* ════════════════════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}
/* warm glow bleeding from behind the gallery wall */
.hero::before {
  content: ""; position: absolute; z-index: 0;
  top: -10%; right: -5%; width: 60vw; height: 80vh;
  background: radial-gradient(ellipse at center, var(--gold-faint), transparent 65%);
  filter: blur(40px); pointer-events: none;
}

/* ── Ambient brand halos ─────────────────────────────────────────────────────
   Soft purple ImageHalo-colored glows behind the hero. They sit above the warm
   gold glow (z0) but below the content (z2), giving a cool-left / warm-right
   atmosphere. A very slow opacity+drift "breathe" passively echoes the Troxler
   fade — no fixation required. Disabled under reduced-motion. */
.hero-halos { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.halo {
  position: absolute; border-radius: 50%; will-change: opacity, transform;
  background: radial-gradient(circle at center, rgba(169,116,255,0.20), rgba(169,116,255,0) 70%);
  filter: blur(44px);
}
.halo-a {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  top: -10%; left: -8%;
  animation: halo-breathe-a 17s var(--ease) infinite;
}
.halo-b {
  width: 32vw; height: 32vw; max-width: 420px; max-height: 420px;
  bottom: -14%; left: 20%;
  background: radial-gradient(circle at center, rgba(169,116,255,0.14), rgba(169,116,255,0) 70%);
  animation: halo-breathe-b 23s var(--ease) infinite;
}
@keyframes halo-breathe-a {
  0%, 100% { opacity: 0.5; transform: translate3d(0, 0, 0) scale(1); }
  50%      { opacity: 1;   transform: translate3d(2.5%, 1.5%, 0) scale(1.08); }
}
@keyframes halo-breathe-b {
  0%, 100% { opacity: 0.85; transform: translate3d(0, 0, 0) scale(1.04); }
  50%      { opacity: 0.35; transform: translate3d(-2%, -1.5%, 0) scale(0.94); }
}
@media (prefers-reduced-motion: reduce) {
  .halo { animation: none !important; }
}

.hero .wrap {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center;
}

.hero-copy { max-width: 560px; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.8rem, 5.4vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.hero-title .accent { color: var(--gold); font-style: italic; }
.hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: var(--text-secondary);
  line-height: 1.6; margin: 0 0 36px; max-width: 480px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust {
  display: flex; gap: 22px; flex-wrap: wrap;
  margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line);
}
.hero-trust span {
  font-size: 0.82rem; color: var(--text-tertiary);
  display: inline-flex; align-items: center; gap: 7px;
}
.hero-trust span::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); flex: none;
}

/* ── The living gallery wall (memory anchor) ─────────────────────────────────
   Three columns of real generated art scrolling vertically at staggered speeds,
   masked top & bottom so they dissolve into the page rather than ending hard. */
.gallery-wall {
  position: relative;
  height: 78vh; max-height: 720px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}
.wall-col { position: relative; overflow: hidden; }
.wall-track {
  display: flex; flex-direction: column; gap: 16px;
  animation: wall-scroll var(--dur, 38s) linear infinite;
  will-change: transform;
}
.wall-col:nth-child(2) .wall-track { --dur: 50s; animation-direction: reverse; }
.wall-col:nth-child(3) .wall-track { --dur: 44s; }
.gallery-wall:hover .wall-track { animation-play-state: paused; }

.wall-track img {
  width: 100%; border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  background: var(--card-bg);
}
@keyframes wall-scroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

/* ════════════════════════════════════════════════════════════════════════════
   SECTION SCAFFOLD
   ════════════════════════════════════════════════════════════════════════════ */
section { position: relative; }
.section-pad { padding: 110px 0; }
.section-head { max-width: 640px; margin: 0 0 56px; }
.section-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.1;
  letter-spacing: -0.02em; margin: 0 0 16px;
}
.section-sub { font-size: 1.02rem; color: var(--text-secondary); margin: 0; line-height: 1.6; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ── Capabilities ─────────────────────────────────────────────────────────── */
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cap-card {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 28px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s;
}
.cap-card:hover { border-color: var(--line-strong); transform: translateY(-4px); background: var(--raised-bg); }
.cap-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-faint); color: var(--gold);
  margin-bottom: 22px;
}
.cap-icon svg { width: 22px; height: 22px; }
.cap-card h3 { font-size: 1.12rem; font-weight: 600; margin: 0 0 10px; }
.cap-card p { font-size: 0.92rem; color: var(--text-secondary); margin: 0; line-height: 1.6; }

/* ── How it works ─────────────────────────────────────────────────────────── */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.how-step { position: relative; padding: 0 28px; }
.how-step:not(:last-child)::after {
  content: ""; position: absolute; top: 18px; right: -1px; bottom: 18px;
  width: 1px; background: var(--line);
}
.how-num {
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 500;
  color: var(--gold); line-height: 1; margin-bottom: 18px;
}
.how-step h3 { font-size: 1.08rem; font-weight: 600; margin: 0 0 10px; }
.how-step p { font-size: 0.92rem; color: var(--text-secondary); margin: 0; line-height: 1.6; }

/* ── Showcase grid (real outputs) ─────────────────────────────────────────── */
.show-section { background: var(--panel-bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.show-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr; gap: 16px;
}
.show-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card-bg); aspect-ratio: 1;
}
/* a couple of tiles span larger to break the grid rhythm */
.show-card.tall { grid-row: span 2; aspect-ratio: auto; }
.show-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.show-card:hover img { transform: scale(1.05); }
.show-tag {
  position: absolute; left: 12px; bottom: 12px;
  font-size: 0.74rem; font-weight: 500; color: var(--text-primary);
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px;
  opacity: 0; transform: translateY(6px); transition: all 0.25s var(--ease);
}
.show-card:hover .show-tag { opacity: 1; transform: translateY(0); }
.show-new-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em;
  background: var(--accent); color: #0e1417;
  padding: 3px 9px; border-radius: 999px;
}

/* ── Pricing / credits ───────────────────────────────────────────────────── */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.price-card {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 28px;
}
.price-card.feature { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-faint), transparent 60%); }
.price-tag-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.price-big { font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; line-height: 1; }
.price-unit { font-size: 0.9rem; color: var(--text-secondary); }
.price-card h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 18px; }
.price-card p { font-size: 0.9rem; color: var(--text-secondary); margin: 0; line-height: 1.65; }
.price-note {
  margin-top: 28px; font-size: 0.86rem; color: var(--text-tertiary);
  text-align: center; line-height: 1.6;
}

/* ── Final CTA ────────────────────────────────────────────────────────────── */
.final {
  text-align: center; padding: 120px 0;
  position: relative; overflow: hidden;
}
.final::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 40%, var(--gold-faint), transparent 70%);
  pointer-events: none;
}
.final .wrap { position: relative; z-index: 1; }
.final-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.2rem, 4.2vw, 3.4rem); line-height: 1.08;
  letter-spacing: -0.02em; margin: 0 auto 20px; max-width: 16ch;
}
.final-sub { font-size: 1.05rem; color: var(--text-secondary); margin: 0 auto 36px; max-width: 460px; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 44px 0; }
.footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-left { display: flex; align-items: center; gap: 11px; color: var(--text-secondary); font-size: 0.86rem; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { font-size: 0.84rem; color: var(--text-secondary); transition: color 0.15s; }
.footer-links a:hover { color: var(--text-primary); }
.footer-copy { font-size: 0.8rem; color: var(--text-tertiary); }

/* ════════════════════════════════════════════════════════════════════════════
   ENTRANCE MOTION — one staggered reveal, then quiet
   ════════════════════════════════════════════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 48px; }
  .hero-copy { max-width: none; }
  .gallery-wall { height: 52vh; max-height: 460px; }
  .cap-grid, .how-grid, .price-grid { grid-template-columns: 1fr; }
  .how-step { padding: 28px 0; }
  .how-step:not(:last-child)::after { top: auto; right: 0; bottom: -1px; left: 0; width: auto; height: 1px; }
  .show-grid { grid-template-columns: repeat(2, 1fr); }
  .show-card.tall { grid-row: span 1; aspect-ratio: 1; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .nav-links { display: none; }
  /* Free up the cramped phone topbar: drop the redundant text sign-in link
     (login is still reachable from the footer and via Start free → /app). */
  .link-login { display: none; }
  .topbar .wrap { gap: 12px; }
  .section-pad { padding: 72px 0; }
  .hero { padding: 100px 0 60px; min-height: auto; }
  .gallery-wall { grid-template-columns: repeat(2, 1fr); height: 46vh; }
  .wall-col:nth-child(3) { display: none; }
  .hero-trust { gap: 14px; }
  .final { padding: 80px 0; }
}

/* Honour reduced-motion: kill the marquee + entrance, keep everything legible. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wall-track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .show-card img, .btn, .cap-card { transition: none; }
}
