/*
 * Zonnex Marketing CSS
 * WhatsApp-derived design system — see zonnex-landing-plan.md §2.2
 * No Tailwind preflight conflict: these are token utilities only.
 */

/* ── 1. Design Tokens ──────────────────────────────────────────────── */
:root {
  /* Ink */
  --ink:            #111B21;
  --ink-secondary:  #3B4A54;
  --ink-muted:      #667781;
  --ink-teal:       #0B3B36;

  /* Teal */
  --teal-900:       #052F2A;
  --teal-800:       #075E54;
  --teal-600:       #128C7E;
  --teal-100:       #D6EDE9;
  --teal-50:        #EFF7F5;

  /* Green — action only */
  --green-500:      #25D366;
  --green-600:      #1DAA61;
  --green-700:      #17864C;
  --mint-200:       #D9FDD3;
  --mint-50:        #F1FCEC;

  /* Blue — data, links, read receipts */
  --tick-blue:      #34B7F1;
  --tick-blue-600:  #1E9AD1;
  --tick-blue-50:   #E9F7FE;

  /* Surfaces */
  --paper:          #EFEAE2;
  --paper-light:    #F7F5F1;
  --surface:        #FFFFFF;
  --border:         #E3DED7;
  --border-cool:    #E4E8EA;

  /* Semantic */
  --success:    #1DAA61; --success-bg: #EAFBEF;
  --warning:    #D98511; --warning-bg: #FDF4E4;
  --danger:     #D93F3F; --danger-bg:  #FCEDED;

  /* Radius */
  --r-bubble: 8px;
  --r-card:   14px;
  --r-lg:     20px;
  --r-pill:   999px;

  /* Elevation — warm-tinted, never grey-black */
  --shadow-sm:     0 1px 2px rgba(11,59,54,.06);
  --shadow-md:     0 4px 16px rgba(11,59,54,.08);
  --shadow-lg:     0 16px 48px rgba(11,59,54,.12);
  --shadow-bubble: 0 1px 1px rgba(11,27,33,.13);

  /* Section padding */
  --section-pad-y: clamp(3.5rem, 7vw, 7rem);

  /* Container */
  --container-max: 1200px;
  --gutter: clamp(1.5rem, 5vw, 4rem);
}

/* ── 2. Fluid type scale ───────────────────────────────────────────── */
.type-display-xl {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  font-weight: 700;
  font-optical-sizing: auto;
}
.type-display-lg {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.type-display-md {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.type-heading {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
}
.type-lead {
  font-family: 'Inter Tight', sans-serif;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  font-weight: 400;
}
.type-body {
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
}
.type-small {
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.type-caption {
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.8125rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  font-weight: 500;
}
.type-eyebrow {
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
}
.type-mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* ── 3. Layout utilities ───────────────────────────────────────────── */
.z-container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.z-container--narrow {
  max-width: 760px;
}
.z-container--wide {
  max-width: 1440px;
}

.z-section {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}
.z-section--sm {
  padding-top: calc(var(--section-pad-y) * 0.6);
  padding-bottom: calc(var(--section-pad-y) * 0.6);
}

/* Band colours */
.band-white  { background-color: var(--surface); }
.band-paper  { background-color: var(--paper); }
.band-teal   { background-color: var(--teal-800); }
.band-mint   { background-color: var(--mint-200); }
.band-teal-50 { background-color: var(--teal-50); }

/* ── 4. Chat window primitives ─────────────────────────────────────── */
.chat-paper {
  background-color: var(--paper);
  background-image: url('/svg/doodle-wallpaper.svg');
  background-size: 320px 320px;
}

.chat-bubble-out {
  background: var(--mint-200);
  border-radius: var(--r-bubble) var(--r-bubble) 2px var(--r-bubble);
  box-shadow: var(--shadow-bubble);
}
.chat-bubble-in {
  background: var(--surface);
  border-radius: var(--r-bubble) var(--r-bubble) var(--r-bubble) 2px;
  box-shadow: var(--shadow-bubble);
}

/* ── 5. Button system ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 600;
  border-radius: var(--r-pill);
  transition: background-color 160ms ease-out, box-shadow 160ms ease-out, border-color 160ms ease-out;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border: 1.5px solid transparent;
}
.btn--sm  { font-size: 0.875rem; padding: 0.5rem 1.25rem; }
.btn--md  { font-size: 1rem;     padding: 0.75rem 1.75rem; }
.btn--lg  { font-size: 1.0625rem; padding: 0.875rem 2.25rem; }

.btn--primary {
  background: var(--green-600);
  color: #fff;
  border-color: var(--green-600);
}
.btn--primary:hover  { background: var(--green-700); border-color: var(--green-700); }
.btn--primary:active { background: var(--green-700); }

.btn--secondary {
  background: transparent;
  color: var(--teal-600);
  border-color: var(--teal-600);
}
.btn--secondary:hover { background: var(--teal-50); }

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.6);
}
.btn--ghost:hover { background: rgba(255,255,255,.08); border-color: #fff; }

.btn--link {
  background: transparent;
  color: var(--teal-600);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  border-radius: 0;
}
.btn--link:hover { color: var(--ink-teal); }

/* ── 6. Card system ────────────────────────────────────────────────── */
.z-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1.5rem;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}
.z-card:hover {
  border-color: var(--teal-600);
  box-shadow: var(--shadow-md);
}

/* ── 7. Tick mark — included list only ────────────────────────────── */
.tick-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.9375rem;
}
.tick-row::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M1 9l3 4 4-5M6 9l3 4 7-10' stroke='%2334B7F1' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}

/* ── 8. Scroll-reveal animation ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── 9. Focus ring ─────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--tick-blue-600);
  outline-offset: 2px;
}

/* ── 10. Typing indicator ──────────────────────────────────────────── */
.typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── 11. Logo marquee ──────────────────────────────────────────────── */
.marquee-track {
  display: flex;
  gap: 3rem;
  animation: marquee-scroll 32s linear infinite;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }

/* ── 12. Navbar scroll shadow ──────────────────────────────────────── */
.navbar-scrolled {
  box-shadow: 0 1px 0 var(--border-cool), 0 4px 16px rgba(11,59,54,.06);
}

/* ── 13. Announcement bar dismiss ──────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ── 14. Comparison table ──────────────────────────────────────────── */
.compare-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}
.compare-table th:first-child,
.compare-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  border-right: 1px solid var(--border);
}
.compare-table th { background: var(--teal-50); }

/* ── 15. Cost calculator ───────────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--teal-100);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--teal-600);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--teal-600);
  cursor: pointer;
  border: none;
}

/* ── 16. FAQ accordion ─────────────────────────────────────────────── */
details > summary {
  list-style: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .faq-chevron {
  transform: rotate(180deg);
}
.faq-chevron {
  transition: transform 200ms ease-out;
  flex-shrink: 0;
}

/* ── 17. Sticky TOC (legal / guides) ───────────────────────────────── */
.toc-link {
  display: block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
  border-left: 2px solid var(--border);
  transition: color 160ms, border-color 160ms;
  text-decoration: none;
}
.toc-link:hover, .toc-link.active {
  color: var(--teal-600);
  border-left-color: var(--teal-600);
}

/* ── 18. Reading progress bar ──────────────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--green-500);
  z-index: 9999;
  transition: width 100ms linear;
}

/* ── 19. Skip link ─────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--teal-800);
  color: #fff;
  border-radius: var(--r-pill);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 1rem; }

/* ── 20. Mobile sticky CTA bar ─────────────────────────────────────── */
.mobile-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
  display: flex;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .mobile-cta-bar { display: none; }
}
