/* FLEX — design tokens. Fonts are embedded in fonts.css. */
:root {
  --paper: #f1ede4;
  --paper-deep: #e8e2d5;
  --paper-soft: #f7f4ed;
  --ink: #131311;
  --ink-2: #3d3a33;
  --ink-3: #746e61;
  --line: #d2cbbc;
  --line-strong: #b6ad9b;
  --signal: #e33f1b;
  --signal-deep: #b92c0d;
  --stage: #070809;
  --stage-2: #0e1013;
  --stage-3: #171a1e;
  --chalk: #f4f0e6;
  --chalk-dim: #a9a396;

  --f-gen: #e33f1b;
  --f-shd: #21c9b7;
  --f-typ: #3446f0;
  --f-spa: #a8d62c;
  --f-phy: #f26b8c;
  --f-int: #f2a51f;
  --f-sys: #7c88ff;

  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --gutter: clamp(18px, 3vw, 48px);
  --header-h: 74px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --shadow: 0 30px 80px -30px rgba(19, 19, 17, 0.35);
}

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

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

::selection {
  background: var(--signal);
  color: var(--paper-soft);
}

:focus-visible {
  outline: 1px solid var(--signal);
  outline-offset: 3px;
}

button,
input {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  margin: 0;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

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

h1,
h2,
h3,
h4,
p,
dl,
dd,
dt,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

kbd {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: 0.55;
  text-transform: uppercase;
}

.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 30;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 500;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
}

.mono {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.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;
}

.runner-error {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
  background: #0b0c0e;
  color: #f4f0e6;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--paper-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--ink-3);
  border: 3px solid var(--paper-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink);
}

/* Custom cursor */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 400;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  pointer-events: none;
  display: none;
  will-change: transform;
}
.cursor__ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(19, 19, 17, 0.55);
  border-radius: 50%;
  transition: width 0.35s var(--ease), height 0.35s var(--ease),
    margin 0.35s var(--ease), background 0.35s var(--ease),
    border-color 0.35s var(--ease), opacity 0.25s;
  mix-blend-mode: difference;
}
.cursor__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px;
  border-radius: 50%;
  background: var(--signal);
}
.cursor__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-soft);
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.cursor.is-active .cursor__ring {
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  background: var(--ink);
  border-color: var(--ink);
  mix-blend-mode: normal;
  opacity: 0.92;
}
.cursor.is-active .cursor__label {
  opacity: 1;
}
.cursor.is-hidden {
  opacity: 0;
}
.cursor.is-down .cursor__ring {
  scale: 0.82;
}
@media (pointer: fine) {
  body.has-cursor .cursor {
    display: block;
  }
  body.has-cursor .card,
  body.has-cursor .row,
  body.has-cursor button,
  body.has-cursor a {
    cursor: none;
  }
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  z-index: 200;
  background: transparent;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Shared controls */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
  padding: 0 16px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow: hidden;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--signal);
  transform: translateY(101%);
  transition: transform 0.4s var(--ease);
  z-index: 0;
}
.btn > * {
  position: relative;
  z-index: 1;
}
.btn:hover::before,
.btn:focus-visible::before {
  transform: translateY(0);
}
.btn:hover,
.btn:focus-visible {
  color: var(--paper-soft);
  border-color: var(--signal);
}
.btn--solid {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper-soft);
  border-color: var(--ink);
}
.btn--solid:hover,
.btn--solid:focus-visible {
  color: var(--paper-soft);
}
.btn--signal {
  --btn-bg: var(--signal);
  --btn-fg: var(--paper-soft);
  border-color: var(--signal);
}
.btn--signal::before {
  background: var(--ink);
}
.btn__arrow {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1;
  transition: transform 0.35s var(--ease);
}
.btn:hover .btn__arrow {
  transform: translate(3px, -3px);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@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;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
