/* ==========================================================================
   ChiveIQ marketing site
   Brand tokens are taken from the ChiveIQ app (apps/frontend theme).
   Edit colors here; every component reads from these variables.
   ========================================================================== */

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/sora-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/sora-latin-600-normal.woff2") format("woff2");
}

:root {
  /* Brand palette */
  --ink: #0f1a12;            /* primary text */
  --ink-soft: #3a4a40;       /* secondary text  (8.7:1+ on white/tints) */
  --muted: #5b6b62;          /* tertiary text   (5.6:1 on white) */
  --green: #2ba854;          /* brand green: decorative only (fails AA as text) */
  --green-strong: #1a7535;   /* text-safe green + button fill (5.6:1 vs white) */
  --green-deep: #0f3d24;     /* hover / pressed */
  --mint: #c8f5d4;
  --tint-1: #f7fbf8;
  --tint-2: #f0f8f2;
  --tint-3: #e8f0ea;
  --line: rgba(15, 26, 18, 0.10);
  --white: #ffffff;

  /* Type */
  --font: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --container: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --radius: 0.875rem;
  --radius-sm: 0.5rem;

  color-scheme: light;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--green-strong);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--green-deep);
}

:focus-visible {
  outline: 3px solid var(--green-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

main:focus {
  outline: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  color: var(--white);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
}

.wordmark img {
  height: 1.75rem;
  width: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  border-color: var(--green-strong);
  background: var(--tint-2);
  color: var(--green-deep);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--green-strong);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(15, 61, 36, 0.18), 0 8px 24px -10px rgba(26, 117, 53, 0.55);
}

.btn-primary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.125rem;
  transition: transform 0.15s ease;
}

.btn-primary:hover {
  background: var(--green-deep);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(15, 61, 36, 0.2), 0 10px 28px -10px rgba(15, 61, 36, 0.6);
}

.btn-primary:hover::after {
  transform: translateX(2px) rotate(45deg);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline-offset: 4px;
  border-radius: 999px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(4.5rem, 12vw, 9rem) clamp(4rem, 10vw, 7.5rem);
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(43, 168, 84, 0.13), transparent 60%),
    radial-gradient(40rem 24rem at -10% 110%, rgba(200, 245, 212, 0.55), transparent 65%),
    linear-gradient(180deg, var(--white) 0%, var(--tint-1) 100%);
}

/* Faint dot grid, faded toward the edges */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(15, 61, 36, 0.16) 1px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 30%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 70% at 70% 30%, #000 10%, transparent 70%);
}

.hero-inner {
  max-width: var(--container);
}

.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.5rem, 7.2vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero h1 .accent {
  display: block;
  color: var(--green-strong);
}

.hero-figure {
  margin: clamp(2.5rem, 7vw, 3.5rem) 0 0;
  max-width: 40rem;
}

.hero-art {
  display: block;
  width: 100%;
  height: auto;
}

.lede {
  max-width: 40rem;
  margin-top: clamp(1.5rem, 3vw, 2rem);
  color: var(--ink-soft);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.65;
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section-y);
}

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}

.section h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.625rem);
}

.section-intro {
  margin-top: 0.875rem;
  color: var(--muted);
  font-size: 1.125rem;
}

/* ---------- Our story ---------- */

.story-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.25rem, 5vw, 4.5rem);
  align-items: start;
}

.story-copy p {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.story-copy .story-close {
  padding-left: 1rem;
  border-left: 3px solid var(--green);
  color: var(--ink);
  font-weight: 600;
}

.story-findings h3 {
  margin-bottom: 1rem;
  color: var(--green-strong);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.finding-list {
  display: grid;
  gap: 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.finding-list li {
  position: relative;
  padding: 1.25rem 1.375rem 1.25rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 1rem;
}

.finding-list li::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 1.25rem;
  bottom: 1.25rem;
  width: 3px;
  background: var(--green);
  border-radius: 0 3px 3px 0;
}

.finding-list strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 600;
}

/* ---------- Today vs. with ChiveIQ ---------- */

.compare {
  background: var(--tint-1);
  border-block: 1px solid var(--line);
}

.compare-title {
  max-width: 24ch;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.compare-title .accent {
  color: var(--green-strong);
}

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.compare-table th,
.compare-table td {
  padding: 1rem 1.5rem 1rem 3rem;
  text-align: left;
  vertical-align: top;
  position: relative;
}

.compare-table th {
  padding-block: 1.125rem;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.compare-table th:first-child {
  color: var(--muted);
}

.compare-table th:last-child {
  color: var(--green-strong);
  background: var(--tint-2);
}

.compare-table td {
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}

.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-table td:first-child {
  color: var(--muted);
}

.compare-table td:last-child {
  color: var(--ink);
  font-weight: 600;
  background: var(--tint-2);
}

/* Row markers: a quiet dash for today, a check for ChiveIQ */
.compare-table td::before {
  content: "";
  position: absolute;
  left: 1.25rem;
  top: 1.15rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
}

.compare-table td:first-child::before {
  background:
    linear-gradient(var(--muted), var(--muted)) center / 0.5rem 2px no-repeat,
    #eef1ef;
}

.compare-table td:last-child::before {
  background: var(--mint);
}

.compare-table td:last-child::after {
  content: "";
  position: absolute;
  left: 1.66rem;
  top: 1.38rem;
  width: 0.28rem;
  height: 0.5rem;
  border-right: 2px solid var(--green-strong);
  border-bottom: 2px solid var(--green-strong);
  transform: rotate(45deg);
}

/* ---------- A world with ChiveIQ ---------- */

.world-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.point-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.point-list li {
  position: relative;
  padding: 1.25rem 0 1.25rem 2.25rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.point-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.5rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--mint);
}

.point-list li::after {
  content: "";
  position: absolute;
  left: 0.4375rem;
  top: 1.75rem;
  width: 0.3125rem;
  height: 0.5625rem;
  border-right: 2px solid var(--green-strong);
  border-bottom: 2px solid var(--green-strong);
  transform: rotate(45deg);
}

.point-list strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Closing CTA ---------- */

.closing-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 6vw, 5rem);
  text-align: center;
  background:
    radial-gradient(36rem 18rem at 50% 0%, rgba(43, 168, 84, 0.12), transparent 70%),
    var(--tint-2);
  border: 1px solid rgba(26, 117, 53, 0.16);
  border-radius: calc(var(--radius) * 1.5);
}

.closing-panel h2 {
  max-width: 22ch;
  margin-inline: auto;
}

.closing-panel p {
  max-width: 34rem;
  margin: 1rem auto 2rem;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.closing-panel .closing-note {
  margin: 1.25rem auto 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.legal p + p {
  margin-top: 0.25rem;
}

.legal p:first-child {
  color: var(--ink);
  font-weight: 600;
}

.footer-email {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 2.75rem; /* 44px hit target */
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Responsive ---------- */

@media (min-width: 40rem) and (max-width: 55.99rem) {
  .hero-figure {
    margin-inline: auto;
  }
}

/* Phones: each comparison row becomes a small card */
@media (max-width: 39.99rem) {
  .compare-table,
  .compare-table thead,
  .compare-table tbody,
  .compare-table tr,
  .compare-table td {
    display: block;
  }

  .compare-table {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .compare-table thead {
    position: absolute;
    left: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .compare-table tr {
    margin-bottom: 0.875rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .compare-table td {
    padding: 0.875rem 1.125rem 0.875rem 2.875rem;
  }

  .compare-table tbody tr td {
    border-bottom: 0;
  }

  .compare-table tbody tr td:first-child {
    border-bottom: 1px solid var(--line);
  }

  .compare-table td::before {
    left: 1.125rem;
    top: 0.95rem;
  }

  .compare-table td:last-child::after {
    left: 1.535rem;
    top: 1.18rem;
  }
}

@media (min-width: 56rem) {
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.5rem, 3.6vw, 3.1rem);
  }

  .hero-figure {
    margin: 0 calc(-1 * var(--gutter)) 0 0;
    justify-self: end;
    width: calc(100% + var(--gutter));
    max-width: 44rem;
  }

  .story-grid,
  .world-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .footer-email {
    align-self: auto;
  }
}

@media (max-width: 22.5rem) {
  .nav-link {
    padding: 0 0.875rem;
  }

  .wordmark img {
    height: 1.5rem;
  }

  .btn {
    width: 100%;
  }
}

/* ---------- Motion & accessibility preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .btn-primary {
    border: 2px solid ButtonText;
  }

  .finding-list li::before,
  .hero-bg {
    display: none;
  }
}

@media print {
  .site-header {
    position: static;
  }

  .hero-bg,
  .skip-link {
    display: none;
  }
}
