/* Cape Labs mock site. Static layout by default; `.motion` (set in <head>) switches the story to the pinned, animated stage. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--color-cloud);
  color: var(--color-obsidian);
  font-family: var(--font-display);
  font-size: var(--text-body);
  line-height: 1.5;
  letter-spacing: var(--tracking-body);
  font-feature-settings: 'ss01' on;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); flex: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 100;
  background: var(--color-paper); padding: 0.5rem 1rem; border-radius: var(--radius-pill);
}
.skip-link:focus { top: 0.75rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-display); font-weight: 500; font-size: 0.9375rem; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
  transition: background-color var(--duration) var(--ease-out), transform 0.15s var(--ease-out);
}
.btn-primary { background: var(--color-obsidian); color: var(--color-paper); box-shadow: var(--shadow-button); }
.btn-primary:hover { background: var(--color-graphite); }
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-sm { min-height: 40px; padding: 0.5rem 1.125rem; font-size: 0.875rem; }
.btn-lg { min-height: 56px; padding: 1rem 2rem; font-size: 1.0625rem; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem var(--gutter);
  background: rgb(255 255 255 / 0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(228 228 234 / 0.6);
}
/* Logo: inline sprite from brand/tools/build-logos.py. Ink is currentColor; only the sun changes colour, following the peptide. */
:root { --logo-sun: var(--accent); --logo-slogan: var(--color-charcoal); --logo-stroke: 2.4; }
.logo-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.logo { display: inline-flex; color: var(--color-obsidian); text-decoration: none; border-radius: var(--radius-sm); }
.logo-svg { display: block; height: 2.5rem; width: auto; aspect-ratio: 438 / 83.3; overflow: visible; }
/* Optical sizing: below ~48px tall the 2.4 trace drops under 1.4px on screen, so the header thickens it. */
.site-header .logo { --logo-stroke: 3.2; }
.logo-footer .logo-svg { height: 4rem; }
@media (max-width: 639px) { .logo-footer .logo-svg { height: 3.5rem; } }
@media (max-width: 639px) { .site-header .logo-svg { height: 2.125rem; } .site-header .logo { --logo-stroke: 3.6; } }

/* ---------- Peptide picker ---------- */
/* Each button carries its own data-peptide, so its dot always shows that peptide's colour. */
.picker {
  display: flex; gap: 0.375rem; margin: 0 calc(var(--gutter) * -1) 2.5rem; padding: 0.25rem var(--gutter);
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent, black var(--gutter), black calc(100% - var(--gutter)), transparent);
          mask-image: linear-gradient(90deg, transparent, black var(--gutter), black calc(100% - var(--gutter)), transparent);
}
.picker::-webkit-scrollbar { display: none; }
.picker-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; flex: none; scroll-snap-align: center;
  min-height: 40px; padding: 0.5rem 1rem;
  font: 500 0.875rem/1 var(--font-display); letter-spacing: -0.01em; color: var(--color-graphite);
  background: rgb(255 255 255 / 0.5); border: 1px solid rgb(255 255 255 / 0.7); border-radius: var(--radius-pill);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background-color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out),
              color var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out), transform 0.15s var(--ease-out);
}
.picker-btn:hover { background: rgb(255 255 255 / 0.85); color: var(--color-obsidian); }
.picker-btn:active { transform: translateY(1px); }
.picker-btn .dot { transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out); }
.picker-btn[aria-pressed="true"] {
  background: var(--color-paper); color: var(--color-obsidian); border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint), var(--shadow-xs);
}
.picker-btn[aria-pressed="true"] .dot { transform: scale(1.25); box-shadow: 0 0 0 3px var(--accent-tint); }

/* ---------- Story: static layout (default and reduced motion) ---------- */
.story { background: var(--gradient-hero); }
.stage { max-width: var(--max-width); margin: 0 auto; padding: 7rem var(--gutter) var(--section-gap); }

.hero-copy { max-width: 36rem; }
.hero-title {
  font-size: var(--text-display); line-height: 0.95; letter-spacing: var(--tracking-display); font-weight: 600;
  text-wrap: balance;
}
.hero-sub { margin: 1.25rem 0 2rem; font-size: var(--text-body-lg); color: var(--color-graphite); max-width: 30rem; }

.vial-wrap { position: relative; width: min(34vw, 11rem); margin: 3rem auto 1rem; }
.vial { display: block; width: 100%; height: auto; overflow: visible; }
.vial-label-name { font-family: var(--font-display); font-weight: 600; font-size: 70px; letter-spacing: -0.03em; fill: var(--color-obsidian); }
.vial-label-sub { font-family: var(--font-ui); font-weight: 500; font-size: 20px; letter-spacing: 0.14em; fill: var(--color-charcoal); }
.vial-label-dose { font-family: var(--font-mono); font-size: 24px; fill: var(--accent-text); }
.vial-label, .vial-band, .vial-mark, .vial-cap-tint, .vial-powder-tint { mix-blend-mode: multiply; }
.vial-band { fill: var(--accent); }
.vial-mark-trace { stroke: var(--color-graphite); }
.vial-mark-sun { fill: var(--accent); }
.vial-cap-tint { fill: var(--accent); }
.vial-powder-tint { fill: var(--color-paper); transition: fill 0.7s var(--ease-out); }
[data-peptide="ghk"] .vial-powder-tint { fill: var(--ghk-tint); }
.vial-shadow {
  position: absolute; left: 12%; right: 12%; bottom: -1.25rem; height: 1.25rem;
  background: radial-gradient(closest-side, rgb(16 55 132 / 0.16), transparent);
}

.particles { display: none; }

.beat { padding: var(--section-gap) 0 0; display: grid; gap: 2rem; justify-items: center; text-align: center; }
.beat-copy { max-width: 34rem; display: grid; gap: 0.75rem; justify-items: center; }
.beat h2 { font-size: var(--text-heading); line-height: 1.1; letter-spacing: var(--tracking-heading); font-weight: 600; text-wrap: balance; }
.beat p { color: var(--color-charcoal); font-size: var(--text-body-lg); }
.beat .btn { margin-top: 1rem; }

/* ---------- Chemistry diagrams ---------- */
.scene { width: min(100%, 50rem); height: auto; overflow: visible; }
.scene line { stroke: var(--color-graphite); stroke-width: 2.5; stroke-linecap: round; }
.scene text {
  font-family: var(--font-mono); font-size: 30px; font-weight: 500;
  fill: var(--color-obsidian); text-anchor: middle; dominant-baseline: middle;
}
/* Floating 3D amino acid (js/amino3d.js). Same atom spheres and bond shine as the peptide-bond scene. */
.scene-amino3d { width: min(100%, 40rem); height: min(50vh, 30rem); overflow: visible; }
.scene-amino3d .aa3-mol { filter: drop-shadow(0 8px 10px rgb(16 24 40 / 0.12)); }
.scene-amino3d .aa3-bond path { fill: none; stroke-linecap: round; }
.scene-amino3d .aa3-bond-shine { transform: translate(-0.8px, -1.1px); }
.scene-amino3d .aa3-sphere { stroke: rgb(16 24 40 / 0.08); stroke-width: 0.8; }
.scene-amino3d .aa3-r { stroke: rgb(16 24 40 / 0.1); stroke-width: 0.8; }
.scene-amino3d text.aa3-r-text { font-family: var(--font-display); font-size: 26px; font-weight: 600; fill: var(--color-paper); text-anchor: middle; dominant-baseline: central; }
.scene-amino3d text.aa3-label { font-family: var(--font-ui); font-size: 17px; font-weight: 500; fill: var(--color-charcoal); text-anchor: middle; }
.scene-amino3d text.aa3-label-r { fill: var(--accent-text); }
.scene-amino3d .aa3-shadow { fill: rgb(16 55 132 / 0.07); }
.mol-dot-r { background: radial-gradient(circle at 36% 32%, var(--accent-tint), var(--accent) 50%, var(--accent-text)); }
/* Ball-and-stick peptide bond (js/molecules.js) */
.scene-bond { width: 100%; height: min(58vh, 38rem); overflow: visible; }
.scene-bond .mol { filter: drop-shadow(0 6px 8px rgb(16 24 40 / 0.10)); }
.scene-bond .mb path { fill: none; stroke-linecap: round; }
.scene-bond .mb-base, .scene-amino3d .aa3-bond-base { stroke: #9097a1; }
.scene-bond .mb-shine, .scene-amino3d .aa3-bond-shine { stroke: #eceef2; }
.scene-bond .mol-atom { stroke: rgb(16 24 40 / 0.08); stroke-width: 0.8; }
.scene-bond .mol-cap { fill: var(--color-paper); stroke: var(--color-slate); stroke-width: 1.2; }
.scene-bond .mol-cap-text { font-family: var(--font-ui); font-size: 14px; font-weight: 500; fill: var(--color-charcoal); text-anchor: middle; dominant-baseline: middle; }
.scene-bond .mol-pb path { fill: none; stroke-linecap: round; }
.scene-bond .mol-pb-glow { stroke: var(--accent); stroke-width: 18; opacity: 0.22; }
.scene-bond .mol-pb-core { stroke: var(--accent); stroke-width: 7; }
.scene-bond .mol-leader { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 4; }
.scene-bond text.mol-pb-label { font-family: var(--font-ui); font-size: 17px; font-weight: 500; fill: var(--accent-text); text-anchor: middle; }
.scene-bond text.mol-water { font-family: var(--font-mono); font-size: 19px; fill: var(--accent-text); text-anchor: middle; }
.scene-bond text.mol-res { font-family: var(--font-ui); font-size: 17px; font-weight: 500; fill: var(--color-graphite); text-anchor: middle; }
.mol-legend { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem 1rem; font-family: var(--font-ui); font-size: var(--text-body-sm); color: var(--color-charcoal); margin: 0; }
.mol-legend-title { font-weight: 500; color: var(--accent-text); }
.mol-key { display: inline-flex; align-items: center; gap: 0.35rem; }
.mol-dot { width: 0.8rem; height: 0.8rem; border-radius: 50%; box-shadow: 0 1px 2px rgb(16 24 40 / 0.15); }
.mol-note { color: var(--color-placeholder); }
.scene-chain .residue circle { fill: var(--color-paper); stroke: var(--accent); stroke-width: 2; }
.scene-chain .residue text { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.scene-chain .residue .code { font-family: var(--font-mono); font-size: 14px; font-weight: 400; fill: var(--color-charcoal); }
.scene-chain .links line { stroke-width: 3; }
.scene-chain .copper circle { fill: var(--color-blue-wash); stroke: var(--color-blue); stroke-width: 2; }
.scene-chain .copper text { font-size: 18px; fill: var(--color-blue-text); }
.scene-chain .coord line { stroke: var(--color-blue); stroke-width: 1.5; stroke-dasharray: 4 6; }
/* Long sequences (drawn by js/peptides.js): small beads in a snaking chain */
.scene-chain .bead circle { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 1.75; }
.scene-chain .bead text { font-family: var(--font-mono); font-size: 13px; font-weight: 500; fill: var(--color-obsidian); }
.scene-chain .bead.mod circle { fill: var(--accent-text); stroke: var(--accent-text); }
.scene-chain .bead.mod text { fill: var(--color-paper); font-size: 8.5px; }
.scene-chain .bead.cap circle { fill: var(--color-paper); stroke-dasharray: 3 3; }
.scene-chain .bead.cap text { font-size: 8px; fill: var(--accent-text); }
.scene-chain .chain-path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.scene-chain .lipid path { fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scene-chain .lipid text, .scene-chain .seg-label, .scene-chain .legend text {
  font-family: var(--font-ui); font-size: 14px; font-weight: 500; fill: var(--color-charcoal); dominant-baseline: middle;
}
.scene-chain .lipid text { fill: var(--accent-text); text-anchor: start; }
.scene-chain .seg-label { text-anchor: start; fill: var(--color-obsidian); font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.scene-chain .legend text { text-anchor: start; font-size: 13px; }
.scene-chain .legend circle { fill: var(--accent-text); }

/* Static layout: show the bond in its final, formed state */

/* ---------- Story: animated stage ---------- */
.motion .story { height: 100vh; height: 100svh; overflow: hidden; }
.motion .stage {
  position: relative; height: 100%; max-width: none; padding: 0;
}
.motion .hero-copy {
  position: absolute; z-index: 3;
  left: max(var(--gutter), calc((100vw - var(--max-width)) / 2 + var(--gutter)));
  top: 50%; transform: translateY(-50%);
  width: min(36rem, 52vw);
}
.motion .vial-wrap {
  position: absolute; z-index: 2; margin: 0;
  width: clamp(7.5rem, 13vw, 12rem); /* photo is 1:2.48 */
  right: max(10vw, calc((100vw - var(--max-width)) / 2 + 8rem));
  top: 50%; transform: translateY(-50%);
}
.motion .picker {
  position: absolute; z-index: 5; margin: 0;
  top: 5rem; left: 0; right: 0; margin-inline: auto;
  max-width: 100%; width: max-content;
}
/* No will-change on .vial-zoom: it would rasterise the SVG at 1x and blur during the zoom. */
.motion .particles { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; }
.motion .beat {
  position: absolute; inset: 0; z-index: 4; padding: 6rem var(--gutter) 2rem;
  align-content: center; gap: clamp(1rem, 4vh, 2.5rem);
  visibility: hidden; /* GSAP autoAlpha reveals each beat */
}
.motion .beat .scene { max-height: 52vh; width: auto; max-width: min(100%, 50rem); }
.motion .beat-text .beat-copy { max-width: 40rem; }
/* The closing beat mirrors the hero: copy left, vial right */
.motion .beat[data-beat="5"] { justify-items: start; text-align: left; padding-left: max(var(--gutter), calc((100vw - var(--max-width)) / 2 + var(--gutter))); }
.motion .beat[data-beat="5"] .beat-copy { justify-items: start; max-width: min(36rem, 52vw); }
.motion .beat[data-beat="5"] h2 { font-size: var(--text-display); line-height: 0.95; letter-spacing: var(--tracking-display); }

@media (max-width: 759px) {
  .motion .picker { top: 4.25rem; width: 100%; }
  .motion .hero-copy { top: 8.25rem; transform: none; width: auto; right: var(--gutter); }
  .motion .vial-wrap { right: 50%; top: auto; bottom: 9vh; transform: translateX(50%); width: clamp(5.5rem, 24vw, 7.5rem); }
  .motion .beat { align-content: center; padding-top: 5rem; }
  .motion .beat[data-beat="5"] { align-content: start; padding-top: 7rem; }
  .motion .beat[data-beat="5"] .beat-copy { max-width: none; }
  .motion .beat .scene { max-height: 42vh; width: 100%; }
  .motion .beat .scene-bond { height: 44vh; max-height: none; }
  .mol-note { display: none; }
  /* SVG text is in viewBox units, which shrink on phones; scale the labels back up */
  .scene-bond text.mol-res, .scene-bond text.mol-pb-label { font-size: 27px; }
  .scene-bond text.mol-water { font-size: 28px; }
  .scene-bond .mol-cap-text { font-size: 15px; }
  .scene-amino3d text.aa3-label { font-size: 27px; }
  .scene-amino3d text.aa3-r-text { font-size: 32px; }
  .motion .beat .scene-amino3d { height: 40vh; max-height: none; }
  .motion .beat .scene-chain { max-height: 54vh; }
}
@media (max-height: 560px) and (max-width: 759px) {
  .motion .vial-wrap { display: none; }
}

/* ---------- Section titles ---------- */
.section-title { font-size: var(--text-heading); line-height: 1.1; letter-spacing: var(--tracking-heading); font-weight: 600; text-align: center; text-wrap: balance; }

/* ---------- Peptide guide: a calm spec sheet, one row per peptide ---------- */
.guide { background: var(--color-paper); padding: var(--section-gap) 0; }
.guide-intro { margin: 1rem auto 0; max-width: 36rem; text-align: center; color: var(--color-charcoal); font-size: var(--text-body-lg); }
.guide-list { list-style: none; margin: 3rem auto 0; padding: 0; max-width: 60rem; border-top: 1px solid var(--color-hairline); }
.guide-item {
  display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: 1rem 3rem;
  padding: 2rem 1.5rem; border-bottom: 1px solid var(--color-hairline);
  transition: background-color var(--duration) var(--ease-out);
}
.guide-item.is-selected { background: var(--accent-wash); }
.guide-head { display: grid; gap: 0.4rem; align-content: start; justify-items: start; }
.guide-area { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-ui); font-size: var(--text-body-sm); color: var(--color-charcoal); }
.guide-area .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }
.guide-name { font-size: var(--text-heading-sm); line-height: 1.2; letter-spacing: var(--tracking-heading-sm); font-weight: 600; }
.guide-class { font-family: var(--font-mono); font-size: var(--text-caption); line-height: 1.4; color: var(--color-charcoal); }
.guide-pick {
  all: unset; cursor: pointer; margin-top: 0.5rem; border-radius: var(--radius-sm);
  font-family: var(--font-ui); font-size: var(--text-body-sm); font-weight: 500; color: var(--accent-text);
}
.guide-pick:hover { text-decoration: underline; text-underline-offset: 3px; }
.guide-pick:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.guide-facts { display: grid; gap: 1.25rem; margin: 0; }
.guide-facts dt { font-family: var(--font-ui); font-size: var(--text-caption); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 0.3rem; }
.guide-item-supply .guide-facts dt { color: var(--color-charcoal); }
.guide-facts dd { margin: 0; color: var(--color-graphite); max-width: 65ch; }
.guide-note { margin: 2rem auto 0; max-width: 60rem; padding: 0 1.5rem; font-size: var(--text-body-sm); color: var(--color-charcoal); }
@media (max-width: 719px) {
  .guide-item { grid-template-columns: 1fr; padding: 1.75rem 0.25rem; }
  .guide-item.is-selected { padding-inline: 1rem; margin-inline: -0.75rem; border-radius: var(--radius-md); }
}

/* Section divider: the mountain trace, drawn in on scroll (main.js) */
.divider { display: block; width: min(13rem, 56%); height: auto; margin: clamp(3rem, 2rem + 3vw, 4.5rem) auto calc(var(--section-gap) * -0.5); overflow: visible; }
.divider-trace { stroke: var(--color-slate); stroke-width: 1.5px; }

/* ---------- Join ---------- */
.join { background: var(--color-cloud); padding: var(--section-gap) 0; }
.join-inner { display: grid; justify-items: center; text-align: center; gap: 1rem; }
.join-sub { color: var(--color-charcoal); font-size: var(--text-body-lg); margin-bottom: 1rem; }
.join-contact { margin-top: 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; color: var(--color-charcoal); }
.join-contact a { font-family: var(--font-mono); font-size: var(--text-body-sm); }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-paper); border-top: 1px solid var(--color-hairline); padding: 3rem 0; }
.footer-inner { display: grid; gap: 1rem; }
.footer-notice, .footer-meta { font-size: var(--text-body-sm); color: var(--color-charcoal); max-width: 65ch; }
.footer-meta a { color: var(--color-charcoal); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
