/* DIVISERA — site styles.
   One file, no build step. Dark only, by design: white on black.
   Every value that recurs is a token on :root. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@view-transition { navigation: auto; }

:root {
  --bg: #000;
  --bg-1: #060606;
  --bg-2: #0b0b0b;
  --bg-3: #131313;
  --bg-rgb: 0 0 0;          /* --bg as channels, for overlays with alpha */
  --fg-rgb: 255 255 255;    /* --fg's extreme, likewise */
  --line: rgb(var(--fg-rgb) / 0.09);
  --line-2: rgb(var(--fg-rgb) / 0.16);
  --line-3: rgb(var(--fg-rgb) / 0.3);
  --fg: #f2f2ef;
  --fg-2: #b2b2ad;
  --fg-3: #7f7f7a;
  --fg-4: #575753;
  --signal: #ff3b30;
  --bar: #e6e6e2;
  --fg-max: #fff;
  --error: #ff6a61;
  --shadow: rgb(0 0 0 / 0.9);

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --chamfer: 10px;

  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--sans);
  font-feature-settings: "calt", "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--fg); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-feature-settings: "zero";
}

.dim { color: var(--fg-3); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Line icons from the sprite. <use> copies inherit from the referencing
   <svg>, not from the sprite, so the stroke is set here. */
.app__icon, .pop__icon, .btn svg, .ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.skip {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--fg);
  color: var(--bg);
  font: 500 13px/1 var(--mono);
  text-decoration: none;
}
.skip:focus { top: 12px; }

.grain {
  position: fixed;
  inset: -120px;
  z-index: 300;
  pointer-events: none;
  background: url("../img/grain.svg");
  opacity: 0.045;
  animation: grain 1.4s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-40px, 24px); }
  40% { transform: translate(32px, -48px); }
  60% { transform: translate(-56px, -16px); }
  80% { transform: translate(18px, 52px); }
  100% { transform: translate(0, 0); }
}

/* ----------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgb(var(--bg-rgb) / 0.42);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
  view-transition-name: site-nav;
}
.nav[data-scrolled] {
  background: rgb(var(--bg-rgb) / 0.72);
  border-bottom-color: var(--line);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--fg);
}
.brand__rune { width: 38px; height: 20px; }
.brand__word {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  margin-right: -0.38em;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 36px);
}
.nav__menu > a { white-space: nowrap; }
.nav__menu > a:not(.btn) {
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-2);
  padding-block: 8px;
  position: relative;
  transition: color 0.2s;
}
.nav__menu > a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav__menu > a:not(.btn):hover { color: var(--fg); }
.nav__menu > a:not(.btn):hover::after,
.nav__menu > a[aria-current]::after { transform: scaleX(1); }
.nav__menu > a[aria-current] { color: var(--fg); }
.nav__menu > .nav__login { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); }
.nav__login .ico { width: 14px; height: 14px; margin-top: -2px; }

.nav__toggle {
  display: none;
  height: 38px;
  padding: 0 14px;
  background: none;
  border: 1px solid var(--line-2);
  color: var(--fg);
  cursor: pointer;
}

/* The menu folds behind the toggle where its links no longer fit on one row
   (about 975px, measured with About in it). The 404 page's plain menu below
   uses the same width. */
@media (max-width: 1000px) {
  .nav__toggle { display: inline-flex; align-items: center; }
  .nav__menu {
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav[data-open] .nav__menu { display: flex; }
  .nav__menu > a:not(.btn) {
    font-size: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }
  .nav__menu > a:not(.btn)::after { display: none; }
  .nav__menu .btn { margin-top: 20px; justify-content: center; }
}

/* ------------------------------------------------------------- buttons */

.btn {
  --h: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  height: var(--h);
  padding: 0 20px;
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line-3);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn svg { width: 16px; height: 16px; flex: none; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--solid {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}
.btn--solid:hover { background: var(--fg-max); }
.btn--solid:focus-visible { outline-offset: 4px; clip-path: none; }
.btn--ghost:hover,
.btn--line:hover { border-color: var(--fg); background: rgb(var(--fg-rgb) / 0.06); }
.btn--line { --h: 38px; padding: 0 14px; font-size: 11.5px; }
.btn--bare,
.btn--bare:hover { border-color: transparent; background: transparent; }
.btn--lg { --h: 58px; padding: 0 30px; font-size: 13px; --chamfer: 14px; }
.btn[disabled] { opacity: 0.5; cursor: progress; }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: max(660px, 100svh);
  margin-top: calc(-1 * var(--nav-h));
  overflow: hidden;
  background: var(--bg);
}
.hero__gl,
.hero__fallback,
.hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}
.hero__gl { opacity: 0; transition: opacity 1.6s ease 0.2s; }
.hero[data-gl="on"] .hero__gl { opacity: 1; }
.hero__fallback {
  background:
    radial-gradient(ellipse 50% 22% at 50% 64%, rgb(var(--fg-rgb) / 0.1), transparent 70%),
    linear-gradient(to bottom, transparent 40%, rgb(var(--fg-rgb) / 0.03)),
    repeating-linear-gradient(to right, rgb(var(--fg-rgb) / 0.05) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(to bottom, rgb(var(--fg-rgb) / 0.05) 0 1px, transparent 1px 64px);
  mask-image: linear-gradient(to bottom, transparent 30%, #000 70%);
}
.hero[data-gl="on"] .hero__fallback { display: none; }
.hero__shade {
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(var(--bg-rgb) / 0.88) 0, rgb(var(--bg-rgb) / 0) 20%),
    linear-gradient(to top, var(--bg) 0, rgb(var(--bg-rgb) / 0.5) 8%, rgb(var(--bg-rgb) / 0) 24%),
    radial-gradient(ellipse 56% 50% at 14% 82%, rgb(var(--bg-rgb) / 0.86), rgb(var(--bg-rgb) / 0) 74%);
}

.hero__rune {
  position: absolute;
  left: var(--rune-x, 50%);
  top: var(--rune-y, 31%);
  width: clamp(190px, min(31vw, 40vh), 470px);
  translate: -50% -50%;
  color: var(--fg);
  filter: var(--rune-glow, drop-shadow(0 0 14px rgb(255 255 255 / 0.4)) drop-shadow(0 0 54px rgb(255 255 255 / 0.18)));
  animation: float 7s ease-in-out infinite;
  pointer-events: none;
}
.hero__rune svg { width: 100%; height: auto; overflow: visible; }
.hero__rune path {
  fill: none;
  stroke: currentColor;
  stroke-width: 36;
  stroke-linejoin: miter;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.5s var(--ease) forwards;
}
.hero__rune .r1 { animation-delay: 0.15s; }
.hero__rune .r2 { animation-delay: 0.5s; }
.hero__rune .r3 { animation-delay: 0.75s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes float {
  0%, 100% { transform: translateY(-7px); }
  50% { transform: translateY(7px); }
}

/* The beam runs from the rune down to the ends of the scan line; hero.js
   projects those points and sets the variables every frame. */
.hero__beam {
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: polygon(
    calc(var(--rune-x, 50%) - 2px) var(--beam-y0, 30%),
    calc(var(--rune-x, 50%) + 2px) var(--beam-y0, 30%),
    var(--beam-x1, 70%) var(--beam-y1, 50%),
    var(--beam-x0, 30%) var(--beam-y1, 50%)
  );
  background:
    repeating-linear-gradient(to bottom, rgb(var(--fg-rgb) / 0.035) 0 1px, transparent 1px 5px),
    linear-gradient(to bottom, rgb(var(--fg-rgb) / 0) var(--beam-y0, 30%), rgb(var(--fg-rgb) / 0.085) var(--beam-y1, 50%));
  background-size: 100% 300px, 100% 100%;
  animation: beam 2.4s linear infinite;
  opacity: 0;
  transition: opacity 1.2s ease 1.4s;
  z-index: -1;
}
.hero[data-gl="on"] .hero__beam { opacity: 1; }
@keyframes beam { to { background-position: 0 300px, 0 0; } }

/* The top padding keeps room for the rune and its beam above the text;
   hero.js then fits the scan line between the two. */
.hero__content {
  position: relative;
  padding-top: clamp(280px, 42vh, 520px);
  padding-bottom: clamp(56px, 10vh, 104px);
}
.hero__title {
  font-size: clamp(42px, min(7.2vw, 9.2vh), 112px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  font-weight: 600;
  max-width: 9.5em;
}
.hero__title span { display: block; }
.hero__sub {
  margin-top: 24px;
  max-width: 42ch;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.5;
  color: var(--fg-2);
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero__content > * { animation: rise 1s var(--ease) both; }
.hero__content > :nth-child(1) { animation-delay: 0.9s; }
.hero__content > :nth-child(2) { animation-delay: 1.05s; }
.hero__content > :nth-child(3) { animation-delay: 1.25s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

@media (max-width: 640px) {
  .hero__content { padding-bottom: 64px; }
  .hero__ctas .btn { flex: 1 1 auto; }
  .hero__ctas .btn--ghost { display: none; }
}

/* --------------------------------------------------------------- brief */

.brief {
  padding-block: clamp(96px, 14vw, 200px) clamp(80px, 10vw, 150px);
}
.label { color: var(--fg-3); margin-bottom: 28px; }
.brief__text {
  font-size: clamp(27px, 3.5vw, 52px);
  line-height: 1.16;
  letter-spacing: -0.025em;
  font-weight: 500;
  max-width: 24em;
}
.brief__text .w { color: var(--fg-4); transition: color 0.5s ease; }
.brief__text .w.lit { color: var(--fg); }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px clamp(20px, 3vw, 48px);
  margin: clamp(64px, 8vw, 112px) 0 0;
}
.fact { border-top: 1px solid var(--line-2); padding-top: 20px; }
.fact dt { color: var(--fg-4); margin-bottom: 16px; }
.fact dd { margin: 0; display: grid; gap: 8px; }
.fact strong { font-size: 21px; font-weight: 500; letter-spacing: -0.01em; }
.fact span { color: var(--fg-3); font-size: 15px; line-height: 1.5; }

/* Three across only where the titles fit on one line. */
@media (max-width: 900px) {
  .facts { grid-template-columns: 1fr; gap: 28px; }
}

/* ------------------------------------------------------------ sections */

.section {
  padding-block: clamp(88px, 11vw, 168px);
  border-top: 1px solid var(--line);
}
.section__head { margin-bottom: clamp(44px, 6vw, 76px); }
.section__title {
  font-size: clamp(42px, 6.2vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.section__lead {
  margin-top: 28px;
  max-width: 54ch;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--fg-2);
}

/* -------------------------------------------------------- capabilities */

.caps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.cap {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.cap__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
}
.cap__media canvas { width: 100%; height: 100%; }
/* The Concord tower sits right of centre in its frame; keep it in the card. */
.cap__video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.cap__img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Pause and play for the card video, in the frame's bottom-left corner. It
   shows only while the pointer is over the video or it has keyboard focus,
   with no fade; on screens without hover (phones) it stays visible, since
   there would be no way to reveal it. */
.cap__toggle {
  position: absolute;
  left: 12px;
  bottom: 12px;
  opacity: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--fg);
  background: rgb(var(--bg-rgb) / 0.55);
  border: 1px solid var(--line-2);
  cursor: pointer;
}
.cap__media:hover .cap__toggle,
.cap__toggle:focus-visible { opacity: 1; }
@media (hover: none) { .cap__toggle { opacity: 1; } }
.cap__toggle[hidden] { display: none; }
.cap__toggle .ico { width: 16px; height: 16px; }
.cap__toggle[data-state="paused"] .ico--pause,
.cap__toggle:not([data-state="paused"]) .ico--play { display: none; }

.cap__body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 26px 28px 34px;
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.6;
}
.cap__title {
  color: var(--fg);
  font-size: clamp(24px, 2.1vw, 30px);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 4px;
}

/* redacted capabilities: one still frame, nothing moves on hover */
.cap--redacted .cap__media canvas {
  filter: blur(9px) contrast(1.15) brightness(0.9);
  transform: scale(1.12);
}
.cap__media--blur::after {
  /* scanlines over the blur */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: repeating-linear-gradient(to bottom, rgb(var(--bg-rgb) / 0.32) 0 1px, transparent 1px 3px);
}

.bars b,
.redacted b {
  display: inline-block;
  height: 0.92em;
  vertical-align: -0.08em;
  background: var(--bar);
}
.cap__title .bars b { height: 0.8em; vertical-align: 0; }
.redacted { color: var(--fg-3); line-height: 1.95; }
.redacted b { background: var(--fg-4); }

.w2 { width: 2ch; } .w3 { width: 3ch; } .w4 { width: 4ch; } .w5 { width: 5ch; }
.w6 { width: 6ch; } .w7 { width: 7ch; } .w8 { width: 8ch; } .w9 { width: 9ch; }
.w10 { width: 10ch; }

@media (max-width: 1080px) {
  .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .caps { grid-template-columns: 1fr; }
  .cap__body { padding: 22px 20px 28px; }
}

/* -------------------------------------------------------- applications */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}
.filters input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  height: 38px;
  padding: 0 14px;
  font-size: 11px;
  color: var(--fg-2);
  border: 1px solid var(--line-2);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.filters label span { color: var(--fg-4); letter-spacing: 0.1em; transition: color 0.2s; }
.filters label:hover { border-color: var(--line-3); color: var(--fg); }
.filters input:checked + label { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.filters input:checked + label span { color: rgb(var(--bg-rgb) / 0.6); }
.filters input:focus-visible + label { outline: 2px solid var(--fg); outline-offset: 3px; }
@media (max-width: 560px) {
  .filters label span { display: none; }
}

.apps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
}
.app { display: flex; background: var(--bg); }
.app__btn {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  min-height: 228px;
  padding: 18px 18px 20px;
  margin: 0;
  text-align: left;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.3s;
}
.app__btn::before,
.app__btn::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 0 solid var(--fg-2);
  opacity: 0;
  transition: opacity 0.25s, transform 0.35s var(--ease);
}
.app__btn::before { left: 8px; bottom: 8px; border-left-width: 1px; border-bottom-width: 1px; transform: translate(5px, -5px); }
.app__btn::after { right: 8px; top: 8px; border-right-width: 1px; border-top-width: 1px; transform: translate(-5px, 5px); }
.app__btn:hover { background: var(--bg-2); }
.app__btn:hover::before,
.app__btn:hover::after { opacity: 1; transform: none; }
.app__btn:focus-visible { outline-offset: -4px; }

.app__cat { color: var(--fg-4); font-size: 10px; letter-spacing: 0.2em; }
.app__icon {
  width: 44px;
  height: 44px;
  align-self: center;
  justify-self: center;
  color: var(--fg-2);
  transition: color 0.3s, transform 0.5s var(--ease);
}
.app__btn:hover .app__icon { color: var(--fg); transform: scale(1.12); }
.app__name {
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  padding-right: 18px;
}
.app__more {
  position: absolute;
  right: 18px;
  bottom: 23px;
  width: 11px;
  height: 11px;
  background:
    linear-gradient(var(--fg-3), var(--fg-3)) center / 100% 1px no-repeat,
    linear-gradient(var(--fg-3), var(--fg-3)) center / 1px 100% no-repeat;
  transition: transform 0.35s var(--ease);
}
.app__btn:hover .app__more { transform: rotate(90deg); }

/* The closing tile fills out the last row: two squares on the five-column
   grid, and whatever the last row leaves at the narrower ones (below). */
.app--cta { grid-column: span 2; }
.app--cta .app__btn {
  grid-template-columns: minmax(0, 1fr) auto;
  background: var(--bg-1);
}
.app--cta .app__cat { grid-column: 1 / -1; color: var(--fg-3); }
.app--cta .app__name {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  max-width: 15ch;
  padding-right: 0;
  font-size: clamp(19px, 1.7vw, 26px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.app--cta .app__icon {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  justify-self: end;
  width: 40px;
  height: 40px;
  color: var(--fg);
}
.app--cta .app__btn:hover .app__icon { transform: translateX(6px); }

/* Filtering dims what is inside a tile, not the tile, so the grid stays black. */
.app__btn > * { transition: opacity 0.4s var(--ease), filter 0.4s var(--ease); }
.section--apps:has(#f-mil:checked) .app:not([data-cat="mil"], .app--cta) .app__btn > *,
.section--apps:has(#f-law:checked) .app:not([data-cat="law"], .app--cta) .app__btn > *,
.section--apps:has(#f-aid:checked) .app:not([data-cat="aid"], .app--cta) .app__btn > *,
.section--apps:has(#f-civ:checked) .app:not([data-cat="civ"], .app--cta) .app__btn > * {
  opacity: 0.14;
  filter: blur(1.5px);
}

/* Thirteen tiles, then the closing one: it spans what the last row has left,
   so the grid never ends in an empty cell. */
@media (max-width: 1180px) {
  .apps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .app--cta { grid-column: span 3; }
}
@media (max-width: 980px) {
  .apps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app--cta { grid-column: span 2; }
}
@media (max-width: 640px) {
  .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app--cta { grid-column: span 1; }
  .app--cta .app__name { font-size: 16px; }
  .app--cta .app__icon { width: 32px; height: 32px; }
  .app__btn { min-height: 176px; padding: 14px 14px 16px; }
  .app__icon { width: 36px; height: 36px; }
  .app__name { font-size: 14.5px; }
  .app__more { right: 14px; bottom: 19px; }
}

/* the application popovers: native [popover], no script needed */
.pop {
  margin: auto;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  overflow: auto;
  padding: 26px clamp(20px, 4vw, 36px) 30px;
  color: var(--fg-2);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px var(--bg), 0 50px 140px var(--shadow);
  font-size: 16.5px;
  line-height: 1.6;
}
.pop::backdrop {
  background: rgb(var(--bg-rgb) / 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pop:popover-open { animation: pop-in 0.4s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
.pop__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 28px;
  color: var(--fg-4);
  font-size: 10px;
  border-bottom: 1px solid var(--line);
}
.pop__icon { width: 52px; height: 52px; color: var(--fg); margin-bottom: 20px; }
.pop__title {
  color: var(--fg);
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 16px;
}
.pop__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.pop__close {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--fg-3);
  cursor: pointer;
}
.pop__close:hover { color: var(--fg); }
.pop__close kbd {
  font: inherit;
  font-size: 9.5px;
  padding: 3px 6px;
  border: 1px solid var(--line-2);
}

/* ----------------------------------------------------------------- cta */

.cta {
  position: relative;
  overflow: hidden;
  padding-block: clamp(110px, 15vw, 220px);
  border-top: 1px solid var(--line);
  text-align: center;
}
.cta__inner { position: relative; display: grid; justify-items: center; gap: 26px; }
.cta__rune {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1100px, 130vw);
  height: auto;
  aspect-ratio: 1400 / 740;
  translate: -50% -50%;
  color: var(--fg);
  opacity: 0.05;
  pointer-events: none;
}
.cta__title {
  position: relative;
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1;
  letter-spacing: -0.04em;
  max-width: 12em;
}
.cta .btn { position: relative; margin-top: 10px; }

/* -------------------------------------------------------------- footer */

.foot { border-top: 1px solid var(--line); }
/* Brand on the left, the seal at the right edge. */
.foot__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px clamp(24px, 4vw, 64px);
  align-items: start;
  padding-block: 64px 48px;
}
.foot__motto { margin-top: 18px; color: var(--fg-3); }
.seal { width: 132px; height: 132px; color: var(--fg-4); justify-self: end; }
.seal text {
  fill: var(--fg-3);
  font-family: var(--mono);
  font-size: 10.4px;
  letter-spacing: 0.135em;
}
.foot__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 20px 28px;
  border-top: 1px solid var(--line);
  color: var(--fg-4);
  font-size: 10.5px;
}
@media (max-width: 560px) {
  .foot__inner { grid-template-columns: 1fr; }
  .seal { justify-self: start; }
}

/* ------------------------------------------------ contact, login, about */

/* Each page is a title and a form or a paragraph, centred over a faint rune. */
.solo {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: calc(100svh - var(--nav-h) - 72px);
  padding: clamp(48px, 8vw, 104px) var(--gutter);
}
.solo__rune {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1100px, 140vw);
  height: auto;
  aspect-ratio: 1400 / 740;
  translate: -50% -50%;
  color: var(--fg);
  opacity: 0.04;
  pointer-events: none;
}
.solo__box { position: relative; width: min(440px, 100%); }
.solo__box--wide { width: min(600px, 100%); }
.solo__title {
  margin-bottom: 30px;
  font-size: clamp(44px, 5.4vw, 68px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.about__text { color: var(--fg-2); font-size: clamp(17px, 1.5vw, 21px); line-height: 1.6; }

.form,
.sent {
  position: relative;
  padding: clamp(22px, 3.4vw, 40px);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
}
.form::before,
.form::after,
.sent::before,
.sent::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0 solid var(--fg-2);
  pointer-events: none;
}
.form::before, .sent::before { left: -1px; top: -1px; border-left-width: 1px; border-top-width: 1px; }
.form::after, .sent::after { right: -1px; bottom: -1px; border-right-width: 1px; border-bottom-width: 1px; }

.field { display: grid; gap: 10px; margin-bottom: 24px; }
.field label { color: var(--fg-2); font-size: 11px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  font: 400 16px/1.45 var(--sans);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 176px; resize: vertical; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--line-3); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px rgb(var(--fg-rgb) / 0.08);
}
.field [aria-invalid="true"] { border-color: var(--signal); }
.select { position: relative; }
.select select { appearance: none; padding-right: 44px; cursor: pointer; }
.select select:invalid { color: var(--fg-3); }
.select option { background: var(--bg-2); color: var(--fg); }
.select::after {
  content: "";
  position: absolute;
  right: 19px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--fg-2);
  border-bottom: 1.5px solid var(--fg-2);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.field__error { color: var(--error); font-size: 13.5px; line-height: 1.4; }
.field__meta { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.field__count { margin-left: auto; color: var(--fg-4); font-size: 10px; white-space: nowrap; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.pow { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-3); font-size: 10.5px; }
.pow i { width: 8px; height: 8px; border: 1px solid var(--fg-3); flex: none; }
.pow[data-pow="working"] i { border-color: var(--fg); animation: spin 1.1s linear infinite; }
.pow[data-pow="done"] { color: var(--fg-2); }
.pow[data-pow="done"] i { background: var(--fg); border-color: var(--fg); }
.pow[data-pow="error"] i { border-color: var(--signal); }
@keyframes spin { to { rotate: 360deg; } }
.form__error {
  margin-top: 18px;
  padding: 12px 14px;
  color: var(--fg);
  font-size: 14.5px;
  border: 1px solid var(--signal);
  background: rgb(255 59 48 / 0.08);
}

.sent { display: grid; justify-items: start; gap: 14px; animation: rise 0.8s var(--ease) both; }
.sent:focus { outline: none; }
.sent__rune {
  width: 104px;
  height: 56px;
  margin-bottom: 18px;
  color: var(--fg);
  animation: wipe 1.2s var(--ease) 0.2s both;
}
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.sent__title { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.05; letter-spacing: -0.03em; }
.sent__text { color: var(--fg-2); font-size: clamp(17px, 1.4vw, 20px); }
.sent__ref { margin: 8px 0 18px; color: var(--fg-3); }
.sent__ref span { color: var(--fg); margin-left: 0.6em; }

.foot--slim .foot__base { padding-top: 22px; }

@media (max-width: 520px) {
  .form__foot .btn { width: 100%; }
}

/* ----------------------------------------------------------------- 404 */

.lost { display: grid; min-height: calc(100svh - var(--nav-h)); place-items: center; }
.lost__inner { display: grid; justify-items: center; gap: 26px; padding-block: 80px; text-align: center; }
.lost__rune { width: min(320px, 60vw); height: auto; aspect-ratio: 1400 / 740; color: var(--fg); opacity: 0.9; }
.lost__title { font-size: clamp(32px, 4.6vw, 64px); line-height: 1.05; letter-spacing: -0.035em; }
.lost .label { margin: 0; }
.nav__menu--plain { display: flex; }
@media (max-width: 1000px) {
  .nav__menu--plain {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 0;
    background: none;
    border: 0;
  }
  .nav__menu--plain > a:not(.btn) { font-size: 12px; padding: 8px 0; border: 0; }
  .nav__menu--plain .btn { margin-top: 0; }
}

/* --------------------------------------------------------------- login */

.login__error { margin: 0 0 20px; }
.login__submit { width: 100%; transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s; }
/* Greyed out while the attempt is "checked". */
.login__form[aria-busy="true"] .login__submit { opacity: 0.55; cursor: progress; }

/* ---------------------------------------------------- reveal on scroll */

/* Grid cells keep their black background while their content fades in, so
   the hairline grid never shows as a grey slab. */
.js [data-reveal]:not(.cap),
.js .cap[data-reveal] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js [data-reveal].is-in:not(.cap),
.js .cap[data-reveal].is-in > * { opacity: 1; transform: none; }
.js .cap[data-reveal] > .cap__body { transition-delay: 0.08s; }
.caps > [data-reveal]:nth-child(3n + 2) > * { transition-delay: 0.1s; }
.caps > [data-reveal]:nth-child(3n + 3) > * { transition-delay: 0.2s; }

/* --------------------------------------------------------------- motion */

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.35s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero__rune path { stroke-dashoffset: 0; }
  .grain { animation: none; }
  .js [data-reveal]:not(.cap),
  .js .cap[data-reveal] > * { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- beige */

/* The live site is Noir, white on black. Beige, black on beige with almost no
   motion, applies with <html data-theme="beige"> (plus a theme-color of
   #e8e0cd and color-scheme light); the local theme picker (noir/dev/) switches
   between the two. --motion: none also tells the scripts to hold still, all
   but the card video, which plays regardless. */
:root[data-theme="beige"] {
  --bg: #e8e0cd;
  --bg-1: #e1d8c3;
  --bg-2: #d9cfb8;
  --bg-3: #cfc4ab;
  --bg-rgb: 232 224 205;
  --fg: #15130f;
  --fg-2: #3d3930;
  --fg-3: #6a6457;
  --fg-4: #8e8775;
  --fg-rgb: 21 19 15;
  --fg-max: #000;
  --signal: #b8321f;
  --bar: #15130f;
  --error: #a3281b;
  --shadow: rgb(60 45 20 / 0.28);
  /* the rune casts a soft shadow, as if floating above the paper */
  --rune-glow: drop-shadow(0 16px 14px rgb(40 30 10 / 0.22));
  --motion: none;
  color-scheme: light;
  scroll-behavior: auto;
}
/* paper grain instead of film grain */
:root[data-theme="beige"] .grain { filter: invert(1); opacity: 0.06; }

/* No landscape: the hero is blank paper with the rune and the words. */
:root[data-theme="beige"] .hero__gl,
:root[data-theme="beige"] .hero__beam,
:root[data-theme="beige"] .hero__fallback { display: none; }

/* Nothing moves: no animations or transitions, and everything that would
   have arrived is simply there. */
:root[data-theme="beige"] *,
:root[data-theme="beige"] *::before,
:root[data-theme="beige"] *::after {
  animation: none !important;
  transition: none !important;
}
:root[data-theme="beige"] .hero__rune path { stroke-dashoffset: 0; }
:root[data-theme="beige"] [data-reveal]:not(.cap),
:root[data-theme="beige"] .cap[data-reveal] > * { opacity: 1 !important; transform: none !important; }
:root[data-theme="beige"]::view-transition-group(*),
:root[data-theme="beige"]::view-transition-old(*),
:root[data-theme="beige"]::view-transition-new(*) { animation: none !important; }
