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

* {
  margin: 0;
}

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

html.is-loading,
html.menu-open {
  overflow: hidden;
}

body {
  min-height: 100vh;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: clamp(1.06rem, 0.98rem + 0.3vw, 1.2rem);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.04em;
}

::selection {
  background: var(--blood-bright);
  color: var(--bone);
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--blood-deep), var(--blood));
  border: 2px solid var(--ink);
}

[hidden] {
  display: none !important;
}

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

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-loader) + 1);
  padding: 10px 16px;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-mono);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

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

.noise {
  position: fixed;
  inset: -50%;
  z-index: var(--z-overlay);
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
  100% { transform: translate(1%, 3%); }
}

.hud-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--animus);
  opacity: 0.85;
}

.hud-label::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.section {
  position: relative;
  padding-block: var(--section-space);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(164, 22, 26, 0.08), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='73.5' viewBox='0 0 28 49'%3E%3Cpath fill='rgba(207,232,255,0.035)' d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/svg%3E"),
    var(--ink);
  transition: background-color 0.6s;
}

.section + .section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(560px, 70%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

.section__head {
  display: grid;
  justify-items: center;
  gap: 18px;
  margin-bottom: clamp(48px, 7vw, 80px);
  text-align: center;
}

.section__title {
  font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone);
}

.section__intro {
  max-width: 60ch;
  color: var(--bone-dim);
  font-style: italic;
}

.ornament {
  position: relative;
  width: min(320px, 70%);
  height: 12px;
}

.ornament::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
}

.ornament::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 1px solid var(--gold);
  background: var(--ink);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 0 4px var(--ink), 0 0 12px rgba(176, 141, 87, 0.5);
}

.frame {
  position: relative;
}

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid var(--gold);
  pointer-events: none;
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out);
}

.frame::before {
  top: -8px;
  left: -8px;
  border-right: 0;
  border-bottom: 0;
}

.frame::after {
  right: -8px;
  bottom: -8px;
  border-left: 0;
  border-top: 0;
}

.noscript {
  padding: 40px var(--gutter);
  text-align: center;
  font-family: var(--font-mono);
  color: var(--animus);
}

.motion [data-reveal]:not(.is-revealed) {
  opacity: 0;
  transform: translateY(36px);
}

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

  .noise {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
