/* site.css — Goosethropic / Blade Systems. Industrial, near-black concrete,
   monochrome red accent, condensed military display + mono for math.
   Palette + type live in tokens.css; faces are self-hosted via fonts.css —
   load order in every page: tokens.css → fonts.css → this file. */

:root {
  --gut: clamp(20px, 5vw, 88px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--steel);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* concrete grain + vignette over everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    radial-gradient(100% 100% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
  mix-blend-mode: multiply;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#cl-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  touch-action: none;
  transition: opacity 0.35s ease;
}
/* Desktop only: let the open hero area pass the pointer through to the turbine so it
   can be grabbed and orbited, while the hero's own text/buttons stay interactive.
   On touch/mobile the hero captures normally (plain scroll) — auto-orbit still runs. */
@media (min-width: 880px) and (hover: hover) {
  #cl-canvas { cursor: grab; }
  #cl-canvas:active { cursor: grabbing; }
  #hero { pointer-events: none; }
  #hero > * { pointer-events: auto; }
}

/* ---- top bar ---- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gut);
  mix-blend-mode: difference;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img { height: 44px; width: auto; display: block; }
.brand .wordmark {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 15px;
  line-height: 0.95;
  color: #fff;
}
.brand .wordmark small {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.42em;
  color: #fff;
  opacity: 0.7;
}
.nav {
  display: flex;
  gap: 26px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
}
.nav a {
  color: inherit; text-decoration: none;
  position: relative; padding-bottom: 4px;
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s;
}
.nav a:hover::after { transform: scaleX(1); }
@media (max-width: 720px) { .nav { display: none; } }

/* ---- mobile nav (≤720px): CSS-only checkbox toggle. The panel lives OUTSIDE
   .topbar — the topbar's mix-blend-mode:difference would mangle a solid panel. */
.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.burger {
  display: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}
.mobile-nav {
  display: none;
  position: fixed;
  top: 72px; left: 0; right: 0;
  z-index: 7;
  flex-direction: column;
  background: var(--ink-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--red);
}
.mobile-nav a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel);
  text-decoration: none;
  padding: 15px var(--gut);
  border-bottom: 1px solid var(--line-soft);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:active { color: var(--red-hot); }
@media (max-width: 720px) {
  .burger { display: block; }
  .menu-toggle:checked ~ .mobile-nav { display: flex; }
}

/* ---- section scaffold ---- */
.section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gut) 90px;
}
.section .index {
  position: absolute;
  top: 96px;
  right: var(--gut);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
}

/* sovereign seal — stamped sign-off, used on the access/contact section */
.seal-stamp {
  position: absolute;
  right: 6%;
  bottom: 8%;
  width: clamp(96px, 12vw, 150px);
  opacity: 0.9;
  transform: rotate(-7deg);
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
@media (max-width: 720px) {
  .seal-stamp { width: 82px; right: 5%; bottom: 4%; opacity: 0.5; }
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: '';
  width: 34px;
  height: 1px;
  background: var(--red);
}

h1, h2 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.005em;
  color: #fff;
  text-wrap: balance;
}
h1 { font-size: clamp(44px, 8.5vw, 132px); }
h2 { font-size: clamp(34px, 5.5vw, 78px); }

.lede {
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(16px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--steel);
  max-width: 52ch;
  text-wrap: pretty;
}
.mt { margin-top: 24px; }
.col { max-width: 720px; }
.col-narrow { max-width: 560px; }

/* ── interstitial: the brand mark rebuilt as a 3D bivector goose (js/goose-blade.js).
   Its own opaque ink stage, so the fixed turbine background doesn't show through and
   the faceted goose reads cleanly. Gold eyebrow ties it to the Cl(3,0) GA language. ── */
.goose-band {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  overflow: hidden;
  background: var(--ink);
  display: flex;
  align-items: flex-start;
}
.goose-band #goose-canvas {
  position: absolute;
  inset: 0;
  width: 100%;                    /* canvas is a replaced element — inset:0 alone won't stretch it */
  height: 100%;
  display: block;
  z-index: 0;
  cursor: grab;
  touch-action: pan-y;            /* keep vertical page scroll working on touch */
}
.goose-band #goose-canvas:active { cursor: grabbing; }
.goose-copy {
  position: relative;
  z-index: 1;
  pointer-events: none;           /* let drags pass through to the goose */
  padding: clamp(116px, 17vh, 180px) var(--gut) 0;
  max-width: 680px;
}
.goose-copy .eyebrow { color: var(--gold); }
.goose-copy .eyebrow::before { background: var(--gold); }
.goose-copy .lede { margin-top: 20px; max-width: 44ch; }
.goose-copy h2, .goose-copy .lede {
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.78), 0 1px 4px rgba(0, 0, 0, 0.6);
}
@media (max-width: 720px) {
  .goose-copy { padding-top: clamp(96px, 14vh, 140px); }
}

.text-shadow, .section h1, .section h2, .section .lede, .section p {
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.8);
}

/* hover-reveals-vectors on words */
.vec {
  position: relative;
  color: #fff;
  cursor: default;
  white-space: nowrap;
}
.vec::after {
  content: attr(data-vec);
  position: absolute;
  left: 0; top: -1.15em;
  font-family: var(--mono);
  font-size: 0.34em;
  letter-spacing: 0.1em;
  color: var(--red);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
.vec::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0.04em;
  height: 1px;
  background: linear-gradient(90deg, var(--red), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.vec:hover::after { opacity: 1; transform: translateY(0); }
.vec:hover::before { transform: scaleX(1); }

/* hollow / outlined display word — brand emphasis device (text-stroke) */
.hollow {
  color: transparent;
  -webkit-text-stroke: 1.4px var(--steel);
  text-stroke: 1.4px var(--steel);
  text-shadow: none;
}

/* ---- capability sub-grid ---- */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 48px;
}
.grid3 .cell {
  background: var(--ink-2);
  padding: 26px 24px 30px;
}
.grid3 .cell h4 {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 16px;
  color: #fff;
  margin-bottom: 10px;
}
.grid3 .cell p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ash);
}
.grid3 .cell .k {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.1em;
}
@media (max-width: 720px) { .grid3 { grid-template-columns: 1fr; } }

/* math block */
.maths {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
  color: var(--ash);
  border-left: 1px solid var(--red);
  padding-left: 18px;
  margin-top: 30px;
}
.maths b { color: var(--steel); font-weight: 500; }
.maths .accent { color: var(--red); }

/* hardware hero graphic — red 2Complex goose on a brushed-charcoal plate */
.hw-graphic {
  position: relative; overflow: hidden;
  margin: 32px 0 6px; padding: 40px 46px; border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.022) 0 2px, rgba(0,0,0,0.05) 2px 4px),
    linear-gradient(135deg, #3a3d42, #26282c 55%, #16181b);
  border: 1px solid #44474d;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
  text-align: center;
}
.hw-graphic::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 18% 10%, rgba(255,255,255,0.08), transparent 55%);
}
.hw-graphic img { position: relative; display: block; width: min(100%, 460px); height: auto; margin: 0 auto; }
.hw-graphic figcaption {
  position: absolute; left: 18px; bottom: 13px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--ash);
}
@media (max-width: 720px) { .hw-graphic { padding: 28px 22px; } }

/* spec table for products */
.spec {
  margin-top: 36px;
  border-top: 1px solid var(--line);
}
.spec .row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.spec .row .name {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  font-size: 17px;
}
.spec .row .desc { font-size: 13.5px; color: var(--ash); line-height: 1.5; }
.spec .row .val { font-family: var(--mono); font-size: 12px; color: var(--gold); white-space: nowrap; }
@media (max-width: 720px) { .spec .row { grid-template-columns: 1fr; gap: 6px; } }

/* team */
.roster {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 40px;
}
.roster .m { background: var(--ink-2); padding: 24px; }
.roster .m .role { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red); }
.roster .m .nm { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 22px; color: #fff; margin: 8px 0 6px; letter-spacing: 0.02em; }
.roster .m p { font-size: 13px; color: var(--ash); line-height: 1.5; }
@media (max-width: 720px) { .roster { grid-template-columns: 1fr; } }

/* contact */
.access {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 14px;
  color: var(--ink);
  background: var(--red);
  border: 1px solid var(--red);
  padding: 15px 30px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn:hover { background: var(--red-hot); box-shadow: 0 0 30px var(--red-dim); }
.btn.ghost { background: transparent; color: #fff; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--red); color: var(--red); box-shadow: none; }

.foot-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ash-dim);
  margin-top: 64px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

/* scroll cue */
.cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ash);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cue .bar { width: 1px; height: 36px; background: linear-gradient(var(--red), transparent); }

.hero-stamp {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ash);
  margin-top: 44px;
  max-width: 44ch;
  line-height: 1.7;
}
.hero-stamp .accent { color: var(--red); }

/* ---- tactical HUD frame ---- */
.hud {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.hud-c {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid var(--red);
  opacity: 0.8;
}
.hud-c.tl { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.hud-c.tr { top: 14px; right: 14px; border-left: none; border-bottom: none; }
.hud-c.bl { bottom: 14px; left: 14px; border-right: none; border-top: none; }
.hud-c.br { bottom: 14px; right: 14px; border-left: none; border-top: none; }
.hud-read {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ash);
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hud-read b { color: var(--gold); font-weight: 500; }
.hud-read .rec {
  width: 7px; height: 7px;
  background: var(--red);
  display: inline-block;
  animation: rec 1.4s steps(1) infinite;
}
@keyframes rec { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }
@media (max-width: 720px) { .hud-read { font-size: 8.5px; letter-spacing: 0.12em; } }

/* ---- scanlines / CRT grit ---- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.55;
  background: repeating-linear-gradient(
    0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.16) 2px 3px);
  mix-blend-mode: multiply;
}

/* ---- chromatic / misregister headline ---- */
.glitch {
  text-shadow:
    1.5px 0 0 rgba(224, 50, 42, 0.55),
    -1.5px 0 0 rgba(233, 178, 63, 0.40),
    0 2px 26px rgba(0, 0, 0, 0.8);
}
.section .glitch { text-shadow:
    1.5px 0 0 rgba(224, 50, 42, 0.55),
    -1.5px 0 0 rgba(233, 178, 63, 0.40),
    0 2px 26px rgba(0, 0, 0, 0.8); }

/* gold tick on eyebrows */
.eyebrow::after {
  content: '';
  width: 5px; height: 5px;
  background: var(--gold);
  display: inline-block;
}

/* ---- source / repo link ---- */
.src-link {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.src-link:hover { color: var(--red-hot); border-color: var(--red); }

/* ---- open-source / ecosystem ---- */
.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 36px;
}
.proj {
  background: var(--ink-2);
  padding: 22px 22px 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: background 0.2s, box-shadow 0.2s;
}
.proj:hover { background: var(--panel); box-shadow: inset 0 0 0 1px var(--red-dim); }
.proj .ph { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.proj .nm {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 18px; color: #fff;
}
.proj .lang {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--gold); text-transform: uppercase; white-space: nowrap;
}
.proj p { font-size: 13px; line-height: 1.5; color: var(--ash); }
.proj .path {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--ash-dim); margin-top: auto; transition: color 0.2s;
}
.proj:hover .path { color: var(--red); }
@media (max-width: 720px) { .projects { grid-template-columns: 1fr; } }

.eco-friend {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ash);
}
.eco-friend a { color: var(--gold); text-decoration: none; }
.eco-friend a:hover { color: var(--red-hot); }

.foot-meta a { color: inherit; text-decoration: none; }
.foot-meta a:hover { color: var(--red-hot); }

/* ---- prefers-reduced-motion: kill autonomous animation. The canvas engines
   check the same media query and hold a static pose (drag still works). ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hud-read .rec { animation: none; opacity: 1; }
  .nav a::after, .vec::after, .vec::before { transition: none; }
  .cue { display: none; }
}
