/* ── Dialogis · smart brutalism (ported from dialogis_widget) ─────────── */
:root {
  --paper: #f5f3ee;
  --ink: #0a0a0a;
  --flare: #e4ff1a;
  --flare-deep: #c8e600;

  --bg: #0a0a0a;
  --panel: #100f0c;
  --panel-2: #15140f;
  --text: #f5f3ee;
  --text-dim: rgba(245, 243, 238, 0.70);
  --text-mute: rgba(245, 243, 238, 0.44);
  --line: rgba(245, 243, 238, 0.15);
  --line-strong: rgba(245, 243, 238, 0.32);
  --glow: 0 0 24px rgba(228, 255, 26, 0.45);

  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Archivo", system-ui, -apple-system, sans-serif;

  --container: 1040px;
  --pad: clamp(20px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Film grain */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.container {
  width: min(var(--container), calc(100vw - 2 * var(--pad)));
  margin: 0 auto;
}

/* ── Primitives ──────────────────────────────────────────────────────── */
.mono {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.dot { color: var(--flare); text-shadow: 0 0 18px rgba(228, 255, 26, 0.6); }

.flare-rule {
  display: block;
  width: 52px; height: 6px;
  background: var(--flare);
  box-shadow: var(--glow);
}

:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; }

.eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* status pill: flare = LIVE, outline = COMING SOON */
.pill {
  font-family: var(--mono); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 2px;
  display: inline-block;
}
.pill-live { background: var(--flare); color: var(--ink); box-shadow: var(--glow); }
.pill-soon { background: transparent; color: var(--text-dim); border: 1px solid var(--line-strong); }

.chip {
  font-family: var(--sans); font-weight: 600; font-size: 0.86rem;
  padding: 0.42rem 0.82rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text-dim);
  transition: 130ms var(--ease);
}
.chip:hover { border-color: var(--flare); color: var(--flare); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  cursor: pointer; font-family: inherit; transition: 150ms var(--ease);
}
.btn-ghost {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.55rem 0.9rem; border: 1px solid var(--line); color: var(--text); background: transparent;
}
.btn-ghost:hover { background: var(--flare); color: var(--ink); border-color: var(--flare); box-shadow: var(--glow); }
.btn-solid {
  font-family: var(--sans); font-weight: 800; font-size: 1rem; letter-spacing: -0.01em;
  padding: 0.85rem 1.5rem;
  background: var(--flare); color: var(--ink);
  border: 1px solid var(--flare); border-radius: 999px; box-shadow: var(--glow);
}
.btn-solid:hover { background: var(--flare-deep); border-color: var(--flare-deep); transform: translateY(-1px); box-shadow: 0 0 34px rgba(228, 255, 26, 0.6); }
.btn-solid:active { transform: translateY(0); }
.btn-solid svg { width: 17px; height: 17px; }

.lang-toggle {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  padding: 0.46rem 0.62rem; border: 1px solid var(--line); background: transparent; color: var(--text);
  cursor: pointer; transition: 130ms var(--ease);
}
.lang-toggle:hover { background: var(--flare); color: var(--ink); border-color: var(--flare); }

/* ── Viewfinder crop-mark frame ──────────────────────────────────────── */
.viewfinder { position: fixed; inset: 14px; z-index: 9000; pointer-events: none; }
.viewfinder i { position: absolute; width: 16px; height: 16px; }
.viewfinder i.tl { top: 0; left: 0; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.viewfinder i.tr { top: 0; right: 0; border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); }
.viewfinder i.bl { bottom: 0; left: 0; border-bottom: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.viewfinder i.br { bottom: 0; right: 0; border-bottom: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); }

/* ── Reveal on scroll (base; observer wired in Task 2) ───────────────── */
[data-reveal] { opacity: 0; transform: translateY(14px); }
[data-reveal].is-in { opacity: 1; transform: none; transition: opacity 540ms var(--ease), transform 540ms var(--ease); }

/* ── Sections (rhythm) ───────────────────────────────────────────────── */
.section { padding-block: clamp(40px, 7vw, 84px); }

/* ── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 900; font-size: 1.15rem; letter-spacing: -0.03em; color: var(--text); }
.brand-dot { width: 9px; height: 9px; background: var(--flare); display: inline-block; box-shadow: var(--glow); }
.menu { display: flex; gap: 22px; }
.menu a { color: var(--text-mute); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; transition: color 150ms var(--ease); }
.menu a:hover { color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

@media (max-width: 820px) {
  .menu { display: none; }
  .topbar-actions .btn-ghost { display: none; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate;
  display: flex; align-items: center;
  padding-block: clamp(64px, 12vw, 132px);
  border-bottom: 1px solid var(--line-strong);
  overflow: hidden;
  background:
    radial-gradient(80% 95% at 88% 46%, rgba(228, 255, 26, 0.10), transparent 62%),
    radial-gradient(120% 80% at 78% 14%, rgba(228, 255, 26, 0.05), transparent 55%),
    linear-gradient(180deg, #0c0c0a 0%, #090907 62%, #050504 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(118deg, transparent 56%, rgba(245, 243, 238, 0.045) 64%, transparent 80%);
}
.hero .container { position: relative; z-index: 2; }
.hero-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: clamp(28px, 5vw, 52px); }
.flare-rule { margin: 0 0 22px; }
.hero-title {
  margin: 0; font-weight: 900; letter-spacing: -0.035em; line-height: 0.96;
  font-size: clamp(2.5rem, 8vw, 5.2rem); max-width: 18ch;
}
.hero .lead {
  margin: 24px 0 0; max-width: 56ch; color: var(--text-dim);
  font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 500; line-height: 1.5;
}
@media (max-width: 767px) {
  .hero-title { font-size: clamp(2.2rem, 11vw, 3.4rem); }
}

/* ── Products at a glance ────────────────────────────────────────────── */
.overview { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 2.4vw, 22px); }
.ov-card {
  display: flex; flex-direction: column; gap: 14px;
  border: 1px solid var(--line); background: var(--panel);
  padding: clamp(22px, 3vw, 34px);
  transition: border-color 160ms var(--ease), transform 160ms var(--ease), background 160ms var(--ease);
}
.ov-card:hover { border-color: var(--line-strong); transform: translateY(-3px); background: var(--panel-2); }
.ov-card .pill { align-self: flex-start; }
.ov-title { margin: 6px 0 0; font-weight: 900; letter-spacing: -0.03em; line-height: 1.02; font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--text); }
.ov-name { margin-top: auto; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-mute); }
.ov-jump { display: inline-flex; align-items: center; gap: 8px; color: var(--flare); font-weight: 700; font-size: 0.96rem; }
.ov-jump .arrow { transition: transform 160ms var(--ease); }
.ov-card:hover .ov-jump .arrow { transform: translateY(3px); }
@media (max-width: 767px) { .overview { grid-template-columns: 1fr; } }

/* ── Section headings (shared by product detail sections) ────────────── */
.sec-title { margin: 0; font-weight: 900; letter-spacing: -0.035em; line-height: 0.98; font-size: clamp(2rem, 5vw, 3.2rem); color: var(--text); }
.sec-sub { margin: 14px 0 0; max-width: 60ch; color: var(--text-dim); font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 500; line-height: 1.5; }
.sec-body { margin: 18px 0 0; max-width: 64ch; color: var(--text-dim); font-size: 1.02rem; line-height: 1.7; }

/* ── Feature cards ───────────────────────────────────────────────────── */
.cards-grid { margin-top: clamp(26px, 4vw, 44px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 16px); }
.feature-card {
  border: 1px solid var(--line); background: var(--panel);
  padding: clamp(18px, 2vw, 24px); min-height: 184px;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}
.feature-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card-kicker { margin: 0; color: var(--flare); font-family: var(--mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }
.feature-card h3 { margin: 12px 0 0; font-weight: 800; letter-spacing: -0.01em; font-size: 1.3rem; line-height: 1.12; color: var(--text); }
.feature-card p:not(.card-kicker) { margin: 10px 0 0; color: var(--text-dim); font-size: 0.98rem; line-height: 1.6; }
@media (max-width: 880px) { .cards-grid { grid-template-columns: 1fr; } }

/* ── Upload → Forge → Chat steps ─────────────────────────────────────── */
.steps { margin-top: clamp(26px, 4vw, 44px); display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.step { display: flex; flex-direction: column; gap: 10px; padding: clamp(22px, 2.4vw, 32px) clamp(18px, 2vw, 28px); border-left: 1px solid var(--line); }
.step:first-child { border-left: 0; }
.step-num { font-size: 0.78rem; letter-spacing: 0.12em; color: var(--flare); }
.step-label { margin: 2px 0 0; color: var(--text); font-weight: 800; letter-spacing: -0.01em; font-size: clamp(1.2rem, 2vw, 1.5rem); }
.step-desc { margin: 0; color: var(--text-dim); font-size: 0.98rem; line-height: 1.6; }
.formats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.formats .chip { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; }
@media (max-width: 767px) {
  .steps { display: flex; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .steps::-webkit-scrollbar { display: none; }
  .step { flex: 0 0 80%; border-left: 0; border-right: 1px solid var(--line); scroll-snap-align: start; }
  .step:last-child { border-right: 0; }
}

/* ── Embed modes schematic ───────────────────────────────────────────── */
.modes { margin-top: clamp(28px, 4vw, 48px); display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(22px, 3vw, 44px); }
.mode { display: flex; flex-direction: column; }
.mode-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); background: rgba(245, 243, 238, 0.02); overflow: hidden; margin-bottom: 18px; }
.mode-frame::before { content: ""; position: absolute; left: 16px; top: 16px; width: 38%; height: 5px; background: rgba(245, 243, 238, 0.14); box-shadow: 0 12px 0 rgba(245, 243, 238, 0.09), 0 24px 0 rgba(245, 243, 238, 0.06); }
.mode-frame .bubble { position: absolute; right: 16px; bottom: 16px; width: 28px; height: 28px; border-radius: 999px; background: var(--flare); box-shadow: var(--glow); }
.mode-frame .inline-panel { position: absolute; right: 16px; top: 16px; bottom: 16px; width: 46%; border: 1px solid var(--flare); background: rgba(228, 255, 26, 0.07); }
.mode-label { margin: 0; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--flare); }
.mode-desc { margin: 8px 0 0; color: var(--text-dim); font-size: 0.98rem; line-height: 1.6; }
.embed-foot { margin: clamp(24px, 4vw, 40px) 0 0; color: var(--text-mute); }
.aimind-cta { margin-top: clamp(22px, 3vw, 30px); }
@media (max-width: 767px) { .modes { grid-template-columns: 1fr; gap: 16px; } }

/* ── Principles ──────────────────────────────────────────────────────── */
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.principles li {
  border: 1px solid var(--line); background: var(--panel);
  padding: 14px 18px; font-weight: 600; color: var(--text-dim);
  transition: border-color 150ms var(--ease), color 150ms var(--ease);
}
.principles li:hover { border-color: var(--flare); color: var(--text); }

/* ── Closing CTA ─────────────────────────────────────────────────────── */
.cta-box { border: 1px solid var(--line-strong); background: var(--panel); padding: clamp(26px, 4vw, 44px); }
.cta-body { margin: 14px 0 0; color: var(--text-dim); font-size: 1.05rem; line-height: 1.6; }
.cta-actions { margin-top: clamp(22px, 3vw, 30px); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); margin-top: clamp(24px, 5vw, 56px); }
.footer-inner {
  padding: 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-mute);
}
.footer-inner a { color: var(--text-mute); transition: color 150ms var(--ease); }
.footer-inner a:hover { color: var(--flare); }
@media (max-width: 640px) { .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; } }

/* ── Top scroll-progress flare line ──────────────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: var(--flare); box-shadow: 0 0 12px rgba(228, 255, 26, 0.6);
  transform: scaleX(var(--progress, 0)); transform-origin: 0 50%;
  pointer-events: none;
}

/* Hero load-in (first paint, no scroll needed) */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero[data-reveal] { opacity: 1; transform: none; } /* hero animates its children instead */
.hero .container > * { opacity: 0; animation: rise 700ms var(--ease) forwards; }
.hero .hero-meta { animation-delay: 60ms; }
.hero .flare-rule { animation-delay: 150ms; }
.hero .hero-title { animation-delay: 250ms; }
.hero .lead { animation-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .hero .container > * { opacity: 1 !important; transform: none !important; animation: none !important; }
  * { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 767px) {
  .viewfinder { inset: 9px; }
  .topbar-inner { min-height: 58px; }
}
