@font-face {
  font-family: "Wolfenstein";
  src: url("assets/fonts/wolfenstein.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #880000;
  --bg-deep: #4c0000;
  --panel: #580000;
  --panel-hi: #6c0000;
  --edge-dark: #380000;
  --edge-light: #b40000;
  --text: #b8b8b8;
  --text-hi: #fcfcfc;
  --gold: #fcd800;
  --tag-bg: #2c0000;
}

* { box-sizing: border-box; }

html { background: var(--bg-deep); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.08) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at top, var(--bg) 0%, var(--bg-deep) 75%);
  background-attachment: fixed;
  font-family: "VT323", "Courier New", monospace;
  font-size: 20px;
  line-height: 1.25;
}

.masthead {
  text-align: center;
  padding: 56px 16px 28px;
}

.logo {
  margin: 0;
  font-family: "Wolfenstein", "Impact", sans-serif;
  font-weight: normal;
  font-size: clamp(2.6rem, 10vw, 6.5rem);
  letter-spacing: .02em;
  line-height: 1;
  color: #e00000;
  text-shadow:
    2px 2px 0 #600000,
    4px 4px 0 #300000,
    6px 6px 0 #000,
    0 0 24px rgba(0,0,0,.6);
  -webkit-text-stroke: 1px #200000;
  word-break: break-word;
}

.tagline {
  margin: 18px 0 0;
  color: var(--gold);
  font-size: 1.4rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sound {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.mute {
  width: 48px;
  height: 48px;
  padding: 10px;
  border: 2px solid var(--edge-light);
  border-right-color: var(--edge-dark);
  border-bottom-color: var(--edge-dark);
  background: var(--panel);
  color: var(--text-hi);
  cursor: pointer;
}
.mute:hover, .mute:focus-visible { background: var(--panel-hi); color: var(--gold); outline: none; }
.mute svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.mute .icon-off { display: none; }
.mute.is-muted .icon-on { display: none; }
.mute.is-muted .icon-off { display: block; }

.sound-hint {
  margin: 0;
  padding: 2px 8px;
  background: rgba(0,0,0,.55);
  color: var(--gold);
  font-size: 1rem;
  animation: blink 1.2s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 22px;
  font-family: "Wolfenstein", "Impact", sans-serif;
  font-weight: normal;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1;
  letter-spacing: .03em;
  color: var(--gold);
  text-shadow: 2px 2px 0 #600000, 4px 4px 0 #000;
}
.section-title::before,
.section-title::after {
  content: "";
  flex: 1;
  height: 4px;
  background: var(--edge-light);
  box-shadow: 0 3px 0 var(--edge-dark);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 20px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
  background: var(--panel);
  border: 3px solid var(--edge-light);
  border-right-color: var(--edge-dark);
  border-bottom-color: var(--edge-dark);
  box-shadow: 0 0 0 2px #000, 6px 6px 0 rgba(0,0,0,.45);
  color: var(--text);
  text-decoration: none;
  transition: transform .08s linear, background .08s linear;
}

.tile:hover,
.tile:focus-visible {
  background: var(--panel-hi);
  color: var(--text-hi);
  transform: translate(-2px, -2px);
  outline: none;
}
.tile:focus-visible { box-shadow: 0 0 0 2px var(--gold), 8px 8px 0 rgba(0,0,0,.45); }

.thumb {
  position: relative;
  display: block;
  margin: -18px -18px 14px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #000;
  border-bottom: 3px solid var(--edge-dark);
}
.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s linear;
}
.thumb img.on { opacity: 1; }
.thumb--banner img:first-child { object-fit: contain; padding: 0 6px; }
.thumb--banner::before {
  content: "";
  position: absolute;
  inset: -8px;
  background: var(--backdrop, none) center / cover;
  filter: blur(4px) brightness(.4);
}
.thumb img[src*="sod-demo-1"] { object-position: 50% 12%; }
.thumb img[src*="wolfram-1"] { object-position: 50% 0; }
.tile:not(:hover):not(:focus-visible) .thumb img { filter: saturate(.85) brightness(.9); }

.tile h3 {
  margin: 10px 0 8px;
  color: var(--text-hi);
  font-weight: normal;
  font-size: 1.6rem;
  line-height: 1.05;
  text-transform: uppercase;
}
.tile:hover h3, .tile:focus-visible h3 { color: var(--gold); }

.tile p { margin: 0 0 16px; flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  padding: 0 6px;
  background: var(--tag-bg);
  color: var(--gold);
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.cta {
  align-self: flex-start;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.cta::before { content: "\25B6\00a0"; }

.site-link {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  padding: 4px 10px;
  border: 2px solid var(--edge-light);
  border-right-color: var(--edge-dark);
  border-bottom-color: var(--edge-dark);
  background: var(--panel);
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: .05em;
  text-decoration: none;
}
.site-link:hover, .site-link:focus-visible { background: var(--panel-hi); color: var(--text-hi); outline: none; }

.footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 64px;
  text-align: center;
  font-size: 1rem;
  color: #a06060;
}

.yt-holder {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 200px;
  height: 200px;
  overflow: hidden;
  pointer-events: none;
}

@media (max-width: 520px) {
  .masthead { padding-top: 72px; }
  body { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .thumb img { transition: none; }
  .tile:hover, .tile:focus-visible { transform: none; }
  .sound-hint { animation: none; }
}
