/* ============================================================================
   Crux — marketing site design system
   Dark "performance instrument" aesthetic: volt-on-black, Archivo display,
   JetBrains Mono telemetry labels, cool→warm zone ramp motif.
   ========================================================================== */

:root {
  --bg: #0b0d08;
  --bg-2: #0e1109;
  --surface: #14180e;
  --surface-2: #181d11;
  --line: #262c1a;
  --line-soft: #1c2114;

  --volt: #c6f24a;
  --volt-deep: #a6d62f;
  --text: #eef1e6;
  --muted: #969c84;
  --faint: #5f6650;

  /* cool → warm training-zone ramp */
  --z1: #3fb98f;
  --z2: #c6f24a;
  --z3: #f2c14a;
  --z4: #f2884a;
  --z5: #e8553f;

  --font-display: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Atmospheric background: volt glow + faint topographic contour + grain. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 78% -10%, rgba(198, 242, 74, 0.14), transparent 55%),
    radial-gradient(90% 60% at 8% 8%, rgba(63, 185, 143, 0.08), transparent 50%), var(--bg);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--volt);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---- eyebrow / section labels (telemetry mono) ------------------------- */
.eyebrow,
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--volt-deep);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-label {
  color: var(--faint);
}
.section-label b {
  color: var(--volt);
  font-weight: 500;
}

/* ---- logo / peak mark -------------------------------------------------- */
.mark {
  display: block;
  flex: none;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 1.05rem;
  color: var(--text);
}

/* ---- top nav ----------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(11, 13, 8, 0.92), rgba(11, 13, 8, 0.5));
  border-bottom: 1px solid var(--line-soft);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.nav-links a {
  color: var(--muted);
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    background 0.2s;
  cursor: pointer;
}
.btn-primary {
  background: var(--volt);
  color: #11140a;
  box-shadow: 0 0 0 rgba(198, 242, 74, 0);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px -12px rgba(198, 242, 74, 0.6);
  text-decoration: none;
}
.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--volt-deep);
  color: var(--volt);
  text-decoration: none;
}

/* ---- hero -------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 92px 0 72px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 22px 0 0;
}
.hero h1 .volt {
  color: var(--volt);
}
.lede {
  max-width: 30ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  margin: 26px 0 0;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
}
.cta-note {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin: 18px 0 0;
}
.cta-note .dot {
  color: var(--z1);
}

/* ---- Apple "Download on the App Store" badge --------------------------- */
/* Official Apple artwork, used unmodified per Apple's badge guidelines:
   don't recolor or restyle it, and keep clear space around it. */
.app-store-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px;
  transition: transform 0.25s var(--ease);
}
.app-store-badge img {
  display: block;
  width: auto;
  height: 52px;
}
.app-store-badge:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

/* ---- store badge row (App Store + Google Play, side by side) ----------- */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.store-badges-center {
  justify-content: center;
}

/* ---- Google "Get it on Google Play" badge ------------------------------ */
/* Official Google artwork, used unmodified per Google's badge guidelines.
   The PNG carries generous built-in padding, so it's rendered a touch taller
   than the Apple badge — and given no extra outer padding — so the two visible
   pills sit at matching heights. */
.play-badge {
  display: inline-flex;
  align-items: center;
  transition: transform 0.25s var(--ease);
}
.play-badge img {
  display: block;
  width: auto;
  height: 78px;
}
.play-badge:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

/* telemetry strip */
.telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 46px;
}
.stat {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 13px;
}
.stat b {
  color: var(--text);
  font-weight: 700;
}
.stat .u {
  color: var(--faint);
}

/* animated profile line behind / under hero */
.profile {
  width: 100%;
  height: auto;
  margin-top: 8px;
  display: block;
}
.profile path.line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 2.4s var(--ease) 0.5s forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---- features ---------------------------------------------------------- */
section {
  padding: 64px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  margin: 12px 0 0;
  max-width: 16ch;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 24px 28px;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--z1), var(--z2), var(--z3), var(--z4), var(--z5));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: #34401f;
}
.card:hover::before {
  opacity: 1;
}
.card .ico {
  width: 38px;
  height: 38px;
  color: var(--volt);
  margin-bottom: 18px;
}
.card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

/* ---- privacy highlight band ------------------------------------------- */
.banner {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(80% 140% at 90% 10%, rgba(198, 242, 74, 0.1), transparent 60%), var(--bg-2);
  padding: 48px 44px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
}
.banner h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  letter-spacing: -0.02em;
  margin: 14px 0 0;
}
.banner p {
  color: var(--muted);
  margin: 14px 0 0;
}
.banner .chips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 11px;
}
.chip svg {
  color: var(--volt);
  flex: none;
}

/* ---- beta CTA ---------------------------------------------------------- */
.beta {
  text-align: center;
}
.beta h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: -0.03em;
  margin: 14px auto 0;
  max-width: 18ch;
}
.beta p {
  color: var(--muted);
  max-width: 46ch;
  margin: 18px auto 30px;
}
.beta-note {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin: 26px auto 0;
}

/* ---- footer ------------------------------------------------------------ */
footer {
  border-top: 1px solid var(--line-soft);
  padding: 40px 0 56px;
  margin-top: 32px;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
footer .meta {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
}
footer .meta a {
  color: var(--muted);
}

/* ---- document (privacy) ------------------------------------------------ */
.doc {
  max-width: 720px;
  padding-top: 56px;
}
.doc h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  letter-spacing: -0.03em;
  margin: 20px 0 6px;
}
.doc .updated {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.doc .tldr {
  border-left: 2px solid var(--volt);
  background: var(--bg-2);
  border-radius: 0 12px 12px 0;
  padding: 18px 22px;
  margin: 30px 0 8px;
  color: var(--text);
}
.doc h2 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 42px 0 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.doc h2::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--volt);
  flex: none;
}
.doc p,
.doc li {
  color: var(--muted);
}
.doc strong {
  color: var(--text);
  font-weight: 700;
}
.doc ul {
  padding-left: 20px;
}
.doc li {
  margin: 8px 0;
}
.doc h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin: 26px 0 2px;
}
.doc .byline {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin: 6px 0 0;
}

/* article table (e.g. pressure chart) */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 24px 0;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  min-width: 360px;
}
.doc th,
.doc td {
  text-align: left;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.doc thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  background: var(--bg-2);
}
.doc tbody tr:last-child td {
  border-bottom: none;
}
.doc td:first-child {
  color: var(--text);
}
.doc th:not(:first-child),
.doc td:not(:first-child) {
  text-align: right;
  color: var(--volt);
  font-family: var(--font-mono);
}
.doc thead th:not(:first-child) {
  color: var(--faint);
}

/* in-article CTA box */
.cta-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(80% 140% at 90% 10%, rgba(198, 242, 74, 0.1), transparent 60%), var(--bg-2);
  padding: 30px 28px;
  margin: 44px 0 8px;
}
.cta-box h2 {
  margin-top: 0;
}
.cta-box h2::before {
  display: none;
}
.cta-box p {
  margin: 10px 0 20px;
}

/* blog index */
.posts {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}
.post-card {
  display: block;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 26px;
  transition:
    transform 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: #34401f;
  text-decoration: none;
}
.post-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 8px 0 6px;
}
.post-card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.96rem;
}

/* ---- entrance animation ------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.9s var(--ease) forwards;
}
@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
  .banner {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    gap: 15px;
  }
  .nav-links a.btn {
    display: none;
  }
  .banner {
    padding: 34px 26px;
  }
  /* slightly smaller store badges so both fit one line on narrow phones,
     keeping the Apple/Google visible pills matched (~46px) */
  .app-store-badge img {
    height: 46px;
  }
  .play-badge img {
    height: 69px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .profile path.line {
    stroke-dashoffset: 0;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}
