/*
 * ToTa-Ai — marketing site
 * Editorial Confidence design system (Dhumketu Ai Labs)
 * Source of truth: ../ToTa-Ai/DESIGN.md
 *
 * Accent shifts by mode: vivid orange #FF5F1F (light) / electric lime #A7FF00 (dark).
 * Display = Newsreader italic. Body = Inter. Eyebrow = Inter 800 uppercase.
 */

/* ============================================================
   Tokens
   ============================================================ */
:root {
  /* Light (default) */
  --canvas: #fdf7ff;
  --surface: #f2ecf4;
  --surface-elevated: #ffffff;
  --text: #1d1b20;
  --text-muted: #494551;
  --border-subtle: rgba(29, 27, 32, 0.05);
  --border-strong: rgba(29, 27, 32, 0.1);
  --accent: #ff5f1f;
  --accent-hover: #e84f0f;
  --accent-soft: rgba(255, 95, 31, 0.1);
  --on-accent: #fdf7ff;
  --success: #2d7e64;
  --warning: #b7791f;
  --error: #c53030;
  --info: #2c5282;

  /* Type */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing scale (4px base) */
  --sp-2xs: 2px;
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;
  --sp-4xl: 64px;
  --sp-5xl: 96px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-full: 9999px;

  --maxw: 1180px;
  --maxw-prose: 760px;
}

html[data-theme="dark"] {
  --canvas: #000000;
  --surface: #121212;
  --surface-elevated: #1e1e1e;
  --text: #ffffff;
  --text-muted: #a1a1aa;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.1);
  --accent: #a7ff00;
  --accent-hover: #90e000;
  --accent-soft: rgba(167, 255, 0, 0.08);
  --on-accent: #000000;
  --success: #3e9d80;
  --warning: #d69e2e;
  --error: #e53e3e;
  --info: #4a6fa5;
}

/* Follow system pref before any JS runs (no-flash default for first paint) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --canvas: #000000;
    --surface: #121212;
    --surface-elevated: #1e1e1e;
    --text: #ffffff;
    --text-muted: #a1a1aa;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-strong: rgba(255, 255, 255, 0.1);
    --accent: #a7ff00;
    --accent-hover: #90e000;
    --accent-soft: rgba(167, 255, 0, 0.08);
    --on-accent: #000000;
    --success: #3e9d80;
    --warning: #d69e2e;
    --error: #e53e3e;
    --info: #4a6fa5;
  }
}

/* ============================================================
   Reset / base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  display: block;
}

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* ============================================================
   Layout primitives
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-xl);
}

.section {
  padding: var(--sp-5xl) 0;
}

@media (max-width: 720px) {
  .section {
    padding: var(--sp-4xl) 0;
  }
}

.hr {
  height: 1px;
  border: 0;
  background: var(--border-strong);
  margin: 0;
}

/* ============================================================
   Typography
   ============================================================ */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  margin: 0 0 var(--sp-lg);
}

.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--accent);
  display: inline-block;
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0;
}

.display em,
.accent-word {
  font-style: italic;
  color: var(--accent);
}

h1.display {
  font-size: clamp(2.75rem, 7vw, 5rem);
}

h2.display {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

h3.display {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
  margin: var(--sp-xl) 0 0;
}

.muted {
  color: var(--text-muted);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 14px 22px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-md);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand .mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.brand .brand-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: var(--sp-5xl) 0 var(--sp-4xl);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--sp-4xl);
  align-items: center;
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-3xl);
  }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
  margin-top: var(--sp-2xl);
}

.hero-note {
  margin-top: var(--sp-xl);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

/* Phone mock */
.phone {
  margin: 0 auto;
  width: 280px;
  max-width: 100%;
  border-radius: var(--r-2xl);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: var(--sp-lg);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.35);
}

.phone-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
}

.phone-bar .eyebrow {
  margin: 0;
}

.msg-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-md);
}

.msg-from {
  font-weight: 700;
  font-size: 0.9rem;
}

.msg-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.msg-body {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: var(--sp-sm) 0 0;
}

.draft-card {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
}

.draft-card .eyebrow {
  margin-bottom: var(--sp-sm);
  color: var(--accent);
}

.draft-card .eyebrow::before {
  background: var(--accent);
}

.draft-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.45;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--success);
}

.pill.high .dot {
  background: var(--success);
}

/* ============================================================
   Logo strip / trust line
   ============================================================ */
.trustline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xl);
  align-items: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.trustline .tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
}

/* ============================================================
   Feature grid
   ============================================================ */
.grid {
  display: grid;
  gap: var(--sp-xl);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 920px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.card .num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--accent);
  display: block;
  margin-bottom: var(--sp-md);
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 var(--sp-sm);
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Section heading block */
.section-head {
  max-width: var(--maxw-prose);
  margin-bottom: var(--sp-3xl);
}

.section-head .lead {
  margin-top: var(--sp-lg);
}

/* ============================================================
   Steps (how it works)
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-xl);
  counter-reset: step;
}

@media (max-width: 920px) {
  .steps {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step {
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--border-strong);
}

.step .step-n {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
}

.step h3 {
  font-size: 1.05rem;
  margin: var(--sp-md) 0 var(--sp-sm);
}

.step p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================================
   Stat band
   ============================================================ */
.statband {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-xl);
  text-align: left;
}

@media (max-width: 620px) {
  .statband {
    grid-template-columns: 1fr;
    gap: var(--sp-2xl);
  }
}

.stat .big {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1;
  color: var(--text);
}

.stat .label {
  margin-top: var(--sp-md);
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 30ch;
}

/* ============================================================
   Principles / privacy callouts
   ============================================================ */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-lg);
}

.checklist li {
  display: flex;
  gap: var(--sp-md);
  align-items: flex-start;
}

.checklist .ico {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-top: 2px;
}

.checklist strong {
  display: block;
  font-weight: 700;
}

.checklist span {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============================================================
   CTA band
   ============================================================ */
.cta-band {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2xl);
  padding: var(--sp-4xl);
  text-align: center;
}

.cta-band .hero-cta {
  justify-content: center;
}

@media (max-width: 620px) {
  .cta-band {
    padding: var(--sp-2xl) var(--sp-lg);
  }
}

/* ============================================================
   FAQ (details/summary)
   ============================================================ */
.faq {
  display: grid;
  gap: 0;
  max-width: var(--maxw-prose);
}

.faq details {
  border-top: 1px solid var(--border-strong);
  padding: var(--sp-lg) 0;
}

.faq details:last-child {
  border-bottom: 1px solid var(--border-strong);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-lg);
  font-weight: 600;
  font-size: 1.05rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary .plus {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  position: relative;
  transition: transform 0.25s ease;
}

.faq summary .plus::before,
.faq summary .plus::after {
  content: "";
  position: absolute;
  background: var(--accent);
  border-radius: 2px;
}

.faq summary .plus::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
}

.faq summary .plus::after {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
}

.faq details[open] summary .plus::after {
  transform: translateX(-50%) scaleY(0);
}

.faq details p {
  margin: var(--sp-md) 0 0;
  color: var(--text-muted);
  max-width: 64ch;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-4xl) 0 var(--sp-2xl);
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--sp-2xl);
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2xl);
  }
}

.footer-col h4 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--sp-lg);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-md);
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-blurb {
  font-size: 0.9rem;
  max-width: 34ch;
  margin: var(--sp-lg) 0 0;
}

.footer-bottom {
  margin-top: var(--sp-3xl);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-md);
  font-size: 0.8rem;
}

/* ============================================================
   Prose (legal / support pages)
   ============================================================ */
.prose {
  max-width: var(--maxw-prose);
  margin: 0 auto;
}

.prose h1.display {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin-bottom: var(--sp-lg);
}

.prose h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem;
  margin: var(--sp-3xl) 0 var(--sp-md);
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: var(--sp-2xl) 0 var(--sp-sm);
}

.prose p,
.prose li {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.prose ul,
.prose ol {
  padding-left: var(--sp-xl);
  display: grid;
  gap: var(--sp-sm);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose strong {
  color: var(--text);
}

.prose .meta-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-2xl);
}

.callout {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  margin: var(--sp-2xl) 0;
}

.callout p {
  margin: 0;
  color: var(--text);
}

/* ============================================================
   Page hero (interior)
   ============================================================ */
.page-hero {
  padding: var(--sp-4xl) 0 var(--sp-2xl);
}

.back-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--sp-xl);
}

.back-link:hover {
  color: var(--accent);
}

/* utility */
.center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}
