/*
 * BasedBioHacker, prototype three
 * Premium editorial-product layer.
 */

:root {
  --paper: #ffffff;
  --canvas: #f5f6f8;
  --canvas-cool: #f1f4fa;
  --ink: #0d0f12;
  --body: #333841;
  --quiet: #626974;
  --muted: #777e88;
  --rule: #dfe3e8;
  --rule-soft: #eceff2;
  --rule-strong: #bfc5cc;
  --panel: #f7f8fa;
  --powder: #e9effc;
  --powder-soft: #f2f5fc;
  --blue: #285edc;
  --blue-dark: #1745bb;
  --hero: #25272b;
  --scrim: rgba(13, 15, 18, 0.76);
  --max: 1224px;
  --narrow: 800px;
  --measure: 43rem;
  --pad: clamp(22px, 4.25vw, 64px);
  --section: clamp(88px, 10vw, 144px);
  --header-height: 68px;
  --radius: 4px;
  --motion-fast: 150ms;
  --motion-state: 220ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  color-scheme: light;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 32px);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.58;
  letter-spacing: -0.006em;
  text-rendering: optimizeLegibility;
}

main { overflow: clip; }

::selection {
  background: rgba(40, 94, 220, 0.2);
  color: var(--ink);
}

h1,
h2,
h3 {
  max-width: none;
  margin: 0;
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3.25rem, 6.4vw, 5.75rem);
  line-height: 0.94;
  letter-spacing: -0.058em;
}

h2 {
  font-size: clamp(2.4rem, 4.4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

h3 {
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

p,
li,
dd { color: var(--body); }

a {
  color: inherit;
  text-underline-offset: 0.22em;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.page-shell,
.page-shell--narrow {
  width: min(calc(100% - (var(--pad) * 2)), var(--max));
  margin-inline: auto;
}

.page-shell--narrow {
  width: min(calc(100% - (var(--pad) * 2)), var(--narrow));
}

.section-pad { padding-block: var(--section); }

.section-kicker,
.home-hero__kicker {
  display: block;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.section-heading { margin-bottom: clamp(48px, 6vw, 80px); }
.section-heading h2 { max-width: 17ch; }

.section-heading p,
.tool-hero__copy,
.peptide-hero__content > p,
.calculator-heading > p {
  max-width: var(--measure);
  margin-top: 22px;
  color: var(--quiet);
  font-size: clamp(1.02rem, 1.25vw, 1.16rem);
  line-height: 1.58;
}

/* Header and controls */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: var(--header-height);
  padding-inline: var(--pad);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--rule-soft);
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.wordmark::before {
  content: "BB";
  display: grid;
  width: 30px;
  height: 30px;
  margin-right: 11px;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.62rem;
  letter-spacing: -0.04em;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(26px, 3.2vw, 48px);
}

.site-nav__link {
  position: relative;
  padding-block: 24px 23px;
  color: var(--quiet);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav__link::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--blue);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--motion-fast) var(--ease-out);
}

.site-nav__link[aria-current='page'] { color: var(--ink); }
.site-nav__link[aria-current='page']::after { transform: scaleX(1); }

.header-ai,
.nav-toggle {
  min-height: 38px;
  padding: 0 15px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  transition: transform var(--motion-fast) var(--ease-out), background-color var(--motion-fast) ease;
}

.nav-toggle { display: none; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding-inline: 19px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--motion-fast) var(--ease-out), background-color var(--motion-fast) ease, border-color var(--motion-fast) ease, color var(--motion-fast) ease;
}

.button--black {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.button--blue {
  background: var(--blue);
  color: var(--paper);
  border-color: var(--blue);
}

.button--outline,
.button--soft {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.button:active,
.header-ai:active,
.nav-toggle:active,
.ranking-list__item:active,
.goal-list__item:active { transform: scale(0.97); }

.text-link,
.text-button,
.article-card__link {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration-thickness: 1px;
}

input,
select,
textarea {
  min-height: 48px;
  padding: 0 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

textarea {
  min-height: 140px;
  padding-block: 12px;
}

input::placeholder,
textarea::placeholder {
  color: #737a84;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 94, 220, 0.12);
  outline: none;
}

/* Homepage */

.home-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: min(780px, calc(100dvh - var(--header-height)));
  overflow: hidden;
  background: var(--hero);
  border-bottom: 0;
}

.home-hero::before,
.peptide-hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(18, 20, 23, 0.96) 0%, rgba(18, 20, 23, 0.79) 46%, rgba(18, 20, 23, 0.3) 100%);
  content: "";
}

.home-hero::after,
.peptide-hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.2));
  content: "";
}

.home-hero__art {
  position: absolute;
  top: -8%;
  right: -7%;
  z-index: -2;
  width: min(78vw, 1100px);
  height: 118%;
  object-fit: contain;
  object-position: right center;
  opacity: 0.56;
  filter: grayscale(1) invert(1) contrast(0.78) brightness(1.22);
}

.home-hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-block: clamp(80px, 11vw, 132px);
}

.home-hero__kicker { color: #a8c1ff; }

.home-hero h1 {
  max-width: 820px;
  color: var(--paper);
  font-size: clamp(3.3rem, 6vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.home-hero__content > p {
  max-width: 40rem;
  margin: 26px 0 30px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.55;
}

.ai-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: min(100%, 670px);
  padding: 6px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.19);
}

.ai-composer input {
  min-width: 0;
  min-height: 50px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.ai-composer button {
  min-width: 132px;
  padding-inline: 18px;
  background: var(--blue);
  color: var(--paper);
  border: 0;
  border-radius: 2px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  transition: transform var(--motion-fast) var(--ease-out), background-color var(--motion-fast) ease;
}

.ai-composer button:active { transform: scale(0.98); }

.home-hero__secondary {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  font-weight: 700;
  text-underline-offset: 4px;
}

.start-section { background: var(--paper); }

.start-section__heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.65fr);
  align-items: end;
  gap: 72px;
  margin-bottom: clamp(50px, 6vw, 76px);
}

.start-section__heading .section-kicker {
  grid-column: 1 / -1;
  margin-bottom: -48px;
}

.start-section__heading h2 { max-width: 11ch; }

.start-section__heading p {
  max-width: 31rem;
  margin: 0;
  color: var(--quiet);
  font-size: 1.06rem;
}

.start-paths {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.start-paths a {
  display: flex;
  min-height: 184px;
  padding: 30px 32px 32px;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--rule);
  text-decoration: none;
  transition: background-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.start-paths a:last-child { border-right: 0; }

.start-paths strong {
  color: var(--ink);
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.start-paths span {
  max-width: 25ch;
  color: var(--quiet);
  font-size: 0.9rem;
}

.ranking-section { background: var(--canvas); }

.ranking-section .section-heading {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 70px;
  align-items: end;
}

.ranking-section .section-kicker {
  grid-column: 1 / -1;
  margin-bottom: -48px;
}

.ranking-section .section-heading p { margin: 0; }

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(34, 42, 55, 0.07);
}

.ranking-feature {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-content: start;
  gap: 0 28px;
  min-height: 510px;
  padding: clamp(38px, 5vw, 68px);
  border-right: 1px solid var(--rule);
  background: var(--paper);
}

.ranking-feature__index {
  grid-row: 1 / 5;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
}

.ranking-feature__meta {
  margin-bottom: 24px;
  color: var(--quiet);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ranking-feature h3 {
  max-width: 14ch;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.96;
}

.ranking-feature__main > p {
  max-width: 39rem;
  margin: 26px 0 38px;
  font-size: 1.02rem;
}

.ranking-feature__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 0 0 34px;
}

.ranking-feature__facts div {
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.ranking-feature__facts dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ranking-feature__facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
}

.ranking-feature .button { justify-self: start; }

.ranking-list {
  display: grid;
  align-content: stretch;
}

.ranking-list__item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 18px 22px;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  transition: background-color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.ranking-list__item:last-child { border-bottom: 0; }

.ranking-list__item::after {
  color: var(--blue);
  content: "→";
  font-size: 1rem;
}

.ranking-list__item span {
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 700;
}

.ranking-list__item strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.ranking-list__item[data-selected='true'] { background: var(--powder-soft); }

.articles-section { background: var(--paper); }

.article-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 4vw, 56px);
}

.article-card {
  display: flex;
  min-height: 360px;
  padding: 0;
  flex-direction: column;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule-strong);
  border-radius: 0;
  box-shadow: none;
}

.article-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.article-card__body { flex: 1; }

.article-card h2,
.article-card h3 {
  max-width: 18ch;
  font-size: clamp(1.8rem, 3.5vw, 3.3rem);
  line-height: 0.98;
}

.article-card h2 a,
.article-card h3 a { text-decoration: none; }

.article-card__body p {
  max-width: 37rem;
  margin-top: 22px;
}

.article-card__link {
  align-self: flex-start;
  margin-top: 32px;
}

.section-action {
  width: min(calc(100% - (var(--pad) * 2)), var(--max));
  margin: 52px auto 0;
  text-align: left;
}

.tools-callout { background: var(--powder); }

.tools-callout__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 64px;
}

.tools-callout h2 { max-width: 15ch; }

.tools-callout p {
  max-width: 35rem;
  margin-top: 18px;
  color: var(--quiet);
}

/* Peptide guide and directory */

.peptide-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: min(650px, calc(100dvh - var(--header-height)));
  overflow: hidden;
  background: var(--hero);
}

.peptide-hero::before {
  background: linear-gradient(90deg, rgba(18, 20, 23, 0.76), rgba(18, 20, 23, 0.42));
}

.peptide-hero__art {
  position: absolute;
  inset: -12% -5%;
  z-index: -2;
  width: 110%;
  height: 124%;
  object-fit: cover;
  opacity: 0.42;
  filter: grayscale(1) invert(1) contrast(0.8) brightness(1.16);
}

.peptide-hero__content {
  position: relative;
  display: flex;
  padding-block: clamp(90px, 12vw, 154px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.peptide-hero h1 {
  max-width: 11ch;
  color: var(--paper);
  font-size: clamp(4rem, 8vw, 7.3rem);
  line-height: 0.88;
}

.peptide-hero__content > p {
  max-width: 39rem;
  margin: 26px auto 30px;
  color: rgba(255, 255, 255, 0.78);
}

.directory-section { background: var(--canvas-cool); }

.directory-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: 72px;
  align-items: end;
  margin-bottom: clamp(50px, 7vw, 84px);
}

.directory-heading .section-kicker {
  grid-column: 1 / -1;
  margin-bottom: -48px;
}

.directory-heading h2 { max-width: 11ch; }

.directory-heading > p {
  max-width: 34rem;
  margin: 0;
  color: var(--quiet);
  font-size: 1.06rem;
}

.directory-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
}

.goal-panel,
.directory-results {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(35, 44, 58, 0.055);
}

.goal-panel {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  overflow: hidden;
}

.directory-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}

.directory-search input {
  width: 100%;
  min-width: 0;
}

.directory-search label,
.directory-search h3,
.goal-panel__header h3 {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.directory-search p,
.goal-panel__header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
}

.goal-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px 16px;
}

.goal-panel__header > span,
.goal-more summary span {
  color: var(--muted);
  font-size: 0.68rem;
}

.goal-list { display: grid; }

.goal-list__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 53px;
  padding: 13px 24px;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-top: 1px solid var(--rule-soft);
  border-radius: 0;
  text-align: left;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.goal-list__item > span:first-child {
  font-size: 0.82rem;
  font-weight: 700;
}

.goal-list__item > span:last-child {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.goal-list__item[aria-pressed='true'] {
  background: var(--powder);
  box-shadow: inset 3px 0 0 var(--blue);
}

.goal-panel__secondary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}

.goal-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 13px 24px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.goal-list__item--all {
  margin-top: 0;
  border-top: 1px solid var(--rule);
}

.directory-results {
  min-width: 0;
  padding: clamp(28px, 4vw, 52px);
}

.directory-results__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--rule-strong);
}

.directory-results__label {
  display: block;
  margin-bottom: 12px;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.directory-results__header h3 {
  font-size: clamp(2rem, 3.6vw, 3.15rem);
}

.directory-results__header > span {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.directory-filter-disclosure { border-bottom: 1px solid var(--rule); }

.directory-filter-disclosure summary {
  padding: 17px 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.directory-facets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 18px;
  align-items: end;
  padding: 6px 0 24px;
}

.directory-facets label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compound-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding-top: 28px;
}

.compound-card {
  display: flex;
  min-width: 0;
  min-height: 330px;
  padding: 26px;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-state) ease, transform var(--motion-state) var(--ease-out);
}

.compound-card__identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.compound-card__kind {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compound-card h3 { font-size: clamp(1.45rem, 2.3vw, 2rem); }
.compound-card h3 a { text-decoration: none; }

.compound-card__fit {
  color: var(--quiet);
  font-size: 0.67rem;
  line-height: 1.35;
  text-align: right;
}

.compound-card__description {
  flex: 1;
  margin: 22px 0 26px;
  color: var(--body);
  font-size: 0.9rem;
  line-height: 1.55;
}

.compound-card__evidence {
  display: grid;
  gap: 22px;
}

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

.compound-card__facts div {
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.compound-card__facts dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.compound-card__facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.77rem;
  line-height: 1.4;
}

.compound-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.empty-state {
  padding: 56px 24px;
  color: var(--quiet);
  text-align: center;
}

/* Product pages */

.simple-hero,
.page-hero,
.tool-hero {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.simple-hero > div,
.page-hero__grid,
.tool-hero__grid {
  min-height: 400px;
  align-content: center;
}

.simple-hero h1,
.page-hero h1,
.tool-hero h1 {
  max-width: 13ch;
}

.simple-hero p,
.page-hero p,
.tool-hero p {
  max-width: 40rem;
  color: var(--quiet);
}

.page-hero__grid,
.tool-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.7fr);
  gap: clamp(50px, 8vw, 110px);
  align-items: center;
}

.tools-directory,
.stack-library,
.research-index,
.source-questions,
.compatibility-section {
  background: var(--canvas);
}

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

.tool-card,
.tools-directory__list > a {
  min-height: 250px;
  padding: 32px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: none;
}

.compatibility-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
  gap: 28px;
  align-items: start;
}

.compatibility-form,
.compatibility-result {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 18px 52px rgba(35, 44, 58, 0.06);
}

.compatibility-form { padding: clamp(28px, 4vw, 48px); }

.compatibility-result {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  padding: clamp(28px, 4vw, 48px);
}

.compatibility-form__heading h2,
.compatibility-result h2 { font-size: clamp(2rem, 3.5vw, 3.2rem); }

.compatibility-pair-fields {
  display: grid;
  gap: 20px;
  margin-top: 34px;
}

.compatibility-pair-fields label,
.advanced-evidence-mode label {
  display: grid;
  gap: 8px;
  color: var(--quiet);
  font-size: 0.75rem;
  font-weight: 700;
}

.compatibility-form__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 26px;
}

.advanced-evidence-mode {
  margin-top: 32px;
  border-top: 1px solid var(--rule);
}

.advanced-evidence-mode > summary,
.result-explanation > summary,
.source-notes > summary {
  padding: 18px 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.advanced-evidence-mode fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0;
  padding: 0;
  border: 0;
}

.advanced-evidence-mode legend {
  grid-column: 1 / -1;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.demo-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 28px;
  padding: 18px 20px;
  background: #fffaf0;
  border: 1px solid #e6dcc7;
  border-radius: var(--radius);
  color: var(--body);
  font-size: 0.8rem;
}

.method-section { background: var(--paper); }

.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 84px;
}

.method-grid h2 { max-width: 11ch; }

.method-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
}

.method-ledger > div {
  padding: 24px 20px 0 0;
  border-right: 1px solid var(--rule);
}

.method-ledger > div + div { padding-left: 20px; }
.method-ledger > div:last-child { border-right: 0; }

.calculator-page {
  background: var(--powder);
}

.calculator-heading {
  margin-bottom: clamp(50px, 7vw, 80px);
  text-align: center;
}

.calculator-heading h1 { max-width: none; }

.calculator-heading > p {
  margin-inline: auto;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.85fr);
  gap: 28px;
  align-items: stretch;
}

.calculator-form,
.calculator-result,
.calculator-notes {
  background: var(--paper);
  border: 1px solid rgba(188, 198, 217, 0.72);
  border-radius: var(--radius);
  box-shadow: 0 18px 52px rgba(35, 44, 58, 0.06);
}

.calculator-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: clamp(28px, 4vw, 48px);
}

.calculator-field {
  display: grid;
  gap: 9px;
}

.calculator-field > label {
  color: var(--quiet);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.calculator-result {
  padding: clamp(30px, 4vw, 52px);
}

.calculator-result__amount {
  display: block;
  margin-top: 22px;
  color: var(--ink);
  font-size: clamp(3.5rem, 7vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.calculator-notes {
  margin-top: 28px;
  padding: clamp(24px, 3vw, 38px);
}

.syringe-track {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
}

.syringe-track span { background: var(--blue); }

.profile-hero,
.profile-tabs,
.profile-panel { background: var(--paper); }

.profile-hero {
  padding-block: clamp(70px, 9vw, 118px);
  border-bottom: 1px solid var(--rule);
}

.profile-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.62fr);
  gap: clamp(50px, 8vw, 110px);
  align-items: end;
}

.profile-hero h1 {
  max-width: 12ch;
  font-size: clamp(4rem, 8vw, 7.8rem);
}

.profile-tabs {
  position: sticky;
  top: var(--header-height);
  z-index: 10;
  border-bottom: 1px solid var(--rule);
}

.profile-panel {
  padding-block: clamp(70px, 9vw, 120px);
}

.profile-snapshot-grid,
.profile-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.profile-snapshot-grid > *,
.profile-evidence-grid > * {
  padding: 28px;
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.stack-library__layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.52fr) minmax(0, 1.48fr);
  gap: clamp(50px, 8vw, 100px);
  align-items: start;
}

.stack-list {
  display: grid;
  gap: 18px;
}

.stack-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
}

.stack-card__summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 100px;
  padding: 22px 26px;
  cursor: pointer;
}

.stack-card__number {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
}

.stack-card__summary strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.stack-card__summary small {
  display: block;
  margin-top: 5px;
  color: var(--quiet);
}

.stack-card__content {
  padding: 0 26px 28px 88px;
}

.stack-card__matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 24px;
  border-top: 1px solid var(--rule);
}

.stack-card__matrix > div {
  padding: 22px 20px 0 0;
  border-right: 1px solid var(--rule);
}

.stack-card__matrix > div + div { padding-left: 20px; }
.stack-card__matrix > div:last-child { border-right: 0; }

.article-grid--archive {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px 48px;
}

.article-grid--archive .article-card { min-height: 390px; }

.research-toolbar {
  margin-bottom: 42px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-strong);
  color: var(--muted);
  font-size: 0.72rem;
}

.research-newsletter { background: var(--powder); }

.source-questions__layout,
.completeness-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(52px, 9vw, 120px);
}

.source-questions__intro h2,
.completeness-intro h2 { max-width: 11ch; }

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

.source-questions__list > * {
  min-height: 170px;
  padding: 26px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.completeness-section { background: var(--paper); }

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

.completeness-checks label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--canvas);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.completeness-track {
  display: flex;
  gap: 5px;
  background: transparent;
}

.completeness-track span {
  height: 4px;
  flex: 1;
  background: var(--rule);
}

.completeness-track span[data-complete='true'] { background: var(--blue); }

.simple-next { background: var(--powder); }

/* Dialogs and footer */

dialog.modal {
  max-width: min(720px, calc(100vw - 32px));
  padding: clamp(30px, 5vw, 56px);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 30px 100px rgba(13, 15, 18, 0.3);
  transform: translateY(0) scale(1);
  transform-origin: center;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), overlay 180ms allow-discrete, display 180ms allow-discrete;
}

dialog.modal::backdrop {
  background: rgba(13, 15, 18, 0.74);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

dialog.modal[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  dialog.modal[open] {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-size: 1.15rem;
}

.gate-form,
.sourcing-dialog form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.gate-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.compare-tray {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: 24px;
  z-index: 15;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  width: min(calc(100% - 48px), 960px);
  margin-inline: auto;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: 0 18px 60px rgba(13, 15, 18, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-footer {
  display: grid;
  grid-template-columns: 0.9fr 0.45fr 1.2fr;
  gap: clamp(40px, 7vw, 96px);
  padding: clamp(64px, 8vw, 104px) var(--pad);
  background: var(--ink);
  color: var(--paper);
  border-top: 0;
}

.site-footer__brand span,
.site-footer__brand strong,
.site-footer__links a,
.site-footer__note p { color: var(--paper); }

.site-footer__brand span {
  display: block;
  margin-bottom: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.site-footer__brand strong {
  display: block;
  max-width: 12ch;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.site-footer__links {
  display: grid;
  align-content: start;
  gap: 12px;
}

.site-footer__links a {
  font-size: 0.82rem;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

.site-footer__note p {
  max-width: 42rem;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.78rem;
}

/* Intentional motion only */

@media (hover: hover) and (pointer: fine) {
  .site-nav__link:hover { color: var(--ink); }
  .site-nav__link:hover::after { transform: scaleX(1); }

  .header-ai:hover,
  .button--black:hover {
    background: #262a30;
    border-color: #262a30;
    color: var(--paper);
  }

  .button--blue:hover,
  .ai-composer button:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: var(--paper);
  }

  .button--outline:hover,
  .button--soft:hover {
    background: var(--canvas);
    color: var(--ink);
  }

  .start-paths a:hover,
  .goal-list__item:hover,
  .ranking-list__item:hover {
    background: var(--powder-soft);
  }

  .compound-card:hover {
    border-color: #bfc7d2;
    box-shadow: 0 18px 44px rgba(35, 44, 58, 0.08);
    transform: translateY(-2px);
  }

  .article-card h2 a:hover,
  .article-card h3 a:hover,
  .compound-card h3 a:hover { color: var(--blue); }
}

/* Responsive structure */

@media (max-width: 1060px) {
  :root { --pad: clamp(20px, 3.4vw, 38px); }

  .directory-layout { grid-template-columns: 280px minmax(0, 1fr); }
  .compound-grid { grid-template-columns: 1fr; }
  .method-ledger { grid-template-columns: 1fr; }

  .method-ledger > div,
  .method-ledger > div + div {
    padding: 18px 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .method-ledger > div:last-child { border-bottom: 0; }
}

@media (max-width: 820px) {
  :root {
    --header-height: 62px;
    --section: clamp(68px, 12vw, 92px);
  }

  h1 { font-size: clamp(3rem, 12vw, 4.7rem); }
  h2 { font-size: clamp(2.25rem, 9vw, 3.5rem); }

  .site-header {
    grid-template-columns: auto 1fr auto;
    min-height: var(--header-height);
  }

  .wordmark::before { display: none; }

  .nav-toggle {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
    align-items: center;
    margin-left: auto;
  }

  .header-ai { display: none; }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    padding: 10px var(--pad) 20px;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }

  .site-nav[data-open='true'] { display: flex; }

  .site-nav__link {
    padding: 16px 0;
    border-bottom: 1px solid var(--rule-soft);
  }

  .home-hero { min-height: min(720px, calc(100dvh - var(--header-height))); }

  .home-hero__art {
    top: 4%;
    right: -36%;
    width: 130vw;
    opacity: 0.35;
  }

  .home-hero h1 {
    max-width: 11.5ch;
    font-size: clamp(3.25rem, 12.6vw, 5.8rem);
  }

  .start-section__heading,
  .ranking-section .section-heading,
  .directory-heading,
  .page-hero__grid,
  .tool-hero__grid,
  .method-grid,
  .profile-hero__inner,
  .source-questions__layout,
  .completeness-layout,
  .stack-library__layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .start-section__heading .section-kicker,
  .ranking-section .section-kicker,
  .directory-heading .section-kicker {
    grid-column: 1;
    margin-bottom: 0;
  }

  .start-paths { grid-template-columns: 1fr; }

  .start-paths a {
    min-height: 136px;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .start-paths a:last-child { border-bottom: 0; }

  .ranking-layout,
  .compatibility-workspace,
  .calculator-layout {
    grid-template-columns: 1fr;
  }

  .ranking-feature {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .directory-layout { grid-template-columns: 1fr; }

  .goal-panel {
    position: static;
    top: auto;
  }

  .compound-grid,
  .tools-directory__list,
  .article-grid,
  .article-grid--archive,
  .source-questions__list,
  .profile-snapshot-grid,
  .profile-evidence-grid {
    grid-template-columns: 1fr;
  }

  .article-card { min-height: 320px; }
  .article-grid--archive { gap: 48px; }

  .compatibility-result {
    position: static;
    top: auto;
  }

  .stack-card__matrix { grid-template-columns: 1fr; }

  .stack-card__matrix > div,
  .stack-card__matrix > div + div {
    padding: 18px 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .stack-card__matrix > div:last-child { border-bottom: 0; }

  .site-footer { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  :root { --pad: 20px; }

  .home-hero__content { padding-block: 72px; }
  .home-hero h1 { font-size: clamp(3rem, 15vw, 4.35rem); }

  .ai-composer {
    grid-template-columns: 1fr;
    padding: 5px;
  }

  .ai-composer button { min-height: 48px; }

  .peptide-hero { min-height: 580px; }
  .peptide-hero h1 {
    max-width: 100%;
    font-size: clamp(2.7rem, 11vw, 3.15rem);
  }

  .ranking-feature {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 30px 24px;
  }

  .ranking-feature__index { grid-row: auto; }
  .ranking-feature__facts { grid-template-columns: 1fr; }

  .ranking-list__item { min-height: 74px; }

  .directory-results { padding: 24px 20px; }

  .directory-results__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .directory-facets,
  .calculator-form,
  .advanced-evidence-mode fieldset,
  .completeness-checks {
    grid-template-columns: 1fr;
  }

  .compound-card { min-height: 0; }

  .compound-card__identity {
    grid-template-columns: 1fr;
  }

  .compound-card__fit { text-align: left; }

  .compound-card__facts { grid-template-columns: 1fr; }

  .compound-card__actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .stack-card__summary {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    padding: 20px;
  }

  .stack-card__content { padding: 0 20px 24px; }

  .gate-form__row,
  .compare-tray {
    grid-template-columns: 1fr;
  }

  .compare-tray {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
  }

  .site-footer { padding-inline: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  dialog.modal,
  .button,
  .compound-card,
  .ranking-list__item,
  .goal-list__item {
    transform: none !important;
    transition: opacity 150ms ease, color 150ms ease, background-color 150ms ease !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .compare-tray {
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --rule: #8b9199;
    --rule-soft: #a6abb2;
    --quiet: #43484f;
    --muted: #4d535b;
  }
}
