/*
 * PepLevel marketing site
 * Cool dark indigo, matching the app's design system
 * (Peptide Tracker/.../Utilities/Managers/Theme/DesignSystem.swift and
 * Docs/Main/DESIGN_SYSTEM.md). Dark is the default look; the light palette is
 * the app's designed light theme, not a system fallback.
 * Mobile-first, no build step, no external fonts or scripts.
 */

:root {
  color-scheme: dark light;

  /* Surfaces (appBackground, appSurface, appSurfaceRaised, appTile) */
  --page: #0A0A0C;
  --surface: #141416;
  --raised: #1C1C1F;
  --tile: #232327;
  --border: #242427;
  --hairline: #242427;

  /* Ink (appInk, appInkSecondary, appInkTertiary) */
  --ink: #E7EAEF;
  --ink-2: #9198A3;
  --ink-3: #6E7684;

  /* Accent (appDefaultIndigo) and its tints */
  --accent: #5E5CE6;
  --accent-hover: #7270EE;
  --accent-text: #8E8CF5;
  --accent-surface: rgba(94, 92, 230, 0.15);
  --accent-border: rgba(94, 92, 230, 0.35);
  --on-accent: #FFFFFF;

  /* Semantic (appPositive, appChartreuse) and the icon's coral */
  --positive: #74C69D;
  --chartreuse: #C9CD7A;
  --chartreuse-surface: #23261A;
  --coral: #F47B5E;

  --card-shadow: none;

  --serif: "New York", ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 16px;
  --radius-sm: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --page: #F4F5F7;
    --surface: #FFFFFF;
    --raised: #FFFFFF;
    --tile: #E7E9EF;
    --border: rgba(23, 23, 26, 0.06);
    --hairline: rgba(23, 23, 26, 0.09);

    --ink: #3F4A63;
    --ink-2: #626A7C;
    --ink-3: #767D8C;

    --accent-hover: #4B49D6;
    --accent-text: #4B49D6;
    --accent-surface: rgba(94, 92, 230, 0.10);
    --accent-border: rgba(94, 92, 230, 0.30);

    --positive: #1F7A55;
    --chartreuse: #5C6118;
    --chartreuse-surface: #F2F4DC;
    --coral: #D95B3E;

    --card-shadow: 0 1px 2px rgba(23, 23, 26, 0.06), 0 8px 24px rgba(23, 23, 26, 0.06);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

img { max-width: 100%; height: auto; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}
.narrow { max-width: 720px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.65rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }
strong { color: var(--ink); font-weight: 600; }

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

ul, ol { margin: 0 0 1rem 1.4rem; }
li { margin-bottom: 0.4rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* The editorial kicker: mono, uppercase, tracked out, muted */
.kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.7rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--page) 88%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand img { width: 34px; height: 34px; display: block; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 18px; }
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.93rem;
}
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-cta {
  color: var(--on-accent);
  background: var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
}
.site-nav .nav-cta:hover { background: var(--accent-hover); color: var(--on-accent); }

/* Hero */
.hero { padding: 64px 0 48px; text-align: center; position: relative; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 420px;
  background: radial-gradient(ellipse 60% 70% at 50% 0%, var(--accent-surface), transparent 70%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 {
  font-size: 2.9rem;
  max-width: 760px;
  margin: 0 auto 1.1rem;
}
.hero h1 em { font-style: italic; color: var(--accent-text); }
.hero .lede {
  font-size: 1.15rem;
  color: var(--ink-2);
  max-width: 620px;
  margin: 0 auto 1.8rem;
}
.hero-icon {
  width: 104px;
  height: 104px;
  margin-bottom: 22px;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
}
.hero-points {
  list-style: none;
  margin: 1.8rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hero-points li { margin: 0; }
.hero-points li::before { content: "\2022"; color: var(--accent); margin-right: 8px; }

/* Buttons and badges */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
}
.btn-secondary:hover { background: var(--surface); color: var(--ink); }

.badge-placeholder {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.appstore-badge {
  /* Placeholder until the listing is live. Replace with the official
     "Download on the App Store" badge inside a link to the listing. */
  display: inline-flex;
  flex-direction: column;
  background: #000;
  color: #fff;
  border: 1px solid #3a3a3e;
  border-radius: 10px;
  padding: 8px 22px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: default;
}
.appstore-badge small { display: block; font-size: 0.68rem; font-weight: 400; letter-spacing: 0.02em; }
.coming-soon-note { font-size: 0.85rem; color: var(--ink-3); }

/* Waitlist signup */
.signup {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 1.4rem auto 0;
  flex-wrap: wrap;
  justify-content: center;
}
.signup input[type="email"] { flex: 1 1 220px; }
.signup-status { font-size: 0.9rem; color: var(--ink-2); margin: 0.7rem 0 0; min-height: 1.4em; }

/* Form fields */
input[type="text"], input[type="email"], textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: var(--raised);
  color: var(--ink);
  font-size: 1rem;
  font-family: var(--sans);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-surface); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.93rem; margin-bottom: 0.35rem; }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Sections */
section { padding: 56px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.section-heading { text-align: center; max-width: 660px; margin: 0 auto 2.2rem; }
.section-heading p { color: var(--ink-2); }

/* Feature grid */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--card-shadow);
}
section.alt .card { background: var(--page); }
.card h3 { color: var(--ink); }
.card p { color: var(--ink-2); margin-bottom: 0; font-size: 0.97rem; }
.card .kicker { margin-bottom: 0.5rem; }

/* Phone mockups (placeholder art until real screenshots are in) */
.shots { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .shots { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .shots { grid-template-columns: 1fr 1fr 1fr; } }

.shot-frame { text-align: center; }
.phone {
  /* PLACEHOLDER mockup. Swap for <img class="phone-shot" src="assets/screenshot-0N.png">
     when the real App Store screenshots exist. */
  width: 100%;
  max-width: 250px;
  aspect-ratio: 9 / 19.5;
  margin: 0 auto 16px;
  border-radius: 36px;
  border: 8px solid #1E1E22;
  background: #0A0A0C;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 30px 16px 16px;
  text-align: left;
  color: #E7EAEF;
  overflow: hidden;
  position: relative;
}
.phone::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 18px;
  border-radius: 999px;
  background: #000;
}
.phone .p-kicker { font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; color: #6E7684; margin: 10px 0 4px; display: block; }
.phone .p-title { font-family: var(--serif); font-size: 21px; line-height: 1.15; color: #E7EAEF; margin-bottom: 8px; display: block; }
.phone .p-big { font-family: var(--serif); font-size: 30px; line-height: 1.1; color: #8E8CF5; display: block; }
.phone .p-sub { font-size: 10px; color: #9198A3; display: block; margin-bottom: 8px; }
.phone .p-rule { height: 1px; background: #242427; margin: 10px 0; }
.phone .p-btn { display: block; background: #5E5CE6; color: #fff; text-align: center; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 8px; margin: 10px 0; }
.phone .p-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.phone .p-tile { background: #141416; border: 1px solid #242427; border-radius: 10px; padding: 8px; font-size: 9px; color: #9198A3; }
.phone .p-tile b { display: block; font-family: var(--serif); font-weight: 500; font-size: 15px; color: #E7EAEF; }
.phone .p-tile.suggest { border: 1px dashed #5E5CE6; background: rgba(94, 92, 230, 0.15); color: #E7EAEF; }
.phone .p-tile.dim { opacity: 0.45; }
.phone .p-row { display: flex; justify-content: space-between; font-size: 10px; color: #9198A3; padding: 5px 0; border-bottom: 1px solid #242427; }
.phone .p-row b { color: #E7EAEF; font-weight: 500; }
.phone .p-tag { display: inline-block; font-size: 9px; color: #C9CD7A; background: #23261A; border: 1px solid #34381F; border-radius: 999px; padding: 2px 8px; margin: 2px 2px 0 0; }
.phone .p-pos { color: #74C69D; }
.phone svg { display: block; width: 100%; height: auto; margin: 6px 0; }
.phone-shot { width: 100%; max-width: 250px; margin: 0 auto 16px; display: block; border-radius: 28px; }

.shot-caption { font-family: var(--serif); font-size: 1.12rem; font-weight: 500; margin-bottom: 2px; }
.shot-sub { font-size: 0.92rem; color: var(--ink-2); margin-bottom: 0; }

/* How it works */
.step { display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-start; }
.step-num {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-surface);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-family: var(--mono);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.step p { color: var(--ink-2); margin-bottom: 0; }

/* Pricing */
.price-cards { align-items: stretch; }
.price-card { text-align: center; display: flex; flex-direction: column; position: relative; }
.price-card .price {
  font-size: 2.3rem;
  font-family: var(--serif);
  font-weight: 500;
  margin: 6px 0 0;
  color: var(--ink);
}
.price-card .per { color: var(--ink-3); font-size: 0.88rem; margin-bottom: 0; }
.price-card ul {
  list-style: none;
  margin: 16px 0 0;
  text-align: left;
  font-size: 0.93rem;
  color: var(--ink-2);
}
.price-card li::before { content: "\2713\20"; color: var(--positive); font-weight: 700; }
.price-card.hero-plan { border: 1px solid var(--accent); background: linear-gradient(180deg, var(--accent-surface), transparent 60%), var(--surface); }
section.alt .price-card.hero-plan { background: linear-gradient(180deg, var(--accent-surface), transparent 60%), var(--page); }
.plan-flag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.tier-compare { margin-top: 2rem; }
.tier-compare h3 { font-size: 1.1rem; }
.tier-compare ul { color: var(--ink-2); font-size: 0.95rem; }
.fine-print { text-align: center; color: var(--ink-3); font-size: 0.88rem; margin-top: 1.4rem; }

/* Guides list */
.guide-list { list-style: none; margin: 0; }
.guide-list li { border-bottom: 1px solid var(--hairline); padding: 14px 0; margin: 0; }
.guide-list li:first-child { border-top: 1px solid var(--hairline); }
.guide-list a { text-decoration: none; font-weight: 600; color: var(--ink); }
.guide-list a:hover { color: var(--accent-text); }
.guide-list p { color: var(--ink-2); font-size: 0.92rem; margin: 4px 0 0; }
.guide-group { margin-bottom: 2.4rem; }
.guide-group h2 { font-size: 1.3rem; }
.more-link { text-align: center; margin-top: 1.6rem; }

/* FAQ */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  padding: 2px 20px;
  box-shadow: var(--card-shadow);
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 28px 14px 0;
  list-style: none;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-text);
  font-size: 1.3rem;
  font-weight: 400;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-body { padding: 0 0 14px; color: var(--ink-2); font-size: 0.97rem; }
.faq-item .faq-body p { margin-bottom: 0.5rem; }
.learn-more { font-size: 0.92rem; font-weight: 600; }

/* CTA band */
.cta-band {
  text-align: center;
  padding: 64px 0;
  border-top: 1px solid var(--hairline);
  background: radial-gradient(ellipse 60% 80% at 50% 100%, var(--accent-surface), transparent 70%);
}
.cta-band p { color: var(--ink-2); max-width: 560px; margin: 0 auto 1.4rem; }

/* Breadcrumbs */
.breadcrumb { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 1rem; }
.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }

/* Guide article and plain pages */
.article { padding: 40px 20px 24px; }
.article header { margin-bottom: 1.6rem; }
.article .meta { color: var(--ink-3); font-size: 0.9rem; margin-top: 0.6rem; }
.article h2 { margin-top: 2.2rem; }
.article h3 { margin-top: 1.4rem; }
.article li { color: var(--ink); }
.article .answer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 1.2rem 0 1.6rem;
  box-shadow: var(--card-shadow);
}
.article .answer-box p:last-child { margin-bottom: 0; }
.app-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin: 2.4rem 0;
  text-align: center;
  box-shadow: var(--card-shadow);
}
.app-cta img { width: 64px; height: 64px; margin-bottom: 10px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35)); }
.app-cta p { color: var(--ink-2); font-size: 0.95rem; }
.related { border-top: 1px solid var(--hairline); margin-top: 2.4rem; padding-top: 1.4rem; }
.related h2 { font-size: 1.2rem; margin-top: 0; }

.table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; -webkit-overflow-scrolling: touch; }
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0 1.4rem;
  font-size: 0.95rem;
  background: var(--surface);
  display: block;
  overflow-x: auto;
}
th, td { border: 1px solid var(--hairline); padding: 9px 12px; text-align: left; }
th { background: var(--tile); font-weight: 600; }

/* Legal pages */
.legal h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal p, .legal li { color: var(--ink-2); }
.legal .updated { color: var(--ink-3); font-size: 0.9rem; }
.legal-nav { font-size: 0.9rem; margin-bottom: 1.6rem; color: var(--ink-3); }

/* Disclaimers and footer */
.disclaimer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.88rem;
  color: var(--ink-2);
  margin: 2rem 0;
}
.disclaimer p:last-child { margin-bottom: 0; }

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0 48px;
  font-size: 0.86rem;
  color: var(--ink-3);
}
.site-footer .footer-links { margin-bottom: 1.2rem; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer .footer-links a { color: var(--ink-2); text-decoration: none; }
.site-footer .footer-links a:hover { color: var(--ink); }
.site-footer p { margin-bottom: 0.6rem; }
.site-footer strong { color: var(--ink-2); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 2.05rem; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .site-nav .nav-hide-sm { display: none; }
  .site-nav { gap: 4px 12px; }
  .site-nav a { font-size: 0.88rem; }
}

/* Screen shown inside a guide (mockup placeholder or real screenshot) */
.article-shot { margin: 2.2rem 0; text-align: center; }
.article-shot .phone, .article-shot .phone-shot { margin-bottom: 12px; }
.article-shot figcaption { font-size: 0.9rem; color: var(--ink-3); max-width: 460px; margin: 0 auto; }
