/* Reset, typography, layout primitives and shared components. */

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

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

/* The lime scroll rail replaces the native page scrollbar. Hidden on both
   html and body so it stays hidden whichever element ends up scrolling. */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar { display: none; width: 0; height: 0; }

body {
  margin: 0;
  background: var(--nm-bg);
  color: var(--nm-ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--nm-lime); color: var(--nm-black); }

:focus-visible {
  outline: 2px solid var(--nm-black);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.section--dark :focus-visible,
.footer :focus-visible,
[data-nav-theme='dark'] :focus-visible { outline-color: var(--nm-lime); }

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

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

.skip-link {
  position: fixed;
  left: 16px; top: -60px;
  z-index: 10002;
  padding: 10px 14px;
  background: var(--nm-lime);
  border: 1px solid var(--nm-black);
  border-radius: var(--r);
  font-weight: 500;
  text-decoration: none;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 16px; }

/* ---------------------------------------------------------------- layout */

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

.section { position: relative; padding-block: var(--section-y); }
.section--dark { background: var(--nm-dark); color: var(--nm-bg); }

.section-head { display: grid; gap: 16px; max-width: 760px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: end;
  gap: 24px 64px;
}
.section-head__text { font-size: clamp(16px, 1.3vw, 18px); color: var(--nm-muted); max-width: 520px; }
.section--dark .section-head__text { color: var(--nm-dark-muted); }
.section-head__text a { text-underline-offset: 3px; }

@media (max-width: 860px) {
  .section-head--split { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ typography */

.display {
  font-size: clamp(34px, 4.6vw, 64px);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede { font-size: clamp(16px, 1.35vw, 19px); line-height: 1.6; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow--dark { color: var(--nm-dark-muted); }

.chev { font-weight: 700; letter-spacing: -0.04em; }
.eyebrow .chev {
  display: inline-block;
  padding: 1px 6px;
  background: var(--nm-lime);
  color: var(--nm-black);
  border: 1px solid var(--nm-black);
  border-radius: var(--r-xs);
  font-size: 12px;
}
.eyebrow--dark .chev { border-color: var(--nm-lime); }

.lime { color: var(--nm-lime); }

.mono { font-family: var(--mono); font-size: 0.92em; }

.footnote { margin-top: 20px; font-size: 13px; color: var(--nm-muted); max-width: 820px; }
.section--dark .footnote { color: var(--nm-dark-muted); }
.footnote a { text-underline-offset: 3px; }

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

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--nm-ink);
  --btn-bd: var(--nm-black);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast), color var(--t-fast);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--extrude); }
.btn:active { transform: translate(0, 0); box-shadow: 0 0 0 var(--nm-black); }

.btn--lime { --btn-bg: var(--nm-lime); --btn-fg: var(--nm-black); }
.btn--ghost { --btn-bg: transparent; }
.btn--ghost:hover { --btn-bg: var(--nm-paper); }
.btn--ghost-dark { --btn-bg: transparent; --btn-fg: var(--nm-bg); --btn-bd: var(--nm-bg); }
.btn--ghost-dark:hover { --btn-bg: var(--nm-bg); --btn-fg: var(--nm-black); box-shadow: 4px 4px 0 var(--nm-lime); }
.section--dark .btn--lime:hover,
.gate .btn--lime:hover { box-shadow: 4px 4px 0 var(--nm-bg); }
.btn--text { --btn-bd: transparent; text-decoration: underline; text-underline-offset: 4px; }
.btn--text:hover { transform: none; box-shadow: none; }

.btn--sm { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn--lg { min-height: 54px; padding: 14px 24px; font-size: 17px; }
.btn--block { width: 100%; }

.btn__icon { width: 13px; height: 16px; flex: none; }

/* --------------------------------------------------------------- brand */

.nm-mark {
  display: inline-block;
  flex: none;
  aspect-ratio: 300 / 401;
  height: 48px;
  background: currentColor;
  -webkit-mask: url('../../assets/brand/nullmask-mask.png') center / contain no-repeat;
  mask: url('../../assets/brand/nullmask-mask.png') center / contain no-repeat;
}

/* ------------------------------------------------------ status LED + pill */

.led {
  display: inline-block;
  width: 9px; height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--nm-lime);
  border: 1px solid var(--nm-black);
  box-shadow: 0 0 0 0 rgba(205, 239, 51, 0.6);
  animation: led 2.4s var(--ease) infinite;
}
@keyframes led {
  0% { box-shadow: 0 0 0 0 rgba(205, 239, 51, 0.55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(205, 239, 51, 0); }
}

/* ---------------------------------------------------- ciphertext bars */

.cipher {
  display: inline-block;
  padding: 2px 8px;
  background: var(--nm-black);
  color: var(--nm-lime);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  border-radius: 3px;
  white-space: pre;
  min-width: 4ch;
  user-select: none;
}
.cipher--lg { font-size: 18px; padding: 4px 12px; }

/* ------------------------------------------------------------ iso icons */

.iso-icon { display: inline-block; width: 84px; height: 84px; flex: none; }
.iso-icon--lg { width: 104px; height: 104px; }
.iso-icon__svg { width: 100%; height: 100%; overflow: visible; }

/* ------------------------------------------------------------- cards */

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  background: var(--nm-bg);
  color: var(--nm-ink);
  border-radius: var(--r);
  border: 1px solid var(--nm-black);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.card h3 { font-size: 17px; line-height: 1.3; font-weight: 500; }
.card p { margin-top: 6px; font-size: 14px; color: var(--nm-muted); }
.section--dark .card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--nm-lime); }

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

.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ----------------------------------------------------------- scroll rail */

.scroll-rail {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 5px;
  z-index: 10000;
  pointer-events: none;
}
.scroll-rail__thumb {
  --t: 0;
  position: absolute;
  right: 0;
  width: 5px;
  height: 14vh;
  top: calc(var(--t) * 86vh);
  background: var(--nm-lime);
}

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

.footer { background: var(--nm-dark); color: var(--nm-bg); padding: 56px 0 40px; border-top: 1px solid var(--nm-dark-line); }
.footer__grid { display: grid; grid-template-columns: auto 1fr; gap: 32px 56px; align-items: center; }
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__brand .nm-wordmark { width: 160px; height: auto; color: var(--nm-bg); }
.footer__brand p { font-size: 13px; color: var(--nm-dark-muted); padding-left: 14px; border-left: 1px solid var(--nm-dark-line); }
.nm-mark--footer { height: 40px; color: var(--nm-bg); }
.footer__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 24px; font-size: 14px; }
.footer__links a { text-decoration: none; color: var(--nm-bg); opacity: 0.85; }
.footer__links a:hover { opacity: 1; color: var(--nm-lime); }
.footer__legal { grid-column: 1 / -1; font-size: 12px; color: var(--nm-dark-muted); padding-top: 24px; border-top: 1px solid var(--nm-dark-line); }

@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr; }
  .footer__links { justify-content: flex-start; }
}

/* ----------------------------------------------------- placeholder dialog */

.gate {
  width: min(440px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--nm-black);
  border-radius: var(--r-lg);
  background: var(--nm-bg);
  color: var(--nm-ink);
  box-shadow: 8px 8px 0 var(--nm-black);
  text-align: center;
}
.gate::backdrop { background: rgba(14, 15, 15, 0.72); backdrop-filter: blur(3px); }
.gate[open] { animation: gate-in 380ms var(--ease-out); }
@keyframes gate-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.gate__crate { width: 180px; margin: -4px auto 12px; }
.gate h2 { font-size: 24px; line-height: 1.2; font-weight: 600; }
.gate p { margin-top: 10px; color: var(--nm-muted); font-size: 15px; }
.gate .gate__small { font-size: 13px; }
.gate__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.gate__close {
  position: absolute; top: 12px; right: 12px;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--nm-black);
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
}
.gate__close svg { width: 14px; height: 14px; }
.gate__close:hover { background: var(--nm-lime); }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
