/* Shared styles for the Peptide Calculator guides cluster.
   Mirrors the homepage design system: cream/purple, Geist + Inter,
   flat (no shadows, no gradients), hairline-bordered rounded cards. */

:root {
  --purple: #7560d8;
  --purple-dark: #5c4bc0;
  --ink: #0e0e10;
  --muted: #6b6b72;
  --cream: #eeece4;
  --muted-cream: #f4f2eb;
  --paper: #ffffff;
  --line: #d6d3ca;
  --divider: #e4e1d7;
  --accent-muted: rgba(117, 96, 216, 0.1);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ---------- Floating frosted nav pill ---------- */
.topbar {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 9px 9px 18px;
  color: var(--ink);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--r-sm);
  background: url("/assets/icon.png") center / cover;
  color: transparent;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  font-size: 14px;
  font-weight: 600;
}

.nav a:not(.app-link) {
  text-decoration: none;
  color: var(--muted);
  transition: color 160ms ease;
}

.nav a:not(.app-link):hover {
  color: var(--ink);
}

.app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  color: #fff;
  background: var(--purple);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.app-link:hover {
  transform: translateY(-2px);
  background: var(--purple-dark);
}

.ico-apple {
  flex: none;
  margin-top: -2px;
}

/* ---------- Page shell ---------- */
.page {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 132px clamp(20px, 5vw, 40px) 0;
}

.page-wide {
  width: min(1120px, 100%);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.breadcrumb a {
  text-decoration: none;
  color: var(--purple-dark);
}

.breadcrumb span {
  color: var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--purple);
}

/* ---------- Article typography ---------- */
.article h1 {
  margin: 0 0 18px;
  font-family: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.article .lede {
  margin: 0 0 14px;
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.5;
  font-weight: 400;
  color: var(--muted);
}

.article .meta {
  margin: 0 0 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.article h2 {
  margin: 48px 0 14px;
  font-family: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 3.6vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.article h3 {
  margin: 32px 0 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.article p {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.62;
  color: #2b2b30;
}

.article ul,
.article ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.article li {
  margin: 0 0 9px;
  font-size: 17px;
  line-height: 1.6;
  color: #2b2b30;
}

.article strong {
  font-weight: 700;
  color: var(--ink);
}

.article a:not(.app-link):not(.button) {
  color: var(--purple-dark);
  text-underline-offset: 2px;
}

/* Formula / callout block */
.formula {
  margin: 0 0 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--muted-cream);
  font-family: Geist, Inter, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--ink);
}

.callout {
  margin: 28px 0;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--accent-muted);
}

.callout h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.callout p {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  background: var(--purple);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
  background: var(--purple-dark);
}

.button.ghost {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.ghost:hover {
  background: var(--muted-cream);
}

/* Reference tables (charts) */
.table-wrap {
  margin: 0 0 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--divider);
}

th {
  background: var(--muted-cream);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

td {
  font-variant-numeric: tabular-nums;
}

.article .disclaimer {
  margin: 56px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--muted-cream);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Guides hub ---------- */
.hub-head {
  max-width: 640px;
  margin-bottom: 40px;
}

.hub-head h1 {
  margin: 0 0 14px;
  font-family: Geist, Inter, sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hub-head p {
  margin: 0;
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.5;
  color: var(--muted);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: var(--purple);
}

.guide-card .tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple);
}

.guide-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.guide-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Related ---------- */
.related {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--divider);
}

.related h2 {
  margin: 0 0 18px;
  font-family: Geist, Inter, sans-serif;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.related-grid a {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  transition: border-color 160ms ease;
}

.related-grid a:hover {
  border-color: var(--purple);
}

/* ---------- Footer ---------- */
footer {
  margin-top: 80px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 30px clamp(20px, 5vw, 40px);
  color: var(--muted);
  background: var(--muted-cream);
  border-top: 1px solid var(--divider);
  font-size: 14px;
  font-weight: 500;
}

footer a {
  text-decoration: none;
  color: var(--muted);
}

footer a:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .guide-card:hover,
  .button:hover,
  .app-link:hover { transform: none; }
}

@media (max-width: 720px) {
  .guide-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 8px 8px 8px 16px;
    gap: 12px;
  }

  .nav a:not(.app-link) {
    display: none;
  }

  .brand span:last-child {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page {
    padding-top: 108px;
  }

  footer {
    display: block;
  }
}

/* ---------- Reusable calculator (landing pages) ---------- */
.calc-card {
  width: min(560px, 100%);
  max-width: 100%;
  margin: 28px 0 0;
  display: grid;
  gap: 20px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
}

.field {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 160ms ease;
}

.field-row:focus-within {
  border-color: var(--purple);
}

.field-input {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: Geist, Inter, sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.field-input::-webkit-outer-spin-button,
.field-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.field-suffix {
  padding-right: 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--muted-cream);
  border-radius: var(--r-sm);
  flex: none;
}

.seg-btn {
  border: 0;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease;
}

.seg-btn.is-active {
  background: var(--purple);
  color: #fff;
}

.calc-result {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px 20px;
  min-width: 0;
  margin-top: 4px;
  padding: 22px 24px;
  border-radius: var(--r-md);
  background: var(--purple);
  color: #fff;
}

.result-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.84;
}

.result-big {
  font-family: Geist, Inter, sans-serif;
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.result-exact {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
}

.result-sub {
  text-align: right;
}

.result-units {
  font-family: Geist, Inter, sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.calc-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 560px) {
  .calc-result {
    grid-template-columns: 1fr;
  }
  .result-sub {
    text-align: left;
  }
}
