/* ==========================================================================
   Unbounded Engineering - shared design system
   Every page loads this. Sub-brands (e.g. Reaper) only swap accent tokens via
   [data-brand], so structure, type, spacing and components stay identical.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* surfaces */
  --bg: #080b0e;
  --surface-1: #0c1115;
  --surface-2: #10171c;
  --line: #1e2831;
  --line-strong: #2c3a44;

  /* text */
  --text: #e9eff1;
  --text-2: #a3b0b7;
  --text-3: #6c7b84;
  --text-4: #4e5b63;

  /* accent (swapped per sub-brand) */
  --accent: #74f5bd;
  --accent-ink: #06120d;
  --accent-dim: #2f5d4b;
  --accent-glow: rgba(116, 245, 189, .18);
  --accent-wash: rgba(116, 245, 189, .05);
  --blue: #79cfff;
  --amber: #ffca5c;

  /* type */
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* layout */
  --max: 1240px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 80px;

  /* motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Reaper sub-brand: same system, different signal colour. */
[data-brand="reaper"] {
  --accent: #e31b23;
  --accent-ink: #ffffff;
  --accent-dim: #7d1116;
  --accent-glow: rgba(227, 27, 35, .22);
  --accent-wash: rgba(227, 27, 35, .06);
}

/* --- Reset ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden
}

svg,
video {
  display: block;
  max-width: 100%
}

/* `height:auto` is load-bearing: images carry width/height attributes for CLS
   reservation, and without this the attribute height wins over any CSS
   aspect-ratio, which makes object-fit:cover crop instead of scale. */
img {
  display: block;
  max-width: 100%;
  height: auto
}

a {
  color: inherit;
  text-decoration: none
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  text-wrap: balance
}

p {
  margin: 0
}

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

/* Visible focus for keyboard users on every interactive element. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Accessibility helpers ------------------------------------------------ */
.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: .7rem 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 12px var(--mono);
  letter-spacing: .06em;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Layout --------------------------------------------------------------- */
.shell {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter)
}

main {
  flex: 1
}

.section {
  padding-block: clamp(72px, 10vw, 128px)
}

.section-head {
  max-width: 820px;
  margin-bottom: clamp(36px, 5vw, 60px)
}

.section-head h2 {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -.045em;
  margin: .6rem 0 1rem;
}

.section-head h2 .dim {
  color: var(--text-3)
}

.section-head>p {
  color: var(--text-2);
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  max-width: 70ch
}

/* --- Eyebrow -------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font: 700 11px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  flex: none
}

/* --- Buttons -------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  font: 600 12px var(--mono);
  letter-spacing: .05em;
  transition: background .25s var(--ease), border-color .25s var(--ease),
    transform .25s var(--ease), box-shadow .25s var(--ease), color .25s var(--ease);
  cursor: pointer;
  text-align: center;
}

.button .arrow {
  transition: transform .25s var(--ease)
}

.button:hover .arrow {
  transform: translateX(3px)
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink)
}

.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--accent-glow)
}

.button.ghost {
  background: transparent;
  color: var(--text)
}

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-wash)
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--accent);
  font: 600 11px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.text-link .arrow {
  transition: transform .2s var(--ease)
}

.text-link:hover .arrow {
  transform: translateX(3px)
}

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: linear-gradient(to bottom, rgba(8, 11, 14, .94), rgba(8, 11, 14, 0));
  border-bottom: 1px solid transparent;
  transition: height .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
}

.site-header.scrolled {
  height: 64px;
  background: rgba(8, 11, 14, .88);
  border-bottom-color: var(--line);
}

body.menu-open .site-header {
  backdrop-filter: none;
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font: 700 11px/1.25 var(--mono);
  letter-spacing: .13em
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  letter-spacing: -.08em;
  transition: box-shadow .25s var(--ease);
}

.brand:hover .brand-mark {
  box-shadow: 0 0 20px var(--accent-glow)
}

.brand small {
  display: block;
  color: var(--text-3);
  font-size: 9px;
  letter-spacing: .14em;
  font-weight: 500;
  margin-top: 3px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 28px);
  font: 500 12px var(--mono);
  color: var(--text-2);
}

.site-nav a {
  transition: color .2s var(--ease);
  white-space: nowrap
}

.site-nav a:hover {
  color: var(--accent)
}

.site-nav a[aria-current="page"] {
  color: var(--accent)
}

.nav-cta {
  border: 1px solid var(--line-strong);
  padding: 9px 15px
}

.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-wash)
}

.menu-toggle {
  display: none;
  position: relative;
  border: 0;
  background: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  cursor: pointer
}

.menu-toggle span:not(.sr-only) {
  display: block;
  height: 1px;
  background: var(--text);
  margin: 6px 0;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 56px 40px;
  margin-top: auto
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 44px
}

.footer-grid h3 {
  font: 700 10px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 18px;
}

.footer-about p {
  color: var(--text-3);
  font-size: .88rem;
  max-width: 46ch;
  margin-top: 16px
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: .88rem;
  color: var(--text-2)
}

.footer-col a {
  transition: color .2s var(--ease)
}

.footer-col a:hover {
  color: var(--accent)
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font: 9px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-4);
}

.legal {
  font-size: .78rem;
  color: var(--text-4);
  line-height: 1.7
}

/* --- Reveal animation ----------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease), transform .7s var(--ease)
}

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

/* --- Responsive ----------------------------------------------------------- */
@media (max-width:900px) {
  :root {
    --header-h: 64px
  }

  .menu-toggle {
    display: block;
    z-index: 32
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 29;
    padding: calc(var(--header-h) + 32px) var(--gutter) 40px;
    background: var(--bg);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: flex-start;
    gap: 26px;
    overflow-y: auto;
    font-size: 1.05rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }

  .site-nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none
  }

  .menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg)
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0
  }

  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg)
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 34px
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: .01ms !important
  }

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

/* --- Utilities (added so no page needs an inline style attribute, which lets
       the CSP drop 'unsafe-inline' from style-src entirely) ----------------- */
.u-nowrap {
  white-space: nowrap
}

.eyebrow.is-centred {
  justify-content: center
}

.footer-base.is-bare {
  border-top: 0;
  padding-top: 0
}

.inline-link {
  display: inline;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-dim);
}

.inline-link:hover {
  border-bottom-color: var(--accent)
}

/* Static nav for pages with no mobile drawer (404). */
.site-nav.is-static {
  position: static;
  inset: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
  flex-direction: row;
  background: none;
  backdrop-filter: none;
}