/*
 * Baboon Labs — the whole stylesheet for the whole site.
 *
 * One page means one sheet. Everything below is either a design token or a
 * rule that page actually uses; nothing is here "in case". The values are
 * lifted unchanged from the previous build, so the rendering is identical.
 *
 * Order matters: fonts, tokens, reset, primitives, then the page itself.
 */

/* ==========================================================================
 * Fonts — self-hosted, same origin, latin subset. No third-party requests.
 * ======================================================================= */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
 * Design tokens
 *
 * The green is taken from the logo (#10ec16). `--brand-green` is the company
 * mark's colour and is deliberately separate from the accent ramp: a future
 * product treatment may remap the accent, but the baboon stays green.
 * ======================================================================= */

:root {
  /* ---- Ink: near-black navy ------------------------------------------- */
  --ink-999: #04090f;
  --ink-950: #070e17;
  --ink-900: #0b1420;
  --ink-850: #111c2b;
  --ink-800: #18263a;
  --ink-700: #24344c;
  --ink-600: #35496a;
  --ink-500: #4d6382;
  --ink-400: #7286a3;
  --ink-300: #9dadc3;
  --ink-200: #c4cedd;
  --ink-100: #e2e7ee;
  --ink-050: #f1f3f7;

  /* ---- Surfaces -------------------------------------------------------- */
  --paper: #f7f7f4;
  --surface: #ffffff;
  --surface-sunken: #eeefe9;

  /* ---- Brand green ----------------------------------------------------- */
  --green-050: #ecfdea;
  --green-100: #cdf9c9;
  --green-200: #96f394;
  --green-300: #57ea57;
  --green-400: #24e42c;
  --green-500: #10ec16;
  --green-600: #0bbb12;
  --green-700: #0a8b13;
  --green-800: #0a6614;
  --green-900: #094c13;

  /*
   * The company green, never remapped by a product brand. `--green-*` is the
   * *current* accent ramp and the VetSeq block overrides it to blue; the Baboon
   * Labs mark has to stay green wherever it appears, so it reads this instead.
   */
  --brand-green: #10ec16;

  /* ---- Semantic: light surfaces ---------------------------------------- */
  --color-bg: var(--paper);
  --color-surface: var(--surface);
  --color-text: var(--ink-900);
  --color-text-muted: var(--ink-600);
  --color-text-subtle: var(--ink-500);
  --color-heading: var(--ink-999);
  --color-border: var(--ink-100);
  --color-border-strong: var(--ink-200);
  --color-link: var(--green-800);
  --color-link-hover: var(--green-900);
  --color-focus: var(--green-700);

  --color-accent: var(--green-500);
  --color-accent-hover: var(--green-400);
  --color-accent-strong: var(--green-800);
  --color-accent-soft: var(--green-050);
  --color-on-accent: var(--ink-999);
  /* Translucent accent behind badges and chips on dark surfaces. */
  --color-accent-veil: rgb(16 236 22 / 0.1);

  /* ---- Semantic: dark surfaces ----------------------------------------- */
  --color-dark-bg: var(--ink-999);
  --color-dark-raised: var(--ink-900);
  --color-dark-card: var(--ink-850);
  --color-dark-text: #eef3f8;
  --color-dark-text-muted: #a3b4c8;
  --color-dark-border: #1d2c40;
  --color-dark-border-strong: #2c3f59;
  --color-dark-accent: var(--green-400);
  --color-dark-focus: var(--green-400);

  --color-notice-bg: #fdf6e6;
  --color-notice-border: #e4cf9c;
  --color-notice-text: #5a4409;

  /* The same notice on a dark band: a tint rather than a filled amber box. */
  --color-notice-dark-bg: rgb(228 207 156 / 0.09);
  --color-notice-dark-border: rgb(228 207 156 / 0.32);
  --color-notice-dark-text: #f2e3b8;

  --color-draft-bg: #fbeeec;
  --color-draft-border: #e3b7b0;
  --color-draft-text: #6b241a;

  /* ---- Typography ------------------------------------------------------- */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-sans:
    'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: clamp(1.125rem, 0.3vw + 1.05rem, 1.28rem);
  --text-xl: clamp(1.3rem, 0.7vw + 1.1rem, 1.6rem);
  --text-2xl: clamp(1.6rem, 1.4vw + 1.2rem, 2.25rem);
  --text-3xl: clamp(2rem, 2.4vw + 1.4rem, 3.1rem);
  --text-4xl: clamp(2.5rem, 4vw + 1.4rem, 4.4rem);
  --text-5xl: clamp(3rem, 6.2vw + 1.2rem, 6.5rem);

  --leading-none: 1;
  --leading-tight: 1.05;
  --leading-snug: 1.22;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  --tracking-tighter: -0.04em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-caps: 0.12em;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---- Spacing ---------------------------------------------------------- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;

  --section-padding-block: clamp(4rem, 8vw, 7.5rem);
  --content-width: 72rem;
  --content-width-wide: 82rem;
  --content-width-prose: 42rem;
  --gutter: clamp(1.25rem, 4vw, 2.75rem);

  /* ---- Shape and depth --------------------------------------------------- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --border-hairline: 1px solid var(--color-border);
  --shadow-sm: 0 1px 2px rgb(4 9 15 / 0.05);
  --shadow-md: 0 6px 20px rgb(4 9 15 / 0.07), 0 1px 3px rgb(4 9 15 / 0.05);
  --shadow-lg: 0 24px 60px rgb(4 9 15 / 0.12), 0 4px 12px rgb(4 9 15 / 0.06);
  --glow-green: 0 0 0 1px rgb(16 236 22 / 0.25), 0 12px 40px rgb(16 236 22 / 0.14);
  --glow-accent: var(--glow-green);

  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;

  /* ---- Motion ------------------------------------------------------------ */
  --duration-fast: 140ms;
  --duration-base: 260ms;
  --duration-slow: 620ms;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1);
}

/* ==========================================================================
 * Reset
 * ======================================================================= */

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

* {
  margin: 0;
}

html {
  /*
   * The page opens and closes on the dark treatment, so paint the root dark.
   * Rubber-band over-scroll at either end then shows the same colour as the
   * header and footer rather than flashing the light body behind them.
   */
  background-color: var(--color-dark-bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  min-height: 100dvh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/*
 * The holding page is exactly one viewport tall, whatever height the footer
 * turns out to be. The landing block used to reserve a fixed 5.5rem for the
 * footer, which was wrong on both sides: too much on desktop, and far too
 * little on a narrow screen where the footer wraps onto two lines and pushed
 * the page into a scroll. Letting the landing take whatever the footer leaves
 * removes the guess.
 */
body.landing-body {
  display: flex;
  flex-direction: column;
}

body.landing-body > main {
  display: flex;
  flex: 1 1 auto;
}

body.landing-body .landing {
  flex: 1 1 auto;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  color: var(--color-heading);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

ul,
ol {
  padding-inline-start: 1.25em;
}

hr {
  border: 0;
  border-top: var(--border-hairline);
}

/*
 * The page is exactly one viewport tall, whatever height the footer turns out
 * to be. An earlier version reserved a fixed 5.5rem for the footer and got it
 * wrong in both directions — too much on desktop, far too little on a narrow
 * screen where the footer wraps onto two lines and pushed the page into a
 * scroll that clipped the contact line. Letting the landing block take
 * whatever is left removes the guess.
 */
body {
  display: flex;
  flex-direction: column;
}

body > main {
  display: flex;
  flex: 1 1 auto;
}

body > main .landing {
  flex: 1 1 auto;
}

/* ==========================================================================
 * Focus and motion
 * ======================================================================= */

:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

.on-dark :focus-visible,
.band--dark :focus-visible,
.section--dark :focus-visible {
  outline-color: var(--color-dark-focus);
}

/*
 * Scroll reveals.
 *
 * The hidden state only applies once the inline head script has set
 * `data-motion="on"`, which it does only when JavaScript runs AND the visitor
 * has not asked for reduced motion. With JS off, or with reduced motion, every
 * element renders visible and nothing is animated.
 */
html[data-motion='on'] [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

html[data-motion='on'] [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

  html [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

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

/* ==========================================================================
 * Primitives
 * ======================================================================= */

.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--wide {
  max-width: var(--content-width-wide);
}

.on-dark {
  background-color: var(--color-dark-bg);
  color: var(--color-dark-text);
  --color-text: var(--color-dark-text);
  --color-text-muted: var(--color-dark-text-muted);
  --color-text-subtle: var(--color-dark-text-muted);
  --color-heading: var(--color-dark-text);
  --color-border: var(--color-dark-border);
  --color-border-strong: var(--color-dark-border-strong);
  --color-surface: var(--color-dark-card);
  --color-link: var(--color-dark-accent);
  --color-link-hover: var(--color-dark-accent);
  --color-focus: var(--color-dark-focus);
  --color-accent-strong: var(--color-dark-accent);
}

a {
  color: var(--color-link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

a:hover {
  color: var(--color-link-hover);
}

.skip-link {
  position: absolute;
  top: var(--space-2xs);
  left: var(--space-2xs);
  z-index: 100;
  padding: var(--space-2xs) var(--space-sm);
  background-color: var(--green-500);
  color: var(--ink-999);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.8rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-on-accent);
}

.btn--primary:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-on-accent);
  box-shadow: var(--glow-accent);
}

.btn--lg {
  min-height: 3.4rem;
  padding-inline: 1.9rem;
  font-size: var(--text-md);
}

/* ==========================================================================
 * The logo
 * ======================================================================= */

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: var(--logo-width);
  max-width: 100%;
  aspect-ratio: var(--logo-ratio);
}

.logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
 * The landing block
 * ======================================================================= */

/*
   * Fills whatever the footer leaves, so the block sits optically centred and
   * the page is exactly one viewport tall. The sizing lives in base.css, on
   * `body.landing-body`, because it needs the body to be a flex column.
   */
.landing {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding-block: clamp(2rem, 8vh, 6rem);
  text-align: center;
}

.landing__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: min(110vw, 900px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgb(16 236 22 / 0.14) 0%, transparent 62%);
  z-index: 0;
  pointer-events: none;
}

.landing__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgb(255 255 255 / 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 5%, transparent 78%);
  pointer-events: none;
}

.landing__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing__mark {
  display: inline-flex;
  color: var(--brand-green);
}

.landing__name {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-tight);
}

.landing__tagline {
  margin-top: var(--space-sm);
  color: var(--color-dark-text-muted);
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
}

.landing__action {
  margin-top: clamp(2rem, 5vw, 3rem);
}

/* ==========================================================================
 * The footer
 * ======================================================================= */

.site-footer {
  margin-top: auto;
  padding-block: var(--space-lg);
  border-top: 1px solid var(--color-dark-border);
}

/*
 * One line: brand on the left, contact and copyright on the right. The band
 * carries equal padding above and below — it used to be 3rem/2rem on the
 * reasoning that the extra top space separated the footer from the page, but
 * the border already does that and the asymmetry read as content sitting low
 * in its own band.
 */
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
}

.site-footer__row {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
}

.site-footer__meta {
  gap: var(--space-sm) var(--space-md);
  justify-content: flex-end;
  color: var(--color-dark-text-muted);
  font-size: var(--text-sm);
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--color-dark-text);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

/* The mark keeps the company green wherever it appears. */
.site-footer__mark {
  display: inline-flex;
  color: var(--brand-green);
}

/*
 * Once the line wraps there is no right-hand edge to hang the contact line
 * off, so both rows align left rather than sitting ragged.
 */
@media (max-width: 44rem) {
  .site-footer__inner,
  .site-footer__meta {
    justify-content: flex-start;
  }
}
