/* ====================================================================
   PeptideRails v2 — Modern fintech (Stripe/Ramp direction)
   White canvas. Cobalt + emerald brand. Confident sans-serif throughout.
   ==================================================================== */

:root {
  /* surfaces — Chase-grade clean: white canvas + cool gray alt */
  --bone: #FFFFFF;
  --cream: #F4F6FA;
  --bg: #FFFFFF;
  --bg-alt: #F4F6FA;
  --bg-alt-2: #E9EEF6;
  --paper: #FFFFFF;

  /* ink — deep navy (Chase masthead) not pure black */
  --ink: #0B2545;
  --ink-2: #4A5A78;
  --ink-3: #7886A0;
  --ink-4: #B5BEC9;

  /* hairlines — cool gray */
  --hairline: #DEE3EC;
  --hairline-2: #C5CCD9;
  --hairline-3: #C9D0DA;

  /* brand — Chase blue family */
  --blue: #117ACA;        /* Chase primary blue — interactive */
  --blue-2: #0E5FA0;       /* hover / pressed */
  --blue-tint: #E8F2FB;
  --blue-tint-2: #C6DCF1;

  --green: #117A4A;        /* success / savings (muted, banking-style) */
  --green-tint: #E8F4ED;

  --sienna: var(--blue);       /* legacy alias — pull-quote highlight now uses Chase blue */

  /* gradient — kept only as token, used nowhere on the page */
  --grad-soft: linear-gradient(180deg, #F7F8FA 0%, #FFFFFF 100%);

  /* shadows — subtle, layered */
  --sh-1: 0 1px 2px rgba(10, 14, 26, 0.04), 0 1px 3px rgba(10, 14, 26, 0.04);
  --sh-2: 0 4px 12px rgba(10, 14, 26, 0.06), 0 2px 4px rgba(10, 14, 26, 0.04);
  --sh-3: 0 10px 28px rgba(10, 14, 26, 0.08), 0 4px 8px rgba(10, 14, 26, 0.04);
  --sh-blue: 0 1px 2px rgba(23, 71, 192, 0.20), 0 1px 0 rgba(0, 0, 0, 0.04);

  /* fonts */
  --font-body: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-serif: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;

  /* layout */
  --container: 1280px;
  --measure: 720px;

  /* radii */
  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;
  --r-xl: 14px;

  /* spacing scale */
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 80px;
  --s-10: 96px;
  --s-11: 120px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'ss02', 'cv01', 'cv11';
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--blue); color: #fff; }

/* ====================================================================
   TYPE
   ==================================================================== */

.display-1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-variation-settings: 'opsz' 144;
  font-size: clamp(56px, 11vw, 128px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.display-1 .accent { color: #1B3A6B; }
.display-1 .accent-green { color: var(--green); }
.display-1 em {
  font-style: italic;
  color: #1B3A6B;
}

.display-2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

.display-3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

.deck {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}

.h-sans {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}

.body-m {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
}

.body-s {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.45;
  font-feature-settings: 'tnum';
}

.mono-micro {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  line-height: 1.45;
}

.ital-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-variation-settings: 'opsz' 144;
}

/* ====================================================================
   LAYOUT
   ==================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 768px) { .container { padding: 0 32px; } }

section { padding: 80px 0; }
@media (min-width: 900px) { section { padding: 112px 0; } }

.measure { max-width: var(--measure); }
.rule { width: 100%; height: 1px; background: var(--hairline); border: 0; margin: 0; }
.rule-ink { width: 100%; height: 1px; background: var(--ink); border: 0; margin: 0; }
.rule-ink-2 { width: 100%; height: 2px; background: var(--ink); border: 0; margin: 0; }
.serif-body { font-family: var(--font-body); font-weight: 400; font-size: 19px; line-height: 1.55; color: var(--ink-2); letter-spacing: -0.005em; }

.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin: 0 0 20px;
  line-height: 1;
}
.label .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}
.label .sec { color: var(--blue); }

/* ====================================================================
   COMPONENTS — Buttons, tags, inputs, cards
   ==================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1;
  border: 1px solid;
  cursor: pointer;
  transition: all 180ms ease;
  border-radius: var(--r);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--blue);
  color: #FFF;
  border-color: var(--blue);
  border-radius: 6px;
  padding: 13px 22px;
  box-shadow: var(--sh-blue);
}
.btn-primary:hover {
  background: var(--blue-2);
  border-color: var(--blue-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 122, 202, 0.30);
}
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--hairline-2);
  border-radius: 0;
  box-shadow: none;
}
.btn-secondary:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
}
.btn-ghost { background: transparent; color: var(--ink); border-color: transparent; padding-left: 4px; padding-right: 4px; }
.btn-ghost:hover { color: var(--blue); }
.btn .arrow { display: inline-block; transition: transform 220ms ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 22px; font-size: 15px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid;
  border-radius: 4px;
  white-space: nowrap;
}
.tag-blue { color: var(--blue); border-color: var(--blue-tint-2); background: var(--blue-tint); }
.tag-green { color: var(--green); border-color: #BBF1CC; background: var(--green-tint); }
.tag-gray { color: var(--ink-3); border-color: var(--hairline); background: var(--bg-alt); }
.tag-ink { color: var(--ink); border-color: var(--hairline-2); background: var(--paper); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.4;
  border: 1px solid var(--hairline-2);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input::placeholder { color: var(--ink-4); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 71, 192, 0.12);
}
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%230A0E1A' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 7px;
  padding-right: 36px;
}

.field-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}

.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 32px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-flat {
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 28px;
  border-radius: var(--r-lg);
}

/* ====================================================================
   MASTHEAD / NAV
   ==================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  border-bottom-color: var(--hairline);
  box-shadow: 0 1px 0 rgba(10, 14, 26, 0.02);
}
.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}
.brand-inline {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.brand-mark-svg {
  display: block;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.brand-lockup-lg .brand-mark-svg { width: 44px; height: 44px; }
.brand-lockup-lg .brand-wordmark { font-size: 22px; }
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.022em;
  line-height: 1;
  color: var(--ink);
}
.brand-wordmark .pep,
.brand-wordmark .rails { color: var(--ink); }
.brand-wordmark .tld { color: var(--ink-3); font-weight: 500; }
.brand-logo {
  display: block;
  width: auto;
}
.brand-logo-lg { height: 64px; }
.brand-logo-xl { height: 96px; }
.brand-inline .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--ink);
  box-shadow: var(--sh-1);
}
.brand-inline .mark svg { width: 18px; height: 18px; }
.brand-inline .name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-inline .tld {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink-3);
  margin-left: 1px;
}
.nav-links {
  display: none;
  justify-self: center;
  gap: 28px;
}
@media (min-width: 980px) { .nav-links { display: flex; } }
.nav-links a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  transition: color 150ms ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta-group { display: flex; align-items: center; gap: 8px; }
.nav-signin {
  display: none;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 12px;
}
@media (min-width: 700px) { .nav-signin { display: inline-flex; } }
.nav-signin:hover { color: var(--ink); }
.nav-burger {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}
@media (min-width: 980px) { .nav-burger { display: none; } }
.nav-burger span { display: block; width: 20px; height: 1.5px; background: var(--ink); }

/* ====================================================================
   FOOTER
   ==================================================================== */

/* Brand lockup inside the dark footer — white type */
footer.masthead .brand-mark-svg { color: #FFFFFF; }
footer.masthead .brand-mark-svg path,
footer.masthead .brand-mark-svg rect:not([fill="#F7F4ED"]) { stroke: #FFFFFF; }
footer.masthead .brand-mark-svg rect[fill="#0A0E1A"],
footer.masthead .brand-mark-svg rect[fill="#0B2545"] { fill: #FFFFFF; }
footer.masthead .brand-mark-svg path[stroke="#0A0E1A"],
footer.masthead .brand-mark-svg path[stroke="#0B2545"] { stroke: #FFFFFF; }
footer.masthead .brand-mark-svg path[stroke="#F7F4ED"],
footer.masthead .brand-mark-svg path[stroke="#FFFFFF"] { stroke: var(--ink); }
footer.masthead .brand-wordmark,
footer.masthead .brand-wordmark .pep,
footer.masthead .brand-wordmark .rails { color: #FFFFFF; }
footer.masthead .brand-wordmark .tld { color: rgba(255,255,255,0.55); }

footer.masthead {
  background: var(--ink);
  color: rgba(255,255,255,0.78);
  border-top: 0;
  padding: 72px 0 40px;
  margin-top: 0;
}
.foot-brand-row {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 18px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
@media (min-width: 800px) {
  .foot-grid { grid-template-columns: repeat(2, 1fr); gap: 40px; }
}
@media (min-width: 1100px) {
  .foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 40px; }
}
.foot-col-brand { grid-column: 1 / -1; }
@media (min-width: 1100px) { .foot-col-brand { grid-column: auto; } }
.foot-col h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: #FFFFFF;
  margin: 0 0 16px;
  letter-spacing: -0.005em;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.foot-col a {
  font-family: var(--font-body);
  font-size: 14.5px;
  color: rgba(255,255,255,0.72);
  transition: color 150ms ease;
}
.foot-col a:hover { color: #FFFFFF; }
.foot-pos {
  font-size: 14.5px;
  color: rgba(255,255,255,0.72);
  line-height: 1.6;
  max-width: 320px;
  margin: 16px 0 24px;
}
.foot-social { display: flex; gap: 12px; }
.foot-social a {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r);
  color: rgba(255,255,255,0.72);
  transition: color 150ms ease, border-color 150ms ease;
  background: transparent;
}
.foot-social a:hover { color: #FFFFFF; border-color: rgba(255,255,255,0.45); }
.foot-social svg { width: 14px; height: 14px; }
.foot-legal {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.14);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  color: rgba(255,255,255,0.55);
}

/* Footer newsletter capture */
.foot-newsletter {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(255,255,255,0.14);
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 800px) {
  .foot-newsletter { grid-template-columns: 1fr 1fr; gap: 48px; padding: 40px 0; }
}
.foot-newsletter-text h4 {
  font-family: var(--font-body); font-weight: 600;
  font-size: 19px; letter-spacing: -0.018em;
  color: #FFFFFF; margin: 0 0 6px;
}
.foot-newsletter-text p {
  font-family: var(--font-body); font-size: 14px; line-height: 1.55;
  color: rgba(255,255,255,0.72); margin: 0; max-width: 420px;
}
.foot-newsletter-form {
  display: flex; gap: 8px; align-items: stretch;
}
.foot-newsletter-input {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.22);
  color: #FFFFFF;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 6px;
}
.foot-newsletter-input::placeholder { color: rgba(255,255,255,0.45); }
.foot-newsletter-input:focus { outline: none; border-color: #FFFFFF; box-shadow: 0 0 0 3px rgba(255,255,255,0.10); }
.foot-newsletter-btn { flex-shrink: 0; padding: 12px 18px; border-radius: 6px !important; }
@media (max-width: 540px) {
  .foot-newsletter-form { flex-direction: column; gap: 10px; }
}
.foot-newsletter-ok {
  font-family: var(--font-body); font-size: 14px;
  color: #FFFFFF; margin: 0;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
}
.foot-credibility { display: none; }
.foot-credibility + .foot-legal { margin-top: 48px; padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.14); }
.foot-phone {
  font-family: var(--font-mono);
  font-size: 14.5px;
  color: rgba(255,255,255,0.72);
  letter-spacing: -0.01em;
}
.foot-legal p { margin: 0; font-size: 13px; line-height: 1.55; max-width: 880px; }
.foot-legal .copy { font-size: 13px; }

/* ====================================================================
   UTILITIES
   ==================================================================== */

.apply-guarantee {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 32px;
  padding: 18px 20px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-tint-2);
  border-radius: var(--r);
}
.apply-guarantee svg { width: 20px; height: 20px; color: var(--blue); flex-shrink: 0; margin-top: 2px; }
.apply-guarantee p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.apply-guarantee strong { color: var(--ink); font-weight: 600; }

/* Contextual internal links — subtle but discoverable */
.ctx-link {
  color: var(--ink);
  border-bottom: 1px solid var(--hairline-2);
  transition: color 150ms ease, border-color 150ms ease;
}
.ctx-link:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Mobile QA bumps */
@media (max-width: 720px) {
  .nav-inner { gap: 12px; padding: 12px 0; }
  .brand-wordmark { font-size: 16px; }
  .brand-mark-svg { width: 28px !important; height: 28px !important; }
  .btn-pill { padding: 12px 18px; font-size: 14px; }
  .btn { padding: 10px 16px; font-size: 14px; }
  .container { padding: 0 18px; }
  section { padding: 56px 0; }
  .form-grid, .quick-fields { gap: 14px; }
  .hero-proof { gap: 16px 20px; }
  .compare-table th, .compare-table td { padding: 12px 14px; font-size: 13px; }
  .calc-grid { gap: 18px; }
}

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack-24 > * + * { margin-top: 24px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-12 > * + * { margin-top: 12px; }
.bg-alt { background: var(--bg-alt); }
.bg-bone { background: var(--bg); }
.bg-cream { background: var(--bg-alt); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }

/* Page header (lighter than home hero) */
.page-hero { padding: 72px 0 56px; }
@media (min-width: 900px) { .page-hero { padding: 112px 0 72px; } }

/* Link styles */
.link-blue { color: var(--blue); font-weight: 500; }
.link-blue:hover { text-decoration: underline; text-underline-offset: 3px; }
