/* ==========================================================================
   atopiclaboratories — shared styles
   Bento grid system · Geist · pastel tiles · violet accent
   ========================================================================== */

:root {
  --bg: #F2F2F5;
  --ink: #1A1A1A;
  --ink-2: #4A4A55;
  --ink-3: #7A7A86;
  --white: #FFFFFF;
  --lavender: #ECE6FF;
  --peach: #FFE6D8;
  --mint: #D8F4E6;
  --sky: #DCEDFF;
  --butter: #FFF3C2;
  --violet: #6C47FF;
  --violet-dark: #5634E6;
  --violet-soft: #B9A8FF;
  --line: rgba(26, 26, 26, 0.08);
  --danger: #D92D4B;
  --ok: #16A36A;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --r-tile: 24px;
  --r-tile-lg: 32px;
  --gap: 16px;
  --max: 1200px;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: "Geist", system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { font-weight: 700; text-wrap: balance; letter-spacing: -0.02em; }
p, li { text-wrap: pretty; }
::selection { background: var(--violet); color: #fff; }

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
  border-radius: 12px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -64px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  transition: top 500ms var(--ease);
}
.skip-link:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Type helpers (Tailwind scale) ---------- */
.t-xs  { font-size: 12px; line-height: 16px; }
.t-sm  { font-size: 14px; line-height: 20px; }
.t-lg  { font-size: 18px; line-height: 28px; }
.t-xl  { font-size: 20px; line-height: 28px; }
.t-2xl { font-size: 24px; line-height: 32px; }
.t-3xl { font-size: 30px; line-height: 36px; }
.t-4xl { font-size: 36px; line-height: 40px; }
.t-5xl { font-size: 48px; line-height: 1; }
.muted { color: var(--ink-2); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  align-self: flex-start;
  justify-self: start;
  width: max-content;
  max-width: 100%;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(22, 163, 106, 0.5);
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 106, 0.45); }
  80%, 100% { box-shadow: 0 0 0 8px rgba(22, 163, 106, 0); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  transition: transform 500ms var(--ease), background-color 500ms var(--ease), box-shadow 500ms var(--ease), color 500ms var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn i { font-size: 18px; transition: transform 500ms var(--ease); }
.btn:hover i.ph-arrow-up-right { transform: translate(2px, -2px); }

.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 8px 24px -8px rgba(108, 71, 255, 0.6); }
.btn-primary:hover { background: var(--violet-dark); transform: translateY(-2px); box-shadow: 0 16px 32px -12px rgba(108, 71, 255, 0.7); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--ink); color: #fff; transform: translateY(-2px); }
.btn-sm { font-size: 14px; line-height: 20px; padding: 8px 16px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

/* ---------- Floating island nav ---------- */
.nav {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: max-content;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 0 0 1px var(--line), 0 12px 32px -16px rgba(26, 26, 26, 0.25);
  transition: box-shadow 700ms var(--ease), transform 700ms var(--ease);
}
.nav.scrolled { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 0 0 1px var(--line), 0 16px 40px -16px rgba(26, 26, 26, 0.35); }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  border-radius: 999px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-mark .bm-liquid { animation: bmWave 2.4s linear infinite; }
@keyframes bmWave { to { transform: translateX(-12px); } }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: background-color 500ms var(--ease), color 500ms var(--ease);
}
.nav-links a:hover { background: rgba(26, 26, 26, 0.06); color: var(--ink); }
.nav-links a[aria-current="page"] { background: var(--ink); color: #fff; }

.nav-actions { display: flex; align-items: center; gap: 4px; }
.auth-desk { display: flex; gap: 4px; }
.nav-user {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; line-height: 20px; font-weight: 600;
  padding: 8px 12px; border-radius: 999px; background: var(--mint);
}

.burger {
  display: none;
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink);
}
.burger span {
  position: absolute;
  left: 12px;
  width: 16px; height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform 700ms var(--ease), top 700ms var(--ease);
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 22px; }
.menu-open .burger span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.menu-open .burger span:nth-child(2) { top: 19px; transform: rotate(-45deg); }

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(64px);
  -webkit-backdrop-filter: blur(64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px 24px 48px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms var(--ease), visibility 0s linear 700ms;
}
.menu-open .menu-overlay { opacity: 1; visibility: visible; transition: opacity 700ms var(--ease), visibility 0s; }
.menu-overlay ul { list-style: none; display: grid; gap: 4px; }
.menu-overlay li { overflow: hidden; }
.menu-overlay nav a {
  display: block;
  font-size: 36px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  padding: 8px 0;
  transform: translateY(48px);
  opacity: 0;
  transition: transform 800ms var(--ease), opacity 800ms var(--ease), color 500ms var(--ease);
}
.menu-overlay nav a[aria-current="page"] { color: var(--violet); }
.menu-open .menu-overlay nav a { transform: none; opacity: 1; }
.menu-open .menu-overlay li:nth-child(1) a { transition-delay: 100ms; }
.menu-open .menu-overlay li:nth-child(2) a { transition-delay: 150ms; }
.menu-open .menu-overlay li:nth-child(3) a { transition-delay: 200ms; }
.menu-open .menu-overlay li:nth-child(4) a { transition-delay: 250ms; }
.menu-open .menu-overlay li:nth-child(5) a { transition-delay: 300ms; }
.menu-open .menu-overlay li:nth-child(6) a { transition-delay: 350ms; }
.menu-overlay .menu-foot {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  opacity: 0;
  transform: translateY(24px);
  transition: transform 800ms var(--ease) 400ms, opacity 800ms var(--ease) 400ms;
}
.menu-open .menu-overlay .menu-foot { opacity: 1; transform: none; }
.menu-overlay .menu-mail { margin-top: 24px; display: grid; gap: 4px; font-size: 14px; line-height: 20px; color: var(--ink-2); word-break: break-all; }

/* ---------- Page scaffolding ---------- */
main { display: block; padding-top: 112px; }
.section { padding: 48px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: 36px; line-height: 40px; max-width: 680px; }
.section-head p { max-width: 480px; color: var(--ink-2); }

/* ---------- Bento grid ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(208px, auto);
  grid-auto-flow: dense;
  gap: var(--gap);
}
.bento.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2   { grid-column: span 2; }
.span-3   { grid-column: span 3; }
.span-4   { grid-column: 1 / -1; }
.row-2    { grid-row: span 2; }

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-tile);
  background: var(--white);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(26, 26, 26, 0.05),
    inset 0 -8px 24px -16px rgba(26, 26, 26, 0.12),
    0 1px 2px rgba(26, 26, 26, 0.04);
  transition: transform 700ms var(--ease), box-shadow 700ms var(--ease);
}
.tile.lg { border-radius: var(--r-tile-lg); padding: 32px; }
.tile:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(26, 26, 26, 0.05),
    inset 0 -8px 24px -16px rgba(26, 26, 26, 0.12),
    0 24px 48px -24px rgba(26, 26, 26, 0.28);
}
.tile.static:hover { transform: none; }

.bg-lavender { background: var(--lavender); }
.bg-peach    { background: var(--peach); }
.bg-mint     { background: var(--mint); }
.bg-sky      { background: var(--sky); }
.bg-butter   { background: var(--butter); }
.bg-ink      { background: var(--ink); color: #fff; }
.bg-violet   { background: var(--violet); color: #fff; }
.bg-ink .muted, .bg-violet .muted { color: rgba(255, 255, 255, 0.72); }

.tile h3 { font-size: 20px; line-height: 28px; }
.tile p { color: var(--ink-2); }
.bg-ink p, .bg-violet p { color: rgba(255, 255, 255, 0.78); }
.tile .push { margin-top: auto; }

.chip-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 20px;
  flex: none;
  transition: transform 700ms var(--spring);
}
.tile:hover .chip-icon { transform: rotate(-8deg) scale(1.08); }
.bg-ink .chip-icon, .bg-violet .chip-icon { background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }

.stat {
  font-size: 60px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tag-list li {
  font-size: 14px; line-height: 20px; font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px var(--line);
}

.check-list { list-style: none; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 20px; }
.check-list i { color: var(--violet); font-size: 20px; flex: none; }

/* Photo inside tile: nested radius = 24 − 8 = 16 */
.tile-photo {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  flex: 1;
  min-height: 160px;
  background: var(--lavender);
}
.tile-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1200ms var(--ease); }
.tile:hover .tile-photo img { transform: scale(1.06); }
.tile.photo-full { padding: 0; }
.tile.photo-full img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1200ms var(--ease); }
.tile.photo-full:hover img { transform: scale(1.06); }
.photo-caption {
  position: absolute;
  left: 16px; right: 16px; bottom: 16px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 14px; line-height: 20px; font-weight: 600;
}

/* Side by side tile content, stacks on phones */
.tile-row { flex-direction: row; gap: 24px; }

/* ---------- Hero ---------- */
.hero { padding-top: 24px; }
.hero-grid { grid-auto-rows: minmax(176px, auto); }
.hero-main { justify-content: space-between; gap: 24px; }
.hero h1 {
  font-size: 60px;
  line-height: 1;
  letter-spacing: -0.04em;
  max-width: 680px;
  background: linear-gradient(90deg, #000000, #666666);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede { font-size: 18px; line-height: 28px; color: var(--ink-2); max-width: 680px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.proof-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.proof-row span { display: inline-flex; align-items: center; gap: 4px; }
.proof-row i { color: var(--violet); font-size: 18px; }

.hero-art { padding: 0; background: var(--lavender); align-items: center; justify-content: center; }
.hero-art svg { width: 100%; height: 100%; max-height: 520px; }

.page-hero h1 { font-size: 48px; line-height: 1; }

/* ---------- Scroll reveal (stagger fade, blur, rise) ---------- */
.reveal:not(.in) { opacity: 0; }
.reveal.in { animation: rise 1000ms var(--ease) var(--d, 0ms) backwards; }
@keyframes rise {
  from { opacity: 0; transform: translateY(64px); filter: blur(12px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

/* ---------- Tagline reveal ---------- */
.tagline { padding: 96px 0; }
.tagline p {
  font-size: 48px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.035em;
  max-width: 880px;
  text-wrap: balance;
}
.tagline .w { color: rgba(26, 26, 26, 0.24); transition: color 700ms var(--ease); }
.tagline .w.on { color: var(--ink); }
.tagline .w.accent.on { color: var(--violet); }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-radius: var(--r-tile);
  background: var(--ink);
  color: #fff;
  padding: 16px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 32px; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { display: inline-flex; align-items: center; gap: 12px; font-size: 20px; line-height: 28px; font-weight: 600; white-space: nowrap; }
.marquee-track i { color: var(--violet-soft); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Steps ---------- */
.step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  background: var(--ink);
  color: #fff;
}
.steps-line { position: absolute; inset: auto 24px 24px 24px; height: 8px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 8px; }
.faq details {
  background: #fff;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 500ms var(--ease);
}
.faq details[open] { background: var(--lavender); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { font-size: 20px; transition: transform 500ms var(--ease); flex: none; }
.faq details[open] summary i { transform: rotate(45deg); }
.faq details p { padding: 0 16px 16px; color: var(--ink-2); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; line-height: 20px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 12px;
  border: 0;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.12);
  transition: box-shadow 500ms var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%231A1A1A' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.field textarea { min-height: 128px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--violet), 0 0 0 4px rgba(108, 71, 255, 0.15); }
.field.invalid input, .field.invalid textarea, .field.invalid select { box-shadow: inset 0 0 0 2px var(--danger); }
.field-error { font-size: 12px; line-height: 16px; color: var(--danger); min-height: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-alert {
  display: none;
  gap: 8px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 20px;
}
.form-alert.show { display: flex; }
.form-alert.error { background: #FFE3E8; color: #8A1330; }
.form-alert.ok { background: var(--mint); color: #0B5D3B; }
.form-alert i { font-size: 20px; flex: none; }
.check-row { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--violet); flex: none; }
.check-row a { color: var(--violet); font-weight: 600; }

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(26, 26, 26, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms var(--ease), visibility 0s linear 500ms;
}
.modal.show { opacity: 1; visibility: visible; transition: opacity 500ms var(--ease), visibility 0s; }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--r-tile-lg);
  padding: 32px;
  display: grid;
  gap: 16px;
  transform: translateY(32px) scale(0.96);
  transition: transform 700ms var(--ease);
  box-shadow: 0 40px 80px -24px rgba(26, 26, 26, 0.4);
}
.modal.show .modal-card { transform: none; }
.modal-card h2 { font-size: 30px; line-height: 36px; }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px;
  background: var(--bg);
  transition: background-color 500ms var(--ease), transform 500ms var(--ease);
}
.modal-close:hover { background: var(--lavender); transform: rotate(90deg); }
.modal-switch { font-size: 14px; line-height: 20px; color: var(--ink-2); text-align: center; }
.modal-switch button { color: var(--violet); font-weight: 600; }
.modal-success { display: none; text-align: center; gap: 16px; justify-items: center; }
.modal-success.show { display: grid; }
.modal-success svg { width: 96px; height: 96px; }
.modal-success .ring { stroke-dasharray: 280; stroke-dashoffset: 280; animation: draw 900ms var(--ease) forwards; }
.modal-success .tick { stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw 700ms var(--ease) 500ms forwards; }

/* ---------- Footer ---------- */
.footer { padding: 48px 0 32px; }
.footer-grid { grid-auto-rows: auto; }
.footer h4 { font-size: 14px; line-height: 20px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 8px; }
.footer ul { list-style: none; display: grid; gap: 8px; }
.footer a { transition: color 500ms var(--ease); }
.footer a:hover { color: var(--violet); }
.bg-ink .footer-contact a:hover { color: var(--violet-soft); }
.footer-contact li { display: flex; gap: 12px; align-items: flex-start; }
.footer-contact i { font-size: 20px; color: var(--violet-soft); flex: none; margin-top: 2px; }
.footer-contact a, .footer-contact span { word-break: break-word; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 16px;
  padding: 16px 24px;
  border-radius: var(--r-tile);
  background: #fff;
  font-size: 14px; line-height: 20px;
  color: var(--ink-2);
}
.footer-bottom nav { display: flex; gap: 16px; flex-wrap: wrap; }

.to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 80;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 700ms var(--ease), transform 700ms var(--ease), background-color 500ms var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--violet); }

/* ---------- Legal pages ---------- */
.legal-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.toc { position: sticky; top: 112px; }
.toc ol { list-style: none; display: grid; gap: 4px; counter-reset: toc; }
.toc a {
  display: block; padding: 8px 12px; border-radius: 12px;
  font-size: 14px; line-height: 20px; color: var(--ink-2);
  transition: background-color 500ms var(--ease), color 500ms var(--ease);
}
.toc a:hover, .toc a.active { background: var(--lavender); color: var(--ink); }
.legal-body { display: grid; gap: var(--gap); }
.legal-body .tile { scroll-margin-top: 112px; }
.legal-body h2 { font-size: 24px; line-height: 32px; }
.legal-body h3 { font-size: 16px; line-height: 24px; margin-top: 8px; }
.legal-body ul { display: grid; gap: 8px; list-style: none; }
.legal-body ul li { position: relative; padding-left: 24px; color: var(--ink-2); }
.legal-body ul li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }

/* ---------- Hours table ---------- */
.hours { list-style: none; display: grid; gap: 4px; }
.hours li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 20px; }
.hours li.today { background: var(--ink); color: #fff; font-weight: 600; }

.map-frame { border: 0; width: 100%; height: 100%; min-height: 320px; border-radius: 16px; filter: saturate(0.85); }

/* ---------- Timeline (about) ---------- */
.timeline { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.year { font-size: 48px; line-height: 1; font-weight: 700; letter-spacing: -0.04em; color: var(--violet); }

/* ==========================================================================
   SVG animation library
   ========================================================================== */
.anim [class] { transform-box: fill-box; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinRev { to { transform: rotate(-360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes twinkle { 0%, 100% { opacity: 0.2; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1); } }

/* Hero flask */
.hf-float { animation: floaty 6s var(--ease) infinite; transform-origin: center; }
.hf-wave-a { animation: waveX 3.2s linear infinite; }
.hf-wave-b { animation: waveX 4.8s linear infinite reverse; }
@keyframes waveX { to { transform: translateX(-200px); } }
.hf-bubble { animation: bubble 3.6s var(--ease) infinite; opacity: 0; }
@keyframes bubble {
  0% { transform: translateY(0) scale(0.4); opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: 0.9; }
  100% { transform: translateY(-190px) scale(1.1); opacity: 0; }
}
.hf-orbit { transform-origin: 200px 214px; transform-box: view-box; animation: spin 18s linear infinite; }
.hf-orbit-2 { transform-origin: 200px 214px; transform-box: view-box; animation: spinRev 26s linear infinite; }
.hf-counter { transform-origin: center; animation: spinRev 18s linear infinite; }
.hf-counter-2 { transform-origin: center; animation: spin 26s linear infinite; }
.hf-spark { transform-origin: center; animation: twinkle 2.8s var(--ease) infinite; }
.hf-ecg { stroke-dasharray: 420; stroke-dashoffset: 420; animation: ecg 3.2s linear infinite; }
@keyframes ecg { 0% { stroke-dashoffset: 420; } 70% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.hf-blob { transform-origin: center; animation: blob 14s var(--ease) infinite; }
@keyframes blob {
  0%, 100% { transform: scale(1) rotate(0deg); }
  33% { transform: scale(1.06) rotate(8deg); }
  66% { transform: scale(0.96) rotate(-6deg); }
}
.hf-drip { animation: drip 2.6s var(--ease) infinite; }
@keyframes drip {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  20% { transform: translateY(0) scale(1); opacity: 1; }
  70% { transform: translateY(46px) scale(1); opacity: 1; }
  100% { transform: translateY(52px) scale(0.2); opacity: 0; }
}
.hf-tube { transform-origin: 50% 0%; animation: tubeSway 5s var(--ease) infinite; }
@keyframes tubeSway { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(-10deg); } }
.parallax { transition: transform 1200ms var(--ease); }

/* DNA helix: rungs flip to fake 3D rotation */
.dna-rung { transform-origin: center; animation: helix 3s ease-in-out infinite; }
@keyframes helix {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(-1); }
}
.dna-dot-a { animation: dnaDepth 3s ease-in-out infinite; }
.dna-dot-b { animation: dnaDepth 3s ease-in-out infinite reverse; }
@keyframes dnaDepth { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Heartbeat */
.hb-line { stroke-dasharray: 600; stroke-dashoffset: 600; animation: hb 2.8s linear infinite; }
@keyframes hb { 0% { stroke-dashoffset: 600; } 75% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.hb-heart { transform-origin: center; animation: beat 1.4s var(--ease) infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }

/* Blood drop */
.bd-drop { animation: dropFall 2.4s cubic-bezier(0.55, 0, 1, 0.45) infinite; }
@keyframes dropFall {
  0% { transform: translateY(-40px) scaleY(0.9); opacity: 0; }
  15% { opacity: 1; }
  60% { transform: translateY(40px) scaleY(1.05); opacity: 1; }
  66%, 100% { transform: translateY(46px) scaleY(0.3); opacity: 0; }
}
.bd-ripple { transform-origin: center; animation: ripple 2.4s var(--ease) infinite; opacity: 0; }
.bd-ripple.r2 { animation-delay: 0.2s; }
@keyframes ripple {
  0%, 60% { transform: scale(0.2); opacity: 0; }
  64% { opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Microscope lens view */
.ms-cell { animation: cellDrift 7s ease-in-out infinite; }
.ms-cell.c2 { animation-duration: 9s; animation-delay: -2s; }
.ms-cell.c3 { animation-duration: 8s; animation-delay: -4s; }
@keyframes cellDrift {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(6px, -8px); }
  66% { transform: translate(-8px, 4px); }
}
.ms-split { transform-origin: center; animation: split 4s var(--ease) infinite; }
.ms-split.s2 { animation-direction: reverse; }
@keyframes split { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
.ms-scan { animation: scanY 3.6s var(--ease) infinite; }
@keyframes scanY { 0%, 100% { transform: translateY(-40px); } 50% { transform: translateY(40px); } }

/* X-ray scan */
.xr-scan { animation: xr 3.2s var(--ease) infinite; }
@keyframes xr { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(112px); } }

/* Home collection route */
.hc-route { stroke-dasharray: 6 8; animation: dash 1.6s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -28; } }
.hc-pin { animation: pinBounce 1.8s var(--spring) infinite; transform-origin: 50% 100%; }
@keyframes pinBounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px); } 60% { transform: translateY(0) scaleY(0.9); } }

/* Tubes filling */
.tt-liquid { transform-origin: 50% 100%; animation: fill 3.6s var(--ease) infinite; }
@keyframes fill { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }

/* Clock */
.ck-min { transform-origin: 50% 100%; animation: spin 4s linear infinite; }
.ck-hr { transform-origin: 50% 100%; animation: spin 48s linear infinite; }
.ck-paper { animation: paperOut 4s var(--ease) infinite; }
@keyframes paperOut { 0%, 20% { transform: translateY(24px); opacity: 0; } 45%, 85% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-8px); opacity: 0; } }

/* Badge */
.bg-ring { transform-origin: center; animation: spin 20s linear infinite; }
.bg-tick { stroke-dasharray: 60; stroke-dashoffset: 60; animation: tickLoop 3.2s var(--ease) infinite; }
@keyframes tickLoop { 0% { stroke-dashoffset: 60; } 35%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -60; } }

/* Target (mission) */
.tg-ring { transform-origin: center; animation: pulse 2.4s var(--ease) infinite; }
.tg-ring.r2 { animation-delay: 0.2s; }
.tg-ring.r3 { animation-delay: 0.4s; }
.tg-arrow { animation: arrowHit 3s var(--ease) infinite; }
@keyframes arrowHit { 0% { transform: translate(-60px, -60px); opacity: 0; } 30% { transform: translate(0, 0); opacity: 1; } 34% { transform: translate(-2px, -2px); } 38%, 85% { transform: translate(0, 0); opacity: 1; } 100% { opacity: 0; } }

/* Eye (vision) */
.ey-lid { transform-origin: center; animation: blink 5s var(--ease) infinite; }
@keyframes blink { 0%, 44%, 52%, 100% { transform: scaleY(1); } 48% { transform: scaleY(0.05); } }
.ey-pupil { animation: look 6s var(--ease) infinite; }
@keyframes look { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 60% { transform: translateX(10px); } }

/* Paper plane (contact) */
.pp-trail { stroke-dasharray: 4 8; animation: dash 1.2s linear infinite; }

/* Shield (privacy) & doc (terms) */
.sh-lock { animation: floaty 4s var(--ease) infinite; }
.sh-scan { animation: xr2 3s var(--ease) infinite; }
@keyframes xr2 { 0%, 100% { transform: translateY(0); opacity: 0.2; } 50% { transform: translateY(72px); opacity: 0.8; } }
.dc-line { stroke-dasharray: 120; stroke-dashoffset: 120; animation: writeLine 4.8s var(--ease) infinite; }
.dc-line.l2 { animation-delay: 0.4s; }
.dc-line.l3 { animation-delay: 0.8s; }
.dc-line.l4 { animation-delay: 1.2s; }
@keyframes writeLine { 0% { stroke-dashoffset: 120; } 40%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.dc-pen { animation: pen 4.8s var(--ease) infinite; }
@keyframes pen { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 25% { transform: translate(24px, 8px) rotate(6deg); } 50% { transform: translate(0, 24px) rotate(-4deg); } 75% { transform: translate(24px, 36px) rotate(4deg); } }

/* Steps connector */
.steps-path { stroke-dasharray: 1200; stroke-dashoffset: 1200; transition: stroke-dashoffset 2400ms var(--ease); }
.in .steps-path, .steps-path.in { stroke-dashoffset: 0; }

/* 404 */
.nf-flask { animation: floaty 4s var(--ease) infinite; transform-origin: center; }
.nf-q { transform-origin: center; animation: twinkle 2s var(--ease) infinite; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .nav-links, .nav-actions .desk { display: none; }
  .burger { display: block; }
  .bento, .bento.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3, .span-4 { grid-column: 1 / -1; }
  .hero h1 { font-size: 48px; }
  .legal-grid { grid-template-columns: 1fr; }
  .toc { position: static; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tagline p { font-size: 36px; line-height: 40px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  main { padding-top: 96px; }
  .nav { top: 16px; }
  .bento, .bento.cols-3 { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .span-2, .span-3, .span-4 { grid-column: auto; }
  .row-2 { grid-row: auto; }
  .tile { padding: 24px; min-height: 0; }
  .tile.lg { padding: 24px; }
  .hero h1 { font-size: 36px; line-height: 40px; }
  .page-hero h1 { font-size: 36px; line-height: 40px; }
  .hero .lede { font-size: 16px; line-height: 24px; }
  .hero-art svg { max-height: 360px; }
  .section { padding: 32px 0; }
  .section-head h2 { font-size: 30px; line-height: 36px; }
  .stat { font-size: 48px; }
  .form-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .tagline { padding: 64px 0; }
  .tagline p { font-size: 30px; line-height: 36px; }
  .modal-card { padding: 24px; }
  .menu-overlay nav a { font-size: 30px; line-height: 36px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .photo-tall { min-height: 280px; }
  .tile-row { flex-direction: column; align-items: stretch !important; }
  .tile-row > .tile-photo { max-width: none !important; min-height: 200px; }
  .tile-row > div[style*="width"]:not(.tile-photo) { width: 100% !important; max-width: 280px !important; }
  .brand .brand-name { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal:not(.in) { opacity: 1; }
  .hf-bubble, .bd-ripple { opacity: 0 !important; }
}

/* Buttons hug their label inside grid tiles; modal buttons stay full width */
.btn { justify-self: start; }
.modal-card .btn { justify-self: stretch; }
.footer { padding-bottom: 96px; }

/* Final call to action */
.cta-tile { align-items: flex-start; gap: 24px; padding: 48px; }
.cta-title { font-size: 48px; line-height: 1; max-width: 680px; overflow-wrap: anywhere; }
.btn-wrap { white-space: normal; overflow-wrap: anywhere; text-align: left; }
@media (max-width: 640px) {
  .cta-tile { padding: 24px; }
  .cta-title { font-size: 30px; line-height: 36px; }
}
