/*
 * PepCalc site styles. The tokens mirror the app's src/styles/tokens.css (warm paper, sage
 * primary, terracotta accent, warm ink) so the site and the app read as one product. Dark mode
 * follows the device; the site ships no script, so there is no toggle.
 */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/hanken-grotesk-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/hanken-grotesk-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/hanken-grotesk-latin-700-normal.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --pc-font: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pc-radius-md: 14px;
  --pc-radius-lg: 20px;
  --pc-radius-xl: 28px;
  --pc-radius-pill: 999px;
  --pc-gutter: 16px;
  --pc-max: 1120px;

  --pc-bg: #fbf8f3;
  --pc-surface: #fffdf9;
  --pc-surface-2: #f4ede2;
  --pc-text-1: #1d1a14;
  --pc-text-2: #5f5544;
  --pc-text-3: #7a6c54;
  --pc-brand: #3f6b52;
  --pc-brand-strong: #305340;
  --pc-on-brand: #fbf8f3;
  --pc-brand-soft: rgba(63, 107, 82, 0.12);
  --pc-accent: #9a4f33;
  --pc-divider: #e8ddcc;
  --pc-shadow: 0 1px 1px rgba(45, 38, 26, 0.04), 0 8px 24px rgba(45, 38, 26, 0.07);
  --pc-backdrop-1: rgba(130, 178, 146, 0.22);
  --pc-backdrop-2: rgba(220, 141, 107, 0.16);
  --pc-focus: #dc8d6b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --pc-bg: #15120e;
    --pc-surface: #221e18;
    --pc-surface-2: #2c2820;
    --pc-text-1: #f4ede2;
    --pc-text-2: #d6c7af;
    --pc-text-3: #b3a286;
    --pc-brand: #77c798;
    --pc-brand-strong: #a2e2bb;
    --pc-on-brand: #15120e;
    --pc-brand-soft: rgba(119, 199, 152, 0.18);
    --pc-accent: #ebb59b;
    --pc-divider: #3a342a;
    --pc-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --pc-backdrop-1: rgba(63, 171, 115, 0.14);
    --pc-backdrop-2: rgba(189, 89, 47, 0.12);
  }
}

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

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

body {
  margin: 0;
  font-family: var(--pc-font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--pc-text-1);
  background:
    radial-gradient(60rem 36rem at 0% 0%, var(--pc-backdrop-1), transparent 70%),
    radial-gradient(50rem 30rem at 100% 0%, var(--pc-backdrop-2), transparent 70%), var(--pc-bg);
  background-repeat: no-repeat;
}

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

a {
  color: var(--pc-brand);
  text-underline-offset: 0.18em;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--pc-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 700;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

p {
  margin: 0;
}

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

@media (min-width: 720px) {
  :root {
    --pc-gutter: 32px;
  }
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--pc-surface);
  padding: 8px 12px;
}

/* Header */
.site-header {
  padding: 16px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--pc-text-1);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: var(--pc-shadow);
}

.brand__accent {
  color: var(--pc-brand);
}

.site-nav {
  display: flex;
  gap: 20px;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--pc-text-2);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--pc-text-1);
}

@media (max-width: 559px) {
  .site-nav .optional {
    display: none;
  }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--pc-radius-pill);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.button--primary {
  background: var(--pc-brand);
  color: var(--pc-on-brand);
}

.button--primary:hover {
  background: var(--pc-brand-strong);
}

.button--quiet {
  border-color: var(--pc-divider);
  color: var(--pc-text-1);
  background: var(--pc-surface);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Stacked buttons on a phone share one width instead of wrapping at two. */
@media (max-width: 559px) {
  .actions .button {
    flex: 1 1 100%;
  }
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pc-accent);
}

.lead {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--pc-text-2);
  max-width: 38ch;
}

.muted {
  color: var(--pc-text-2);
}

.small {
  font-size: 0.9rem;
}

/* The container owns the spacing between its children, so a child's own margin reset can't
   collapse it. */
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack--loose {
  gap: 28px;
}

/* Hero */
.hero {
  padding: 32px 0 56px;
}

.hero .wrap {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.phones {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.phone {
  width: min(46%, 260px);
  border-radius: var(--pc-radius-xl);
  overflow: hidden;
  box-shadow: var(--pc-shadow);
  border: 1px solid var(--pc-divider);
  background: var(--pc-surface);
}

.phone:nth-child(2) {
  transform: translateY(32px);
}

/* Plain text with a tick, not pills: a pill reads as a button you can tap. */
.badges {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--pc-text-2);
}

.badges li {
  padding-left: 22px;
  position: relative;
}

.badges li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--pc-brand);
  border-bottom: 2px solid var(--pc-brand);
  transform: rotate(-45deg);
}

/* Sections */
.section {
  padding: 56px 0;
}

.section--band {
  background: var(--pc-surface-2);
}

.section-head {
  max-width: 60ch;
  margin-bottom: 32px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.card {
  background: var(--pc-surface);
  border: 1px solid var(--pc-divider);
  border-radius: var(--pc-radius-lg);
  padding: 24px;
  box-shadow: var(--pc-shadow);
}

.card h3 {
  margin-bottom: 8px;
}

.split {
  display: grid;
  gap: 32px;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

.split .phone {
  width: min(100%, 300px);
  margin: 0 auto;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.checks li {
  padding-left: 32px;
  position: relative;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 18px;
  height: 10px;
  border-left: 3px solid var(--pc-brand);
  border-bottom: 3px solid var(--pc-brand);
  transform: rotate(-45deg);
}

.meds {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.meds dl {
  margin: 0;
}

.meds dt {
  font-weight: 600;
}

.meds dd {
  margin: 0;
  color: var(--pc-text-2);
  font-size: 0.95rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--pc-divider);
  vertical-align: top;
}

.table-scroll {
  overflow-x: auto;
}

/* A wide comparison scrolls sideways on a phone rather than wrapping a word a line. */
.table-scroll .table--wide {
  min-width: 760px;
}

details {
  border-bottom: 1px solid var(--pc-divider);
  padding: 16px 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 32px;
}

details p {
  margin-top: 8px;
  color: var(--pc-text-2);
}

/* Long-form pages (privacy) */
.prose {
  max-width: 68ch;
  padding: 24px 0 64px;
}

.prose h2 {
  font-size: 1.4rem;
  margin-top: 36px;
}

.prose p,
.prose ul {
  margin-top: 12px;
}

/* Footer */
.site-footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--pc-divider);
  font-size: 0.9rem;
  color: var(--pc-text-2);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background-color 160ms ease;
  }
}

/* Inline style attributes are blocked by the CSP, so spacing tweaks are classes. */
.spaced {
  margin-top: 20px;
}
