/* ============================================================================
   Tovari marketing site — stylesheet
   Brand: teal #0f8fa8 / navy #0e2330, Plus Jakarta Sans.
   Ported from the "Tovari Website" design. Inline decorative styles remain in
   index.html (product mockups); this file owns the reset, layout scaffolding,
   hover states (the design used a non-standard style-hover attribute), the
   responsive breakpoints (the design had none), and the modal/form.
   ============================================================================ */

:root {
  --teal: #0f8fa8;
  --teal-dark: #0a6e83;
  --teal-deep: #095e71;
  --navy: #0e2330;
  --navy-deep: #0c1e2c;
  --navy-mid: #0a3a4d;
  --slate: #5a7a8a;
  --slate-light: #93aebb;
  --green: #2aab6c;
  --green-tint: #e8f9f0;
  --orange: #e8933a;
  --red: #e05252;
  --red-tint: #fdeaea;
  --cyan-tint: #e0f5f9;
  --bg-section: #f5fafb;
  --bg-row: #fafcfd;
  --border: #deeef5;
  --border-light: #f0f7fa;
  --accent-cyan: #4bbfd6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--navy);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  /* Guard against horizontal overflow WITHOUT turning <body> into a scroll container.
     `overflow-x: hidden` here computes overflow-y to `auto`, making <body> the scroller
     (not the viewport) — which broke scroll-position/reveal behavior. `clip` prevents the
     horizontal scroll without creating a scroll container, so the viewport scrolls normally. */
  overflow-x: clip;
}

/* Large headings — declared as classes (not inline) so the mobile breakpoint can shrink them. */
.hero-title { font-size: 52px; font-weight: 800; line-height: 1.08; letter-spacing: -2px; color: #fff; }
.dark-title { font-size: 36px; font-weight: 700; line-height: 1.1; letter-spacing: -1px; color: #fff; }
.cta-title { font-size: 40px; font-weight: 800; line-height: 1.12; letter-spacing: -1.5px; color: #fff; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }
img { max-width: 100%; }

/* --- Scroll-reveal animation (ported verbatim from the design) --- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.reveal, .reveal-left, .reveal-right, .reveal-scale { opacity: 0; }
.reveal { transform: translateY(32px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-scale { transform: scale(0.92); }
.reveal.visible, .reveal-left.visible, .reveal-right.visible, .reveal-scale.visible {
  opacity: 1; transform: none;
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.delay-1.visible { transition-delay: 0.1s; }
.delay-2.visible { transition-delay: 0.2s; }
.delay-3.visible { transition-delay: 0.3s; }
.delay-4.visible { transition-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  [style*="animation"] { animation: none !important; }
}

/* --- Layout scaffolding --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.container--narrow { max-width: 1000px; }
.container--faq { max-width: 800px; }
.section { padding: 96px 32px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
/* Grid tracks default to min-width:auto, refusing to shrink below their content's
   intrinsic width (e.g. the hero's long "Coming Soon" badge). min-width:0 lets the
   tracks shrink so wide content wraps or scrolls instead of overflowing the page. */
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.feature-row { margin-bottom: 96px; }
.feature-row:last-child { margin-bottom: 0; }
.section-head { text-align: center; margin-bottom: 56px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 1.2px; }
.eyebrow--cyan { color: var(--accent-cyan); }

/* Horizontal-scroll guard for wide product mockups / tables on small screens */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- Buttons (real :hover, replacing the design's style-hover attribute) --- */
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer; font-family: inherit; transition: all 0.15s ease; border: none; }
.btn--primary { padding: 9px 20px; background: var(--teal); color: #fff; font-size: 14px; font-weight: 600; border-radius: 10px; }
.btn--primary:hover { background: var(--teal-dark); color: #fff; }
.btn--white { padding: 14px 28px; background: #fff; color: var(--navy-deep); font-size: 16px; font-weight: 700; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.15); }
.btn--white:hover { transform: translateY(-1px); box-shadow: 0 6px 32px rgba(0,0,0,0.2); color: var(--navy-deep); }
.btn--white-lg { padding: 16px 32px; font-size: 17px; }
.btn--ghost { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.7); }
.btn--ghost:hover { color: #fff; }

/* --- Nav --- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(255,255,255,0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(15,143,168,0.08); }
.nav__inner { max-width: 1200px; margin: 0 auto; padding: 0 32px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__links { display: flex; align-items: center; gap: 32px; }
.nav-link { font-size: 14px; font-weight: 500; color: var(--slate); }
.nav-link:hover { color: var(--navy); }
.logo-mark { width: 32px; height: 32px; background: var(--teal); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.logo-mark span { font-size: 16px; font-weight: 700; color: #fff; font-style: italic; }
.wordmark { font-size: 18px; font-weight: 700; color: var(--navy); letter-spacing: -0.3px; }

/* --- Section headings --- */
h2.title { font-size: 36px; font-weight: 700; color: var(--navy); letter-spacing: -1px; margin-top: 12px; }
.lead { font-size: 17px; color: var(--slate); margin-top: 12px; max-width: 560px; margin-left: auto; margin-right: auto; line-height: 1.6; }

/* --- Feature-block copy --- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--cyan-tint); border-radius: 100px; margin-bottom: 16px; }
.pill span { font-size: 12px; font-weight: 600; color: var(--teal); }
.feature-title { font-size: 28px; font-weight: 700; color: var(--navy); letter-spacing: -0.5px; margin-bottom: 12px; }
.feature-copy { font-size: 15px; line-height: 1.7; color: var(--slate); margin-bottom: 20px; }
.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist > div { display: flex; align-items: center; gap: 10px; }
.checklist span { font-size: 14px; color: var(--navy); }

/* --- Footer --- */
.footer-link { font-size: 13px; color: rgba(255,255,255,0.45); }
.footer-link:hover { color: rgba(255,255,255,0.7); }

/* --- Comparison table --- */
.compare-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr; }
.compare-scroll > .compare-grid { min-width: 720px; }

/* --- Reporting rows --- */
.report-row { display: flex; gap: 32px; align-items: center; }
.report-row--reverse { flex-direction: row-reverse; }
.report-row__copy { width: 300px; flex-shrink: 0; }

/* ============================================================================
   Early-access modal + form
   ============================================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(12,30,44,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3); position: relative;
  animation: fadeUp 0.25s cubic-bezier(0.16,1,0.3,1);
}
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: transparent; border: none; transition: background 0.15s ease;
}
.modal-close:hover { background: var(--border-light); }
.modal__head { text-align: center; margin-bottom: 24px; }
.modal__logo { width: 48px; height: 48px; background: linear-gradient(135deg,var(--teal),var(--teal-deep)); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.modal__logo span { font-size: 22px; font-weight: 700; color: #fff; font-style: italic; }
.modal__title { font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: -0.5px; }
.modal__subtitle { font-size: 14px; color: var(--slate); margin-top: 6px; }

.form { display: flex; flex-direction: column; gap: 18px; }
/* `.form { display:flex }` outranks the UA `[hidden]` rule, so JS setting form.hidden alone
   won't hide it — this restores the hide-on-success behavior (mirrors .form-error/.form-success). */
.form[hidden] { display: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label, .field > .field-label { display: block; font-size: 12px; font-weight: 600; color: var(--slate); margin-bottom: 6px; }
.field-label .muted { font-weight: 400; color: var(--slate-light); }
.input, .textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 9px;
  font-size: 14px; font-family: inherit; color: var(--navy); background: var(--bg-row); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { resize: vertical; min-height: 76px; }
.input:focus, .textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,143,168,0.12); }
.input:invalid:not(:placeholder-shown) { border-color: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border: 1.5px solid var(--border); border-radius: 100px; cursor: pointer;
  font-size: 13px; color: var(--navy); background: var(--bg-row);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  user-select: none;
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip:hover { border-color: var(--teal); }
.chip.selected { border-color: var(--teal); background: var(--cyan-tint); color: var(--teal-deep); font-weight: 600; }

.radio-group { display: flex; gap: 8px; }
.radio-opt {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 9px;
  border: 1.5px solid var(--border); border-radius: 9px; cursor: pointer;
  font-size: 13px; color: var(--slate); background: var(--bg-row);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  user-select: none;
}
.radio-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-opt:hover { border-color: var(--teal); }
.radio-opt.selected { border-color: var(--teal); background: var(--cyan-tint); color: var(--teal-deep); font-weight: 600; }

.submit-btn {
  width: 100%; padding: 14px; background: linear-gradient(135deg,var(--teal),var(--teal-deep));
  color: #fff; font-size: 16px; font-weight: 700; border: none; border-radius: 10px;
  cursor: pointer; font-family: inherit; transition: opacity 0.15s ease;
}
.submit-btn:hover { opacity: 0.9; }
.submit-btn:disabled { opacity: 0.6; cursor: default; }

.fineprint { font-size: 12px; color: var(--slate-light); text-align: center; line-height: 1.5; }
.form-error { font-size: 13px; color: var(--red); text-align: center; }
.form-error[hidden] { display: none; }

/* Honeypot — hidden from humans, catches bots */
.hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Success state */
.form-success { text-align: center; padding: 12px 0 4px; }
.form-success[hidden] { display: none; }
.form-success__check { width: 56px; height: 56px; border-radius: 50%; background: var(--green-tint); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.form-success h3 { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.form-success p { font-size: 14px; color: var(--slate); line-height: 1.6; }

/* ============================================================================
   Responsive — the design shipped fixed multi-column grids with no @media.
   ============================================================================ */
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; gap: 40px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .feature-row { margin-bottom: 64px; }
  .report-row, .report-row--reverse { flex-direction: column; }
  .report-row__copy { width: 100%; }
}
@media (max-width: 720px) {
  .section { padding: 72px 20px; }
  .container, .nav__inner { padding: 0 20px; }
  .nav__links { gap: 12px; }
  .nav-link { display: none; }
  h2.title { font-size: 28px; }
  .feature-title { font-size: 23px; }
  .hero-title { font-size: 33px; letter-spacing: -1px; }
  .dark-title { font-size: 27px; }
  .cta-title { font-size: 29px; }
  .hero-section { padding: 108px 20px 64px !important; }
  .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal { padding: 28px 22px; }
}
