
:root {
  --ground: #15403f;
  --ground-dark: #0d2b2a;
  --ground-deep: #081c1b;
  --bone: #e9ece5;
  --bone-dim: #a4b8b4;
  --brass: #d4a853;
  --brass-dim: #9e7b35;
  --line: rgba(233, 236, 229, 0.12);
  --line-active: rgba(212, 168, 83, 0.45);
  --line-strong: rgba(233, 236, 229, 0.28);
  --danger: #d9534f;
  --danger-bg: rgba(217, 83, 79, 0.15);
  --success: #5cb85c;
  --success-bg: rgba(92, 184, 92, 0.15);

  --bahu-3a6: 'Syne', system-ui, -apple-system, sans-serif;
  --bahu-ed8: 'Bitter', Georgia, serif;
  --bahu-b8c: 'JetBrains Mono', ui-monospace, monospace;

  --ease-hud: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-kinetic: cubic-bezier(0.2, 0, 0, 1);
  --dur-rapid: 140ms;
  --dur-base: 240ms;
  --dur-deliberate: 420ms;

  --shell-max: 1440px;
  --gutter: clamp(1rem, 3.5vw, 3rem);
  --rail-width: 280px;

  --step--2: clamp(0.6944rem, 0.65rem + 0.22vw, 0.8rem);
  --step--1: clamp(0.8333rem, 0.78rem + 0.27vw, 0.96rem);
  --bahu-daa: clamp(1rem, 0.94rem + 0.31vw, 1.15rem);
  --bahu-ea2: clamp(1.2rem, 1.1rem + 0.5vw, 1.44rem);
  --bahu-f71: clamp(1.44rem, 1.28rem + 0.8vw, 1.82rem);
  --bahu-a10: clamp(1.728rem, 1.48rem + 1.24vw, 2.33rem);
  --bahu-eee: clamp(2.0736rem, 1.7rem + 1.87vw, 2.98rem);
  --bahu-d7c: clamp(2.4883rem, 1.94rem + 2.74vw, 3.82rem);
  --bahu-300: clamp(2.986rem, 2.2rem + 3.93vw, 4.88rem);

  --space-3xs: clamp(0.25rem, 0.22rem + 0.15vw, 0.35rem);
  --space-2xs: clamp(0.5rem, 0.45rem + 0.25vw, 0.7rem);
  --space-xs: clamp(0.75rem, 0.68rem + 0.35vw, 1rem);
  --space-s: clamp(1rem, 0.9rem + 0.5vw, 1.4rem);
  --space-m: clamp(1.5rem, 1.35rem + 0.75vw, 2.1rem);
  --space-l: clamp(2rem, 1.8rem + 1vw, 2.8rem);
  --space-xl: clamp(3rem, 2.6rem + 2vw, 4.2rem);
  --space-2xl: clamp(4rem, 3.4rem + 3vw, 6rem);
  --space-3xl: clamp(5.5rem, 4.5rem + 5vw, 8.5rem);
}

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

html {
  font-size: 16px;
  background-color: var(--ground);
  color: var(--bone);
  font-family: var(--bahu-ed8);
  font-weight: 400;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background-color: var(--ground);
  color: var(--bone);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;

  overflow-x: hidden;
  background-image: 
    linear-gradient(to right, rgba(233, 236, 229, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(233, 236, 229, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

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

a {
  color: var(--bone);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-rapid) var(--ease-hud);
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 0;
}

button {
  cursor: pointer;
  user-select: none;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--bahu-3a6);
  font-weight: 700;
  line-height: 1.1;
  color: var(--bone);
  text-wrap: balance;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--bahu-d7c);

  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--bahu-eee);
  font-weight: 700;
}

h3 {
  font-size: var(--bahu-f71);
  font-weight: 600;
}

h4 {
  font-size: var(--bahu-ea2);
  font-weight: 600;
}

p {
  color: var(--bone);
  max-width: 68ch;
  font-size: var(--bahu-daa);
  line-height: 1.65;
}

p + p { margin-top: var(--space-s); }

p.standfirst {
  font-size: var(--bahu-ea2);
  line-height: 1.45;
  color: #ffffff !important;
  font-weight: 500;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.8);
}

small, .meta {
  font-family: var(--bahu-b8c);
  font-size: var(--step--1);
  color: var(--bone-dim);
  letter-spacing: 0.02em;
}

code, kbd, samp, pre {
  font-family: var(--bahu-b8c);
  font-size: var(--step--1);
}

em { font-style: italic; }

strong {
  font-weight: 600;
  color: var(--bone);
}

::selection {
  background: var(--brass);
  color: var(--ground-deep);
}

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

/* Layout primitives */
.shell-container {
  width: 100%;
  max-width: var(--shell-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.hud-bracket { position: relative; }

.hud-bracket::before,
.hud-bracket::after {
  content: "";
  position: absolute;
  width: 8px;

  height: 8px;
  pointer-events: none;
  border: 1px solid var(--brass-dim);
  z-index: 2;
}

.hud-bracket::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.hud-bracket::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

.hud-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--bahu-b8c);
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  background-color: var(--ground-dark);
  color: var(--brass);
  border: 1px solid var(--line-active);
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  flex-shrink: 0;
}

.hud-tag-dim {
  color: var(--bone-dim);
  border-color: var(--line);
}

.icon {
  width: 1.2em;
  height: 1.2em;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  background: var(--brass);
  color: var(--ground-deep);
  padding: 0.8rem 1.4rem;
  font-family: var(--bahu-b8c);
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  border: 2px solid var(--bone);
  transition: top var(--dur-rapid) var(--ease-hud);
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--ground-deep);
}

/* Screen reader utility */
.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;
}

/* Reduced motion */
@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;
  }
}

.grid-shell {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(1rem, 2vw, 2rem);
  row-gap: var(--space-l);
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }

@media (max-width: 900px) {
  .col-8, .col-6, .col-4 { grid-column: span 12; }
}

@media (max-width: 480px) {
  .grid-shell > .col-6 { grid-column: span 12 !important; }
}

.flow > * + * { margin-top: var(--space-m); }

.flow-tight > * + * { margin-top: var(--space-xs); }

.flow-loose > * + * { margin-top: var(--space-xl); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

.cluster-wide {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
  align-items: center;
}

.repel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-s);
}

/* Subtle interface scanline background layer */
.scanline-overlay { position: relative; }

.scanline-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(233, 236, 229, 0) 0px,
    rgba(233, 236, 229, 0) 2px,
    rgba(233, 236, 229, 0.015) 3px,
    rgba(233, 236, 229, 0) 4px
  );
  z-index: 1;
}
