/* ─── MSAlgoAI · Landing design system (Phase 2) ───
 *
 * Dark premium theme. Continues the intro's palette:
 * deep navy-black radial background, soft blue/cyan accents.
 * WCAG AA: body text ≥ 4.5:1, large text ≥ 3:1 on #04070d.
 */

:root {
  --bg-0: #020409;
  --bg-1: #04070d;
  --bg-2: #081222;
  --ink: #e6f1fd;          /* primary text  (≈15.5:1 on bg-1) */
  --ink-soft: #a9bdd6;     /* secondary text (≈8.2:1) */
  --ink-dim: #7d92ac;      /* tertiary text  (≈5.1:1) */
  --accent: #4facfe;       /* brand blue */
  --accent-2: #00f2fe;     /* brand cyan */
  --line: rgba(151, 190, 235, 0.14);
  --glass-bg: rgba(120, 170, 235, 0.05);
  --glass-bg-strong: rgba(120, 170, 235, 0.08);
  --radius: 16px;
  --container: 1120px;
  --nav-h: 68px;
  --ease-out: cubic-bezier(0.22, 0.61, 0.21, 1);
}

/* ─── Base ─── */

html { scroll-behavior: smooth; }

body {
  background: var(--bg-1);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}

/* While the intro overlay exists, lock scrolling beneath it.
   (Skip-intro visits never lock; the intro node is removed on boot.) */
html:not([data-skip-intro]) body:has(#intro:not(.intro-done)) { overflow: hidden; }

#landing-root {
  background:
    radial-gradient(60% 48% at 50% 0%, var(--bg-2) 0%, var(--bg-1) 62%, var(--bg-0) 100%);
}

.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}
.container.narrow { max-width: 760px; }
.container.center { text-align: center; }

::selection { background: rgba(79, 172, 254, 0.28); }

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--ink);
}

p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Skip link */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 2000;
  padding: 10px 16px;
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease,
              color 0.25s ease, transform 0.25s var(--ease-out),
              box-shadow 0.25s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #2f7fd9 0%, #1f5fae 100%);
  color: #f2f8ff;
  box-shadow: 0 6px 24px -10px rgba(79, 172, 254, 0.55);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3c8ee6 0%, #266cc0 100%);
  box-shadow: 0 8px 28px -10px rgba(79, 172, 254, 0.7);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(151, 190, 235, 0.3);
}
.btn-ghost:hover {
  border-color: rgba(151, 190, 235, 0.55);
  background: rgba(120, 170, 235, 0.06);
}

.btn-lg { padding: 15px 34px; font-size: 16px; }
.btn-nav { padding: 9px 20px; font-size: 14px; }

/* ─── Navigation ─── */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease-out),
              background-color 0.35s ease, border-color 0.35s ease,
              backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
.site-nav.visible { opacity: 1; transform: none; }
.site-nav.scrolled {
  background: rgba(4, 8, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav-inner {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.brand-emblem {
  display: block;
  width: 26px;
  height: 26px;
}
.footer-brand .brand-emblem { width: 30px; height: 30px; }
.nav-brand:hover { text-decoration: none; }
.brand-accent {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ─── Reveal-on-scroll ───
   Hidden state applies only after JS adds `reveal-init` to <body>, so
   content is never invisible if scripts fail or JS is disabled. */

body.reveal-init .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.9s var(--ease-out);
}
body.reveal-init .reveal.in { opacity: 1; transform: none; }

/* Hero staged entrance delays */
.reveal[data-stage="2"] { transition-delay: 0.12s; }
.reveal[data-stage="3"] { transition-delay: 0.26s; }
.reveal[data-stage="4"] { transition-delay: 0.4s; }

/* ─── Sections ─── */

.section { padding: 108px 0; }

.section-title {
  font-size: clamp(28px, 4.2vw, 40px);
  margin-bottom: 20px;
}
.section .section-title { margin-bottom: 48px; }
.container.center .section-title,
.container.narrow .section-title { margin-bottom: 24px; }

.lede {
  font-size: clamp(17px, 2.2vw, 20px);
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 62ch;
  margin-bottom: 28px;
}
.center .lede { margin-inline: auto; }

/* ─── Hero ─── */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 72px;
  position: relative;
}

.hero-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.hero-title {
  font-size: clamp(40px, 7.4vw, 84px);
  font-weight: 450;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #f3f8ff 0%, #b9d2ef 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(16px, 2.3vw, 20px);
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border: 1px solid rgba(0, 242, 254, 0.28);
  border-radius: 999px;
  background: rgba(0, 190, 220, 0.07);
  color: #8fe9f5;              /* ≥ 4.5:1 on bg */
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.status-badge.neutral {
  border-color: rgba(151, 190, 235, 0.26);
  background: rgba(120, 170, 235, 0.07);
  color: var(--ink-soft);
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.8);
}

/* Non-clickable "AI Chat — Coming Soon" chip */
.chip-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-dim);
  font-size: 15px;
  cursor: default;
  user-select: none;
}
.soon-badge {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ─── Screen-reader-only utility ─── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Signature visual · collaborative intelligence ───
   Symbolic only: one core, orbiting agent nodes, thin light links.
   Slow, elegant, no excessive glow. All motion disabled under
   prefers-reduced-motion (static arrangement remains). */

.signature { padding-top: 0; }

.signature-panel {
  max-width: 680px;
  margin-inline: auto;
  padding: 28px;
}

.agents-svg {
  display: block;
  width: 100%;
  height: auto;
}

.orbit-guide {
  fill: none;
  stroke: rgba(122, 178, 235, 0.10);
  stroke-width: 1;
}

.orbit {
  transform-box: view-box;
  transform-origin: 50% 50%;
}
.orbit-a { animation: orbit-spin 78s linear infinite; }
.orbit-b { animation: orbit-spin 120s linear infinite reverse; }

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

.link {
  stroke: rgba(122, 178, 235, 0.30);
  stroke-width: 1;
  stroke-dasharray: 3 9;
  animation: link-flow 9s linear infinite;
}
.link.dim {
  stroke: rgba(122, 178, 235, 0.18);
  animation-duration: 13s;
}

@keyframes link-flow {
  to { stroke-dashoffset: -120; }
}

.node {
  fill: #9fcdf2;
  transform-box: fill-box;
  transform-origin: center;
  animation: node-breathe 7s ease-in-out infinite;
}
.node.small { fill: #6fa9d9; }
.node.n2 { animation-delay: -1.5s; }
.node.n3 { animation-delay: -3s; }
.node.n4 { animation-delay: -2s; }
.node.n5 { animation-delay: -4s; }
.node.n6 { animation-delay: -5.5s; }
.node.n7 { animation-delay: -0.8s; }

@keyframes node-breathe {
  0%, 100% { opacity: 0.78; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.22); }
}

.core-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: core-breathe 8s ease-in-out infinite;
}
.core {
  transform-box: fill-box;
  transform-origin: center;
  animation: core-breathe 8s ease-in-out infinite;
}

@keyframes core-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* ─── Cards / glass ─── */

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.card-grid {
  display: grid;
  gap: 22px;
}
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  padding: 32px 28px;
  transition: border-color 0.35s ease, background-color 0.35s ease,
              transform 0.35s var(--ease-out);
}
.card:hover {
  border-color: rgba(151, 190, 235, 0.3);
  background: var(--glass-bg-strong);
  transform: translateY(-3px);
}
.card h3 {
  font-size: 18px;
  margin-bottom: 12px;
}
.card p {
  font-size: 15px;
  font-weight: 300;
  color: var(--ink-soft);
}
.card.subtle {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(79, 172, 254, 0.1);
  border: 1px solid rgba(79, 172, 254, 0.22);
}
.card-icon svg { width: 24px; height: 24px; }

/* ─── Philosophy ─── */

.philosophy { text-align: center; padding: 132px 0; }
.philosophy-line {
  font-size: clamp(26px, 4.6vw, 48px);
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--ink-soft);
}
.philosophy-line.accent {
  color: var(--ink);
  font-weight: 450;
}

/* ─── How it works flow ─── */

.flow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  counter-reset: step;
}
.flow-step {
  position: relative;
  padding: 30px 26px;
}
.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -18px;
  width: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(79, 172, 254, 0.55), rgba(79, 172, 254, 0.1));
}
.flow-index {
  display: block;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #62b6f7;           /* ≥ 3:1, decorative-adjacent label */
  margin-bottom: 14px;
}
.flow-step h3 { font-size: 17px; margin-bottom: 10px; }
.flow-step p {
  font-size: 14.5px;
  font-weight: 300;
  color: var(--ink-soft);
}

/* ─── Collaborative AI ─── */

.collab { text-align: center; }
.collab .lede { margin-inline: auto; }

/* ─── About ─── */

.about-card {
  display: flex;
  gap: 28px;
  padding: 36px 32px;
  align-items: flex-start;
}
.about-photo {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  background: rgba(120, 170, 235, 0.07);
  border: 1px dashed rgba(151, 190, 235, 0.3);
}
.about-photo svg { width: 38px; height: 38px; }
.about-name {
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}
.about-body p:not(.about-name) {
  font-size: 15.5px;
  font-weight: 300;
  color: var(--ink-soft);
}

/* ─── Early access form ─── */

.ea-form {
  padding: 40px 36px;
  margin-top: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 24px;
}
.field.span-2 { grid-column: span 2; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  color: var(--ink-soft);
}
.req { color: #79d2ff; }
.opt {
  font-weight: 300;
  color: var(--ink-dim);
  letter-spacing: 0;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: rgba(4, 10, 20, 0.55);
  border: 1px solid rgba(151, 190, 235, 0.2);
  border-radius: 10px;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.field select { appearance: none; }
.field select:invalid { color: var(--ink-dim); }
.field textarea { resize: vertical; min-height: 96px; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: rgba(151, 190, 235, 0.34); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(6, 14, 26, 0.75);
}

.field.invalid input,
.field.invalid select { border-color: rgba(255, 128, 128, 0.6); }

.field-error {
  margin-top: 7px;
  font-size: 13px;
  color: #ffb3b3;           /* ≥ 4.5:1 on bg */
}

/* Honeypot — visually removed, still submittable by bots */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.consent { margin-top: 26px; }
.checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  font-weight: 300;
  color: var(--ink-soft);
  cursor: pointer;
}
.checkbox input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.form-actions {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.form-status { font-size: 14.5px; color: var(--ink-soft); }
.form-status.ok { color: #8ff0c8; }     /* ≥ 4.5:1 */
.form-status.err { color: #ffb3b3; }

.disclaimer {
  margin-top: 34px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-dim);
}

/* ─── Contact ─── */

.contact-list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin-top: 10px;
}
.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
}
.contact-row.contact-row--link { padding: 0; }
.contact-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.contact-value { font-size: 14.5px; color: var(--ink-dim); }

.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 18px 24px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color 0.25s ease;
}
.contact-link:hover,
.contact-link:focus-visible {
  background: var(--glass-bg-strong);
  text-decoration: none;
}
.contact-link:hover .contact-value,
.contact-link:focus-visible .contact-value {
  color: var(--ink-soft);
}
.contact-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ink-dim);
}

/* ─── FAQ ─── */

.faq-list { display: grid; gap: 14px; }

.faq-item { overflow: hidden; }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 300;
  color: var(--accent);
  transition: transform 0.3s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding: 0 24px 22px;
  font-size: 15px;
  font-weight: 300;
  color: var(--ink-soft);
}

/* ─── Footer ─── */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 44px;
  background: rgba(2, 4, 9, 0.6);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.footer-brand {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 14px;
  color: var(--ink-soft);
}
.footer-links a:hover { color: var(--ink); }

.footer-disclaimer {
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-dim);
  max-width: 88ch;
  margin-bottom: 22px;
}
.footer-legal { font-size: 13px; color: var(--ink-dim); }

/* ─── Legal pages (privacy / terms) ─── */

.legal-page {
  min-height: 100vh;
  background:
    radial-gradient(60% 40% at 50% 0%, var(--bg-2) 0%, var(--bg-1) 62%, var(--bg-0) 100%);
}
.legal-main {
  padding: calc(var(--nav-h) + 56px) 0 96px;
}
.legal-main h1 {
  font-size: clamp(30px, 4.6vw, 44px);
  margin-bottom: 10px;
}
.legal-updated {
  font-size: 14px;
  color: var(--ink-dim);
  margin-bottom: 42px;
}
.legal-main h2 {
  font-size: 20px;
  margin: 40px 0 14px;
}
.legal-main p,
.legal-main li {
  font-size: 15.5px;
  font-weight: 300;
  color: var(--ink-soft);
}
.legal-main ul {
  margin: 12px 0 12px 22px;
  display: grid;
  gap: 6px;
}
.legal-nav-static {
  position: static;
  opacity: 1;
  transform: none;
  background: transparent;
}

/* ─── Responsive ─── */

@media (max-width: 980px) {
  .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .flow-step:not(:last-child)::after { display: none; }
}

@media (max-width: 760px) {
  .section { padding: 80px 0; }
  .card-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .ea-form { padding: 30px 22px; }
  .about-card { flex-direction: column; align-items: center; text-align: center; }
  .footer-top { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .card-grid.cols-4 { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; gap: 18px; }
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn, .card, .site-nav, .faq-item summary::after {
    transition: none;
  }
  .btn:hover, .card:hover { transform: none; }
  .orbit, .link, .node, .core, .core-halo { animation: none; }
}
