/* ==========================================================================
   Biotech Environ — Base layer
   Fonts · design tokens · reset · typography · layout utilities · buttons
   ========================================================================== */

/* ---------- Self-hosted fonts (latin subset) ---------- */
@font-face {
  font-family: "Anton";
  src: url("../fonts/anton-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette */
  --navy: #102b3a;
  --navy-950: #071820;
  --navy-900: #0b2230;
  --navy-800: #16384a;
  --teal: #087f8c;
  --teal-700: #066672;
  --teal-300: #63c2cb;
  --green: #65a878;
  --green-300: #9fd1ac;
  --white: #ffffff;
  --mist: #f3f7f8;
  --mist-200: #e6eef0;
  --ink: #172b35;
  --muted: #667780;
  --muted-on-dark: #a9bcc4;

  --line: rgba(16, 43, 58, 0.12);
  --line-strong: rgba(16, 43, 58, 0.22);
  --line-dark: rgba(255, 255, 255, 0.12);

  /* Typography */
  --font-display: "Anton", "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: clamp(1.0625rem, 0.98rem + 0.3vw, 1.1875rem);
  --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-xl: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --fs-display-sm: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);
  --fs-display: clamp(2.6rem, 1.7rem + 3.8vw, 5.25rem);
  --fs-display-xl: clamp(3rem, 1.2rem + 7.4vw, 8.5rem);

  /* Spacing & layout */
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 3rem);
  --container: 1320px;
  --section-y: clamp(5rem, 3.5rem + 6vw, 9.5rem);
  --header-h: 76px;
  --radius-sm: 4px;
  --radius: 8px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.9s;

  --shadow-sm: 0 1px 2px rgba(7, 24, 32, 0.06), 0 2px 8px rgba(7, 24, 32, 0.05);
  --shadow: 0 10px 30px -12px rgba(7, 24, 32, 0.22);
  --shadow-lg: 0 30px 60px -24px rgba(7, 24, 32, 0.35);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
}
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
@supports (overflow: clip) {
  body {
    overflow-x: clip;
  }
}
img,
svg,
video {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}
ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
address {
  font-style: normal;
}
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible,
.on-dark:focus-visible {
  outline-color: var(--teal-300);
}
::selection {
  background: var(--teal);
  color: var(--white);
}

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: none;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  position: relative;
  padding-block: var(--section-y);
}
.section--mist {
  /* Slightly deeper muted tone keeps body copy above 4.5:1 on the mist background */
  --muted: #56666f;
  background: var(--mist);
}
.section--dark {
  background: var(--navy);
  color: var(--white);
}

/* ---------- Typography ---------- */
.overline {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}
.overline::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  flex: none;
}
.on-dark .overline,
.section--dark .overline {
  color: var(--teal-300);
}
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: 0.005em;
  color: var(--navy);
}
.section--dark .display,
.on-dark .display {
  color: var(--white);
}
.display--xl {
  font-size: var(--fs-display-xl);
  line-height: 0.92;
}
.display--lg {
  font-size: var(--fs-display);
}
.display--md {
  font-size: var(--fs-display-sm);
  line-height: 1.04;
}
.display .accent {
  color: var(--teal);
}
.section--dark .display .accent,
.on-dark .display .accent {
  color: var(--teal-300);
}
.lead {
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--muted);
}
.section--dark .lead,
.on-dark .lead {
  color: var(--muted-on-dark);
}
.prose p + p {
  margin-top: 1.1em;
}
.prose p {
  color: var(--muted);
}
.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.section-head {
  display: grid;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 2rem + 3vw, 5rem);
}
.section-head--split {
  grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 960px) {
  .section-head--split {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
    gap: 4rem;
  }
}
.section-head .display {
  max-width: 18ch;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--teal);
  --btn-fg: var(--white);
  --btn-bd: var(--teal);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.9rem 1.6rem;
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.2;
  overflow: hidden;
  transition: color 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-hover-bg, var(--navy));
  transform: translateY(101%);
  transition: transform 0.5s var(--ease-out);
}
.btn:hover::before,
.btn:focus-visible::before {
  transform: none;
}
.btn:hover,
.btn:focus-visible {
  color: var(--btn-hover-fg, var(--white));
  border-color: var(--btn-hover-bd, var(--navy));
}
.btn .btn__icon {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.5s var(--ease-out);
}
.btn:hover .btn__icon {
  transform: translateX(4px);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--white);
  --btn-bd: rgba(255, 255, 255, 0.4);
  --btn-hover-bg: var(--white);
  --btn-hover-fg: var(--navy);
  --btn-hover-bd: var(--white);
}
.btn--light {
  --btn-bg: var(--white);
  --btn-fg: var(--navy);
  --btn-bd: var(--white);
  --btn-hover-bg: var(--teal);
  --btn-hover-bd: var(--teal);
}
.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--navy);
  --btn-bd: var(--line-strong);
}
.btn--block {
  width: 100%;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--teal);
  background: none;
  border: 0;
  padding: 0.25rem 0;
}
.link-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 0.45s var(--ease-out);
}
.link-arrow:hover svg,
.link-arrow:focus-visible svg {
  transform: translateX(5px);
}

/* ---------- Scroll reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
.js [data-reveal="fade"] {
  transform: none;
}
.js [data-reveal="left"] {
  transform: translate3d(-36px, 0, 0);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Image curtain reveal */
.js [data-reveal-img] {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.3s var(--ease-out);
}
.js [data-reveal-img] img {
  transform: scale(1.18);
  transition: transform 1.6s var(--ease-out);
}
.js [data-reveal-img].is-in {
  clip-path: inset(0 0 0 0);
}
.js [data-reveal-img].is-in img {
  transform: scale(1);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal],
  .js [data-reveal-img],
  .js [data-reveal-img] img {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}

/* ---------- Laptop & desktop tuning ----------
   Headings and section spacing also scale with viewport height, so short
   laptop screens (1280×720, 1366×768) are not dominated by huge type,
   and large monitors get a slightly wider layout. */
@media (min-width: 1024px) {
  :root {
    --fs-display: min(clamp(2.6rem, 1.2rem + 3.5vw, 5rem), 10.5vh);
    --fs-display-xl: min(clamp(3rem, 1.2rem + 6.6vw, 8rem), 14vh);
    --fs-display-sm: min(clamp(2.25rem, 1.4rem + 2.2vw, 3.5rem), 7.5vh);
    --section-y: min(clamp(5rem, 3.5rem + 6vw, 9.5rem), 17vh);
  }
  .section-head--split {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr);
  }
  .section-head .display {
    max-width: 20ch;
  }
}
@media (min-width: 1600px) {
  :root {
    --container: 1440px;
  }
}
