/*
  beyondaerospace.com. Tokens are ares-networks.com's (src/app/(frontend)/globals.css), which are the
  dashboard's, ported verbatim. OKLCH canonical. Light = :root, dark = [data-theme='dark'] (default).
  Semantics: primary (cyan) is flow and brand; warning (amber) is permission only; success is allowed;
  destructive is refused and redacted.
*/

@font-face {
  font-family: 'Geist';
  src: url('fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --background: oklch(0.985 0.003 230);
  --foreground: oklch(0.302 0.056 230.161);
  --card: oklch(1 0 0);
  --primary: oklch(0.797 0.14 213.226);
  --primary-foreground: oklch(0.302 0.056 230.161);
  --primary-strong: oklch(0.505 0.1 223.128);
  --secondary: oklch(0.955 0.006 230);
  --muted: oklch(0.965 0.004 230);
  --muted-foreground: oklch(0.47 0.03 230);
  --destructive: oklch(0.53 0.21 27.325);
  --success: oklch(0.5 0.118 165.612);
  --warning: oklch(0.53 0.15 50);
  --info: oklch(0.5 0.134 242.749);
  --border: oklch(0.92 0.006 230);
  --input: oklch(0.65 0.02 230);
  --ring: oklch(0.505 0.1 223.128);
  --canvas-dot: oklch(0.787 0.006 230);
  --radius: 0.5rem;

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

[data-theme='dark'] {
  --background: oklch(0.205 0.005 230);
  --foreground: oklch(0.93 0.004 230);
  --card: oklch(0.237 0.007 230);
  --primary: oklch(0.797 0.14 213.226);
  --primary-foreground: oklch(0.25 0.05 230);
  --primary-strong: oklch(0.797 0.14 213.226);
  --secondary: oklch(0.285 0.01 230);
  --muted: oklch(0.265 0.01 230);
  --muted-foreground: oklch(0.73 0.012 230);
  --destructive: oklch(0.72 0.17 22.216);
  --success: oklch(0.765 0.177 163.223);
  --warning: oklch(0.828 0.189 84.429);
  --info: oklch(0.746 0.16 232.661);
  --border: oklch(0.3 0.008 230);
  --input: oklch(0.55 0.02 230);
  --ring: oklch(0.797 0.14 213.226);
  --canvas-dot: oklch(0.35 0.03 230);
  color-scheme: dark;
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}
* {
  margin: 0;
}
html {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}
body {
  background: var(--background);
  color: var(--foreground);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main {
  flex: 1;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
a {
  color: inherit;
  text-decoration: none;
}
svg {
  display: block;
}
ol,
ul {
  list-style: none;
  padding: 0;
}
::selection {
  background: color-mix(in oklab, var(--primary) 35%, transparent);
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 50;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
}
.skip:focus {
  top: 0.75rem;
}

/* Type roles (site scale: 56/40/28/20, 18 lead, 16 body, 14 caption) */
.text-display {
  font-size: 2.5rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.text-h2 {
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.text-h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.text-lead {
  font-size: 1.125rem;
  line-height: 1.6;
}
.text-caption {
  font-size: 0.875rem;
  line-height: 1.45;
}
.text-overline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.text-mono-sm {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}
.muted {
  color: var(--muted-foreground);
}
@media (min-width: 48rem) {
  .text-display {
    font-size: 3.5rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
  }
  .text-h2 {
    font-size: 2.5rem;
    line-height: 1.1;
    letter-spacing: -0.025em;
  }
}

/* Layout */
.container {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 48rem) {
  .container {
    padding-inline: 2rem;
  }
}
.section {
  position: relative;
  padding-block: 4rem;
}
@media (min-width: 48rem) {
  .section {
    padding-block: 6rem;
  }
}
.hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}
.section-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 42rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 48rem) {
  .section-header {
    margin-bottom: 3.5rem;
  }
}

/* Eyebrow */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
}

/* Surfaces */
.surface {
  background: color-mix(in oklab, var(--card) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
}
.surface-glass {
  background: color-mix(in oklab, var(--background) 72%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.backdrop .glow {
  position: absolute;
  inset: 0 0 auto;
  height: 70%;
  background: radial-gradient(
    60% 50% at 50% 0%,
    color-mix(in oklab, var(--primary) 18%, transparent),
    transparent 70%
  );
}
.backdrop .grid {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(60% 50% at 50% 30%, black, transparent);
  mask-image: radial-gradient(60% 50% at 50% 30%, black, transparent);
}

/* Buttons (ares-networks.com button.tsx) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  height: 2.75rem;
  padding-inline: 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  transition:
    background-color 200ms ease-out,
    color 200ms ease-out,
    border-color 200ms ease-out;
}
.btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: inset 0 1px 0 0 rgb(255 255 255 / 0.25);
}
.btn-primary:hover {
  background: color-mix(in oklab, var(--primary) 90%, transparent);
}
.btn-outline {
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 60%, transparent);
  color: var(--foreground);
}
.btn-outline:hover {
  background: var(--secondary);
  border-color: color-mix(in oklab, var(--input) 60%, transparent);
}
.btn-ghost {
  height: 2.25rem;
  padding-inline: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.btn-ghost:hover {
  background: var(--secondary);
  color: var(--foreground);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2.5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  transition:
    border-color 300ms,
    background-color 300ms;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in oklab, var(--background) 72%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 3.5rem;
}
@media (min-width: 48rem) {
  .site-header .container {
    height: 4.5rem;
  }
}
.brand {
  display: flex;
  align-items: center;
  color: var(--primary-strong);
  border-radius: 4px;
}
.brand svg {
  height: 2.5rem;
  width: auto;
}
@media (min-width: 48rem) {
  .brand svg {
    height: 3rem;
  }
}
.nav-ares svg.mark {
  width: 1rem;
  height: 1.25rem;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-block: 4rem 3rem;
}
@media (min-width: 48rem) {
  .hero {
    padding-block: 7rem 4.5rem;
  }
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 48rem;
  margin-inline: auto;
  text-align: center;
}
.hero-copy .text-lead {
  max-width: 40rem;
}
.hero-copy .cta-row {
  justify-content: center;
  margin-top: 0.5rem;
}
.hero-copy h1 {
  max-width: 56rem;
}

/* Release view: one request as each side sees it, plus its record */
.release {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 3.5rem auto 0;
  max-width: 60rem;
  padding: 1rem;
}
@media (min-width: 48rem) {
  .release {
    margin-top: 4.5rem;
    padding: 1.75rem;
  }
}
.sides {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 48rem) {
  .fields div {
    grid-template-columns: 7.5rem 1fr;
  }
  .sides {
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
  }
}
.side {
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
}
.side-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--muted-foreground);
}
.lvl {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--kind);
}
.fields div {
  display: grid;
  grid-template-columns: 6.75rem 1fr;
  gap: 0.75rem;
  padding-block: 0.375rem;
  border-top: 1px dashed var(--border);
}
.fields dt {
  color: var(--muted-foreground);
}
.fields dd {
  margin: 0;
  min-width: 0;
}
.redacted,
.tag {
  display: inline-block;
  padding: 0 0.5rem;
  border: 1px solid color-mix(in oklab, var(--kind) 45%, transparent);
  border-radius: 4px;
  background: color-mix(in oklab, var(--kind) 10%, transparent);
  color: var(--kind-fg);
  font-size: 0.75rem;
}
.boundary {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-strong);
}
.boundary svg {
  width: 1.25rem;
  height: 1.25rem;
  transform: rotate(90deg);
}
@media (min-width: 48rem) {
  .boundary {
    padding-inline: 0.25rem;
  }
  .boundary svg {
    transform: none;
  }
}

/* Header section anchors (desktop only) */
.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-anchor {
  display: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: color 200ms;
}
.nav-anchor:hover {
  color: var(--foreground);
}
@media (min-width: 64rem) {
  .nav-anchor {
    display: inline-block;
  }
}

/* How it works */
.steps .step {
  color: var(--primary-strong);
}
.note {
  max-width: 42rem;
  margin-top: 2rem;
  color: var(--muted-foreground);
}

/* Ledger strip (ares-networks.com LedgerStrip) */
[data-kind='flow'] {
  --kind: var(--primary);
  --kind-fg: var(--primary-strong);
}
[data-kind='permission'] {
  --kind: var(--warning);
  --kind-fg: var(--warning);
}
[data-kind='allowed'] {
  --kind: var(--success);
  --kind-fg: var(--success);
}
[data-kind='refused'],
[data-kind='redacted'] {
  --kind: var(--destructive);
  --kind-fg: var(--destructive);
}
.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.rec {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.75rem;
  padding-inline: 0.5rem;
  border: 1px solid color-mix(in oklab, var(--kind) 45%, transparent);
  border-radius: 4px;
  background: color-mix(in oklab, var(--kind) 10%, transparent);
  color: var(--kind-fg);
  line-height: 1;
  white-space: nowrap;
}
.rec::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--kind);
  flex-shrink: 0;
}
.rec .why {
  opacity: 0.8;
}
@media (max-width: 24rem) {
  .rec {
    height: auto;
    min-height: 1.75rem;
    padding-block: 0.375rem;
    white-space: normal;
    line-height: 1.3;
  }
}
@keyframes stamp {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.js .strip.armed .rec {
  opacity: 0;
}
.js .strip.play .rec {
  animation: stamp 260ms var(--ease) both;
  animation-delay: calc(200ms + var(--i, 0) * 420ms);
}

/* Cards */
.cards {
  display: grid;
  gap: 1rem;
}
@media (min-width: 48rem) {
  .cards-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .cards-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 64rem) {
  .cards-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
}
.card .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--primary-strong);
}
.card .icon svg {
  width: 1.125rem;
  height: 1.125rem;
}
.card p {
  color: var(--muted-foreground);
}

/* Heritage timeline */
@media (min-width: 64rem) {
  .split {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 4rem;
    align-items: start;
  }
  .split .section-header {
    margin-bottom: 0;
  }
}
.timeline {
  position: relative;
  display: grid;
  gap: 0;
  max-width: 48rem;
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--border);
}
.timeline li:last-child {
  border-bottom: 1px solid var(--border);
}
.timeline .year {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6rem;
  color: var(--primary-strong);
}
.timeline p {
  font-size: 1.0625rem;
}
@media (min-width: 48rem) {
  .timeline li {
    grid-template-columns: 9rem 1fr;
    gap: 2rem;
  }
}

/* Deployment */
.watt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
}
.watt strong {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--primary-strong);
}

/* Company */
.company {
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 64rem) {
  .company {
    grid-template-columns: 1.1fr 1fr;
  }
}
.legal {
  margin-top: 1rem;
  font-size: 1.125rem;
  line-height: 1.5;
  max-width: 34rem;
}
.contact {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}
.contact li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
}
.contact dt,
.contact .k {
  color: var(--muted-foreground);
}
.contact a {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 4px;
  transition: text-decoration-color 200ms;
}
.contact a:hover {
  text-decoration-color: var(--primary-strong);
}
.duo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 2.5rem 1.5rem;
  color: var(--foreground);
}
@media (min-width: 40rem) {
  .duo {
    flex-direction: row;
    gap: 4rem;
    padding: 3.5rem 2rem;
  }
}
.duo .ba {
  height: 4.5rem;
  width: auto;
}
.duo .ares-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius);
  transition: opacity 200ms;
}
.duo .ares-wrap:hover {
  opacity: 0.8;
}
.duo .ares {
  height: 2.7rem; /* 0.6x of the Beyond Aerospace lockup */
  width: auto;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (min-width: 48rem) {
  .site-footer .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}
.footer-links a {
  color: var(--muted-foreground);
  transition: color 200ms;
}
.footer-links a:hover {
  color: var(--foreground);
}
.theme-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.theme-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition:
    background-color 200ms,
    color 200ms;
}
.theme-toggle button:hover {
  color: var(--foreground);
}
.theme-toggle button[aria-pressed='true'] {
  background: var(--secondary);
  color: var(--foreground);
}
.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

/* 404 */
.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding-block: 8rem;
}

/* Reveal on scroll */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 350ms var(--ease),
    transform 350ms var(--ease);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .js .strip.armed .rec {
    opacity: 1;
  }
  .js .strip.play .rec {
    animation: none;
  }
}

.fields .tag {
  margin-left: 0.375rem;
}
