/* ============================================================
   WritanK shared design system
   Used by index.php (landing) and tools/answer-the-public/ (tool)
   ============================================================ */

:root {
  /* Brand blues */
  --wt-primary: #2563EB;
  --wt-primary-dark: #1D4ED8;
  --wt-primary-light: #60A5FA;
  --wt-accent: #38BDF8;

  /* "Free" green trust signal */
  --wt-free: #22C55E;
  --wt-free-bg: rgba(34, 197, 94, .10);
  --wt-free-border: rgba(34, 197, 94, .30);

  /* Dark theme surfaces */
  --wt-bg: #0A0E1A;
  --wt-bg-soft: #0F1525;
  --wt-surface: rgba(255, 255, 255, .04);
  --wt-surface-hover: rgba(255, 255, 255, .07);
  --wt-card-light: rgba(255, 255, 255, .97);

  /* Borders */
  --wt-border: rgba(96, 165, 250, .16);
  --wt-border-strong: rgba(96, 165, 250, .32);

  /* Text */
  --wt-text: #F8FAFC;
  --wt-text-muted: #94A3B8;
  --wt-text-soft: #64748B;
  --wt-ink: #0F172A;

  /* Effects */
  --wt-radius-sm: 12px;
  --wt-radius: 16px;
  --wt-radius-lg: 22px;
  --wt-shadow: 0 20px 55px rgba(0, 0, 0, .35);
  --wt-shadow-soft: 0 8px 30px rgba(0, 0, 0, .18);

  /* Type */
  --wt-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--wt-font);
  color: var(--wt-text);
  line-height: 1.7;
  background-color: var(--wt-bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(37, 99, 235, .22), transparent 38%),
    radial-gradient(circle at 88% 2%, rgba(56, 189, 248, .12), transparent 34%),
    linear-gradient(var(--wt-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--wt-border) 1px, transparent 1px);
  background-size: auto, auto, 96px 96px, 96px 96px;
  background-position: center top;
  background-attachment: fixed, fixed, scroll, scroll;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--wt-primary-light); }

/* ---------- Layout ---------- */
.wt-container {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.wt-section { padding: 72px 0; }
.wt-section-tight { padding: 48px 0; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 .5em;
}

.wt-eyebrow {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--wt-accent);
  margin-bottom: 14px;
}

.wt-section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  max-width: 18em;
}

.wt-section-intro {
  color: var(--wt-text-muted);
  font-size: 1.05rem;
  max-width: 42em;
  margin: 0 0 8px;
}

.wt-center { text-align: center; }
.wt-center .wt-section-title,
.wt-center .wt-section-intro { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.wt-btn-primary,
.wt-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: var(--wt-radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

.wt-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--wt-primary) 0%, var(--wt-primary-dark) 100%);
  box-shadow: 0 10px 30px rgba(37, 99, 235, .35);
}
.wt-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(37, 99, 235, .45); }

.wt-btn-secondary {
  color: var(--wt-text);
  background: var(--wt-surface);
  border-color: var(--wt-border-strong);
}
.wt-btn-secondary:hover { background: var(--wt-surface-hover); border-color: var(--wt-primary-light); transform: translateY(-2px); }

.wt-btn-lg { min-height: 60px; padding: 0 34px; font-size: 1.08rem; }

.wt-btn-primary:disabled,
.wt-btn-secondary:disabled { opacity: .6; cursor: wait; transform: none; }

/* ---------- Badges / pills ---------- */
.wt-badge,
.wt-badge-free {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}
.wt-badge {
  color: #dbeafe;
  background: rgba(37, 99, 235, .14);
  border: 1px solid var(--wt-border-strong);
}
.wt-badge-free {
  color: #4ade80;
  background: var(--wt-free-bg);
  border: 1px solid var(--wt-free-border);
}

/* ---------- Cards ---------- */
.wt-card {
  background: var(--wt-surface);
  border: 1px solid var(--wt-border);
  border-radius: var(--wt-radius-lg);
  padding: 26px;
}
.wt-card-light {
  background: var(--wt-card-light);
  border: 1px solid var(--wt-border-strong);
  border-radius: var(--wt-radius-lg);
  box-shadow: var(--wt-shadow);
  color: var(--wt-ink);
}

/* ---------- Forms ---------- */
.wt-input,
.wt-textarea {
  width: 100%;
  border: 1px solid #cfe0fb;
  border-radius: var(--wt-radius-sm);
  padding: 15px 16px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--wt-ink);
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wt-textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.wt-input:focus,
.wt-textarea:focus {
  border-color: var(--wt-primary);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .25);
}

/* Email capture (single-row form) */
.wt-capture {
  display: flex;
  gap: 10px;
  width: min(520px, 100%);
}
.wt-capture .wt-input { flex: 1; }
.wt-capture .wt-btn-primary { flex-shrink: 0; }
.wt-form-message { font-size: .9rem; margin-top: 10px; min-height: 1.2em; }
.wt-form-message.success { color: #4ade80; font-weight: 700; }
.wt-form-message.error-msg { color: #fca5a5; font-weight: 700; }

/* ---------- Nav ---------- */
.wt-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 26, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wt-border);
}
.wt-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.wt-nav-logo { display: inline-flex; align-items: center; text-decoration: none; }
.wt-nav-logo img { width: 150px; height: 60px; display: block; object-fit: contain; }
.wt-nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.wt-nav-links a:not(.wt-btn-primary):not(.wt-btn-secondary) {
  color: var(--wt-text-muted);
  text-decoration: none;
  font-size: .94rem;
  font-weight: 500;
  transition: color .15s ease;
}
.wt-nav-links a:not(.wt-btn-primary):not(.wt-btn-secondary):hover { color: var(--wt-text); }
.wt-nav-cta { display: flex; align-items: center; gap: 14px; }
.wt-nav .wt-btn-primary,
.wt-nav .wt-btn-secondary { min-height: 44px; padding: 0 18px; font-size: .92rem; }

/* ---------- Footer ---------- */
.wt-footer {
  border-top: 1px solid var(--wt-border);
  padding: 56px 0 40px;
  margin-top: 40px;
}
.wt-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}
.wt-footer-brand img { width: 160px; height: 64px; object-fit: contain; display: block; margin-bottom: 14px; }
.wt-footer-brand p { color: var(--wt-text-muted); font-size: .92rem; max-width: 26em; }
.wt-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--wt-text-soft); margin-bottom: 14px; }
.wt-footer ul { list-style: none; margin: 0; padding: 0; }
.wt-footer li { margin-bottom: 10px; }
.wt-footer a { color: var(--wt-text-muted); text-decoration: none; font-size: .92rem; }
.wt-footer a:hover { color: var(--wt-text); }
.wt-footer-bottom {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--wt-border);
  color: var(--wt-text-soft);
  font-size: .86rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: space-between;
  align-items: center;
}

/* ---------- Trust row ---------- */
.wt-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: center;
}
.wt-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--wt-text-muted);
  font-size: .9rem;
  font-weight: 500;
}
.wt-check { color: var(--wt-free); flex-shrink: 0; }

/* ---------- Toast ---------- */
.wt-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: 340px;
  padding: 14px 16px;
  border-radius: var(--wt-radius-sm);
  color: var(--wt-ink);
  background: #fff;
  border: 1px solid var(--wt-primary-light);
  box-shadow: var(--wt-shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.wt-toast.show { opacity: 1; transform: translateY(0); }
.wt-toast.error-msg { border-color: #fca5a5; color: #b91c1c; }

/* ---------- FAQ accordion ---------- */
.wt-faq { display: grid; gap: 12px; max-width: 760px; margin: 0 auto; }
.wt-faq-item {
  background: var(--wt-surface);
  border: 1px solid var(--wt-border);
  border-radius: var(--wt-radius);
  overflow: hidden;
}
.wt-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--wt-text);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  text-align: left;
}
.wt-faq-q:hover { color: #fff; }
.wt-faq-icon { flex-shrink: 0; transition: transform .2s ease; color: var(--wt-primary-light); font-size: 1.4rem; line-height: 1; }
.wt-faq-q[aria-expanded="true"] .wt-faq-icon { transform: rotate(45deg); }
.wt-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.wt-faq-a-inner {
  padding: 0 22px 20px;
  color: var(--wt-text-muted);
  line-height: 1.7;
}

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.wt-btn-primary:focus-visible,
.wt-btn-secondary:focus-visible {
  outline: 3px solid var(--wt-accent);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .wt-footer-grid { grid-template-columns: 1fr 1fr; }
  .wt-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .wt-section { padding: 52px 0; }
  .wt-nav-links { display: none; }
  .wt-capture { flex-direction: column; }
  .wt-capture .wt-btn-primary { width: 100%; }
  .wt-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
