/* ============================================================
   kardia.one — page styles
   Brand tokens live in kardia.css (source of truth: kardia/ci).
   Light-first: linen canvas, ink text, ONE green element per view.
   ============================================================ */

/* ---- self-hosted fonts (GDPR — no external requests) ---- */
@font-face {
  font-family: "Gabarito";
  src: url("/assets/fonts/gabarito-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--kardia-mint); color: var(--kardia-ink); }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

/* the brand word in running text: script, never bold, a touch larger */
.font-kardia {
  font-weight: 400 !important;
  font-size: 1.08em;
  font-style: normal;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* mono eyebrow above each section title */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 0.75rem;
}

h1, h2, h3 { margin: 0; }
.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hl { color: var(--accent-brand); }

p { margin: 0; }
.lead { color: var(--muted-foreground); max-width: 38rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease-kardia), background 0.15s var(--ease-kardia);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--muted); }

/* ---- nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--kardia-linen) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}
.nav-logo { display: inline-flex; align-items: center; }
.nav-logo img { width: 118px; height: auto; display: block; }
.nav-links {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  align-items: center;
}
.nav-links a:not(.btn) {
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.15s;
}
.nav-links a:not(.btn):hover { color: var(--foreground); }
.nav .btn { padding: 0.5rem 1rem; font-size: 0.9375rem; }
@media (max-width: 760px) {
  .nav-links a:not(.btn) { display: none; }
}

/* ---- hero ---- */
.hero { padding: 5.5rem 0 4.5rem; }
.hero h1 {
  font-size: clamp(2.75rem, 7vw, var(--text-display));
  max-width: 14ch;
}
.hero .lead { margin: 1.5rem 0 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.hero-hint { margin-top: 1rem; color: var(--muted-foreground); }

/* hero screenshot — a quiet browser frame; the app's own window bar is
   cropped out of the image so only this chrome shows */
.hero-shot { margin-top: 3.5rem; }
.browser-frame {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.6);
  overflow: hidden;
  box-shadow: 0 20px 45px -28px rgba(26, 26, 23, 0.28);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}
.browser-bar .dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--kardia-stone);
}
.browser-bar .url {
  margin: 0 auto;
  color: var(--muted-foreground);
  background: var(--background);
  border-radius: 999px;
  padding: 0.15rem 1rem;
}
.shot-img { display: block; width: 100%; height: auto; }
.phone-frame .shot-img { border-radius: 1.5rem; }

/* ---- app section ---- */
.app-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 800px) { .app-grid { grid-template-columns: 1fr; } }
.app-copy h2 { font-size: clamp(1.75rem, 4vw, var(--text-h1)); }
.app-copy .lead { margin-top: 1rem; }
.app-chip { margin-top: 1.5rem; }
.app-chip .kardia-callout {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
}
.app-shot { display: flex; justify-content: center; }
.phone-frame {
  position: relative;
  margin: 0;
  width: min(18rem, 72vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2.25rem;
  padding: 0.875rem;
  box-shadow: 0 20px 45px -28px rgba(26, 26, 23, 0.28);
}
/* the screenshot is a scrolled page — let it dissolve into the device
   instead of ending on a half-cut row */
.phone-frame::after {
  content: "";
  position: absolute;
  left: 0.875rem;
  right: 0.875rem;
  bottom: 0.875rem;
  height: 3.5rem;
  border-radius: 0 0 1.5rem 1.5rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--card));
  pointer-events: none;
}

/* ---- sections ---- */
.section { padding: 4.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 40rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.75rem, 4vw, var(--text-h1)); }
.section-head .lead { margin-top: 1rem; }

/* feature cards */
.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 800px) { .cards-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { font-size: var(--text-h3); font-weight: 600; margin-bottom: 0.5rem; }
.card p { color: var(--muted-foreground); font-size: 0.9375rem; }
.card .mono-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--muted-foreground);
  margin-bottom: 0.875rem;
}

/* ---- pricing ---- */
.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem;
  background: var(--card);
  margin-bottom: 2rem;
}
.billing-toggle button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.billing-toggle button[aria-pressed="true"] {
  background: var(--kardia-ink);
  color: var(--kardia-linen);
}
.billing-toggle .save {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--kardia-mint);
  color: var(--kardia-ink);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  margin-right: 0.375rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}
@media (max-width: 800px) { .pricing-grid { grid-template-columns: 1fr; } }

.tier {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.6);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  background: var(--card);
}
.tier .tier-label {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}
.tier .price {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 3rem;
  line-height: 1.1;
  margin-top: 0.75rem;
}
.tier .price-suffix { font-size: 0.875rem; color: var(--muted-foreground); min-height: 2.6em; }
.tier .tier-lead { margin-top: 0.75rem; font-size: 0.9375rem; color: var(--muted-foreground); }
.tier ul {
  list-style: none;
  margin: 1.25rem 0 1.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.9375rem;
}
.tier ul li { padding-left: 1.4rem; position: relative; }
.tier ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted-foreground);
}
.tier .btn { margin-top: auto; }

/* aidgile impact — the giving model, right where the decision happens.
   Dark-mint surface (the mint token's dark sibling) with linen text;
   the lone ember asterisk belongs to the aidgile wordmark. */
.tier .impact {
  background: #24312A;
  color: var(--kardia-linen);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
}
.tier .impact strong { font-weight: 600; }
.tier .impact .ast { color: #FF5A36; }

/* the upsell twist: PRO is the one dark card on the linen page */
.tier.pro {
  background: var(--kardia-ink);
  color: var(--kardia-linen);
  border-color: var(--kardia-ink);
  position: relative;
}
.tier.pro .tier-label { color: #A3A29B; }
.tier.pro .tier-lead, .tier.pro .price-suffix { color: #A3A29B; }
.tier.pro ul li::before { color: #A3A29B; }
/* the ONE green element in the pricing view — bright pulse on ink */
.tier.pro .price { color: var(--kardia-pulse-bright); }
.tier.pro .btn { background: var(--kardia-linen); color: var(--kardia-ink); border-color: var(--kardia-linen); }
.tier.pro .popular {
  position: absolute;
  top: -0.8rem;
  right: 1.5rem;
  background: var(--kardia-mint);
  color: var(--kardia-ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}
.tier .note { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--muted-foreground); text-align: center; }
.tier.pro .note { color: #A3A29B; }

/* launch promo — mint callout, ink text */
.promo {
  background: var(--kardia-mint);
  color: var(--kardia-ink);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
}
.promo code {
  font-family: var(--font-mono);
  font-weight: 500;
  background: rgba(26, 26, 23, 0.08);
  border-radius: 0.375rem;
  padding: 0.15rem 0.5rem;
}
.promo .copy {
  border: 1px solid rgba(26, 26, 23, 0.25);
  background: transparent;
  color: var(--kardia-ink);
  border-radius: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
}
.promo .copy:hover { background: rgba(26, 26, 23, 0.06); }

.enterprise-row {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}
.enterprise-row a { color: var(--foreground); text-underline-offset: 4px; }

/* ---- testimonials ---- */
.quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: stretch;
}
@media (max-width: 800px) { .quotes { grid-template-columns: 1fr; } }
.t-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.6);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}
.t-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 0.6;
  color: var(--kardia-stone);
  margin-bottom: 1rem;
  user-select: none;
}
.t-card blockquote { margin: 0; }
.t-card blockquote p {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--foreground);
}
.t-card figcaption {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.t-avatar {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--kardia-mint);
  color: var(--kardia-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.t-who { display: flex; flex-direction: column; gap: 0.1rem; }
.t-who strong { font-size: 0.9375rem; font-weight: 600; }
.t-who .mono { color: var(--muted-foreground); }

/* ---- faq ---- */
.faq { max-width: 44rem; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 0.25rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.0625rem;
  padding: 1rem 2rem 1rem 0;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  transition: transform 0.2s var(--ease-kardia);
}
.faq details[open] summary::after { content: "—"; }
.faq details p { color: var(--muted-foreground); padding: 0 0 1.25rem; max-width: 40rem; }

/* ---- CTA banner (ink flood — the calm, bold close) ---- */
.cta-banner {
  background: var(--kardia-ink);
  color: var(--kardia-linen);
  border-radius: calc(var(--radius) * 2);
  padding: 3.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.cta-banner h2 { font-size: clamp(1.75rem, 4vw, var(--text-h1)); max-width: 18ch; }
.cta-banner p { color: #A3A29B; max-width: 34rem; }
.cta-banner .btn {
  background: var(--kardia-linen);
  color: var(--kardia-ink);
  border-color: var(--kardia-linen);
  margin-top: 0.5rem;
}
.cta-banner .hint { font-family: var(--font-mono); font-size: var(--text-mono); color: #A3A29B; }

/* ---- footer ---- */
/* extra bottom room so the floating aidgile badge (fixed, 60px + 20px inset)
   never sits on top of the footer links */
.footer { border-top: 1px solid var(--border); padding: 2.5rem 0 6.5rem; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}
.footer .copyright { font-size: 0.8125rem; color: var(--muted-foreground); }
.footer .copyright .font-kardia { font-size: 1.05em; }
.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-left: auto;
  font-size: 0.8125rem;
}
.footer nav a { color: var(--muted-foreground); text-decoration: none; }
.footer nav a:hover { color: var(--foreground); }

/* The aidgile badge is the floating widget from /assets/aidgile-badge.js —
   it renders in a shadow root and carries its own styles. Nothing to do here. */

/* ---- reveal on scroll (only when JS is running — .js on <html>) ---- */
.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s var(--ease-kardia), transform 0.55s var(--ease-kardia);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .aidgile-badge.shaking { animation: none; }
}

/* ---- legal pages ---- */
.legal-page { max-width: 42rem; margin: 0 auto; padding: 3.5rem 1.25rem 7rem; }
.legal-page .backlink {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--muted-foreground);
  text-decoration: none;
}
.legal-page .backlink:hover { color: var(--foreground); }
.legal-page .logo { width: 132px; margin: 2rem 0 2.5rem; display: block; }
.legal-page h1 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: var(--text-h1);
  margin-bottom: 0.5rem;
}
.legal-page .stand {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--muted-foreground);
  margin-bottom: 2.5rem;
}
.legal-page h2 { font-size: var(--text-h3); font-weight: 600; margin: 2rem 0 0.5rem; }
.legal-page p, .legal-page li { color: var(--muted-foreground); font-size: 0.9375rem; }
.legal-page ul { padding-left: 1.25rem; margin: 0.5rem 0; }
.legal-page a { color: var(--foreground); text-underline-offset: 4px; }

/* ---- 404 ---- */
.nf {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: 1.25rem;
}
.nf .code {
  color: var(--foreground);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(4rem, 16vw, 8rem);
  line-height: 1;
}
.nf .code .hl { color: var(--accent-brand); }
.nf p { color: var(--muted-foreground); }
