/* ==========================================================================
   nullstate.io — legal.css (0.7.0)
   Shared optical frame & reading typography for /privacy, /data-deletion, /404
   Single accent hue: Crimson #c8102e. Zero third-party requests.
   ========================================================================== */

:root {
  --ns-ink: #0a0a0c;
  --ns-surface: #101014;
  --ns-rule: #1d1d24;
  --ns-rule-hi: #2e2e38;
  --ns-gray-dim: #5c5c68;   /* decorative non-reading ticks & borders (3.0:1) */
  --ns-gray: #8a8a94;       /* reading metadata & labels (5.8:1 on #0a0a0c) */
  --ns-gray-hi: #a8a8b6;    /* secondary reading copy (8.5:1 on #0a0a0c) */
  --ns-cream: #eceae4;      /* primary reading copy (16.5:1 on #0a0a0c) */
  --ns-crimson: #c8102e;    /* sole chromatic accent */

  --font-display: "Soehne Breit", "Archivo", sans-serif;
  --font-mono: "Berkeley Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--ns-ink);
  color: var(--ns-cream);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.74;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

::selection {
  background: var(--ns-crimson);
  color: var(--ns-cream);
}

/* ==========================================================================
   Leica Viewfinder Outer Shell
   ========================================================================== */
.leica-shell {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 38px) clamp(16px, 4vw, 56px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(24px, 4vh, 52px);
}

/* ==========================================================================
   Top Rangefinder Bar: Mark + Wordmark + Interactive Vernier Scale + Telemetry
   ========================================================================== */
.top-vernier {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ns-rule);
  position: relative;
  text-transform: lowercase;
}

.top-vernier::before {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 28px;
  height: 1px;
  background-color: var(--ns-crimson);
}

.brand-unit {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  position: relative;
  text-decoration: none;
  color: var(--ns-cream);
  padding: 2px 4px 2px 0;
  outline: none;
}

.brand-unit:focus-visible {
  outline: 1px solid var(--ns-crimson);
  outline-offset: 4px;
}

/* Mark laws: exact geometry, standard (>24px) and small (<=24px) cuts */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  position: relative;
  color: var(--ns-cream);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-mark .rf-ghost {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  transform: translateX(var(--rf, 0px));
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease;
  pointer-events: none;
}

.brand-mark .cut-small {
  display: none;
}

@media (max-width: 520px) {
  .brand-mark {
    width: 22px;
    height: 22px;
  }
  .brand-mark .rf-ghost {
    display: none;
  }
  .brand-mark .cut-regular {
    display: none;
  }
  .brand-mark .cut-small {
    display: block;
  }
}

/* Wordmark: null 700 cream, state 900 Extrafett crimson, no space */
.wordmark {
  font-family: var(--font-mono);   /* the wordmark is Berkeley Mono: null regular, state bold crimson */
  font-size: clamp(20px, 2.1vw, 26px);
  line-height: 1;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  user-select: none;
}

.wordmark-null {
  font-weight: 400;
  color: var(--ns-cream);
}

.wordmark-state,
.wordmark b {
  font-weight: 700;
  color: var(--ns-crimson);
}

/* Engraved lens barrel scale (interactive detents, >=10px & 5.8:1 contrast) */
.vernier-rail {
  position: relative;
  height: 24px;
  margin: 0 12px;
  user-select: none;
}

.vernier-rail .ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  height: 6px;
  opacity: 0.75;
  background-image: repeating-linear-gradient(
    to right,
    var(--ns-rule-hi) 0 1px,
    transparent 1px 8px
  );
  pointer-events: none;
}

.vernier-rail .d {
  position: absolute;
  top: 11px;
  transform: translateX(-50%);
  font: 10px/1 var(--font-mono);
  color: var(--ns-gray);
  cursor: pointer;
  padding: 2px 3px;
  transition: color 140ms ease;
}

.vernier-rail .d::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  width: 1px;
  height: 8px;
  background: var(--ns-rule-hi);
}

.vernier-rail .d:hover,
.vernier-rail .d.hit {
  color: var(--ns-cream);
  font-weight: 700;
}

.vernier-rail .d.hit::before {
  background: var(--ns-crimson);
}

.vernier-rail .ix {
  position: absolute;
  top: -3px;
  width: 5px;
  height: 5px;
  background: var(--ns-crimson);
  transform: translateX(-2px);
  transition: left 180ms steps(3, end);
  pointer-events: none;
}

@media (max-width: 760px) {
  .vernier-rail {
    display: none;
  }
  .top-vernier {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }
}

.optical-telemetry {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  color: var(--ns-gray);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
}

@media (max-width: 520px) {
  .optical-telemetry span:not(#hud-lock) {
    display: none;
  }
}

.optical-telemetry .crimson-index {
  color: var(--ns-crimson);
  font-weight: 700;
}

/* ==========================================================================
   Legal Reading Architecture (/privacy & /data-deletion)
   ========================================================================== */
.reading-stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  padding: clamp(8px, 2.5vh, 32px) 0 clamp(28px, 5vh, 56px);
}

@media (min-width: 1080px) {
  .reading-stage {
    grid-template-columns: 220px minmax(0, 65ch) 1fr;
    column-gap: clamp(32px, 5vw, 72px);
  }
}

/* Left Margin Optical Rail (Desktop sticky sidebar; Mobile horizontal index bar) */
.margin-datum {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--ns-gray);
  text-transform: lowercase;
}

@media (min-width: 1080px) {
  .margin-datum {
    position: sticky;
    top: 40px;
    padding-top: 8px;
    gap: 24px;
  }
}

.datum-block {
  border-left: 1px solid var(--ns-rule-hi);
  padding-left: 12px;
  display: none;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 1080px) {
  .datum-block {
    display: flex;
  }
}

.datum-label {
  color: var(--ns-gray);
  letter-spacing: 0.06em;
  font-size: 10px;
}

.datum-val {
  color: var(--ns-cream);
  font-size: 11px;
  font-weight: 700;
}

.datum-rail-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  border-bottom: 1px solid var(--ns-rule);
  padding-bottom: 12px;
}

@media (min-width: 1080px) {
  .datum-rail-list {
    flex-direction: column;
    gap: 10px;
    border-bottom: none;
    border-left: 1px solid var(--ns-rule);
    padding-bottom: 0;
    padding-left: 12px;
  }
}

.datum-rail-item {
  position: relative;
}

.datum-rail-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ns-gray);
  text-decoration: none;
  padding: 2px 4px;
  transition: color 140ms ease;
}

.datum-rail-link:hover,
.datum-rail-link:focus-visible {
  color: var(--ns-cream);
}

.datum-rail-link:focus-visible {
  outline: 1px solid var(--ns-crimson);
  outline-offset: 2px;
}

@media (min-width: 1080px) {
  .datum-rail-item::before {
    content: "";
    position: absolute;
    left: -13px;
    top: 5px;
    width: 2px;
    height: 12px;
    background-color: var(--ns-crimson);
    transform: scaleY(0);
    transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .datum-rail-item.is-active::before {
    transform: scaleY(1);
  }
}

.datum-rail-item.is-active .datum-rail-link {
  color: var(--ns-cream);
  font-weight: 700;
}

.datum-rail-num {
  color: var(--ns-gray);
  font-size: 10px;
}

.datum-rail-item.is-active .datum-rail-num {
  color: var(--ns-cream);   /* reading text stays >= 4.5:1; the crimson bar beside it marks the active section */
}

/* At-a-glance Dossier Spec Box in the margin */
.datum-spec-box {
  display: none;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--ns-rule);
  background-color: var(--ns-surface);
  padding: 10px 12px;
}

@media (min-width: 1080px) {
  .datum-spec-box {
    display: flex;
  }
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 10.5px;
}

.spec-k {
  color: var(--ns-gray);
}

.spec-v {
  color: var(--ns-cream);
  font-weight: 700;
}

/* Primary Reading Sheet */
.legal-sheet {
  width: 100%;
  max-width: 65ch;
  margin: 0 auto;
  position: relative;
}

@media (min-width: 1080px) {
  .legal-sheet {
    margin: 0;
  }
}

/* Document Header inside Reading Sheet: Söhne Breit 900 Extrafett */
.legal-sheet h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.036em;
  color: var(--ns-cream);
  margin: 0 0 10px;
  min-height: 1.06em;
}

.legal-sheet p.meta {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ns-gray);
  margin: 0 0 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ns-rule);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legal-sheet p.meta::before,
.legal-sheet p.meta::after {
  content: "";
  position: absolute;
  bottom: -3px;
  width: 6px;
  height: 5px;
  border-top: 1px solid var(--ns-crimson);
  border-bottom: 1px solid var(--ns-crimson);
}

.legal-sheet p.meta::before {
  left: 0;
}

.legal-sheet p.meta::after {
  right: 0;
}

/* Section Headings (h2) */
.legal-sheet h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ns-cream);
  margin: 42px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--ns-rule);
  position: relative;
  scroll-margin-top: 32px;
}

.legal-sheet h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 18px;
  height: 1px;
  background-color: var(--ns-crimson);
}

/* Body Paragraphs: 15px, 60-65ch measure, 16.5:1 contrast */
.legal-sheet p {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ns-cream);
  margin: 0 0 16px;
  overflow-wrap: break-word;
}

/* Inline Links in Reading Text */
.legal-sheet a {
  color: var(--ns-cream);
  text-decoration: underline;
  text-decoration-color: var(--ns-crimson);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  padding: 1px 2px;
  margin: 0 -2px;
  transition: color 120ms ease, background-color 120ms ease, text-decoration-color 120ms ease;
}

.legal-sheet a:hover {
  background-color: rgba(200, 16, 46, 0.16);
  color: var(--ns-cream);
}

.legal-sheet a:focus-visible {
  outline: 1px solid var(--ns-crimson);
  outline-offset: 2px;
  background-color: rgba(200, 16, 46, 0.2);
  text-decoration: none;
}

.legal-sheet > p:last-child {
  margin-top: 24px;
}

/* ==========================================================================
   404 Out-of-Focus Rangefinder Stage (404.html)
   ========================================================================== */
.page-404 .vernier-rail .ix {
  left: 103.5%;
}

.page-404.is-coincident .vernier-rail .ix {
  left: 98%;
}

.stage-404 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(16px, 4.5vh, 52px) 0;
  position: relative;
}

.upper-404 {
  padding-bottom: clamp(28px, 5vh, 52px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .upper-404 {
    grid-template-columns: 8fr 4fr;
    align-items: end;
  }
}

.focus-patch-404 {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 780px;
  position: relative;
}

.eyebrow-404 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ns-crimson);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reticle-frame-404 {
  display: inline-flex;
  padding: 6px 14px 10px 0;
  position: relative;
  align-self: flex-start;
}

/* Doubled Rangefinder Headline ("not here.") in Söhne Breit 900 Extrafett */
.double-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 6.8vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--ns-cream);
  position: relative;
  display: inline-block;
  --split-x: 5.5px;
  --split-y: -3.2px;
}

.double-title::before {
  content: attr(data-ghost);
  position: absolute;
  inset: 0;
  color: var(--ns-cream);
  opacity: 0.32;
  transform: translate(var(--split-x, 5.5px), var(--split-y, -3.2px));
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease;
  pointer-events: none;
  user-select: none;
}

.double-title::after {
  content: attr(data-ghost);
  position: absolute;
  inset: 0;
  color: var(--ns-crimson);
  opacity: 0.44;
  transform: translate(calc(var(--split-x, 5.5px) * -0.65), calc(var(--split-y, -3.2px) * -0.5));
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease;
  pointer-events: none;
  user-select: none;
}

.page-404.is-coincident .double-title::before,
.page-404.is-coincident .double-title::after {
  transform: translate(0, 0);
  opacity: 0;
}

.meta-404 {
  font-family: var(--font-mono);
  font-size: clamp(14.5px, 1.35vw, 16.5px);
  line-height: 1.55;
  color: var(--ns-cream);
  max-width: 58ch;
  margin: 0;
}

.sub-404 {
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ns-gray-hi);
  max-width: 58ch;
}

/* Coincidence Telemetry Meter on 404 */
.coincidence-meter {
  justify-self: start;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ns-gray);
  border-left: 1px solid var(--ns-rule-hi);
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  user-select: none;
  text-transform: lowercase;
}

@media (min-width: 900px) {
  .coincidence-meter {
    justify-self: end;
  }
}

.coincidence-meter .meter-val {
  color: var(--ns-cream);
  font-size: 12px;
  font-weight: 700;
}

.coincidence-meter .meter-val.crimson {
  color: var(--ns-crimson);
}

.coincidence-meter .meter-path {
  color: var(--ns-gray);
  font-size: 10.5px;
}

/* Horizon Datum Line */
.horizon-datum {
  position: relative;
  width: 100%;
  height: 2px;
  background-color: var(--ns-rule);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.horizon-datum::before,
.horizon-datum::after {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1px solid var(--ns-crimson);
  border-bottom: 1px solid var(--ns-crimson);
}

/* Lower Return Action Card */
.lower-404 {
  padding-top: clamp(28px, 5vh, 52px);
}

.return-grid {
  max-width: 440px;
  border: 1px solid var(--ns-rule);
}

.return-node {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 114px;
  padding: 18px 20px 16px;
  text-decoration: none;
  color: var(--ns-cream);
  position: relative;
  outline: none;
  transition: background-color 140ms ease;
}

.return-node::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background-color: var(--ns-crimson);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.return-node::after {
  content: "";
  position: absolute;
  inset: 7px;
  --c: var(--ns-cream);
  background:
    linear-gradient(var(--c), var(--c)) left top / 9px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left top / 1px 9px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 9px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 1px 9px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 9px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 1px 9px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 9px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 1px 9px no-repeat;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 120ms linear, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.return-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.return-index {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  color: var(--ns-gray);
  transition: color 140ms ease;
}

.return-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ns-gray);
  transition: color 140ms ease;
}

.return-body {
  margin-top: 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.return-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(15px, 1.4vw, 18px);
  letter-spacing: -0.02em;
  color: var(--ns-cream);
}

.return-endpoint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ns-gray);
  transition: color 140ms ease;
}

.return-node:hover,
.return-node:focus-visible {
  background-color: rgba(16, 16, 20, 0.9);
}

.return-node:hover::before,
.return-node:focus-visible::before {
  transform: scaleY(1);
}

.return-node:hover::after,
.return-node:focus-visible::after {
  opacity: 0.88;
  transform: none;
}

.return-node:hover .return-index,
.return-node:focus-visible .return-index {
  color: var(--ns-crimson);
}

.return-node:hover .return-label,
.return-node:focus-visible .return-label,
.return-node:hover .return-endpoint,
.return-node:focus-visible .return-endpoint {
  color: var(--ns-cream);
}

.return-node:focus-visible {
  outline: 1px solid var(--ns-crimson);
  outline-offset: -1px;
}

.tail-glitch {
  color: var(--ns-crimson);
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.leica-footer {
  border-top: 1px solid var(--ns-rule);
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ns-gray);
  text-transform: lowercase;
}

.footer-copy {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footer-dot {
  color: var(--ns-gray-dim);
  user-select: none;
}

.footer-link {
  color: var(--ns-gray);
  text-decoration: none;
  padding: 1px 4px;
  transition: color 120ms ease;
}

.footer-link:hover,
.footer-link:focus-visible,
.footer-link[aria-current="page"] {
  color: var(--ns-cream);
}

.footer-link[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--ns-crimson);
  text-underline-offset: 4px;
}

.footer-link:focus-visible {
  outline: 1px solid var(--ns-crimson);
  outline-offset: -1px;
}

.footer-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer-version {
  font-size: 11px;
  color: var(--ns-gray);
  user-select: none;
}

.footer-mark {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  color: var(--ns-cream);
}

.footer-mark svg {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Reduced Motion Law: Every state change lands immediately
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html, body {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
