/* emptyarray.com — [] motif, red/black retro terminal */
:root {
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --bg: #0a0000;
  --bg-panel: #120505;
  --red: #ff0033;
  --red-dim: #990022;
  --red-glow: #ff3355;
  --black: #050505;
  --text: #ffccd5;
  --text-muted: #884455;
  --shadow-primary-hue: 355;
  --shadow-secondary-hue: 0;
  --primary-hue: 0;
  --nav-h: 48px;
  --pixel: 4px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-tiny: 12px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background: var(--bg);
  padding-top: var(--nav-h);
}

/* CRT / scanlines */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12),
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.45;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

/* Thin top bar — full width, cyber buttons */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  height: var(--nav-h);
  background: linear-gradient(180deg, #1a0508 0%, #0d0203 100%);
  border-bottom: 2px solid var(--red-dim);
  box-shadow: 0 0 20px rgba(255, 0, 51, 0.25);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
  height: 100%;
  gap: 8px;
}

.nav-bar__brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-domain {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.brand-domain__dot {
  color: var(--red-dim);
}

.brand-link {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-link:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.brand-logo {
  height: 34px;
  width: auto;
  max-width: 140px;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 5px rgba(255, 0, 51, 0.35));
}

.brand-link.is-active .brand-logo {
  filter: drop-shadow(0 0 10px rgba(255, 0, 51, 0.55));
}

.nav-bar__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Cyberpunk glitch button — red theme (inspired by xdega / CodePen) */
.cybr-btn {
  --primary: hsl(var(--primary-hue), 85%, 42%);
  --primary-lightness: 2;
  --color: #ffe0e5;
  --font-size: 13px;
  --label-size: 10px;
  --shadow-secondary: hsl(var(--shadow-secondary-hue), 100%, 55%);
  --shadow-primary: hsl(var(--shadow-primary-hue), 100%, 48%);
  --border: 0px;
  --shimmy-distance: 8;
  --clip-one: polygon(0 2%, 100% 2%, 100% 95%, 95% 95%, 95% 90%, 85% 90%, 85% 95%, 8% 95%, 0 70%);
  --clip-two: polygon(0 78%, 100% 78%, 100% 100%, 95% 100%, 95% 90%, 85% 90%, 85% 100%, 8% 100%, 0 78%);
  --clip-three: polygon(0 44%, 100% 44%, 100% 54%, 95% 54%, 95% 54%, 85% 54%, 85% 54%, 8% 54%, 0 54%);
  --clip-four: polygon(0 0, 100% 0, 100% 0, 95% 0, 95% 0, 85% 0, 85% 0, 8% 0, 0 0);
  font-family: var(--font-sans);
  color: var(--color);
  background: transparent;
  text-transform: uppercase;
  font-size: var(--font-size);
  font-weight: 600;
  outline: transparent;
  letter-spacing: 0.03em;
  position: relative;
  border: 0;
  height: 38px;
  line-height: 34px;
  padding: 0 12px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.cybr-btn:after,
.cybr-btn:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  clip-path: var(--clip);
  z-index: -1;
}

.cybr-btn:before {
  background: var(--shadow-primary);
  transform: translate(var(--border), 0);
}

.cybr-btn:after {
  background: var(--primary);
}

.cybr-btn__glitch {
  position: absolute;
  top: calc(var(--border) * -1);
  left: calc(var(--border) * -1);
  right: calc(var(--border) * -1);
  bottom: calc(var(--border) * -1);
  background: var(--shadow-primary);
  text-shadow: 2px 2px var(--shadow-primary), -2px -2px var(--shadow-secondary);
  clip-path: var(--clip);
  animation: glitch 2.2s infinite;
  display: none;
  white-space: nowrap;
}

.cybr-btn:hover .cybr-btn__glitch,
.cybr-btn:focus-visible .cybr-btn__glitch {
  display: block;
}

.cybr-btn__glitch:before {
  content: "";
  position: absolute;
  top: calc(var(--border) * 1);
  right: calc(var(--border) * 1);
  bottom: calc(var(--border) * 1);
  left: calc(var(--border) * 1);
  clip-path: var(--clip);
  background: var(--primary);
  z-index: -1;
}

.cybr-btn {
  --clip: var(--clip-four);
}

@keyframes glitch {
  0% {
    clip-path: var(--clip-one);
  }
  2%,
  8% {
    clip-path: var(--clip-two);
    transform: translate(calc(var(--shimmy-distance) * -1%), 0);
  }
  6% {
    clip-path: var(--clip-two);
    transform: translate(calc(var(--shimmy-distance) * 1%), 0);
  }
  9% {
    clip-path: var(--clip-two);
    transform: translate(0, 0);
  }
  10% {
    clip-path: var(--clip-three);
    transform: translate(calc(var(--shimmy-distance) * 1%), 0);
  }
  13% {
    clip-path: var(--clip-three);
    transform: translate(0, 0);
  }
  14%,
  21% {
    clip-path: var(--clip-four);
    transform: translate(calc(var(--shimmy-distance) * 1%), 0);
  }
  31%,
  61%,
  100% {
    clip-path: var(--clip-four);
  }
}

.cybr-btn.is-active:after {
  background: #330011;
  box-shadow: inset 0 0 12px var(--red);
}

.cybr-btn.is-active {
  color: var(--red-glow);
}

/* Main layout */
main {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 20px 72px;
}

.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero__array {
  font-size: clamp(40px, 14vw, 120px);
  line-height: 1.1;
  color: var(--red);
  text-shadow:
    0 0 20px rgba(255, 0, 51, 0.45),
    4px 4px 0 var(--black);
  margin: 0;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.hero__array-bracket {
  display: inline-block;
  animation: bracket-pulse 3s ease-in-out infinite;
}

.hero__array-bracket--r {
  animation-delay: 0.15s;
}

@keyframes bracket-pulse {
  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.88;
    filter: brightness(1.15);
  }
}

.hero__domain {
  font-family: var(--font-mono);
  font-size: clamp(12px, 2.8vw, 16px);
  color: var(--red-glow);
  margin: 16px 0 20px;
  letter-spacing: 0.12em;
}

.hero__domain span {
  color: var(--text-muted);
}

.hero__tag {
  font-size: var(--fs-small);
  color: var(--text-muted);
  max-width: 36em;
  margin: 0 auto 24px;
}

.hero__code {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  line-height: 1.55;
  color: var(--red-dim);
  white-space: pre;
  overflow-x: auto;
  margin: 24px auto 0;
  opacity: 0.9;
  max-width: 28em;
  text-align: left;
  border-left: 2px solid var(--red-dim);
  padding-left: 12px;
}

.hero__code .kw {
  color: var(--text-muted);
}

.hero__code .name {
  color: var(--red-glow);
}

.panel {
  background: var(--bg-panel);
  border: var(--pixel) solid var(--red-dim);
  box-shadow:
    var(--pixel) var(--pixel) 0 var(--black),
    inset 0 0 30px rgba(255, 0, 40, 0.06);
  padding: 20px;
  margin-bottom: 24px;
}

.panel__title {
  font-size: 1rem;
  color: var(--red-glow);
  margin: 0 0 12px;
  border-bottom: 2px dashed var(--red-dim);
  padding-bottom: 8px;
}

.panel p {
  margin: 0 0 12px;
  color: var(--text);
}

.panel p:last-child {
  margin-bottom: 0;
}

/* Article list */
.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-list li {
  border-bottom: 1px dashed var(--red-dim);
  padding: 12px 0;
}

.article-list li:last-child {
  border-bottom: 0;
}

.article-list a {
  color: var(--red-glow);
  text-decoration: none;
  font-size: var(--fs-small);
}

.article-list a:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px var(--red);
}

.article-meta {
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  margin-top: 4px;
}

/* Videos grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.video-card {
  border: 2px solid var(--red-dim);
  background: var(--black);
  padding: 0;
  overflow: hidden;
}

.video-card__inner {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #111;
}

.video-card__inner iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-card__cap {
  padding: 10px;
  font-size: var(--fs-tiny);
  color: var(--text-muted);
}

/* Wargames */
.wargame-grid {
  display: grid;
  gap: 12px;
}

.wargame-card {
  display: block;
  padding: 16px;
  border: 2px solid var(--red-dim);
  background: linear-gradient(135deg, #140808 0%, #0a0203 100%);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wargame-card:hover {
  border-color: var(--red);
  box-shadow: 0 0 16px rgba(255, 0, 51, 0.2);
}

.wargame-card h3 {
  font-size: var(--fs-small);
  color: var(--red-glow);
  margin: 0 0 8px;
}

.wargame-card p {
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  margin: 0;
}

/* Article body */
.prose {
  font-size: var(--fs-small);
  line-height: 1.9;
}

.prose h2 {
  font-size: 1rem;
  color: var(--red-glow);
  margin: 24px 0 12px;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #1a0508;
  padding: 2px 6px;
  border: 1px solid var(--red-dim);
}

.prose pre {
  background: #080203;
  border: 2px solid var(--red-dim);
  padding: 12px;
  overflow-x: auto;
  font-size: var(--fs-tiny);
  line-height: 1.5;
}

.prose ul {
  margin: 0 0 12px 1.2em;
  padding: 0;
}

.prose li {
  margin-bottom: 6px;
}

.footer {
  text-align: center;
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  padding: 32px 16px;
  position: relative;
  z-index: 1;
}

.err-msg {
  color: var(--red);
  font-size: var(--fs-tiny);
}

/* Curated links page */
.links-page {
  max-width: 1100px;
}

.links-controls__row {
  margin-bottom: 16px;
}

.links-controls__row:last-of-type {
  margin-bottom: 8px;
}

.links-controls__label {
  display: block;
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.links-search {
  width: 100%;
  max-width: 420px;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  padding: 10px 12px;
  background: var(--black);
  border: 2px solid var(--red-dim);
  color: var(--text);
  border-radius: 0;
}

.links-search::placeholder {
  color: var(--text-muted);
}

.links-search:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red-glow);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-row--tags {
  align-items: flex-start;
}

.filter-pill {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  background: var(--black);
  color: var(--text-muted);
  border: 2px solid var(--red-dim);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.filter-pill:hover {
  color: var(--red-glow);
  border-color: var(--red);
}

.filter-pill--active {
  color: var(--red-glow);
  border-color: var(--red);
  background: #1a0508;
  box-shadow: inset 0 0 12px rgba(255, 0, 51, 0.15);
}

.filter-pill--tag {
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.01em;
}

.filter-clear {
  font-family: var(--font-sans);
  font-size: var(--fs-tiny);
  padding: 6px 10px;
  background: transparent;
  color: var(--red-dim);
  border: 1px dashed var(--red-dim);
  cursor: pointer;
  margin-left: auto;
  align-self: center;
}

.filter-clear:hover {
  color: var(--red-glow);
  border-color: var(--red);
}

.links-count {
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  margin: 8px 0 0;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.link-card {
  border: 2px solid var(--red-dim);
  background: linear-gradient(165deg, #140808 0%, #0a0203 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.link-card:hover {
  border-color: var(--red);
  box-shadow: 0 0 14px rgba(255, 0, 51, 0.12);
}

.link-card__title {
  font-size: var(--fs-small);
  font-weight: 600;
  margin: 0;
  line-height: 1.5;
}

.link-card__title a {
  color: var(--red-glow);
  text-decoration: none;
}

.link-card__title a:hover {
  text-decoration: underline;
  text-shadow: 0 0 8px var(--red);
}

.link-card__desc {
  font-size: var(--fs-tiny);
  color: var(--text-muted);
  margin: 0;
  flex: 1;
  line-height: 1.55;
}

.link-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--red-dim);
}

.link-card__cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.link-card__tag {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 2px 6px;
  border: 1px solid var(--red-dim);
  background: var(--black);
}

@media (max-width: 640px) {
  .nav-bar {
    flex-direction: column;
    height: auto;
    padding: 8px;
    gap: 8px;
  }

  body {
    padding-top: 0;
  }

  .site-header {
    position: relative;
    height: auto;
  }

  .nav-bar__links {
    justify-content: center;
  }

  .cybr-btn {
    font-size: 12px;
    padding: 0 8px;
  }
}
