/* ============================================================
   PillRem — shared subpage stylesheet
   Imported by privacy.html, terms.html, security.html,
   about.html, blog.html, press.html
   Matches the Calm Apothecary design tokens from the iOS app.
   ============================================================ */

:root {
  /* Canvas */
  --bg:               #FAF7F2;
  --bg-dim:           #F2EEE4;
  --surface:          #FFFFFF;
  --surface-soft:     #F5F0E6;

  /* Brand */
  --primary:          #3B6AA0;
  --primary-dark:     #2A4E7A;
  --primary-soft:     #E8EFF7;
  --primary-muted:    #C7D6E8;

  /* Accents */
  --sage:             #7BA088;
  --sage-soft:        #E4EEE7;
  --peach:            #E8C4A0;
  --peach-soft:       #FBF1E6;
  --amber:            #D4A574;
  --amber-soft:       #FAF2E6;
  --rose:             #C17B7B;
  --rose-soft:        #F7E8E8;
  --lavender:         #9B8FB5;
  --lavender-soft:    #EFEBF5;

  /* Text */
  --text:             #2A3142;
  --text-secondary:   #7A8094;
  --text-tertiary:    #A8ADBD;

  /* Hairlines */
  --hairline:         #EFE8DD;
  --hairline-strong:  #E2D9CB;

  /* Shadows */
  --shadow-soft:      0 2px 12px rgba(0,0,0,0.05);
  --shadow-raised:    0 4px 20px rgba(0,0,0,0.07);
  --shadow-floating:  0 10px 32px rgba(0,0,0,0.10);

  /* Type */
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body:    "DM Sans", ui-sans-serif, system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- base reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--primary-dark); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

/* subtle grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/></svg>");
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}
.container-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}
@media (max-width: 640px) {
  .container, .container-narrow { padding: 0 24px; }
  body { font-size: 16px; }
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.nav.scrolled { border-bottom-color: var(--hairline); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.logo:hover { color: var(--text); }
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
}
.logo-mark svg { width: 20px; height: 20px; color: #fff; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}
.nav-links a:hover { color: var(--primary); }

.nav-cta {
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform .2s var(--ease-out), box-shadow .2s ease, background .2s ease;
  box-shadow: 0 2px 10px rgba(59, 106, 160, 0.25);
}
.nav-cta:hover {
  transform: translateY(-1px);
  background: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(59, 106, 160, 0.35);
  color: #fff;
}
@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* ---------- page hero ---------- */
.page-hero {
  padding: 72px 0 48px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -160px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(59, 106, 160, 0.14), transparent 60%);
  filter: blur(60px);
  z-index: 0;
}
.page-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
}
.page-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  padding: 6px 12px;
  background: var(--primary-soft);
  border-radius: 999px;
  margin-bottom: 24px;
}
.page-title {
  font-size: clamp(40px, 5.4vw, 72px);
  font-weight: 400;
  letter-spacing: -0.032em;
  line-height: 1.02;
}
.page-title em {
  font-style: italic;
  color: var(--primary);
}
.page-lead {
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--text-secondary);
  max-width: 620px;
  margin-top: 28px;
  line-height: 1.55;
}
.page-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: var(--font-body);
}
.page-meta strong { color: var(--text-secondary); font-weight: 500; }

/* ---------- prose / long-form content ---------- */
.prose {
  padding: 48px 0 96px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.prose h2 {
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 500;
  margin: 56px 0 16px;
  letter-spacing: -0.02em;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 20px;
  font-weight: 500;
  margin: 36px 0 12px;
  font-family: var(--font-display);
}
.prose p { margin: 0 0 20px; color: var(--text); }
.prose p.muted { color: var(--text-secondary); }
.prose ul, .prose ol {
  margin: 0 0 24px;
  padding-left: 24px;
  color: var(--text);
}
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--primary); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--primary-muted);
  text-underline-offset: 3px;
}
.prose a:hover { text-decoration-color: var(--primary); }
.prose blockquote {
  margin: 32px 0;
  padding: 24px 32px;
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  border-radius: 0 16px 16px 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--text);
}
.prose hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 56px 0;
}
.prose code {
  background: var(--surface-soft);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  color: var(--primary-dark);
}
.prose .callout {
  padding: 24px 28px;
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
  border-radius: 0 14px 14px 0;
  margin: 32px 0;
  font-size: 15px;
  color: var(--text);
}
.prose .callout strong { color: var(--text); }

/* ---------- table of contents ---------- */
.toc {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-soft);
}
.toc h3 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 16px;
}
.toc ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 8px;
  padding-left: 36px;
  position: relative;
  font-size: 15px;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--primary);
  font-size: 13px;
}
.toc a { color: var(--text-secondary); }
.toc a:hover { color: var(--primary); }

/* ---------- card grids (about, press, blog) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 48px 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 32px;
  transition: transform .4s var(--ease-out), box-shadow .3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-raised); }
.card h3 {
  font-size: 19px;
  margin-bottom: 10px;
}
.card p {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0;
  line-height: 1.6;
}
.card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}
.card .card-icon svg { width: 22px; height: 22px; }

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

/* ---------- CTA strip ---------- */
.cta-strip {
  padding: 72px 0 120px;
}
.cta-box-small {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: 28px;
  padding: 56px 48px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-box-small::before {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 60%);
}
.cta-box-small > * { position: relative; }
.cta-box-small h2 {
  color: #fff;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 400;
  max-width: 620px;
  margin: 0 auto 24px;
  letter-spacing: -0.025em;
}
.cta-box-small h2 em { color: var(--peach); font-style: italic; }
.cta-box-small p {
  opacity: 0.85;
  margin: 0 auto 32px;
  max-width: 480px;
}

.app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: var(--text);
  padding: 14px 22px 14px 18px;
  border-radius: 14px;
  transition: transform .25s var(--ease-out), box-shadow .25s ease;
  box-shadow: var(--shadow-raised);
}
.app-store-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-floating); color: var(--text); }
.app-store-btn svg { width: 28px; height: 28px; }
.app-store-btn .labels { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.app-store-btn .tiny { font-size: 10px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; }
.app-store-btn .big { font-size: 17px; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.01em; }

/* ---------- footer (shared) ---------- */
.footer {
  padding: 72px 0 40px;
  border-top: 1px solid var(--hairline);
  background: var(--bg-dim);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.footer-about .logo { margin-bottom: 16px; }
.footer-about p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 340px;
  margin: 0;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}
.footer-col ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-col a {
  font-size: 14px;
  color: var(--text-secondary);
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--text-tertiary);
}
@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ---------- press-specific bits ---------- */
.fact-table {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 32px;
  margin: 32px 0 48px;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
}
.fact-table dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.fact-table dd {
  margin: 0;
  padding: 10px 0;
  font-size: 15px;
  color: var(--text);
  border-bottom: 1px solid var(--hairline);
}
.fact-table dt:last-of-type, .fact-table dd:last-of-type { border-bottom: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
