/* ─────────────────────────────────────────────────────────────
   Omos Biosciences — shared shell
   Tokens, page frame (header / footer), motion, cookie banner.
   Page-specific styling lives in each page's own <style> block
   or in legal.css.
   ───────────────────────────────────────────────────────────── */

/* ── Fonts (self-hosted; no third-party request) ─────────────── */

/* Inter variable, SIL Open Font License 1.1 — see fonts/OFL.txt */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Reset ───────────────────────────────────────────────────── */

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

/* ── Tokens ──────────────────────────────────────────────────── */

:root {
  --bg: #faf7f4;
  --ink: #14181f;
  --ink-soft: #5a616e;
  --ink-dim: #636a77;
  --rule: rgba(20, 24, 31, 0.14);
  --accent: #1d4ed8;
  --gutter: 48px;
  --measure: 620px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

/* Pages that pin the footer to the bottom on short content */
body.column {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Motion ──────────────────────────────────────────────────── */

@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rise {
  opacity: 0;
  animation: riseIn 0.9s var(--ease) var(--d, 0s) forwards;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Header ──────────────────────────────────────────────────── */

header {
  padding: 26px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

/* only the home page pins its header */
header.fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}

.logo-icon {
  flex-shrink: 0;
  height: 20px;
  width: auto;
}

.logo-text {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.header-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.header-cta,
.back-link {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.header-cta:hover,
.back-link:hover {
  color: var(--accent);
}

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
}

.back-link svg {
  transition: transform 0.3s var(--ease);
}

.back-link:hover svg {
  transform: translateX(-3px);
}

/* ── Rules and labels ────────────────────────────────────────── */

.rule {
  width: 100%;
  max-width: 72px;
  height: 1px;
  background: var(--ink);
  opacity: 0.28;
  margin-bottom: 20px;
}

.section-label,
.page-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 44px;
}

/* ── Contact link ────────────────────────────────────────────── */

.contact-email {
  display: inline-block;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Footer ──────────────────────────────────────────────────── */

footer {
  padding: 24px var(--gutter);
  border-top: 1px solid var(--rule);
}

.footer-text {
  font-size: 0.75rem;
  color: var(--ink-dim);
}

.footer-text a {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

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

/* Registered-office and company-number line. Sits a step quieter than the
   line above it so the footer still reads as one block, not two. */
.footer-legal {
  margin-top: 4px;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--ink-dim);
  opacity: 0.75;
}

/* Slightly wider gap where the block meets the line above, so the two
   legal lines group together rather than stacking evenly with it. */
.footer-text + .footer-legal {
  margin-top: 8px;
}

/* ── Cookie banner ───────────────────────────────────────────── */

.cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  padding: 14px 18px;
  max-width: 320px;
  background: #ffffff;
  border: 1px solid var(--rule);
  box-shadow: 0 6px 24px rgba(20, 24, 31, 0.07);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.cookie-banner.visible {
  opacity: 1;
  transform: translateY(0);
}

.cookie-banner p {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.cookie-banner p a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-actions {
  display: flex;
  gap: 8px;
}

.cookie-actions button {
  flex: 1;
  padding: 7px 0;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.cookie-accept {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
}

.cookie-accept:hover {
  opacity: 0.82;
}

.cookie-decline {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(20, 24, 31, 0.16);
}

.cookie-decline:hover {
  color: var(--ink);
  border-color: rgba(20, 24, 31, 0.32);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
  :root {
    --gutter: 28px;
  }

  header {
    padding: 20px var(--gutter);
  }

  .logo-icon {
    height: 17px;
  }

  .logo-text {
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
  }

  /* keep the nav — tighten it instead of hiding it */
  .header-links {
    gap: 18px;
  }

  .header-cta,
  .back-link {
    font-size: 0.75rem;
  }

  .section-label,
  .page-label {
    margin-bottom: 30px;
  }

  footer {
    padding: 20px var(--gutter);
  }

  .cookie-banner {
    left: 20px;
    right: 20px;
    bottom: 20px;
    max-width: none;
  }
}

/* below this the wordmark and the nav can't share the bar */
@media (max-width: 420px) {
  .logo-text {
    display: none;
  }
}

@media (max-width: 380px) {
  :root {
    --gutter: 20px;
  }
}

/* ── Reduced motion ──────────────────────────────────────────── */

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

  html {
    scroll-behavior: auto;
  }

  .rise {
    opacity: 1;
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
