/* =========================================================
   Metrivo — marketing one-pager
   Scoped to plain element + .class selectors so this can be
   dropped in front of an app shell without collisions.
   ========================================================= */

:root {
  --ink: #182722;
  --paper: #F1F3EC;
  --paper-raised: #FFFFFF;

  --sage: #5C8368;
  --sage-deep: #3F5E48;
  --sage-soft: #DCE7DD;

  --gold: #BE9A5C;
  --gold-soft: #EDE0C4;

  --clay: #B15D3E;
  --clay-soft: #F2DED4;

  --line: #DBE0D3;
  --muted: #5F6E63;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1140px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24, 39, 34, .04), 0 12px 32px -18px rgba(24, 39, 34, .22);
  --arc: 131.95; /* half-circumference of the r=42 gauge arc */
}

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

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

/* keep anchor targets clear of the sticky header */
:is(#features, #how, #pricing, #top) { scroll-margin-top: 84px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.35rem, 5.2vw, 3.65rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.16rem; letter-spacing: -0.005em; line-height: 1.3; }
p  { margin: 0 0 1rem; }
a  { color: var(--sage-deep); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.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;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--paper-raised); color: var(--ink);
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 16px; }

/* ---------- focus ---------- */
:is(a, button, [tabindex]):focus-visible {
  outline: 2.5px solid var(--sage-deep);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin: 0 0 .85rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-size: .97rem; font-weight: 500;
  padding: .78rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn--primary { background: var(--sage); color: #fff; }
.btn--primary:hover { background: var(--sage-deep); }
.btn--ghost { background: var(--paper-raised); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--sage); color: var(--sage-deep); }
.btn--sm { padding: .55rem 1.05rem; font-size: .92rem; }
.btn--lg { padding: .95rem 1.9rem; font-size: 1.03rem; }
.btn--full { width: 100%; }

.section { padding: clamp(64px, 9vw, 104px) 0; }
.section__head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section__lede { color: var(--muted); font-size: 1.06rem; margin-bottom: 0; }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(241, 243, 236, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--ink);
  margin-right: auto;
}
.brand__mark { width: 34px; height: 22px; display: block; }
.brand__word {
  font-family: var(--font-display);
  font-size: 1.32rem; font-weight: 600; letter-spacing: -0.02em;
}
.brand--sm .brand__word { font-size: 1.18rem; }

.nav__menu { display: flex; align-items: center; gap: 1.85rem; }
.nav__menu a:not(.btn) {
  color: var(--ink); text-decoration: none; font-size: .96rem;
  padding: .25rem 0;
  border-bottom: 1.5px solid transparent;
  transition: border-color .18s ease, color .18s ease;
}
.nav__menu a:not(.btn):hover { color: var(--sage-deep); border-bottom-color: var(--sage); }
.nav__signin { font-weight: 500; }

.nav__toggle {
  display: none;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .55rem .6rem;
  cursor: pointer;
}
.nav__bars { display: block; width: 20px; }
.nav__bars i {
  display: block; height: 1.8px; background: var(--ink); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav__bars i + i { margin-top: 4.5px; }
.nav__toggle[aria-expanded="true"] .nav__bars i:nth-child(1) { transform: translateY(6.3px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars i:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__bars i:nth-child(3) { transform: translateY(-6.3px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero { padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 8vw, 96px); }
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.hero__copy h1 { max-width: 15ch; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 54ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero__note {
  font-family: var(--font-mono);
  font-size: .8rem; color: var(--muted);
  margin-top: 1.1rem; margin-bottom: 0;
}

/* ---------- dashboard mockup ---------- */
.mock {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.mock__bar {
  display: flex; align-items: center; gap: .6rem;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.mock__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); flex: none; }
.mock__title { font-size: .88rem; color: var(--muted); }
.mock__sync {
  margin-left: auto;
  font-family: var(--font-mono); font-size: .68rem; color: var(--muted);
}
.mock__pill {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  background: var(--sage-soft); color: var(--sage-deep);
  padding: .25rem .6rem; border-radius: 999px;
}

.mock__gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gauge {
  display: grid; justify-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 6px 11px;
  position: relative;
}
.gauge svg { width: 100%; max-width: 92px; height: auto; display: block; }
.gauge__track { fill: none; stroke: var(--sage-soft); stroke-width: 9; stroke-linecap: round; }
.gauge__value {
  fill: none; stroke: var(--sage); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: var(--arc);
  stroke-dashoffset: calc(var(--arc) * (1 - var(--pct)));
  transition: stroke-dashoffset .9s cubic-bezier(.22,.61,.36,1);
}
.gauge--warn .gauge__value { stroke: var(--clay); }
.gauge--warn .gauge__track { stroke: var(--clay-soft); }
.gauge--warn .gauge__num { color: var(--clay); }
.gauge__num {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 1rem; font-weight: 500; color: var(--sage-deep);
  margin-top: -14px;
}
.gauge__label { font-size: .78rem; margin-top: 6px; }
.gauge__sub {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .68rem; color: var(--muted);
}

.mock__event {
  margin-top: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.mock__event-head { display: flex; align-items: baseline; gap: .75rem; }
.mock__event-name { font-size: .88rem; font-weight: 500; }
.mock__event-fig {
  margin-left: auto;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .92rem; color: var(--ink);
}
.mock__event-fig em { font-style: normal; color: var(--muted); font-size: .74rem; }
.mock__meter {
  height: 6px; border-radius: 999px; background: var(--gold-soft);
  margin: 9px 0 7px; overflow: hidden;
}
.mock__meter span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.mock__event-sub {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .7rem; color: var(--muted); margin: 0;
}
.mock__note {
  margin: 14px 0 0; font-size: .84rem; color: var(--muted); line-height: 1.55;
}
.mock__note strong { color: var(--ink); font-weight: 600; }

/* =========================================================
   PROBLEM
   ========================================================= */
.problem { border-top: 1px solid var(--line); }
.split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
}
.split__rule { width: 1px; background: var(--line); align-self: stretch; }
.split__side h3 { font-size: 1.3rem; margin-bottom: .55rem; }
.split__side p { color: var(--muted); margin: 0; }

.callouts {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-top: clamp(32px, 4vw, 44px);
}
.callout {
  display: flex; gap: 14px;
  background: var(--sage-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--sage-deep);
}
.callout p { margin: 0; font-size: .95rem; color: var(--ink); }
.callout p strong { font-weight: 600; }
.callout__icon { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.callout--alert { background: var(--clay-soft); color: var(--clay); }

/* =========================================================
   FEATURES
   ========================================================= */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 28px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--sage-soft); }
.card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--sage-soft); color: var(--sage-deep);
  margin-bottom: 16px;
}
.card__icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--muted); font-size: .96rem; margin: 0; }

/* =========================================================
   HOW IT WORKS
   ========================================================= */
.how { border-top: 1px solid var(--line); }
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3.5vw, 40px);
}
.step { border-top: 2px solid var(--sage); padding-top: 20px; }
.step__num {
  display: block;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .82rem; letter-spacing: .1em; color: var(--sage);
  margin-bottom: .6rem;
}
.step h3 { font-size: 1.45rem; margin-bottom: .5rem; }
.step p { color: var(--muted); margin: 0; font-size: .98rem; }

/* =========================================================
   PRICING
   ========================================================= */
.pricing { border-top: 1px solid var(--line); }
.plans {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px; align-items: stretch;
}
.plan {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px 32px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: border-color .22s ease;
}

/* ---------- header row: name + billing toggle ---------- */
.plan__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; min-height: 34px; margin-bottom: .5rem;
}
.plan__name { font-size: 1.35rem; margin: 0; }

/* ---------- segmented billing control ---------- */
.billing {
  display: inline-flex; flex: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.billing__opt { display: block; }
.billing__opt input {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.billing__opt span {
  display: block; cursor: pointer; white-space: nowrap;
  padding: .26rem .62rem; border-radius: 999px;
  font-size: .76rem; color: var(--muted);
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.billing__opt:hover span { color: var(--ink); }
.billing__opt input:checked + span {
  background: var(--paper-raised); color: var(--ink);
  box-shadow: 0 1px 2px rgba(24, 39, 34, .1);
}
.billing__opt input:focus-visible + span {
  outline: 2.5px solid var(--sage-deep); outline-offset: 2px;
}

/* ---------- price, cross-faded between billing periods ---------- */
.plan__prices {
  display: grid;
  /* reserve the yearly card's extra savings line so all three price blocks
     share a baseline, including Free which has no toggle */
  min-height: 6.75rem;
}
.plan__price-opt {
  grid-area: 1 / 1;
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility 0s linear .22s;
}
/* monthly is the default, and the fallback where :has() is unsupported */
.plan__price-opt[data-period="monthly"] {
  opacity: 1; visibility: visible;
  transition: opacity .22s ease, visibility 0s;
}
.plan:has(.billing input[value="yearly"]:checked) .plan__price-opt[data-period="monthly"] {
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility 0s linear .22s;
}
.plan:has(.billing input[value="yearly"]:checked) .plan__price-opt[data-period="yearly"] {
  opacity: 1; visibility: visible;
  transition: opacity .22s ease, visibility 0s;
}

.plan__price { display: flex; align-items: baseline; gap: .45rem; margin-bottom: .35rem; }
.plan__fig {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 2.3rem; font-weight: 500; letter-spacing: -0.02em;
}
.plan__per { color: var(--muted); font-size: .9rem; }
.plan__sub {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .72rem; color: var(--muted); margin-bottom: .35rem;
}
.plan__save {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: .72rem; color: var(--gold); margin-bottom: 0;
}

/* ---------- badges ---------- */
.plan__badge {
  position: absolute; top: -12px; left: 28px;
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .09em; text-transform: uppercase;
  padding: .3rem .7rem; border-radius: 999px;
}
.plan__badge--value {
  background: var(--gold-soft); color: #6E5426;
  border: 1px solid var(--gold);
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility 0s linear .22s;
}
.plan__badge--pro {
  background: var(--sage-soft); color: var(--sage-deep);
  border: 1px solid var(--sage-soft);
}

/* gold treatment belongs to Plus on yearly only, so it never competes with Pro */
.plan--plus:has(.billing input[value="yearly"]:checked) { border-color: var(--gold); }
.plan--plus:has(.billing input[value="yearly"]:checked) .plan__badge--value {
  opacity: 1; visibility: visible;
  transition: opacity .22s ease, visibility 0s;
}
.plan--plus:has(.billing input[value="yearly"]:checked) .plan__list li::before {
  border-color: var(--gold);
}

.plan__blurb { color: var(--muted); font-size: .95rem; margin-top: .9rem; }
.plan__list { list-style: none; margin: .5rem 0 1.75rem; padding: 0; flex: 1; }
.plan__list li {
  position: relative; padding-left: 1.6rem; margin-bottom: .65rem;
  font-size: .95rem;
}
.plan__list li::before {
  content: ""; position: absolute; left: 0; top: .48em;
  width: 11px; height: 6px;
  border-left: 2px solid var(--sage); border-bottom: 2px solid var(--sage);
  transform: rotate(-45deg);
  transition: border-color .22s ease;
}
.pricing__note {
  font-family: var(--font-mono); font-size: .78rem; color: var(--muted);
  margin-top: 1.25rem;
}

/* =========================================================
   FINAL CTA
   ========================================================= */
.cta { border-top: 1px solid var(--line); text-align: center; }
.cta__inner { max-width: 620px; }
.cta__mark { width: 52px; height: 34px; margin-bottom: 1rem; }
.cta p { color: var(--muted); margin-bottom: 1.75rem; }

/* ---------- inline sign-up on the final CTA ---------- */
.signup {
  margin-top: 1.75rem; text-align: left;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.signup__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.signup .field { display: flex; flex-direction: column; gap: .3rem; }
/* Matches .field__hint in the app's globals.css — the marketing page carries its
   own stylesheet, so a class defined only there renders as plain text here. */
.signup .field__hint { font-size: .74rem; color: var(--muted); }
.signup label { font-size: .78rem; color: var(--muted); }
.signup .input {
  font-family: inherit; font-size: .92rem; color: var(--ink); width: 100%;
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .55rem .7rem;
}
.signup .input:hover { border-color: var(--sage); }
.signup__note {
  font-size: .8rem; color: var(--muted); text-align: center;
  margin: .9rem 0 0;
}
@media (max-width: 640px) {
  .signup__row { grid-template-columns: 1fr; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: var(--paper-raised); border-top: 1px solid var(--line); padding: 32px 0; }
.footer__inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer__links { display: flex; gap: 1.5rem; margin-left: auto; }
.footer__links a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.footer__links a:hover { color: var(--sage-deep); text-decoration: underline; }
.footer__legal {
  font-family: var(--font-mono); font-size: .78rem; color: var(--muted); margin: 0;
}

/* =========================================================
   SCROLL REVEAL (progressive enhancement — no JS, no hiding)
   ========================================================= */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22,.61,.36,1);
}
html.js .reveal.is-shown { opacity: 1; transform: none; }
html.js .gauge:not(.is-shown) .gauge__value { stroke-dashoffset: var(--arc); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__copy h1 { max-width: 20ch; }
  .hero__visual { max-width: 520px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .plans { grid-template-columns: 1fr; max-width: 560px; }
  .plan--plus, .plan--pro { margin-top: 14px; }
}

@media (max-width: 760px) {
  body { font-size: 16.5px; }

  .nav__toggle { display: inline-flex; }
  .nav__menu {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a:not(.btn) { padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .nav__menu a:not(.btn):hover { border-bottom-color: var(--line); }
  .nav__menu .btn { margin-top: 14px; }

  .split { grid-template-columns: 1fr; gap: 28px; }
  .split__rule { display: none; }
  .callouts { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .footer__links { margin-left: 0; }
}

@media (max-width: 400px) {
  .mock__gauges { grid-template-columns: 1fr; }
  .mock__sync { display: none; }
  .gauge svg { max-width: 120px; }
  .hero__actions .btn { width: 100%; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .gauge:not(.is-shown) .gauge__value {
    stroke-dashoffset: calc(var(--arc) * (1 - var(--pct)));
  }
  .card:hover { transform: none; }
}
