/* ─────────────────────────────────────────────────────────────
   Attest AI · Components & Animations
   Modals · Toasts · Logo bar · FAQ · Code samples
   Hero gradient · Reveal animations · Mobile responsive
   ───────────────────────────────────────────────────────────── */

/* ── Hero gradient mesh (Stripe-like subtle) ─────────────── */
.hero-canvas {
  position: relative;
  overflow: hidden;
}
.hero-canvas::before, .hero-canvas::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.hero-canvas::before {
  width: 520px; height: 520px;
  top: -100px; right: -160px;
  background: radial-gradient(circle, #5b9aff 0%, transparent 70%);
}
.hero-canvas::after {
  width: 360px; height: 360px;
  bottom: -120px; left: 35%;
  background: radial-gradient(circle, #b9d4ff 0%, transparent 70%);
  opacity: 0.4;
}
.hero-canvas > * { position: relative; z-index: 1; }

/* Subtle dot grid for sections */
.dot-grid {
  background-image: radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 1000;
  background: rgba(15, 15, 18, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  padding: 24px;
  animation: modal-fade-in 0.18s ease;
}
.modal.modal-open { display: flex; }

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.10);
  animation: modal-slide-up 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-card.lg { max-width: 720px; }

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  padding: 24px 28px 16px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
}
.modal-head h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.modal-head p { font-size: 13.5px; color: var(--text-secondary); margin-top: 4px; }
.modal-close {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-muted);
  background: transparent;
  font-size: 18px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.modal-close:hover { background: var(--bg-subtle); color: var(--text); }
.modal-body { padding: 4px 28px 24px; }
.modal-foot {
  padding: 16px 28px 24px;
  display: flex; gap: 8px; justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}

/* Form inside modal */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .field.span-2 { grid-column: span 2; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 500;
  min-width: 280px; max-width: 420px;
  opacity: 0; transform: translateX(8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.toast.toast-show { opacity: 1; transform: translateX(0); }
.toast-icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 13px; font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.toast-success .toast-icon { background: var(--success); }
.toast-error .toast-icon { background: var(--danger); }
.toast-info .toast-icon { background: var(--brand); }
.toast-warn .toast-icon { background: var(--warning); }
.toast-msg { flex: 1; min-width: 0; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Logo bar (customer logos placeholder) ────────────────── */
.logo-bar {
  padding: 32px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.logo-bar .label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--text-muted); text-transform: uppercase;
  text-align: center; margin-bottom: 24px;
}
.logo-grid {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 48px;
  opacity: 0.62;
}
.logo-grid .logo {
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  filter: grayscale(100%);
  transition: opacity 0.2s, filter 0.2s;
}
.logo-grid .logo:hover { filter: grayscale(0%); }
.logo-grid .logo.serif { font-family: 'Fraunces', serif; font-style: italic; }
.logo-grid .logo.condensed { letter-spacing: -0.04em; font-weight: 800; }
.logo-grid .logo.outlined {
  border: 2px solid var(--text-secondary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── FAQ accordion ────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-q {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 0;
  background: transparent;
  border: none;
  font-size: 17px; font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  letter-spacing: -0.01em;
}
.faq-q .icon {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.18s, color 0.18s;
}
.faq-item.open .faq-q .icon { transform: rotate(45deg); color: var(--brand); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  font-size: 14.5px; line-height: 1.65;
  color: var(--text-secondary);
  transition: max-height 0.25s ease, padding 0.25s ease;
}
.faq-item.open .faq-a {
  max-height: 320px;
  padding-bottom: 24px;
}

/* ── Code sample ──────────────────────────────────────────── */
.code-block {
  background: #0d1117;
  color: #e6edf3;
  border-radius: var(--r-md);
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  border: 1px solid #21262d;
}
.code-block .c { color: #8b949e; font-style: italic; }
.code-block .k { color: #ff7b72; }
.code-block .s { color: #a5d6ff; }
.code-block .n { color: #d2a8ff; }
.code-block .v { color: #79c0ff; }
.code-block .m { color: #ffa657; }
.code-tabs {
  display: flex; gap: 4px;
  background: #21262d;
  border-radius: var(--r) var(--r) 0 0;
  padding: 8px 12px 0;
  border: 1px solid #30363d;
  border-bottom: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8b949e;
}
.code-tabs span {
  padding: 6px 12px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
}
.code-tabs span.active { background: #0d1117; color: #e6edf3; }
.code-tabs + .code-block { border-radius: 0 0 var(--r-md) var(--r-md); border-top: none; }

/* ── Comparison table ──────────────────────────────────────── */
.compare-table {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  width: 100%;
}
.compare-table table { width: 100%; border-collapse: collapse; }
.compare-table th {
  padding: 18px 20px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
  text-align: center;
}
.compare-table th:first-child { text-align: left; }
.compare-table th.featured {
  background: var(--brand-faint);
  color: var(--brand);
  position: relative;
}
.compare-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  text-align: center;
  color: var(--text-secondary);
}
.compare-table td:first-child { text-align: left; font-weight: 500; color: var(--text); }
.compare-table td.featured { background: rgba(0,102,255,0.04); color: var(--text); font-weight: 600; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table .check { color: var(--success); font-weight: 700; font-size: 16px; }
.compare-table .x { color: var(--text-faint); font-weight: 400; font-size: 15px; }
.compare-table .partial { color: var(--warning); font-weight: 700; font-size: 16px; }

/* ── Quote/testimonial ────────────────────────────────────── */
.quote-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
}
.quote-card .quote {
  font-size: 18px; line-height: 1.55;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.quote-card .quote::before { content: '"'; color: var(--brand); font-size: 28px; line-height: 0; }
.quote-card .quote::after { content: '"'; color: var(--brand); font-size: 28px; line-height: 0; }
.quote-card .author {
  display: flex; align-items: center; gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.quote-card .author .avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  display: grid; place-items: center;
  color: var(--brand); font-weight: 600; font-size: 14px;
}
.quote-card .author .info .name { font-size: 14px; font-weight: 600; }
.quote-card .author .info .role { font-size: 12.5px; color: var(--text-muted); }

/* ── Newsletter / final CTA ────────────────────────────────── */
.newsletter-card {
  padding: 56px;
  background: linear-gradient(135deg, #0a0a0c 0%, #1d1d1f 100%);
  border-radius: var(--r-lg);
  color: white;
  text-align: center;
}
.newsletter-card h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.018em; margin-bottom: 12px; }
.newsletter-card p { font-size: 15px; color: rgba(255,255,255,0.72); margin-bottom: 28px; max-width: 50ch; margin-left: auto; margin-right: auto; }
.newsletter-form {
  display: flex; gap: 8px;
  max-width: 480px; margin: 0 auto;
}
.newsletter-form input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  color: white;
  font-size: 14px;
  font-family: inherit;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.42); }
.newsletter-form input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.12);
}
.newsletter-form button {
  padding: 12px 20px;
  background: white;
  color: var(--text);
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.newsletter-form button:hover { background: var(--bg-soft); }

/* ── Footer rich ──────────────────────────────────────────── */
.footer-rich {
  padding: 64px 0 32px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  margin-top: 80px;
}
.footer-rich .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-rich .footer-grid h5 {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.footer-rich .footer-grid ul { display: flex; flex-direction: column; gap: 10px; }
.footer-rich .footer-grid a {
  font-size: 13.5px;
  color: var(--text-secondary);
}
.footer-rich .footer-grid a:hover { color: var(--text); }
.footer-rich .brand-col { display: flex; flex-direction: column; gap: 12px; }
.footer-rich .brand-col .tagline { font-size: 13px; color: var(--text-muted); max-width: 28ch; line-height: 1.5; }

.footer-rich .copyright {
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--text-muted);
}
.footer-rich .copyright .meta { display: flex; gap: 24px; }
.footer-rich .copyright .meta a { color: var(--text-muted); }
.footer-rich .copyright .meta a:hover { color: var(--text); }

/* ── Demo banner (top of portal/review when not logged in) ─── */
.demo-banner {
  background: linear-gradient(90deg, #fffbeb 0%, #fff8db 100%);
  border-bottom: 1px solid rgba(178, 107, 0, 0.18);
  padding: 10px 24px;
  display: flex; align-items: center; gap: 12px; justify-content: center;
  font-size: 13px;
  color: #6b4d00;
  position: sticky; top: 0; z-index: 50;
}
.demo-banner-icon { font-size: 14px; }
.demo-banner strong { color: #4a3500; font-weight: 600; }
.demo-banner .btn { margin-left: 8px; }

/* ── Reveal animations ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Glow/highlight on scroll-in features ─────────────────── */
.feature {
  position: relative;
  overflow: hidden;
}
.feature::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent 60%, rgba(0,102,255,0.12) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.feature:hover::before { opacity: 1; }

/* ── Small badge for "New" labels ─────────────────────────── */
.new-badge {
  display: inline-block;
  padding: 2px 7px;
  background: var(--brand);
  color: white;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: 2px;
}

/* ── 404 ──────────────────────────────────────────────────── */
.not-found {
  min-height: 80vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 64px 24px;
}
.not-found .num {
  font-size: 144px; font-weight: 200; color: var(--brand);
  letter-spacing: -0.04em; line-height: 1;
}
.not-found h1 { font-size: 28px; font-weight: 600; margin-top: 16px; }
.not-found p { color: var(--text-secondary); margin-top: 8px; }

/* ── Mobile responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .step-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-rich .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer-rich .footer-grid > :nth-child(4),
  .footer-rich .footer-grid > :nth-child(5) { display: none; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip .stat:nth-child(2) { border-right: none; }
  .stat-strip .stat:nth-child(1), .stat-strip .stat:nth-child(2) { border-bottom: 1px solid var(--border-subtle); }
}
@media (max-width: 720px) {
  .container, .container-narrow { padding: 0 20px; }
  .topbar { padding: 0 20px; }
  .topbar nav { display: none; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 40px !important; }
  .hero .lead { font-size: 15px; }
  .h-display, .h-display-sm { font-size: 32px; }
  .section-title { font-size: 28px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 16px; }
  .step-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr; }
  .stat-strip .stat { border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .stat-strip .stat:last-child { border-bottom: none; }
  .footer-rich .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-rich .footer-grid > :nth-child(4),
  .footer-rich .footer-grid > :nth-child(5) { display: block; }
  .shell { grid-template-columns: 1fr; }
  .shell .sidebar { display: none; }
  .review-shell { grid-template-columns: 1fr; }
  .compare-table { overflow-x: auto; display: block; white-space: nowrap; }
  .newsletter-card { padding: 32px 20px; }
  .newsletter-form { flex-direction: column; }
  .modal { padding: 16px; }
  .modal-card { max-height: 95vh; }
  .toast-container { left: 16px; right: 16px; top: 16px; }
  .toast { min-width: 0; max-width: none; }
}
