/* Heimdall Research — Instrument */

@font-face {
  font-family: "IBM Plex Sans Fallback";
  src: local("Arial");
  size-adjust: 102%;
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "IBM Plex Mono Fallback";
  src: local("Courier New");
  size-adjust: 100%;
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #0b0d10;
  --ground-2: #12161b;
  --rule: rgba(236, 239, 242, 0.1);
  --rule-strong: rgba(236, 239, 242, 0.22);
  --ink: #eceff2;
  --ink-2: #a9b1ba;
  --ink-3: #9aa3ad;
  --signal: #f2a93b;
  --scrim: linear-gradient(
    180deg,
    rgba(11, 13, 16, 0) 35%,
    rgba(11, 13, 16, 0.72) 72%,
    #0b0d10 100%
  );
  --font-sans: "IBM Plex Sans", "IBM Plex Sans Fallback", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "IBM Plex Mono Fallback", "Courier New", monospace;
  --wrap: 1320px;
  --gutter: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --space-9: 112px;
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }
}

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

html {
  scroll-behavior: smooth;
  background: var(--ground);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
}

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

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--signal);
}

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

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  list-style: none;
  padding: 0;
}

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  transform: translateY(-120%);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--ground-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(var(--space-3));
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 13, 16, 0.88);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(8px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 56px;
}

.brand {
  view-transition-name: brand;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: flex-end;
}

.site-nav a {
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

/* Hero */

.hero {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 78svh;
  overflow: hidden;
  background-color: var(--ground-2);
  background-image: url("data:image/webp;base64,UklGRtIAAABXRUJQVlA4IMYAAAAwBQCdASogABIAPxFwr1AsJiQisAgBgCIJZwDOPbASA4k/HKSSmQPB9FDUxUPidfaMoAD+hbb+NukBdz2u+fioEzKgAV/hgxS8bE2aIqj+jMOWoqQskvvW6QfDKzorAa2vW82dkMpYNdSEEOQrrePK3AOo22AawmSppcDZVlQrvIrC/uuo5BabaYCiKFmNEYq/tPsCsCP4vRnTdVzCdji8ZoRELGeZkYKJs53rE9Fnl+A/05N4NFwTvrrMq84Ww58ATf+IAAA=");
  background-position: center;
  background-size: cover;
}

@media (min-width: 641px) {
  .hero {
    height: min(88svh, 860px);
    min-height: min(88svh, 860px);
  }
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__base,
.hero__change {
  position: absolute;
  inset: 0;
}

.hero__base img,
.hero__change img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__change {
  opacity: 0.7;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero__graticule {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__graticule line,
.hero__graticule path {
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  pointer-events: none;
}

.hero__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}

.hero__scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--signal);
  box-shadow: 0 0 12px rgba(242, 169, 59, 0.35);
}

.hero__readout {
  position: absolute;
  top: var(--space-5);
  right: var(--gutter);
  z-index: 2;
  max-width: min(100% - (var(--gutter) * 2), 28rem);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-align: right;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(11, 13, 16, 0.8);
}

.hero__copy {
  position: relative;
  z-index: 2;
  padding-bottom: var(--space-8);
}

.hero h1 {
  max-width: 18ch;
  color: var(--ink);
  font-size: clamp(2.4rem, 1.2rem + 4.6vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.hero__sub {
  max-width: 42ch;
  margin-top: var(--space-5);
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-5);
  border: 1px solid var(--signal);
  background: var(--signal);
  color: #1a1208;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.action:hover {
  color: #1a1208;
  filter: brightness(1.05);
}

.action--ghost {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink);
}

.action--ghost:hover {
  border-color: var(--signal);
  color: var(--signal);
  filter: none;
}

.hero__credit {
  position: absolute;
  right: var(--gutter);
  bottom: var(--space-4);
  z-index: 2;
  max-width: min(42ch, calc(100% - var(--gutter) * 2));
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.4;
  text-align: right;
}

/* Sections */

.section {
  padding-block: var(--space-8);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-9);
  }
}

.section__head {
  margin-bottom: var(--space-7);
}

.section__rule {
  height: 1px;
  margin-bottom: var(--space-4);
  background: var(--rule-strong);
  transform-origin: left center;
}

.section__index {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section h2 {
  margin-top: var(--space-4);
  max-width: 28ch;
  color: var(--ink);
  font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.section h3 {
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.section p {
  max-width: 64ch;
  margin-top: var(--space-3);
  color: var(--ink-2);
  font-size: 1.0625rem;
}

/* Figures */

.figure-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .figure-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-7);
  }
}

.figure {
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
}

.figure__value {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(2rem, 1.4rem + 2vw, 3.25rem);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.figure__value::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--space-3);
  margin-bottom: 0.35em;
  background: var(--signal);
  vertical-align: middle;
}

.figure__label {
  margin-top: var(--space-4);
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.figure__source {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.45;
}

.figure__source a {
  color: var(--ink-3);
}

.figure__source a:hover {
  color: var(--signal);
}

/* Practice panels */

.panel-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .panel-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);
  }
}

.panel {
  padding: var(--space-6);
  background: var(--ground-2);
  border: 1px solid var(--rule);
}

.panel__plate {
  margin-top: var(--space-6);
  border: 1px solid var(--rule);
  background: #0a0c0f;
}

.panel__plate--ledger svg,
.case-plate__art svg {
  width: 100%;
  height: auto;
}

.panel__plate--ledger line,
.case-plate__art line {
  stroke: var(--rule-strong);
  stroke-width: 1;
}

.panel__plate--ledger .mark,
.case-plate__art .mark {
  fill: var(--signal);
}

.panel__plate--diptych,
.case-plate__art--diptych {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
}

.panel__plate--diptych img,
.case-plate__art--diptych img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.panel__credit {
  margin-top: var(--space-3);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

/* Services */

.service-grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 768px) {
  .service-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1100px) {
  .service-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.service {
  padding: var(--space-5);
  border-top: 1px solid var(--rule-strong);
}

.service__index {
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.service h3 {
  margin-top: var(--space-3);
}

.services-close {
  margin-top: var(--space-7);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* Cases */

.case-grid {
  display: grid;
  gap: var(--space-6);
}

.case-plate {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--ground-2);
  border: 1px solid var(--rule);
}

@media (min-width: 900px) {
  .case-plate {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: stretch;
  }
}

.case-plate__label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-plate h3 {
  margin-top: var(--space-3);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.chip-row li {
  padding: 0.2em 0.55em;
  border: 1px solid var(--rule-strong);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-plate__art {
  min-height: 160px;
  border: 1px solid var(--rule);
  background: #0a0c0f;
}

/* Sources */

.source-list {
  display: grid;
  gap: var(--space-3) var(--space-7);
  column-count: 1;
}

@media (min-width: 700px) {
  .source-list {
    grid-template-columns: 1fr 1fr;
  }
}

.source-list li {
  padding-block: var(--space-3);
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* About / contact */

.contact-lead {
  margin-top: var(--space-7);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.contact-email {
  margin-top: var(--space-4);
}

.contact-email a {
  color: var(--ink);
  font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: none;
}

.contact-email a:hover {
  color: var(--signal);
}

/* Entry row (future papers/datasets) */

.entry-row {
  display: grid;
  gap: var(--space-2);
  padding-block: var(--space-5);
  border-top: 1px solid var(--rule);
}

.entry-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-row__title {
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
}

.entry-row__summary {
  color: var(--ink-2);
  font-size: 1rem;
}

.entry-row__source {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Interior pages */

.page {
  padding-block: var(--space-8) var(--space-9);
}

.page h1 {
  color: var(--ink);
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.page .lede {
  max-width: 54ch;
  margin-top: var(--space-5);
  color: var(--ink-2);
  font-size: 1.0625rem;
}

.prose {
  max-width: 64ch;
  margin-top: var(--space-7);
}

.prose p + p {
  margin-top: var(--space-4);
}

.prose a {
  color: var(--ink);
}

/* Footer */

.site-footer {
  padding-block: var(--space-7) var(--space-8);
  border-top: 1px solid var(--rule);
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-footer p,
.site-footer__credit {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.site-footer__credit {
  margin-top: var(--space-4);
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-links a {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .hero__change {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    animation: acquire 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s forwards;
  }

  .hero__scan {
    opacity: 1;
    transform: translateY(-100%);
    animation: sweep 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s forwards;
  }

  .hero__sub,
  .hero__actions {
    opacity: 0;
    translate: 0 8px;
    animation: rise 0.6s ease-out 1.2s forwards;
  }

  @supports (animation-timeline: view()) {
    .section__rule {
      transform: scaleX(0);
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }

    /* Translate only — never opacity — so contrast stays valid while the timeline runs. */
    .reveal {
      translate: 0 10px;
      animation: lift linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }
}

@keyframes acquire {
  to {
    clip-path: inset(0);
    opacity: 0.7;
  }
}

@keyframes sweep {
  to {
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 8px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes lift {
  from {
    translate: 0 10px;
  }
  to {
    translate: 0 0;
  }
}

@keyframes draw {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
}

