/* ==========================================================================
   Bagged — marketing site
   The palette, type and metrics are lifted from the app's own design system
   (Theme.swift / Typography.swift) so the site and the product read as one.
   ========================================================================== */

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/SpaceGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/SpaceGrotesk-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/SpaceGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("assets/fonts/SpaceMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("assets/fonts/SpaceMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Surfaces */
  --bg: #f6f5f1;
  --surface: #ffffff;
  --sunken: #edece6;

  /* Ink */
  --ink: #14140f;
  --ink-2: #6b6b62;
  --ink-3: #a3a399;

  /* Rarity tiers (§3.1) */
  --common: #9a9a90;
  --uncommon: #3fa45b;
  --rare: #3b7dd8;
  --epic: #8b4fd6;
  --legendary: #e0a423;
  --secret: #e0559b;

  --radius: 18px;
  --radius-sm: 14px;
  --gutter: 24px;
  --max: 1180px;

  --sans: "Space Grotesk", ui-sans-serif, -apple-system, system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

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

/* Small all-caps labels. The capitals are in the markup; the tracking lives
   here, because caps without tracking read as shouting rather than as a label. */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin: 0 0 14px;
}

.section-title {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
}

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-2);
  margin: 0;
  max-width: 46ch;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.nav.is-stuck { border-bottom-color: rgba(20, 20, 15, 0.08); }

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 19px;
  margin-right: auto;
}
.brand img { width: 32px; height: 32px; border-radius: 9px; }

.nav-links {
  display: flex;
  gap: 26px;
  font-size: 15px;
  color: var(--ink-2);
}
.nav-links a { text-decoration: none; transition: color 0.15s ease; }
.nav-links a:hover { color: var(--ink); }

/* -------------------------------------------------------------- button --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  border: 1px solid var(--ink);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(20, 20, 15, 0.18); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(20, 20, 15, 0.16);
}
.btn-ghost:hover { box-shadow: 0 8px 20px rgba(20, 20, 15, 0.08); }

.btn-note {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

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

.hero { padding: clamp(56px, 8vw, 104px) 0 clamp(48px, 6vw, 80px); }

.hero .wrap {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(42px, 6.6vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 700;
  margin: 0 0 22px;
}
.hero h1 em {
  font-style: normal;
  position: relative;
  white-space: nowrap;
}
/* A hand-drawn-ish underline, in the app's Legendary gold. */
.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.14em;
  background: var(--legendary);
  opacity: 0.5;
  border-radius: 999px;
  z-index: -1;
}

.hero p.lede { font-size: clamp(18px, 1.8vw, 21px); max-width: 40ch; }

.hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 34px;
}

.hero-stats {
  display: flex;
  gap: 34px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid rgba(20, 20, 15, 0.1);
  flex-wrap: wrap;
}
.hero-stats div strong {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: -0.02em;
}
.hero-stats div span {
  font-size: 13px;
  color: var(--ink-2);
}

/* --------------------------------------------------------------- phone --- */

/* A restrained device frame: the screenshots already carry the product's
   look, so the bezel stays quiet and only supplies the corner radius. */
.phone {
  position: relative;
  border-radius: 44px;
  padding: 9px;
  background: linear-gradient(160deg, #23231e, #0c0c09);
  box-shadow:
    0 2px 3px rgba(20, 20, 15, 0.14),
    0 24px 48px -12px rgba(20, 20, 15, 0.3),
    0 60px 110px -30px rgba(20, 20, 15, 0.28);
  width: 100%;
  max-width: 340px;
}
.phone img {
  border-radius: 36px;
  width: 100%;
  display: block;
}
/* Dynamic Island. */
.phone::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 26px;
  border-radius: 999px;
  background: #0c0c09;
}

.hero-phones {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  position: relative;
}
.hero-phones .phone { max-width: 306px; }
.hero-phones .phone:first-child {
  transform: rotate(-5deg) translateX(9%) scale(0.9);
  transform-origin: bottom right;
  z-index: 1;
}
.hero-phones .phone:last-child {
  transform: rotate(4deg) translateX(-9%) scale(0.9);
  transform-origin: bottom left;
  z-index: 1;
}
.hero-phones .phone.lead {
  transform: none;
  z-index: 3;
}

/* --------------------------------------------------------------- tiers --- */

.tiers { padding: clamp(40px, 5vw, 64px) 0; }

.tier-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 34px;
}

.tier {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 18px 16px 16px;
  border: 1px solid rgba(20, 20, 15, 0.06);
}
.tier .dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--c);
  margin-bottom: 12px;
}
.tier h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tier p {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}

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

.feature { padding: clamp(56px, 7vw, 96px) 0; }
.feature + .feature { border-top: 1px solid rgba(20, 20, 15, 0.07); }

.feature .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 84px);
  align-items: center;
}
/* Alternate which side the phone sits on. */
.feature.flip .feature-media { order: -1; }

.feature-media { display: flex; justify-content: center; }

.feature-body h2 { margin-bottom: 18px; }

.feature-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
/* The marker is positioned rather than laid out as a sibling: as a grid or flex
   item it would split the <b> from the text that follows it, and each anonymous
   text run would become its own item in a 20px column. */
.feature-list li {
  position: relative;
  padding-left: 34px;
  font-size: 16px;
  color: var(--ink-2);
}
.feature-list li b {
  color: var(--ink);
  font-weight: 500;
}
/* Mono for a literal string quoted out of the interface, per the app's own
   rule that mono means "this is data, not prose". */
.mono-inline {
  font-family: var(--mono);
  font-size: 0.9em;
  letter-spacing: -0.02em;
  color: var(--ink);
}
/* The tick is drawn, not a glyph, so it keeps its weight at any size. */
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent, var(--ink));
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.2 10.4l3.2 3.2 6.4-6.8' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 20px 20px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.2 10.4l3.2 3.2 6.4-6.8' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 20px 20px no-repeat;
}

/* ---------------------------------------------------------- three lanes -- */

.lanes { padding: clamp(56px, 7vw, 96px) 0; background: var(--sunken); }

.lane-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.lane {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 30px 28px 32px;
  border: 1px solid rgba(20, 20, 15, 0.06);
}
.lane .lane-no {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.lane h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 12px 0 10px;
}
.lane p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.lane .lane-meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(20, 20, 15, 0.08);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
}

.lanes-note {
  margin: 34px auto 0;
  text-align: center;
  max-width: 60ch;
  color: var(--ink-2);
  font-size: 15.5px;
}
.lanes-note b { color: var(--ink); font-weight: 500; }

/* --------------------------------------------------------------- ranks --- */

.ranks { padding: clamp(56px, 7vw, 96px) 0; }

.ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}
.rung {
  display: flex;
  align-items: baseline;
  gap: 9px;
  background: var(--surface);
  border: 1px solid rgba(20, 20, 15, 0.07);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
}
.rung span {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
}
/* The top rung is the whole dex — it should look like the end of the road. */
.rung.apex {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.rung.apex span { color: rgba(255, 255, 255, 0.6); }

.crowns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 44px;
}
.crown {
  background: var(--surface);
  border: 1px solid rgba(20, 20, 15, 0.07);
  border-radius: var(--radius-sm);
  padding: 20px 18px;
  text-align: center;
}
.crown svg { width: 26px; height: 26px; margin: 0 auto 10px; display: block; }
.crown h4 { margin: 0 0 2px; font-size: 15px; font-weight: 700; }
.crown p { margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }

/* -------------------------------------------------------------- closing -- */

.closing {
  padding: clamp(64px, 8vw, 110px) 0;
  background: var(--ink);
  color: #fff;
  text-align: center;
}
.closing h2 {
  font-size: clamp(34px, 5.4vw, 60px);
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 0 0 18px;
  text-wrap: balance;
}
.closing p {
  color: rgba(255, 255, 255, 0.66);
  max-width: 54ch;
  margin: 0 auto;
  font-size: 18px;
  text-wrap: pretty;
}
.closing .btn {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
  margin-top: 34px;
}
.closing .btn-note { color: rgba(255, 255, 255, 0.45); display: block; margin-top: 16px; }

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

.footer { padding: 44px 0 56px; }
.footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-3);
}
.footer .brand { font-size: 16px; margin-right: 0; }
.footer .brand img { width: 26px; height: 26px; border-radius: 7px; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer .brand:hover { text-decoration: none; }
/* The legal links are the one thing on this page App Store review has to find. */
.footer-links a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

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

.legal { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.legal .wrap { max-width: 760px; }

.legal-head { margin-bottom: 40px; }
.legal-head h1 {
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 14px;
}
.legal-meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* A standing note at the top of each document. Not a legal clause — it says
   what state the document is in and who still has to look at it. */
.callout {
  background: var(--surface);
  border: 1px solid rgba(20, 20, 15, 0.1);
  border-left: 3px solid var(--legendary);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 28px 0 40px;
  font-size: 15px;
  color: var(--ink-2);
}
.callout strong { color: var(--ink); font-weight: 700; }
.callout p { margin: 0 0 10px; }
.callout p:last-child { margin-bottom: 0; }

/* Unfilled placeholders. Deliberately loud: shipping one of these unedited is
   worse than shipping no policy at all. */
.fill {
  background: rgba(224, 164, 35, 0.24);
  border-bottom: 1.5px solid var(--legendary);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.88em;
  font-weight: 700;
  white-space: nowrap;
}

.legal .toc {
  background: var(--sunken);
  border-radius: var(--radius-sm);
  padding: 24px 28px;
  margin-bottom: 48px;
}
.legal .toc h2 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin: 0 0 14px;
  text-transform: uppercase;
}
.legal .toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
  font-size: 14.5px;
}
.legal .toc li { margin-bottom: 6px; break-inside: avoid; }
.legal .toc a { color: var(--ink-2); text-decoration: none; }
.legal .toc a:hover { color: var(--ink); text-decoration: underline; }

.legal h2 {
  font-size: clamp(21px, 2.4vw, 26px);
  letter-spacing: -0.02em;
  margin: 52px 0 14px;
  scroll-margin-top: 88px;
}
.legal h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 30px 0 10px;
}
.legal p, .legal li { color: var(--ink-2); font-size: 16px; }
.legal p { margin: 0 0 16px; }
.legal ul, .legal ol { margin: 0 0 16px; padding-left: 24px; }
.legal li { margin-bottom: 9px; }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.legal strong { color: var(--ink); font-weight: 700; }

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 14.5px;
}
.legal .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.legal .table-scroll table { min-width: 620px; }
.legal th, .legal td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(20, 20, 15, 0.1);
  vertical-align: top;
  color: var(--ink-2);
}
.legal th {
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom-color: rgba(20, 20, 15, 0.18);
  white-space: nowrap;
}
.legal td:first-child { color: var(--ink); font-weight: 500; }

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: none;
  margin-bottom: 30px;
}
.legal-back:hover { color: var(--ink); }

@media (max-width: 640px) {
  .legal .toc ol { columns: 1; }
}

/* --------------------------------------------------------------- motion -- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* ---------------------------------------------------------- responsive --- */

@media (max-width: 1000px) {
  .tier-strip { grid-template-columns: repeat(3, 1fr); }
  .crowns { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .hero .wrap,
  .feature .wrap { grid-template-columns: 1fr; }
  .hero .wrap { text-align: left; }
  .feature.flip .feature-media { order: 0; }
  .lane-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero-phones { margin-top: 12px; }
  .hero-phones .phone { max-width: 232px; }
}

@media (max-width: 560px) {
  :root { --gutter: 18px; }
  .tier-strip { grid-template-columns: repeat(2, 1fr); }
  .crowns { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 22px; }
  .hero-phones .phone:first-child,
  .hero-phones .phone:last-child { display: none; }
  .hero-phones .phone.lead { max-width: 270px; }
}
