/* NexBrain landing page. Colours and type follow the app's design tokens (public/workspace.css). */
:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --muted: #f1f5f9;
  --fg: #0f172a;
  --heading: #023491;
  --muted-fg: #475569;
  --primary: #004acc;
  --primary-hover: #0241b2;
  --secondary: #dee8f9;
  --green: #34d399;
  --border: #e2e8f0;
  --navy: #0b1120;
  --navy-2: #01184c;
  --radius: 12px;
  --shadow: 0 24px 60px rgba(2, 52, 145, 0.16), 0 4px 14px rgba(15, 23, 42, 0.08);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font: 500 0.88em ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--secondary);
  color: var(--heading);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  white-space: nowrap;
}
h1, h2, h3 { color: var(--heading); margin: 0; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 800px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fg); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font: 600 16px/1 var(--font); white-space: nowrap;
  border: 1px solid transparent; transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(0, 74, 204, 0.28); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: #fff; color: var(--heading); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }
.btn-light { background: #fff; color: var(--heading); }
.btn-light:hover { background: var(--secondary); }
.btn-outline-light { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-row.center { justify-content: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.header-row { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand img { height: 36px; width: auto; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { color: var(--muted-fg); font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--heading); text-decoration: none; }
/* VI | EN: a small segmented switch at the far right of the header */
.lang { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--muted); border: 1px solid var(--border); }
.lang a {
  min-width: 36px; padding: 5px 10px; border-radius: 99px; text-align: center;
  font: 600 13px/1.2 var(--font); color: var(--muted-fg); letter-spacing: 0.02em;
}
.lang a:hover { color: var(--heading); text-decoration: none; }
.lang a[aria-current] { background: #fff; color: var(--heading); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 40px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(52, 211, 153, 0.18), transparent 60%),
    radial-gradient(900px 600px at 10% -20%, rgba(0, 74, 204, 0.14), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px;
  padding: 6px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--heading);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.25); }
h1 { font-size: clamp(38px, 5.2vw, 62px); line-height: 1.08; font-weight: 800; }
.grad { white-space: nowrap; background: linear-gradient(90deg, var(--primary), #14b8a6 70%, var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: var(--muted-fg); margin: 22px 0 30px; max-width: 34em; }
.fine { font-size: 14px; color: var(--muted-fg); margin: 18px 0 0; }

.hero-shot { position: relative; padding-bottom: 40px; }
.frame { margin: 0; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--border); }
.frame-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.frame-bar span { margin: 0 auto; padding-right: 48px; font-size: 12px; color: var(--muted-fg); }
.frame-phone {
  position: absolute; right: -18px; bottom: 0; width: 26%; min-width: 120px;
  border-radius: 26px; border: 6px solid var(--navy);
}

/* ---------- Platforms strip ---------- */
.strip { padding: 20px 0 8px; }
.strip-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 32px; color: var(--muted-fg); font-size: 15px; }
.strip-row b { color: var(--heading); font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.kicker { margin: 0 0 10px; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.15; font-weight: 800; }
.sub { margin: 16px 0 0; color: var(--muted-fg); font-size: 18px; }

.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.feature {
  padding: 26px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.feature:hover { transform: translateY(-3px); background: #fff; box-shadow: 0 14px 34px rgba(2, 52, 145, 0.1); }
.feature h3 { font-size: 18px; margin: 16px 0 8px; }
.feature p { margin: 0; color: var(--muted-fg); font-size: 15.5px; }
.ficon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #14b8a6); }
.ficon svg, .dl svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.spotlight { background: linear-gradient(180deg, var(--surface), #fff); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: center; }
.split-copy .sub { margin-bottom: 26px; }
.split-shot { margin: 0; border-radius: 20px; overflow: hidden; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 34px; color: var(--fg); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23004acc' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: s; }
.steps li { padding: 28px; border-radius: var(--radius); border: 1px solid var(--border); }
.steps b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--secondary); color: var(--primary); font-weight: 800; }
.steps h3 { margin: 16px 0 8px; font-size: 20px; }
.steps p { margin: 0; color: var(--muted-fg); }

.download { background: var(--surface); }
.dl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dl {
  display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--border); color: var(--fg); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
a.dl:hover { text-decoration: none; border-color: var(--primary); box-shadow: 0 10px 26px rgba(0, 74, 204, 0.14); transform: translateY(-2px); }
.dl svg { flex: none; width: 44px; height: 44px; padding: 10px; border-radius: 11px; background: var(--navy); stroke: #fff; color: #fff; }
.dl span { display: grid; gap: 2px; }
.dl b { font-size: 17px; color: var(--heading); }
.dl small { font-size: 13.5px; color: var(--muted-fg); }
.dl-soon { opacity: 0.65; }
.dl-soon svg { background: #64748b; }

/* Beta sign-up */
.beta-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: start; }
.beta-copy .sub { margin-bottom: 26px; }
.beta-form {
  display: grid; gap: 16px; padding: 28px; border-radius: 16px; background: #fff;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.beta-form label { display: grid; gap: 6px; font-size: 15px; font-weight: 600; color: var(--heading); }
.beta-form small { font-weight: 400; color: var(--muted-fg); }
.beta-form .req { color: #b71c1c; }
.beta-form input, .beta-form select, .beta-form textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid #94a3b8; background: #fff; color: var(--fg);
  font: 400 16px/1.4 var(--font); /* 16px stops iPhone zooming in on focus */
  transition: border-color 0.15s, box-shadow 0.15s;
}
.beta-form textarea { resize: vertical; min-height: 88px; }
.beta-form input:focus, .beta-form select:focus, .beta-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 74, 204, 0.18);
}
.beta-form .btn { width: 100%; margin-top: 4px; }
.beta-form .btn:disabled { opacity: 0.7; cursor: progress; }
.beta-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin: 0; min-height: 1.4em; font-size: 15px; font-weight: 500; }
.form-msg.ok { color: #0f6b4b; }
.form-msg.bad { color: #b71c1c; }
.form-fine { margin: 0; font-size: 13.5px; color: var(--muted-fg); }

.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 0 22px; }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 32px 20px 0; position: relative;
  font-weight: 600; font-size: 17px; color: var(--heading);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 2px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted-fg); border-bottom: 2px solid var(--muted-fg); transform: rotate(45deg); transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { margin: 0 0 20px; color: var(--muted-fg); }

.final {
  padding: 96px 0; color: #fff; text-align: center;
  background:
    radial-gradient(700px 400px at 80% 0%, rgba(52, 211, 153, 0.22), transparent 60%),
    radial-gradient(800px 500px at 10% 100%, rgba(0, 74, 204, 0.45), transparent 60%),
    var(--navy);
}
.final-inner { display: flex; flex-direction: column; align-items: center; }
.final h2 { color: #fff; margin: 22px 0 12px; }
.final p { margin: 0 0 30px; color: rgba(255, 255, 255, 0.75); font-size: 18px; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0; border-top: 1px solid var(--border); font-size: 15px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-brand p { margin: 0; color: var(--muted-fg); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-left: auto; }
.footer-links a { color: var(--muted-fg); }
.copy { width: 100%; margin: 0; color: var(--muted-fg); font-size: 14px; }

/* ---------- Scroll-in motion (only when allowed; see the script) ---------- */
.anim .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0, 0, 1); }
.anim .reveal.in { opacity: 1; transform: none; }
.anim .features .reveal:nth-child(4n + 2), .anim .dl-grid .reveal:nth-child(2), .anim .steps .reveal:nth-child(2) { transition-delay: 0.07s; }
.anim .features .reveal:nth-child(4n + 3), .anim .dl-grid .reveal:nth-child(3), .anim .steps .reveal:nth-child(3) { transition-delay: 0.14s; }
.anim .features .reveal:nth-child(4n + 4), .anim .dl-grid .reveal:nth-child(4) { transition-delay: 0.21s; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1020px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid, .split, .beta-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero { padding-top: 48px; }
  .hero-copy { text-align: center; }
  .hero-copy .lead { margin-left: auto; margin-right: auto; }
  .hero-copy .cta-row { justify-content: center; }
  .frame-phone { right: 0; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav { display: none; }
  .header-row { gap: 10px; height: 60px; }
  .header-row .btn-sm { margin-left: auto; padding: 0 12px; }
  .lang a { min-width: 32px; padding: 5px 8px; }
  .brand img { height: 30px; }
  .lead { font-size: 17px; }
  .cta-row .btn { flex: 1 1 100%; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .features, .steps, .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .beta-form { padding: 20px; }
  .frame-bar span { display: none; }
  .frame-phone { width: 32%; border-width: 4px; border-radius: 18px; }
  .footer-links { margin-left: 0; }
}
.beta-form .lbl { display: block; }
.beta-form .lbl small { margin-left: 4px; }
.form-msg:empty { display: none; }

/* After signing up: the fields give way to a thank-you card */
.beta-done { display: none; text-align: center; padding: 28px 8px; outline: none; }
.beta-form.done > :not(.beta-done) { display: none; }
.beta-form.done .beta-done { display: grid; justify-items: center; gap: 12px; animation: pop-in 0.35s cubic-bezier(0.2, 0, 0, 1); }
.beta-done-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #14b8a6); box-shadow: 0 10px 24px rgba(0, 74, 204, 0.25); }
.beta-done-icon svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.beta-done h3 { font-size: 22px; margin-top: 6px; }
.beta-done p { margin: 0 0 8px; color: var(--muted-fg); max-width: 26em; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .beta-form.done .beta-done { animation: none; } }
.beta-email { margin: 0; font-size: 14px; color: var(--muted-fg); }
.beta-email b { color: var(--heading); font-weight: 600; word-break: break-all; }

/* Blocks from the page editor (/edit) */
.rt p { margin: 0; }
.rt p + p { margin-top: 0.7em; }
.faq details .rt { margin: 0 0 20px; color: var(--muted-fg); }
.feature .rt, .steps .rt { color: var(--muted-fg); }
.feature .rt { font-size: 15.5px; }
.steps .step-n::before { counter-increment: s; content: counter(s); }
.spotlight.flip .split-shot { order: -1; }
.text-section.center { text-align: center; }
.image-section figure { margin: 0; }
.fine.center { text-align: center; }
.rt-html { display: contents; }
