/* 2Failure — the site
 *
 * The app's own tokens, verbatim from ios/App/Shared/Design/Skin.swift (the
 * `.graphite` skin, which is the one that ships) and its type scale from
 * FailureTheme.swift. Nothing here is a fresh design decision: if the app and
 * the site disagree about a colour, the app is right and this file is stale.
 */

:root {
  /* Ground and boxes */
  --bg:      #0E0E0F;
  --surface: #1B1B1D;
  --card:    #1F1F22;
  --line:    #2C2C30;
  --pane:    #161618;

  /* Type */
  --accent:  #F2F05F;   /* the only colour that means "act" */
  --ink:     #181405;   /* text on the accent */
  --sub:     #ADADB2;
  --muted:   #74747A;

  /* Group tones — the three bands */
  --push: #C4463C;
  --pull: #3D74B4;
  --legs: #565656;

  /* The screen's radial ground, outermost stop last */
  --ground-1: #2B384D;
  --ground-2: #191F2B;
  --ground-3: #0C0E14;

  --hairline: rgba(255,255,255,0.08);
  --edge-lit: rgba(255,255,255,0.11);
  --lift:     rgba(255,255,255,0.05);

  /* The seam angle every slab in the app is cut on: 26pt over 393pt. */
  --slant: 3.79deg;

  --page: min(1140px, 92vw);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: #fff;
  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* `height: auto` matters: every screenshot carries width/height attributes (so
 * the browser reserves the right box before it loads and the page does not jump)
 * and without this the intrinsic height wins over the scaled width — a 552x1200
 * shot renders 1200px tall inside a 205px-wide frame. */
img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------------------------------------------------------------- type */

.display {
  font-family: Anton, "Arial Narrow", Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.92;
  text-transform: uppercase;
}

.label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3 { margin: 0; }
p { margin: 0; }

/* ---------------------------------------------------------------- layout */

.wrap { width: var(--page); margin-inline: auto; }

section { position: relative; padding: clamp(72px, 11vw, 140px) 0; }

.eyebrow { color: var(--accent); }

.lede {
  color: var(--sub);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.65;
  max-width: 58ch;
}

/* ---------------------------------------------------------------- nav */

header.nav {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  width: var(--page); margin-inline: auto;
  display: flex; align-items: center; gap: 22px;
  height: 62px;
}
.wordmark {
  font-family: Anton, "Arial Narrow", Impact, sans-serif;
  font-size: 1.18rem; letter-spacing: 0.02em;
  color: #fff; text-transform: uppercase;
}
.wordmark span { color: var(--accent); }
.nav-links { margin-left: auto; display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--sub); font-size: 0.86rem; font-weight: 500; }
.nav-links a:hover { color: #fff; }
@media (max-width: 720px) { .nav-links a:not(.btn) { display: none; } }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 0.9rem;
  padding: 13px 22px; border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.18s cubic-bezier(0.2,0.8,0.3,1), background 0.18s, border-color 0.18s;
}
.btn:active { transform: scale(0.97); }

.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { background: #fff; color: var(--ink); }

.btn-ghost { background: rgba(255,255,255,0.08); color: #fff; border-color: var(--hairline); }
.btn-ghost:hover { background: rgba(255,255,255,0.14); color: #fff; }

.btn-lg { padding: 17px 30px; font-size: 1rem; }

/* ---------------------------------------------------------------- hero */

.hero { padding-top: clamp(56px, 8vw, 96px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% 0 auto 0; height: 720px;
  background:
    radial-gradient(52% 46% at 50% 0%, var(--ground-1) 0%, var(--ground-2) 46%, transparent 78%),
    radial-gradient(30% 26% at 86% 4%, rgba(242,240,95,0.10) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero-grid {
  display: grid; gap: clamp(34px, 5vw, 70px);
  grid-template-columns: 1.05fr 0.95fr; align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 {
  font-size: clamp(3.4rem, 9.5vw, 7.2rem);
  margin-bottom: 22px;
}
.hero h1 .yellow { color: var(--accent); display: block; }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-meta { margin-top: 20px; display: flex; gap: 18px; flex-wrap: wrap; }
.hero-meta span { font-size: 0.78rem; color: var(--muted); font-weight: 500; }

/* ---------------------------------------------------------------- devices */

/* Devices are sized off a single height budget rather than off the column's
 * width. A 552x1200 screenshot at "74% of the column" is 650pt tall on a laptop
 * and pushes the headline below the fold — which is the one thing the hero of a
 * landing page must not do. `--ph` is the phone's height; everything else is a
 * fraction of it, so the pair scales as one object. */
.devices { display: flex; align-items: flex-end; justify-content: center; gap: 0; --ph: min(580px, 62vh); }

.phone {
  width: calc(var(--ph) * 0.46);   /* 552 / 1200 */
  border-radius: 44px;
  padding: 9px;
  background: linear-gradient(160deg, #3a3a40, #141416 42%, #29292e);
  box-shadow: 0 40px 90px rgba(0,0,0,0.62), 0 6px 18px rgba(0,0,0,0.5);
  flex: 0 0 auto;
}
.phone img { border-radius: 36px; }

.watch {
  width: calc(var(--ph) * 0.205);
  margin-left: calc(var(--ph) * -0.085);
  margin-bottom: calc(var(--ph) * 0.045);
  border-radius: 34px;
  padding: 7px;
  background: linear-gradient(160deg, #4a4a52, #17171a 46%, #2e2e34);
  box-shadow: 0 26px 54px rgba(0,0,0,0.66);
  flex: 0 0 auto;
  position: relative;
}
.watch img { border-radius: 27px; }
/* The crown, because a watch without one reads as a small phone. */
.watch::after {
  content: ""; position: absolute; right: -4px; top: 34%;
  width: 5px; height: 30px; border-radius: 3px;
  background: linear-gradient(180deg, #6a6a72, #34343a);
}

/* ---------------------------------------------------------------- bands */

/* The Push · Pull · Legs slabs, cut on one slant.
 *
 * Same geometry as the app: each band is a parallelogram whose top and bottom
 * edges both climb to the right by the same amount, so band N's bottom edge and
 * band N+1's top edge evaluate to the same line — the bands interlock and the
 * seam is one clean diagonal with nothing to fudge. Every edge slants, the
 * outermost two included: the block is cut on a slant, not a square with
 * slanted lines drawn inside it.
 *
 * The cut is a `clip-path` on the background rather than a `skewY` on the
 * container, because a skewed container drags its children with it: skewY maps
 * (x, y) to (x, y + x·tanθ), so the percentage sitting at the right-hand edge is
 * lifted 85px on a 1280px screen and lands inside the band above. Counter-
 * skewing the child un-shears its letterforms but does not put it back. Clipping
 * the slab leaves the text on an ordinary, untransformed baseline — which is
 * also how it stays crisp.
 */
.bands {
  padding: 0;
  margin: clamp(60px, 8vw, 110px) 0 calc(clamp(60px, 8vw, 110px) + var(--rise));
  --rise: calc(100vw * 0.0662);   /* 26pt over 393pt — the app's seam angle */
}

.band {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: clamp(22px, 3.6vw, 38px) max(4vw, calc((100vw - var(--page)) / 2));
  color: #fff;
}

/* The slab, and the sweep across it. Both are clipped to the same parallelogram,
 * and both extend `--rise` below the band's own box so the next band's top edge
 * lands exactly on this one's bottom edge. */
.band .slab,
.band .fill {
  position: absolute;
  inset: 0 0 calc(-1 * var(--rise)) 0;
  clip-path: polygon(
    0 var(--rise),
    100% 0,
    100% calc(100% - var(--rise)),
    0 100%
  );
  pointer-events: none;
}
.band .fill {
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.1s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.band .body { position: relative; z-index: 1; flex: 1; min-width: 0; }
.band .num  { position: relative; z-index: 1; text-align: right; }

.band h3 { font-size: clamp(1.9rem, 5vw, 3.3rem); }
.band .muscles { font-size: 0.76rem; color: rgba(255,255,255,0.72); font-weight: 500; margin-top: 2px; }
.band .pct { font-family: Anton, sans-serif; font-size: clamp(1.6rem, 4vw, 2.8rem); }
.band .togo { font-size: 0.68rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.64); text-transform: uppercase; }

/* The unfilled part still carries the group tone at 22%, because a week with
 * nothing logged is exactly when you come to look, and a band that only found
 * its colour at 50% would be grey precisely then. */
.band.push .slab { background: color-mix(in srgb, var(--push) 22%, var(--bg)); }
.band.push .fill { background: var(--push); }
.band.pull .slab { background: color-mix(in srgb, var(--pull) 22%, var(--bg)); }
.band.pull .fill { background: var(--pull); }
.band.legs .slab { background: color-mix(in srgb, var(--legs) 22%, var(--bg)); }
.band.legs .fill { background: var(--legs); }

/* ---------------------------------------------------------------- features */

.section-head { max-width: 62ch; margin-bottom: clamp(34px, 5vw, 58px); }
.section-head h2 { font-size: clamp(2.3rem, 5.6vw, 4rem); margin: 10px 0 18px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 940px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 26px 24px 28px;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 50%;
  background: linear-gradient(180deg, var(--lift), transparent);
  pointer-events: none;
}
.card h3 { font-size: 1.22rem; margin-bottom: 9px; letter-spacing: 0.01em; }
.card p { color: var(--muted); font-size: 0.9rem; line-height: 1.62; }
.card .ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: rgba(242,240,95,0.12); color: var(--accent);
}
.card .ico svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- split */

.split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(34px, 6vw, 84px); align-items: center;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.split .devices { --ph: min(620px, 66vh); }
.split.flip > *:first-child { order: 2; }
@media (max-width: 900px) { .split.flip > *:first-child { order: 0; } }

.split h2 { font-size: clamp(2.1rem, 5vw, 3.5rem); margin: 10px 0 18px; }

.bullets { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.bullets li { display: flex; gap: 12px; color: var(--sub); font-size: 0.94rem; line-height: 1.55; }
.bullets b { color: #fff; font-weight: 600; }
.bullets .tick {
  flex: 0 0 auto; width: 19px; height: 19px; margin-top: 3px;
  border-radius: 50%; background: var(--accent); color: var(--ink);
  display: grid; place-items: center; font-size: 11px; font-weight: 900;
}

/* watch strip */
.watch-strip { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.watch-strip { --ph: 1px; }
.watch-strip .watch { margin: 0; width: min(168px, 40vw); }

/* ---------------------------------------------------------------- pricing */

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

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
@media (max-width: 820px) { .plans { grid-template-columns: 1fr; } }

.plan {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 26px; padding: 32px 28px 34px;
  display: flex; flex-direction: column;
}
.plan.pro { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.plan .tag {
  align-self: flex-start; font-size: 0.62rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; margin-bottom: 18px;
}
.plan.free .tag { background: rgba(255,255,255,0.10); color: var(--sub); }
.plan.pro  .tag { background: var(--accent); color: var(--ink); }

.price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.price .amount { font-family: Anton, sans-serif; font-size: 3.4rem; line-height: 1; }
.plan.pro .price .amount { color: var(--accent); }
.price .per { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.plan .note { color: var(--sub); font-size: 0.88rem; margin-bottom: 22px; }
.plan .bullets { margin-top: 0; flex: 1; }
.plan .bullets .tick { background: rgba(255,255,255,0.14); color: #fff; }
.plan.pro .bullets .tick { background: var(--accent); color: var(--ink); }
.plan .btn { margin-top: 26px; justify-content: center; }

.pay-note {
  margin-top: 22px; color: var(--muted); font-size: 0.8rem;
  text-align: center; max-width: 64ch; margin-inline: auto; line-height: 1.6;
}
.pay-error {
  margin-top: 14px; text-align: center; font-size: 0.85rem;
  color: #E8A0A0; min-height: 1.2em;
}

/* ---------------------------------------------------------------- faq */

.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 18px 20px;
}
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 1rem;
  list-style: none; display: flex; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--accent);
  font-size: 1.3rem; font-weight: 400; line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq p { color: var(--muted); font-size: 0.92rem; margin-top: 12px; line-height: 1.65; }

/* ---------------------------------------------------------------- footer */

footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 56px; color: var(--muted); font-size: 0.84rem;
}
.foot-inner { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.foot-links { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: #fff; }

/* ---------------------------------------------------------------- reveal */

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.62s cubic-bezier(0.2,0.8,0.3,1), transform 0.62s cubic-bezier(0.2,0.8,0.3,1);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- legal pages */

.legal { padding-top: 56px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin-bottom: 8px; }
.legal h2 { font-size: 1.15rem; margin: 34px 0 10px; color: #fff; }
.legal p, .legal li { color: var(--sub); font-size: 0.95rem; line-height: 1.7; }
.legal ul { padding-left: 20px; }
.legal .updated { color: var(--muted); font-size: 0.82rem; margin-bottom: 30px; }
