/* =======================================================
   style.css — OC project stylesheet.
   THEME: backrooms / weirdcore / analog-horror (matches the
   root site so the whole thing feels like one place).
   Same variable names as the root css/style.css on purpose —
   if you ever consolidate into one shared file, the values
   already line up.
   ======================================================= */

:root {
  --bg: #100f0a;
  --bg-alt: #1c1a10;
  --wall: #b8a34a;
  --text: #d8d2b0;
  --text-muted: #8a836a;
  --accent: #9c2b23;
  --accent-glitch: #2fb0c4;
  --border: #3a331c;
  --font-heading: 'Special Elite', 'Courier New', monospace;
  --font-body: 'Courier Prime', 'Courier New', monospace;
  --max-width: 900px;
}

/* ---- Reset & base ---- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  position: relative;
}

/* grain overlay — real generated texture, tiled over the page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url('images/grain.png');
  background-repeat: repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 2px,
    transparent 4px
  );
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--text); font-weight: normal; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-glitch); text-decoration: underline; }

/* ---- Header / nav ---- */
@keyframes flicker {
  0%, 19%, 21%, 23%, 80%, 100% { opacity: 1; }
  20%, 22%, 24% { opacity: 0.85; }
  50% { opacity: 0.97; }
}

header {
  border-bottom: 2px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--bg-alt);
  animation: flicker 7s infinite;
  position: relative;
  z-index: 1;
}

.back-link {
  margin: 0 0 0.75rem 0;
  font-size: 0.75rem;
}

.back-link a { color: var(--text-muted); }

.site-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin: 0 0 0.75rem 0;
  letter-spacing: 0.04em;
  text-shadow: 2px 0 var(--accent), -2px 0 var(--accent-glitch);
}

.site-title span { color: var(--wall); text-shadow: none; }

nav { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; }

nav a {
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

nav a.active, nav a:hover {
  color: var(--wall);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

main.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  position: relative;
  z-index: 1;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.hero { text-align: center; }

.hero p.tagline {
  font-family: var(--font-heading);
  color: var(--wall);
  font-size: 1.1rem;
  margin-top: -0.5rem;
}

/* ---- Character cards ---- */
.character-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.character-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.5rem;
  width: 320px;
}

.character-card .portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--border);
  border-radius: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 1rem;
  overflow: hidden;
  outline: 2px solid var(--accent);
  outline-offset: -6px;
}

.character-card .portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(55%) sepia(20%) hue-rotate(20deg) contrast(105%) brightness(85%);
}

.character-card ul.traits {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.character-card ul.traits li {
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---- Art gallery ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.gallery-grid figure {
  margin: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  filter: grayscale(55%) sepia(20%) hue-rotate(20deg) contrast(105%) brightness(85%);
}

.gallery-grid figcaption {
  padding: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---- "View More" expandable gallery ----
   .gallery-extra stays hidden until JS adds .is-visible to it. */
.gallery-extra { display: none; }
.gallery-extra.is-visible { display: grid; }

.view-more-btn {
  display: block;
  margin: 0 auto 2.5rem auto;
  padding: 0.5rem 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--accent);
  color: var(--wall);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 2px;
}

.view-more-btn:hover {
  color: var(--accent-glitch);
  border-color: var(--accent-glitch);
}

/* ---- "No signal" empty state ----
   Used when a character/section has no art yet. */
.no-signal {
  text-align: center;
  padding: 2rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 2px;
  margin-bottom: 2.5rem;
  background: var(--bg-alt);
}

.no-signal img {
  width: 180px;
  max-width: 60%;
  border-radius: 2px;
  margin-bottom: 1rem;
}

.no-signal p {
  color: var(--text-muted);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

/* ---- Stories list ---- */
.story-entry {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  background: var(--bg-alt);
}

.story-entry h3 { margin: 0 0 0.4rem 0; }

.story-entry .meta {
  font-size: 0.75rem;
  color: var(--wall);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.story-entry .external-badge {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.65rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.05rem 0.5rem;
  border-radius: 2px;
}
