:root {
  --bg: #05040a;
  --bg-2: #0b0a12;
  --bg-3: #12101a;
  --ink: #f7eedc;
  --ink-2: #cbbca0;
  --muted: #8a7d68;
  --line: #1c1812;
  --line-2: #3a3224;
  --lamp: #ffd27a;
  --lamp-hot: #ffe9b0;
  --accent: #ffd27a;
  --accent-ink: #1a1204;
  --stamp: #e11d3a;
  --max: 1120px;
  --nav-h: 4.25rem;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Figtree", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 1.05rem;
  min-height: 100%;
}

.grain,
.grain::after {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 90;
}

.grain {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grain::after {
  content: "";
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 1;
  z-index: 89;
}

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

a {
  color: inherit;
}

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

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

::selection {
  background: var(--lamp);
  color: var(--accent-ink);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--lamp);
  color: var(--accent-ink);
  padding: 0.6rem 0.9rem;
  z-index: 100;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.top-stage {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 70% 55% at 46% 10%, rgba(255, 196, 110, 0.18), transparent 58%),
    var(--bg);
}

.top-stage::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 36rem;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 17px,
    rgba(0, 0, 0, 0.35) 17px 19px
  );
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.lamp-rig {
  position: absolute;
  top: calc(var(--nav-h) - 14px);
  left: 46%;
  width: 160px;
  z-index: 12;
  pointer-events: none;
}

.lamp-swing {
  transform-origin: 80px 0;
  animation: swing 8s ease-in-out infinite;
}

.lamp-cord {
  display: block;
  width: 3px;
  height: 34px;
  margin: 0 auto;
  background: linear-gradient(#7a5a22, #e0b75a);
  box-shadow: 0 0 8px rgba(255, 210, 120, 0.4);
}

.lamp {
  display: block;
  width: 160px;
  height: 88px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}

.lamp-flare {
  display: block;
  width: 90px;
  height: 90px;
  margin: -28px auto 0;
  background: radial-gradient(circle, rgba(255, 236, 180, 0.95) 0%, rgba(255, 196, 90, 0.35) 34%, transparent 70%);
  mix-blend-mode: screen;
  animation: glow 7s ease-in-out infinite;
}

.beam {
  position: absolute;
  top: calc(var(--nav-h) + 86px);
  left: 46%;
  width: 1250px;
  height: 720px;
  transform: translateX(-48%);
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 220, 150, 0.38) 0%,
    rgba(255, 196, 110, 0.16) 28%,
    rgba(255, 170, 70, 0.06) 58%,
    transparent 100%
  );
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  filter: blur(3px);
  mix-blend-mode: screen;
  animation: glow 7s ease-in-out infinite;
}

.beam::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 240, 200, 0.55) 0.7px, transparent 0.8px);
  background-size: 22px 22px;
  opacity: 0.18;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

@keyframes swing {
  0%,
  100% {
    transform: rotate(-1.35deg);
  }
  50% {
    transform: rotate(1.35deg);
  }
}

@keyframes glow {
  0%,
  100% {
    opacity: 0.92;
  }
  41% {
    opacity: 1;
  }
  43% {
    opacity: 0.78;
  }
  46% {
    opacity: 1;
  }
  78% {
    opacity: 0.94;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(to bottom, rgba(5, 4, 10, 0.2), rgba(5, 4, 10, 0.05));
  border-bottom: 1px solid rgba(255, 210, 140, 0.08);
}

.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.92rem;
  text-shadow: 0 0 18px rgba(255, 210, 120, 0.25);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 210, 140, 0.35);
  box-shadow: 0 0 16px rgba(255, 200, 100, 0.25);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
}

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

.kicker {
  font-family: "Special Elite", "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lamp);
  margin: 0 0 0.85rem;
  text-shadow: 0 0 12px rgba(255, 200, 100, 0.35);
}

h1,
h2,
h3 {
  font-family: "Newsreader", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  color: #fff6e4;
  text-shadow:
    0 0 28px rgba(255, 200, 110, 0.28),
    0 2px 0 rgba(0, 0, 0, 0.35);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h3 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.18rem;
  max-width: 42rem;
  color: var(--ink-2);
}

.hl {
  box-shadow: inset 0 -0.22em 0 rgba(255, 210, 122, 0.85);
}

.hero {
  position: relative;
  z-index: 5;
  padding: 3.4rem 0 2.6rem;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 2.6rem;
  align-items: stretch;
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 5;
}

.hero-copy .lede {
  margin: 1.15rem 0 0;
}

.hero-art {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  z-index: 5;
}

.hero-art img {
  width: 100%;
  height: 100%;
  min-height: 18rem;
  object-fit: cover;
  border: 1px solid rgba(255, 210, 140, 0.18);
  box-shadow:
    0 0 0 1px #000,
    var(--shadow),
    0 0 40px rgba(255, 180, 80, 0.08);
}

.hero-art figcaption {
  font-family: "Special Elite", "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.65rem;
}

.stats {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-2);
  background: rgba(8, 7, 12, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 210, 140, 0.08);
}

.stat {
  padding: 1.15rem 1.25rem;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat b {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
  color: var(--lamp-hot);
}

.stat span {
  color: var(--muted);
  font-size: 0.92rem;
}

#index,
#method {
  scroll-margin-top: calc(var(--nav-h) + 0.75rem);
}

.section {
  position: relative;
  z-index: 5;
  padding: 4.2rem 0;
}

.section.tight {
  padding-top: 2.4rem;
}

.section-head {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  margin-bottom: 2.2rem;
  align-items: end;
}

.section-head p {
  margin: 0;
  color: var(--ink-2);
}

.files {
  display: grid;
  gap: 1.5rem;
}

.file {
  position: relative;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 0;
  border: 1px solid #2a241c;
  background: var(--bg-2);
  box-shadow: var(--shadow);
}

.file-art {
  position: relative;
  min-height: 100%;
  background: #07060c;
}

.file-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 22rem;
  filter: saturate(0.85) contrast(1.05);
}

.file-body {
  padding: 1.6rem 1.7rem 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.file-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.file-id {
  color: var(--accent-ink);
  background: #c4a574;
  padding: 0.28rem 0.65rem;
  letter-spacing: 0.12em;
  box-shadow: 2px 2px 0 #000;
}

.badge {
  display: inline-block;
  padding: 0.32rem 0.55rem;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  font-family: "Special Elite", "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  transform: rotate(-8deg);
  background: rgba(225, 29, 58, 0.06);
  box-shadow: 0 0 0 1px rgba(225, 29, 58, 0.2);
}

.file-target {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.file-target a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.file-body p {
  margin: 0;
  color: var(--ink-2);
}

.charges {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.charges li {
  padding-left: 0.95rem;
  border-left: 3px solid var(--lamp);
  color: var(--ink-2);
}

.charges strong {
  color: var(--ink);
  font-weight: 700;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--lamp);
  color: var(--accent-ink);
  text-decoration: none;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.78rem 1rem;
  border: 1px solid var(--lamp);
  white-space: nowrap;
}

.btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.btn.ghost:hover {
  border-color: var(--lamp);
  color: var(--lamp);
  background: transparent;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.method-card {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 1.35rem 1.3rem 1.45rem;
}

.method-card h3 {
  font-family: "Special Elite", "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
  margin-bottom: 0.7rem;
  color: var(--lamp);
}

.method-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.note {
  margin-top: 1.4rem;
  padding: 1.1rem 1.2rem;
  border: 1px dashed var(--line-2);
  color: var(--muted);
  font-size: 0.98rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  background: #04030a;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: end;
}

.site-footer strong {
  display: block;
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.site-footer p {
  margin: 0;
  max-width: 36rem;
}

.footer-links {
  display: flex;
  gap: 1.1rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted);
}

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

.top-stage:has(.page-404) .lamp-rig,
.top-stage:has(.page-404) .beam {
  left: 58%;
}

.page-404 {
  position: relative;
  z-index: 5;
  padding: 4.5rem 0 6rem;
  max-width: 40rem;
}

.page-404 .lede {
  margin: 1rem 0 1.5rem;
}

@media (max-width: 880px) {
  .hero,
  .file,
  .section-head,
  .method-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .stat {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stat:last-child {
    border-bottom: 0;
  }

  .file-art img {
    min-height: 14rem;
    aspect-ratio: 16 / 10;
    height: auto;
  }

  .hero {
    padding-top: 2.2rem;
  }

  .hero-art {
    display: block;
  }

  .hero-art img {
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .section {
    padding: 3rem 0;
  }

  .lamp-rig {
    left: 68%;
    width: 120px;
  }

  .lamp {
    width: 120px;
    height: 66px;
  }

  .beam {
    left: 68%;
    width: 900px;
    height: 560px;
    top: calc(var(--nav-h) + 64px);
  }
}

@media (max-width: 520px) {
  .nav-links {
    gap: 0.85rem;
    font-size: 0.7rem;
  }

  .file-body {
    padding: 1.2rem 1.15rem 1.3rem;
  }

  .footer-row {
    flex-direction: column;
    align-items: start;
  }

  .lamp-rig {
    left: 78%;
  }
}

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

  .lamp-swing,
  .beam,
  .lamp-flare {
    animation: none;
  }
}
