/* PeptideClients docs site styles.
   Mirrors apps/marketing/DESIGN_SYSTEM.md exactly: cream paper, ink text,
   Fraunces display, Inter body, one clay accent. */

@import url('/fonts/fonts.css');

:root {
  --paper: #F2EAD9;
  --paper-2: #ECE2CB;
  --paper-3: #E4D8BC;
  --linen: #FBF7EE;
  --ink: #1B1714;
  --ink-2: #2C251E;
  --muted: #6E6051;
  --muted-2: #8C7E6C;
  --rule: rgb(27 23 20 / 0.10);
  --rule-strong: rgb(27 23 20 / 0.15);
  --clay: #A8451E;
  --clay-deep: #8A3815;
  --sand: #D9C49A;
  --olive: #4D4A33;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Offset hash-link jumps and smooth scrolls so headings clear the 64px sticky nav. */
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
a:hover { color: var(--clay); }
img { max-width: 100%; height: auto; }
code, pre, .tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: 720px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(242, 234, 217, 0.9);
  backdrop-filter: blur(8px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); font-weight: 500;
  letter-spacing: -0.005em;
}
.brand .mark {
  display: inline-block; width: 10px; height: 10px; background: var(--clay);
  border-radius: 1px;
}
/* Image wordmark variants. Both nav and footer sit on cream backgrounds
 * (--paper / --paper-2), so the logo renders as-is without any inversion
 * filter -- the white-on-cream version washes out. If we ever introduce
 * a dark (--ink) footer variant, add a `.footer-logo--on-dark img` class
 * with `filter: brightness(0) invert(1)` and apply it from chrome.js. */
.nav-logo,
.footer-logo {
  display: inline-flex; align-items: center;
  line-height: 0; text-decoration: none;
}
.nav-logo img {
  height: 34px; width: auto; display: block;
}
.footer-logo img {
  height: 36px; width: auto; display: block;
}
@media (max-width: 900px) {
  .nav-logo img { height: 28px; }
  .footer-logo img { height: 30px; }
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px; color: var(--ink-2); text-decoration: none;
}
.nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; gap: 8px; align-items: center; }
.nav-right .signin { font-size: 14px; color: var(--ink-2); padding: 8px 14px; text-decoration: none; }
.nav-right .btn { font-size: 14px; }

/* ---------- Mobile nav (hamburger + off-canvas drawer) ----------
 * Hidden above 800px. Below 800px the desktop .nav-links collapse and
 * we surface the drawer in their place. The toggle and drawer markup
 * are injected by chrome.js so every doc/legal page gets it for free. */
.nav-toggle {
  display: none;
  appearance: none; background: transparent; border: 0; cursor: pointer;
  padding: 10px; margin: -10px -8px -10px 0;
  color: var(--ink); line-height: 0;
}
.nav-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.nav-toggle svg { display: block; width: 22px; height: 22px; }
.nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(86vw, 320px);
  background: var(--paper);
  border-left: 1px solid var(--rule-strong);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 60; overflow-y: auto;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 4px;
  visibility: hidden;
}
.nav-drawer a {
  display: block; padding: 12px 0;
  font-size: 1rem; color: var(--ink); font-weight: 500;
  border-bottom: 1px solid var(--rule); text-decoration: none;
}
.nav-drawer a:hover { color: var(--clay); }
.nav-drawer .nav-drawer-cta { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.nav-drawer .nav-drawer-cta a { border-bottom: 0; padding: 0; }
.nav-drawer .nav-drawer-cta .btn { width: 100%; justify-content: center; }
.nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}
.nav-drawer-head .small-caps { color: var(--muted); }
.nav-drawer-close {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  padding: 8px; margin: -8px; color: var(--ink); line-height: 0;
}
.nav-drawer-close svg { display: block; width: 20px; height: 20px; }
.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(27,23,20,0.35);
  backdrop-filter: blur(1px);
  opacity: 0; transition: opacity .25s ease;
  z-index: 55; pointer-events: none;
}
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
body.nav-open .nav-drawer { transform: translateX(0); visibility: visible; }
body.nav-open { overflow: hidden; }

@media (max-width: 800px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-right .signin { display: none; }
  .nav-inner { height: 56px; }
  .page-header { padding: 56px 0 24px; margin-bottom: 32px; }
  .doc-grid { grid-template-columns: 1fr; gap: 12px; }
  .doc-card { padding: 18px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  .page-header h1 { font-size: clamp(2rem, 8vw, 2.5rem); }
  footer { padding: 40px 0 32px; margin-top: 56px; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-fine { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-weight: 500;
  text-decoration: none; transition: all 150ms ease; cursor: pointer;
  border: 1px solid transparent;
}
.btn-dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-dark:hover { background: var(--ink-2); color: var(--paper); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-outline:hover { background: var(--paper-2); }

/* ---------- Typography ---------- */
.display, h1, h2, h3 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 300; letter-spacing: -0.01em; color: var(--ink);
}
.display em, h1 em, h2 em, h3 em {
  font-style: italic; color: var(--clay); font-weight: 300;
}
h1 { font-size: clamp(2.25rem, 4.5vw, 3.25rem); line-height: 1.05; }
h2 { font-size: clamp(1.625rem, 3vw, 2rem);     line-height: 1.1; margin-top: 2.5em; margin-bottom: 0.5em; }
h3 { font-size: 1.25rem; line-height: 1.2; margin-top: 2em; margin-bottom: 0.5em; font-weight: 500; }
p, ul, ol { color: var(--ink-2); }
p + p, ul + p, ol + p, p + ul, p + ol { margin-top: 1em; }
ul, ol { padding-left: 1.5em; }
li + li { margin-top: 0.4em; }
.small-caps, .smallcap {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.eyebrow .bar { display: inline-block; width: 24px; height: 1px; background: var(--ink); }
.hr {
  border: 0; border-top: 1px solid var(--rule); margin: 3em 0;
}

/* ---------- Page header (every doc page) ---------- */
.page-header { padding: 80px 0 32px; border-bottom: 1px solid var(--rule); margin-bottom: 48px; }
.page-header .meta { display: flex; gap: 16px; margin-top: 16px; color: var(--muted); font-size: 13px; }

/* ---------- Two-column legal layout ---------- */
.legal-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  padding: 24px 0 96px;
}
.legal-toc {
  position: sticky; top: 88px; align-self: start;
  font-size: 13px;
}
.legal-toc h4 {
  font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  margin-bottom: 10px;
}
.legal-toc a {
  display: block; padding: 6px 0; color: var(--muted); text-decoration: none;
  border-bottom: 1px solid transparent;
}
.legal-toc a:hover { color: var(--ink); }
.legal-toc a.active { color: var(--ink); }
@media (max-width: 800px) {
  .legal-grid { grid-template-columns: 1fr; gap: 24px; }
  .legal-toc { position: static; }
}

/* ---------- Cards on the index ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.doc-card {
  display: block;
  background: var(--linen);
  border: 1px solid var(--rule);
  padding: 24px;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}
.doc-card:hover { border-color: var(--rule-strong); transform: translateY(-1px); }
.doc-card .small-caps { margin-bottom: 10px; display: block; }
.doc-card .title { font-family: 'Fraunces', Georgia, serif; font-weight: 300; font-size: 1.25rem; color: var(--ink); }
.doc-card .blurb { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- Definition list (for "what we collect" tables) ---------- */
.dl {
  display: grid; grid-template-columns: 200px 1fr; gap: 12px 24px;
  border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 16px;
}
.dl dt { font-size: 13px; color: var(--muted); }
.dl dd { color: var(--ink-2); }
@media (max-width: 700px) {
  .dl { grid-template-columns: 1fr; gap: 4px 0; }
  .dl dt { margin-top: 10px; }
}

/* ---------- Footer ---------- */
footer {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding: 56px 0 40px; margin-top: 80px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
}
.foot-brand .foot-tag {
  margin-top: 12px; color: var(--muted); font-size: 13px; max-width: 32ch;
}
.foot-brand .foot-tag em { color: var(--clay); font-style: italic; }
.foot-col h5 {
  font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  margin-bottom: 14px;
}
.foot-col a {
  display: block; font-size: 14px; color: var(--ink-2); text-decoration: none;
  padding: 4px 0;
}
.foot-col a:hover { color: var(--ink); }
.foot-fine {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
@media (max-width: 800px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

/* Language picker (footer). Rendered by chrome.js below the fine line.
   The native <select> keeps focus + a11y semantics for free; we just
   restyle the chrome to match the rest of the footer. */
.lang-picker {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.lang-picker label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.lang-picker select {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 13px;
  padding: 6px 28px 6px 10px;
  border-radius: 2px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%238a8a8a' stroke-width='1.5' stroke-linecap='round'><path d='M3 4.5l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}
.lang-picker select:focus {
  outline: 2px solid var(--ink-2);
  outline-offset: 2px;
  color: var(--ink);
}
/* RTL: flip the chevron and padding so it sits on the leading edge. */
html[dir="rtl"] .lang-picker select {
  padding: 6px 10px 6px 28px;
  background-position: left 8px center;
}

/* Subtle italic-clay emphasis in prose */
p em, li em { font-style: italic; color: var(--clay); }

/* ============================================================
   Guides chrome -- used by every page under /guides/*
   ============================================================ */

/* Two-column guide layout (sidebar TOC + prose), same shape as
   the legal pages but with a slightly wider main column.
   Falls back to a single column under 900px. */
.guide-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  padding: 16px 0 96px;
}
.guide-toc {
  position: sticky; top: 88px; align-self: start;
  font-size: 13px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.guide-toc h4 {
  font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  margin-bottom: 10px;
}
.guide-toc a {
  display: block; padding: 5px 0; color: var(--muted); text-decoration: none;
  border-left: 2px solid transparent; padding-left: 10px; margin-left: -10px;
  line-height: 1.35;
}
.guide-toc a:hover { color: var(--ink); }
.guide-toc a.active { color: var(--ink); border-left-color: var(--clay); }
.guide-toc ul { list-style: none; padding-left: 0; }
.guide-toc li + li { margin-top: 0; }
.guide-toc .toc-sub { padding-left: 14px; font-size: 12px; }
@media (max-width: 900px) {
  .guide-grid { grid-template-columns: 1fr; gap: 16px; }
  .guide-toc { position: static; max-height: none; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
}

/* Anchor padding so deep-links don't slide the heading under the
   sticky nav (already handled by html.scroll-padding-top, but
   re-stated for printer/UA reset stragglers). */
.guide-body h2, .guide-body h3, .guide-body h4 { scroll-margin-top: 88px; }

/* Callouts: a single component with intent flavors.
   Use <div class="callout {note|tip|warn|error|success}">...</div>. */
.callout {
  border: 1px solid var(--rule-strong);
  background: var(--linen);
  padding: 14px 18px;
  margin: 1.25em 0;
  border-left: 4px solid var(--muted-2);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child  { margin-bottom: 0; }
.callout .callout-title {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 500; margin-bottom: 6px; color: var(--muted);
}
.callout.note    { border-left-color: var(--olive); }
.callout.tip     { border-left-color: var(--clay); }
.callout.warn    { border-left-color: #C29A2A; background: #FBF4DF; }
.callout.error   { border-left-color: #B0392C; background: #F7E4DF; }
.callout.success { border-left-color: #4F6D3A; background: #E8EFDD; }
.callout.note    .callout-title { color: var(--olive); }
.callout.tip     .callout-title { color: var(--clay); }
.callout.warn    .callout-title { color: #8A6D14; }
.callout.error   .callout-title { color: #8A2A1F; }
.callout.success .callout-title { color: #3A5028; }

/* Numbered step list -- the canonical "do this" component.
   Use <ol class="steps">...</ol>. */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; margin: 1em 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 18px 18px 18px 64px;
  border: 1px solid var(--rule);
  background: var(--linen);
  margin-bottom: 10px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 18px; top: 18px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper); font-family: 'Fraunces', serif;
  font-weight: 500; font-size: 14px;
}
ol.steps > li > :first-child { margin-top: 0; }
ol.steps > li > :last-child  { margin-bottom: 0; }
ol.steps > li ul, ol.steps > li ol { margin-top: 6px; }

/* "How it should work when working correctly" badge row -- a
   tight strip of green dots at the top of every guide page so
   users can confirm at a glance what the healthy steady state
   should look like. */
ul.health-row {
  list-style: none; padding: 0; margin: 1em 0 1.5em;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
ul.health-row li {
  border: 1px solid var(--rule);
  background: var(--linen);
  padding: 12px 14px 12px 38px;
  position: relative;
  font-size: 13px;
  margin-top: 0;
}
ul.health-row li::before {
  content: ''; position: absolute; left: 14px; top: 50%;
  width: 12px; height: 12px; border-radius: 50%;
  background: #4F6D3A;
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px rgba(79,109,58,0.18);
}

/* Symptom → cause → fix table for troubleshooting pages. */
table.tshoot {
  width: 100%; border-collapse: collapse; font-size: 14px;
  margin: 1em 0;
}
table.tshoot th, table.tshoot td {
  text-align: left; padding: 10px 12px; vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
table.tshoot th {
  font-weight: 500; color: var(--muted);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--paper-2);
}
table.tshoot td code { font-size: 0.85em; background: var(--paper-2); padding: 1px 5px; border-radius: 2px; }

/* Reusable preformatted block (cURL / shell / JSON examples). */
pre.example {
  background: var(--paper-2);
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid var(--rule);
  margin: 1em 0;
}
.guide-body code { background: var(--paper-2); padding: 1px 5px; border-radius: 2px; font-size: 0.9em; }
.guide-body pre code { background: transparent; padding: 0; font-size: inherit; }

/* Compact <kbd> tag for keyboard chords and menu paths. */
kbd {
  display: inline-block; padding: 1px 6px;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  background: var(--linen);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em; line-height: 1.4;
  border-radius: 3px;
}
