/* Swold site. Tokens from the app design handoff: ink, lime, flame, violet, sky.
   Dark ink is the base look; light follows the system setting. */

@font-face { font-family: "Familjen Grotesk"; src: url("/assets/fonts/FamiljenGrotesk_400Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url("/assets/fonts/FamiljenGrotesk_500Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url("/assets/fonts/FamiljenGrotesk_700Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/JetBrainsMono_500Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --ink: #161613;
  --lime: #b6e35a;
  --flame: #f2733a;
  --flame-2: #f7a27a;
  --violet: #8a72e6;
  --sky: #5fb6e6;
  --on-accent: #161613;

  --bg: #161613;
  --bg-deep: #0f0f0d;
  --surface: #1f1f1c;
  --text: #f1f0ea;
  --muted: #a3a299;
  --line: rgba(241, 240, 234, 0.09);
  --tint-flame: oklch(0.29 0.06 50);
  --tint-violet: oklch(0.29 0.07 290);
  --tint-sky: oklch(0.29 0.05 235);
  --flame-text: oklch(0.86 0.06 55);
  --violet-text: oklch(0.82 0.11 290);
  --sky-text: oklch(0.83 0.09 235);
  --phone-ring: rgba(241, 240, 234, 0.12);
  --shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.75);

  --font: "Familjen Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-wipe: cubic-bezier(0.6, 0, 0.2, 1);
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --section: clamp(88px, 10vw, 150px);

  /* Meter geometry from the app: goal line at 76.9% (track = 130% of target). */
  --goal-at: 76.9%;
  --over-w: 7.2%;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5f0;
    --bg-deep: #ecebe4;
    --surface: #ffffff;
    --text: #161613;
    --muted: #6d6c64;
    --line: rgba(22, 22, 19, 0.08);
    --tint-flame: oklch(0.95 0.045 55);
    --tint-violet: oklch(0.93 0.05 290);
    --tint-sky: oklch(0.93 0.05 230);
    --flame-text: #5b4636;
    --violet-text: oklch(0.42 0.15 290);
    --sky-text: oklch(0.42 0.12 235);
    --phone-ring: rgba(22, 22, 19, 0.14);
    --shadow: 0 40px 70px -34px rgba(22, 22, 19, 0.45);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:hover { color: var(--lime); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font: 500 12px/1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Buttons */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 34px;
  border-radius: 20px;
  background: var(--lime);
  color: var(--on-accent);
  font: 700 18px/1 var(--font);
  text-decoration: none;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
  box-shadow: 0 18px 36px -22px rgba(182, 227, 90, 0.9);
}
.pill:hover { color: var(--on-accent); transform: translateY(-2px); }
.pill:active { transform: scale(0.97); }
.pill-sm { min-height: 44px; padding: 0 20px; border-radius: 15px; font-size: 15px; box-shadow: none; }
.store-note { min-height: 1.5em; margin-top: 10px; font-size: 14px; color: var(--muted); }

/* Header and lockup */
.nav { display: flex; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; }
.lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.wipe { display: inline-block; overflow: hidden; }
.wipe-in { display: block; }
.lockup-mark { height: 30px; width: auto; }
.lockup-word { height: 27px; width: auto; margin-top: 2px; }
.rise { display: inline-block; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding-top: clamp(28px, 5vw, 64px);
  padding-bottom: clamp(56px, 7vw, 96px);
}
.headline {
  margin-top: 18px;
  font-weight: 700;
  font-size: clamp(64px, 9.4vw, 136px);
  line-height: 0.88;
  letter-spacing: -0.055em;
}
.word { display: inline-block; }
.sub { margin-top: 26px; max-width: 26ch; font-size: clamp(19px, 1.7vw, 23px); line-height: 1.35; color: var(--muted); }
.cta-row { display: flex; align-items: flex-start; gap: 28px; margin-top: 36px; }
.qr { display: flex; align-items: center; gap: 14px; margin: 0; }
.qr-frame { display: block; padding: 10px; background: #f6f5f0; border-radius: 16px; }
.qr-frame img { width: 76px; height: 76px; }
.qr figcaption { font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); max-width: 13ch; }

.hero-visual { position: relative; display: grid; justify-items: center; }
.phone {
  padding: 7px;
  border-radius: 46px;
  background: #050505;
  box-shadow: 0 0 0 1px var(--phone-ring), var(--shadow);
}
.phone img { width: 100%; border-radius: 39px; }
.phone-hero { width: clamp(250px, 26vw, 318px); }

.meter-card {
  position: absolute;
  left: max(-6%, calc(50% - 330px));
  bottom: 7%;
  width: 280px;
  padding: 20px 20px 18px;
  border-radius: 26px;
  background: var(--lime);
  color: var(--on-accent);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.7);
}
.meter-label { font-size: 14px; font-weight: 500; }
.meter-num { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-weight: 700; font-size: 48px; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.meter-unit { font-size: 15px; letter-spacing: 0; font-weight: 500; }
.meter {
  position: relative;
  height: 18px;
  margin-top: 16px;
  border-radius: 9px;
  background: rgba(22, 22, 19, 0.13);
  overflow: hidden;
}
.meter-fill, .meter-over, .meter-goal { position: absolute; top: 0; bottom: 0; transform-origin: left center; }
.meter-fill { left: 0; width: var(--goal-at); background: var(--ink); border-radius: 9px; }
.meter-over {
  left: var(--goal-at);
  width: var(--over-w);
  background: repeating-linear-gradient(135deg, var(--flame) 0 5px, var(--flame-2) 5px 9px);
}
.meter-goal { left: calc(var(--goal-at) - 1px); width: 3px; background: #ffffff; }
.meter-legend { display: flex; justify-content: space-between; margin-top: 10px; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }

/* Sections */
.section { padding-top: var(--section); }
.section-title {
  margin-top: 14px;
  max-width: 17ch;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  font-weight: 700;
}

/* What it does */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.tile { grid-column: span 2; display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: 26px; min-height: 250px; }
.tile-wide { grid-column: span 4; }
.tile h3 { font-size: 27px; line-height: 1.05; letter-spacing: -0.03em; }
.tile p:not(.tile-tag) { font-size: 16px; color: inherit; opacity: 0.86; max-width: 42ch; }
.tile-tag { font: 500 11px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.tile-lime { background: var(--lime); color: var(--on-accent); }
.tile-lime h3 { font-size: clamp(30px, 3.2vw, 42px); max-width: 15ch; }
.tile-lime .meter { margin-top: auto; height: 22px; border-radius: 11px; }
.tile-surface { background: var(--surface); border: 1px solid var(--line); }
.tile-surface .tile-tag { color: var(--lime); }
.tile-sky { background: var(--tint-sky); }
.tile-sky .tile-tag { color: var(--sky-text); }
.tile-violet { background: var(--tint-violet); }
.tile-violet .tile-tag { color: var(--violet-text); }
.tile-flame { background: var(--tint-flame); }
.tile-flame .tile-tag { color: var(--flame-text); }
@media (prefers-color-scheme: light) {
  .tile-surface .tile-tag { color: #4d6b12; }
}

.streak-head { display: flex; align-items: center; gap: 14px; }
.streak-head h3 { margin-top: 4px; }
.flame {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  margin: 4px;
  border-radius: 50% 0 50% 50%;
  background: linear-gradient(225deg, #ffb36b, var(--flame) 55%, #d9502a);
  transform: rotate(-45deg);
}
.flame::after {
  content: "";
  position: absolute;
  left: 30%;
  top: 30%;
  width: 46%;
  height: 46%;
  border-radius: 50% 0 50% 50%;
  background: #ffe2b8;
}
.week { display: flex; gap: 8px; margin: auto 0 0; padding: 14px 0 0; list-style: none; }
.week li {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px dashed rgba(127, 127, 120, 0.4);
  font: 500 11px/1 var(--mono);
  color: var(--flame-text);
}
.week li.hit { border: 0; background: var(--flame); color: var(--on-accent); }
.week li.today { border: 2px dashed var(--flame); }
.week li.today::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--flame);
  opacity: 0;
}

/* Screens strip */
.strip {
  display: flex;
  gap: clamp(18px, 2.4vw, 32px);
  margin: 48px 0 0;
  padding: 8px max(var(--gutter), calc((100vw - var(--wrap)) / 2)) 40px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.shot { flex: 0 0 clamp(210px, 22vw, 250px); scroll-snap-align: start; }
.shot:nth-child(even) { margin-top: 44px; }
.shot .phone { border-radius: 38px; padding: 6px; }
.shot .phone img { border-radius: 32px; }
.shot-cap { margin-top: 16px; font: 500 12px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 48px 0 0; padding: 0; list-style: none; }
.step { padding: 28px 26px 30px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); }
.step h3 { margin-top: 22px; font-size: 25px; letter-spacing: -0.03em; line-height: 1.1; }
.step p { margin-top: 10px; color: var(--muted); }
.step-num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; font: 700 20px/1 var(--font); color: var(--on-accent); }
.step-lime { background: var(--lime); }
.step-sky { background: var(--sky); }
.step-flame { background: var(--flame); }

/* Pricing */
.plans { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; margin: 48px 0 0; padding: 0; list-style: none; }
.plan { padding: 26px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); }
.plan-main { background: var(--lime); color: var(--on-accent); border-color: transparent; }
.plan-name { font: 500 12px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.plan-price { margin-top: 14px; font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.plan-price span { font-size: 16px; font-weight: 500; letter-spacing: 0; margin-left: 4px; }
.plan-note { margin-top: 12px; font-size: 15px; opacity: 0.8; }
.fine { margin-top: 20px; font-size: 14px; color: var(--muted); }

/* Final CTA */
.final { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: var(--section); padding-bottom: clamp(72px, 8vw, 120px); }
.final-mark { width: 92px; }
.final-title { margin-top: 30px; font-size: clamp(54px, 8vw, 112px); line-height: 0.9; letter-spacing: -0.055em; }
.final .cta { margin-top: 36px; }

/* Footer */
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 40px; border-top: 1px solid var(--line); }
.foot-lockup { height: 22px; width: auto; }
.foot-links, .foot-pill { display: flex; flex-wrap: wrap; gap: 22px; font-size: 14px; }
.foot-links a, .foot-pill a { color: var(--muted); text-decoration: none; }
.foot-links a:hover, .foot-pill a:hover { color: var(--text); }

/* Small pages: download, 404 */
.center-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.center-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 40px var(--gutter); text-align: center; }
.center-main .final-mark { width: 76px; }
.center-title { font-size: clamp(40px, 6vw, 64px); line-height: 0.95; letter-spacing: -0.045em; max-width: 14ch; }
.center-sub { color: var(--muted); max-width: 32ch; }
.center-page .site-footer { justify-content: center; border: 0; }

/* Terms and Privacy */
.top-bar { display: flex; align-items: center; justify-content: space-between; max-width: 820px; margin: 0 auto; padding: 22px var(--gutter); }
.top-bar img { height: 24px; width: auto; }
.back { font-size: 15px; color: var(--muted); text-decoration: none; }
.doc { max-width: 820px; margin: 0 auto; padding: 20px var(--gutter) 72px; }
.doc h1 { margin-top: 18px; font-size: clamp(40px, 6vw, 60px); letter-spacing: -0.045em; line-height: 0.98; }
.doc h2 { margin: 42px 0 12px; font-size: 24px; letter-spacing: -0.02em; }
.doc p, .doc li { color: var(--text); opacity: 0.9; }
.doc p + p { margin-top: 14px; }
.doc ul { padding-left: 22px; }
.doc li + li { margin-top: 8px; }
.doc a { color: var(--lime); }
@media (prefers-color-scheme: light) { .doc a { color: #4d6b12; } }
.updated { margin-top: 10px; font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.draft-note { display: inline-block; padding: 8px 14px; border-radius: 12px; background: var(--flame); color: var(--on-accent); font: 500 12px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.placeholder { padding: 1px 6px; border-radius: 6px; background: var(--tint-flame); color: var(--flame-text); font-weight: 500; }
.doc-page .site-footer { max-width: 820px; }

/* Layout breakpoints */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { margin-top: 12px; }
  .meter-card { left: auto; right: max(0px, calc(50% - 250px)); bottom: 6%; width: 250px; }
  .bento { grid-template-columns: 1fr 1fr; }
  .tile, .tile-wide { grid-column: span 1; }
  .tile-lime { grid-column: span 2; }
  .steps, .plans { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { padding-top: 16px; padding-bottom: 16px; }
  .cta-row { flex-direction: column; }
  .cta-row .cta, .cta-row .pill { width: 100%; }
  .bento { grid-template-columns: 1fr; }
  .tile, .tile-lime { grid-column: span 1; min-height: 0; }
  .tile-lime .meter { margin-top: 18px; }
  .meter-card { right: 0; width: 220px; padding: 16px; border-radius: 22px; }
  .meter-num { font-size: 38px; }
  .site-footer { justify-content: center; }
}
/* Phones and touch screens can't scan their own screen, so the QR is desktop only. */
@media (max-width: 960px), (pointer: coarse) {
  .qr { display: none; }
}

/* Motion. Only runs with html.motion (set by motion.js when reduced motion is off).
   Everything animates transform and opacity only. */
@keyframes wipe-outer { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes wipe-inner { from { transform: translateX(100%); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes rise-big { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes flicker {
  0%, 100% { transform: rotate(-45deg) scale(1); }
  30% { transform: rotate(-41deg) scale(1.08, 0.94); }
  60% { transform: rotate(-49deg) scale(0.94, 1.08); }
}
@keyframes ring { 0% { opacity: 0.7; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.25); } }

.motion .wipe { animation: wipe-outer 1s var(--ease-wipe) both; }
.motion .wipe-in { animation: wipe-inner 1s var(--ease-wipe) both; }
.motion .rise { animation: rise 0.6s var(--ease-out) 1s both; }
.motion .hero .eyebrow { animation: rise 0.6s var(--ease-out) 0.15s both; }
.motion .word { animation: rise-big 0.75s var(--ease-out) both; }
.motion .word:nth-child(1) { animation-delay: 0.25s; }
.motion .word:nth-child(2) { animation-delay: 0.36s; }
.motion .word:nth-child(4) { animation-delay: 0.47s; }
.motion .fade-up { animation: rise 0.7s var(--ease-out) 0.65s both; }
.motion .cta-row.fade-up { animation-delay: 0.8s; }
.motion .float { animation: rise-big 0.9s var(--ease-out) 0.35s both; }
.motion .phone-hero { animation: float 6s ease-in-out 1.3s infinite; }
.motion .meter-card { animation: rise 0.7s var(--ease-out) 0.85s both; }
.motion .meter-card .meter-fill { animation: grow 1s var(--ease-out) 1.2s both; }
.motion .meter-card .meter-over { animation: grow 0.5s var(--ease-out) 2.25s both; }
.motion .meter-card .meter-goal { animation: rise 0.4s var(--ease-out) 1.1s both; }

.motion .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .bento .reveal:nth-child(2), .motion .steps .reveal:nth-child(2), .motion .plans .reveal:nth-child(2), .motion .strip .reveal:nth-child(2) { transition-delay: 0.08s; }
.motion .bento .reveal:nth-child(3), .motion .steps .reveal:nth-child(3), .motion .plans .reveal:nth-child(3), .motion .strip .reveal:nth-child(3) { transition-delay: 0.16s; }
.motion .bento .reveal:nth-child(4), .motion .strip .reveal:nth-child(4) { transition-delay: 0.24s; }
.motion .bento .reveal:nth-child(5), .motion .strip .reveal:nth-child(5) { transition-delay: 0.32s; }
.motion .strip .reveal:nth-child(6) { transition-delay: 0.4s; }
.motion .tile-lime .meter-fill { transform: scaleX(0); }
.motion .tile-lime .meter-over { transform: scaleX(0); }
.motion .tile-lime.in .meter-fill { animation: grow 1s var(--ease-out) 0.3s both; }
.motion .tile-lime.in .meter-over { animation: grow 0.5s var(--ease-out) 1.3s both; }
.motion .flame { animation: flicker 1.1s ease-in-out infinite; }
.motion .week li.today::after { animation: ring 1.6s ease-out infinite; }
.motion .pill { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
