/* Landing page. Scoped to body.home so the legal pages keep style.css as
   it is. The tokens mirror ProteinScannerCore/Tokens.swift ("Linen",
   PIVOT.md Phase 0): warm cream ground, warm near-black ink, white cards
   that lift off the cream, one plum accent. Light only; the face has no
   dark mode, so the dark tokens in style.css are overridden here. */

body.home {
  --bg: #f6f1ea;
  --bg-subtle: #efe8df;
  --card: #ffffff;
  --text: #2b2622;
  --text-secondary: #7a716a;
  --text-tertiary: #9a928a;
  --border: #e3dbd0;
  --accent: #7b4b6e;
  --button: #6e3f62;
  --verified: #4f8a5b;
  --serif: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  padding: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
}

body.home .wrap { max-width: none; }

.section-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

body.home h1,
body.home h2,
body.home h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "opsz" 144;
}

body.home h2 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0 0 16px;
}

body.home .nav { background: color-mix(in srgb, var(--bg) 88%, transparent); }
body.home .brand { font-family: var(--serif); font-weight: 600; }

/* App Store badge links */
.badge { display: inline-block; line-height: 0; border-radius: 8px; }
.badge img { display: block; height: auto; }
.badge:hover { text-decoration: none; opacity: 0.86; }
.badge:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Hero ---------- */

.hero { padding: 56px 0 72px; overflow: hidden; }

.hero-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
}

.hero-lede {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 34em;
  margin: 0 0 30px;
}

.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cta-note { color: var(--text-tertiary); font-size: 14px; }

/* Phones. The body is an SVG render (rim, bezel, buttons) and the screen is
   an absolutely placed image inside it. Geometry follows the 730x1466 symbol
   in index.html: body x 12..718, bezel 12, screen x 36..694, y 24..1442. */

.hero-stage {
  position: relative;
  width: min(560px, 100%);
  aspect-ratio: 560 / 620;
  margin: 0 auto;
}

.phone {
  position: relative;
  aspect-ratio: 730 / 1466;
}

.phone-body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.phone .screen {
  position: absolute;
  left: calc(100% * 36 / 730);
  top: calc(100% * 24 / 1466);
  width: calc(100% * 658 / 730);
  height: calc(100% * 1418 / 1466);
  border-radius: 13% / 6.03%;
  overflow: hidden;
  background: var(--bg);
}

.phone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Three phones the same size, fanned like a hand of cards. Side phones pivot
   from their bottom edge so the tops splay outward and the centre one leads. */

.phone-fan {
  position: absolute;
  width: 46%;
  transform-origin: 50% 100%;
}

.phone-fan-l { left: 3%;  top: 10%; transform: rotate(-9deg); z-index: 1; }
.phone-fan-c { left: 27%; top: 0;   z-index: 3; }
.phone-fan-r { right: 3%; top: 10%; transform: rotate(9deg);  z-index: 2; }

/* ---------- How it works ---------- */

.how { padding: 72px 0 40px; }

.how-lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2vw, 24px);
  color: var(--text-secondary);
  margin: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 26px 22px;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--button);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 18px;
}

.step h3 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.008em; }
.step p { margin: 0; color: var(--text-secondary); font-size: 16px; }

/* ---------- Feature rows ---------- */

.feature { padding: 64px 0; }
.feature-alt { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.feature-row-flip .feature-copy { order: 2; }
.feature-row-flip .feature-art { order: 1; }

.feature-copy p { color: var(--text-secondary); font-size: 17.5px; margin: 0 0 14px; max-width: 32em; }

.feature-art { display: flex; justify-content: center; }
.phone-lg { width: min(300px, 80%); }

/* ---------- Why protein first ---------- */

.reads { padding: 72px 0; }
.reads-lede { color: var(--text-secondary); font-size: 18px; margin: 0 0 32px; max-width: 44em; }

.reads-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
}

.reads-grid li {
  display: grid;
  gap: 3px;
  padding: 16px 18px 16px 44px;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  margin: 0;
}

.reads-grid li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 23px;
  width: 11px;
  height: 6px;
  border-left: 2.2px solid var(--verified);
  border-bottom: 2.2px solid var(--verified);
  transform: rotate(-45deg);
}

.reads-grid strong { font-weight: 650; font-size: 16.5px; }
.reads-grid span { color: var(--text-secondary); font-size: 15.5px; }

/* ---------- Closing ---------- */

.closing { padding: 40px 0 88px; }

.closing-inner {
  text-align: center;
  background: var(--button);
  color: #fff;
  border-radius: 28px;
  padding: 64px 32px 56px;
  max-width: 1104px;
}

.closing-inner h2 { color: inherit; margin-bottom: 14px; }
.closing-inner p { color: inherit; opacity: 0.82; max-width: 40em; margin: 0 auto 30px; font-size: 17.5px; }
.closing-note { font-size: 13.5px !important; opacity: 0.62 !important; margin: 28px auto 0 !important; }

/* ---------- Footer ---------- */

.foot { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--text-tertiary); font-size: 15px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; color: var(--text); }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { color: var(--text-secondary); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-copy { text-align: center; }
  .hero-lede { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-stage { width: min(500px, 100%); }
  .feature-row { grid-template-columns: 1fr; gap: 36px; }
  .feature-row-flip .feature-copy { order: 1; }
  .feature-row-flip .feature-art { order: 2; }
  .feature-copy p { max-width: none; }
  .steps { grid-template-columns: 1fr; }
  .reads-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero { padding-top: 24px; }
  .hero-stage { width: 100%; }
  .closing-inner { padding: 44px 22px 40px; border-radius: 22px; }
}
