/* --------
   Base junk
-------- */

* {
  box-sizing: border-box;
}

:root {
  /* Palette (aligned to your red-leaning header colors) */
  --accent: #ac0f2c;
  --accent2: rgb(220, 35, 82);
  --text: #ce385d;
}

body {
  margin: 0;
  /* font-family: monospace; */
  background: #030202;
  color: var(--text);
}


@font-face {
  font-family: 'dystopian_demo';
  src: url(/fonts/dystopian_demo/sddystopiandemo-go7xa-webfont.woff);
}


@font-face {
  font-family: 'leander';
  src: url(/fonts/leander/leander-webfont.woff);
}

/* -----------------
   Easy reusables
------------------ */

.center-children {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fill-page {
  min-height: 100vh;
  min-width: 100vw;
}


/* -----------------
   Page grid layout
------------------ */

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header header"
    "sidebar content";
  min-height: 100vh;
}

/* --------
   Header
-------- */

.header {
  grid-area: header;
  border-bottom: 3px solid var(--accent);
  /* Subtle overlay gradient over the GIF to improve legibility on bright frames. */
  background-image:
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0.35),
      rgba(0, 0, 0, 0.15)),
    url('/images/shared/header.gif');
  background-size: 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 10px 16px;
}

.site-title {
  margin: 0;
  font-size: 5rem;
  font-family: 'dystopian_demo';
  color: #c90d30;
  -webkit-text-stroke: 1.5px rgb(17, 16, 16);
  cursor: no-drop;

  /* “Glass plate” behind the title:
     - background provides consistent contrast vs animated GIF
     - backdrop-filter blurs the GIF underneath (if supported)
     - box-shadow is a gentle fallback separation */
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.18);
}

.site-title .ch {
  display: inline-block;
  -webkit-text-stroke: 1.5px rgb(17, 16, 16);
}

/* ----------------------------
   Generic twitch-glitch effect
   ---------------------------- */

.fx-glitch-text {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.fx-glitch-text::before,
.fx-glitch-text::after {
  /* Two RGB “ghost layers” of the full title used for slice glitching. */
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}

.fx-glitch-text::before {
  text-shadow: -2px 0 #00ff99;
  transform: translate(0, 0);
}

.fx-glitch-text::after {
  text-shadow: 2px 0 #FC5DA2;
  transform: translate(0, 0);
}

/* Short bursts (toggled by JS via .glitching). */
.fx-glitch-text.glitching::before {
  /* Clip-path slicing is handled in @keyframes header-glitch-slice. */
  opacity: 0.75;
  animation: header-glitch-slice 220ms steps(2, end) infinite;
}

.fx-glitch-text.glitching::after {
  opacity: 0.75;
  animation: header-glitch-slice 180ms steps(2, end) infinite reverse;
}

/* Hover: stronger but still (barely) legible. */
.fx-glitch-text:hover::before,
.fx-glitch-text:hover::after {
  opacity: 0.95;
  animation-duration: 85ms;
}

.fx-glitch-text .ch.twitch {
  /* Per-letter twitch uses CSS variables set by JS:
     --glitch-x / --glitch-y / --glitch-skew-x */
  transform: translate(var(--glitch-x), var(--glitch-y)) skewX(var(--glitch-skew-x));
  text-shadow: 1px 0 #00ff99, -1px 0 #FC5DA2;
}

.fx-shuffle-text.shuffling {
  text-shadow: 1px 0 rgba(0, 255, 153, 0.35), -1px 0 rgba(252, 93, 162, 0.35);
}

.fx-shuffle-text.foreboding {
  color: #670013;
  font-weight: 800;
  -webkit-text-stroke: 1.4px rgb(10, 0, 0);
  text-shadow:
    0 0 6px rgba(96, 2, 19, 0.45),
    0 0 18px rgba(40, 0, 7, 0.25);
}

@keyframes header-glitch-slice {
  0% {
    clip-path: inset(10% 0 85% 0);
    transform: translate(-1px, 0);
  }

  20% {
    clip-path: inset(60% 0 15% 0);
    transform: translate(2px, -1px);
  }

  40% {
    clip-path: inset(25% 0 55% 0);
    transform: translate(-2px, 1px);
  }

  60% {
    clip-path: inset(75% 0 5% 0);
    transform: translate(1px, 1px);
  }

  80% {
    clip-path: inset(40% 0 35% 0);
    transform: translate(2px, 0);
  }

  100% {
    clip-path: inset(10% 0 85% 0);
    transform: translate(0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {

  .fx-glitch-text::before,
  .fx-glitch-text::after {
    animation: none !important;
    opacity: 0 !important;
    transform: none !important;
  }

  .fx-glitch-text .ch.twitch {
    transform: none !important;
    text-shadow: none !important;
  }
}

.site-subtitle {
  margin: 0;
  font-size: 1.5rem;
  font-family: 'leander';
  color: rgb(186, 11, 55);
  cursor: progress;
  -webkit-text-stroke: 0.5px rgb(17, 16, 16);

  /* “Glass plate” behind the subtitle (same idea as title). */
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.18);
}

/* --------
   Sidebar
-------- */

.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #080808;
  border-right: 3px solid var(--accent);
  padding: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav a {
  color: var(--accent2);
  text-decoration: none;
  padding: 6px;
  border: 1px solid var(--accent);
}

.nav a:hover {
  background: var(--accent);
  color: #000;
}

/* --------
   Content
-------- */

.content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

#age-of-agony {
  width: 88%;
  height: 75px;
  margin-top: auto;
  align-self: end;
}