/* ═══════════════════════════════════════════════════════
   DARKHELM STUDIO — styles.css
   B&W Lofi / Scratchy / Interactive
═══════════════════════════════════════════════════════ */


/* ─── CUSTOM PROPERTIES ──────────────────────────── */
:root {
  --bg:        #080808;
  --bg-raised: #111111;
  --ink:       #e8e4d8;   /* warm off-white, aged paper */
  --dim:       #888880;   /* muted mid-gray             */
  --faint:     #333330;   /* barely-there dividers      */

  --font-display: 'Cinzel Decorative', serif;
  --font-title:   'Cinzel', serif;
  --font-body:    'Special Elite', 'Courier New', monospace;

  --ease-out:  cubic-bezier(0.22, 0.61, 0.36, 1);
}


/* ─── RESET ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: none;             /* replaced by custom cursor */
}

/* Hide custom cursor on touch devices */
@media (hover: none) {
  body { cursor: auto; }
  #cursor { display: none; }
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

em { font-style: italic; color: var(--ink); }


/* ─── HIDDEN SVG FILTER CONTAINER ───────────────── */
.svg-filters {
  position: absolute;
  width: 0; height: 0;
  overflow: hidden;
  pointer-events: none;
}


/* ═══════════════════════════════════════════════════
   PERSISTENT OVERLAYS
═══════════════════════════════════════════════════ */

/* Film grain canvas (driven by JS at ~10 fps) */
#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 900;
  opacity: 0.085;
  mix-blend-mode: screen;
  image-rendering: auto;    /* scale up half-res canvas smoothly */
}

/* Scanlines */
.ov-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 901;
  background: repeating-linear-gradient(
    to bottom,
    transparent          0px,
    transparent          2px,
    rgba(0,0,0, 0.14)    2px,
    rgba(0,0,0, 0.14)    4px
  );
}

/* Vignette */
.ov-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 902;
  background: radial-gradient(
    ellipse at 50% 50%,
    transparent 28%,
    rgba(0,0,0, 0.55) 68%,
    rgba(0,0,0, 0.88) 100%
  );
}


/* ─── INTRO CURTAIN ──────────────────────────────── */
#curtain {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9990;
  pointer-events: none;
  transition: opacity 0.9s ease;
}


/* ─── CUSTOM CURSOR ──────────────────────────────── */
#cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}

.cursor-dot {
  position: absolute;
  width: 5px; height: 5px;
  background: var(--ink);
  border-radius: 50%;
  transform: translate(calc(var(--cx, 0px) - 2.5px), calc(var(--cy, 0px) - 2.5px));
}

.cursor-ring {
  position: absolute;
  width: 28px; height: 28px;
  border: 1px solid rgba(232,228,216, 0.75);
  border-radius: 50%;
  transform: translate(calc(var(--rx, 0px) - 14px), calc(var(--ry, 0px) - 14px));
  transition: width 0.25s var(--ease-out),
              height 0.25s var(--ease-out),
              border-color 0.25s ease;
}

#cursor.is-hover .cursor-ring {
  width: 48px; height: 48px;
  transform: translate(calc(var(--rx, 0px) - 24px), calc(var(--ry, 0px) - 24px));
  border-color: rgba(232,228,216, 0.4);
}


/* ═══════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 3rem;
  /* Very subtle gradient so text stays readable over the image */
  background: linear-gradient(to bottom, rgba(8,8,8,0.6) 0%, transparent 100%);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.35em;
  color: var(--ink);
  filter: url(#f-scratch);
  transition: opacity 0.2s;
}
.nav-brand:hover { opacity: 0.75; }
.nav-brand-glyph { font-size: 0.55rem; }

.nav-links {
  display: flex;
  gap: 2.5rem;
}
.nav-links a {
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--ink);
  opacity: 0.6;
  position: relative;
  transition: opacity 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  height: 1px; width: 0;
  background: var(--ink);
  transition: width 0.3s ease;
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { width: 100%; }


/* ═══════════════════════════════════════════════════
   HERO SECTION
═══════════════════════════════════════════════════ */
.hero {
  position: relative;
  width: 100vw;
  height: 240vh;   /* scroll canvas — visual stays pinned via .hero-sticky */
}

/* The 100vh sticky frame that holds all hero visuals */
.hero-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Hero background image ── */
.hero-bg {
  position: absolute;
  inset: -6%;        /* extra room for mouse parallax movement */
  z-index: 0;
}

.hero-img {
  position: absolute;
  inset: 0;
  /*  Place your image at  assets/hero.jpg  */
  background-image: url('assets/hero.jpg');
  background-size: cover;
  background-position: center 18%;   /* JS takes over immediately; matches POS_START */
  /* Convert to B&W with punchy contrast */
  filter: grayscale(1) contrast(1.18) brightness(0.62);
  will-change: transform;
}

/* Fade hero image into the dark page background */
.hero-img-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 35%;
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 100%);
  z-index: 1;
}

/* ── Particles canvas ── */
#particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* ── Hero text ── */
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  /* Sit below center so the castle spires are visible above the text */
  margin-top: 10vh;
}

.hero-eyebrow {
  font-size: 0.6rem;
  letter-spacing: 0.5em;
  color: var(--dim);
  filter: url(#f-scratch);
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.88;
  gap: 0.04em;
}

.hero-title-solid,
.hero-title-outline {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 16vw, 13rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  filter: url(#f-scratch-heavy);
}

.hero-title-solid {
  color: var(--ink);
  text-shadow:
    0 0 100px rgba(255,255,255, 0.06),
    0 3px 6px rgba(0,0,0, 0.9);
}

.hero-title-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: none;
  opacity: 0.85;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 1.8vw, 1rem);
  letter-spacing: 0.35em;
  color: var(--dim);
  filter: url(#f-scratch);
}

/* ── Scroll cue ── */
.scroll-cue {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.5s ease;
}
.scroll-cue-bar {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, var(--dim), transparent);
  animation: scroll-breathe 2.2s ease-in-out infinite;
}
.scroll-cue-label {
  font-size: 0.5rem;
  letter-spacing: 0.45em;
  color: var(--dim);
  opacity: 0.5;
}
@keyframes scroll-breathe {
  0%, 100% { opacity: 0.25; transform: scaleY(0.85) translateY(-4px); }
  50%       { opacity: 0.7;  transform: scaleY(1.1)  translateY(4px);  }
}


/* ═══════════════════════════════════════════════════
   SHARED SECTION STYLES
═══════════════════════════════════════════════════ */
.page-section {
  padding: 7rem 0;
  position: relative;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* Horizontal rule / divider */
.ruled {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--faint) 20%, var(--faint) 80%, transparent);
  margin: 3rem 0;
}

/* Section number + heading row */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 3rem;
}
.section-num {
  font-family: var(--font-body);
  font-size: 0.58rem;
  letter-spacing: 0.4em;
  color: var(--dim);
  opacity: 0.5;
  flex-shrink: 0;
}
.section-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink);
  filter: url(#f-scratch);
}

/* Body copy */
.body-text {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.95;
  color: var(--ink);
  opacity: 0.78;
  margin-bottom: 1.1rem;
}


/* ─── SCROLL-REVEAL ANIMATION ────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity  0.85s var(--ease-out),
    transform 0.85s var(--ease-out);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════════════════
   ABOUT / MANIFESTO
═══════════════════════════════════════════════════ */
.manifesto-grid {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 2.5rem;
  align-items: start;
  margin: 0 0 0.5rem;
}
.manifesto-num {
  font-family: var(--font-body);
  font-size: 0.58rem;
  letter-spacing: 0.4em;
  color: var(--dim);
  opacity: 0.4;
  padding-top: 0.5rem;
}
.manifesto-body { }


/* ═══════════════════════════════════════════════════
   GAMES GRID
═══════════════════════════════════════════════════ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px;
}

/* ── Game card ── */
.game-card {
  background: var(--bg-raised);
  overflow: hidden;
  position: relative;
}

.game-card-visual {
  overflow: hidden;
  height: 260px;
}
.game-card-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  /* B&W until hover */
  filter: grayscale(1) contrast(1.15) brightness(0.55);
  transition: transform 0.7s var(--ease-out), filter 0.5s ease;
}
.game-card:hover .game-card-img {
  transform: scale(1.04);
  filter: grayscale(1) contrast(1.2) brightness(0.65);
}

/* TBA placeholder card */
.game-card--tba {
  border: 1px solid var(--faint);
}
.game-card-visual--tba {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-raised) 100%);
}
.tba-mark {
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--dim);
  opacity: 0.2;
  filter: url(#f-scratch-heavy);
}

.game-card-body {
  padding: 1.4rem 1.6rem 1.8rem;
}
.game-card-tag {
  display: block;
  font-size: 0.52rem;
  letter-spacing: 0.42em;
  color: var(--dim);
  margin-bottom: 0.6rem;
}
.game-card-name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  color: var(--ink);
  filter: url(#f-scratch);
  margin-bottom: 0.6rem;
}
.game-card-desc {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--dim);
  margin-bottom: 1.1rem;
}
.game-card-link {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--ink);
  opacity: 0.5;
  transition: opacity 0.2s;
  position: relative;
}
.game-card-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  height: 1px; width: 0;
  background: var(--ink);
  transition: width 0.3s ease;
}
.game-card-link:hover { opacity: 1; }
.game-card-link:hover::after { width: 100%; }


/* ═══════════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════════ */
.contact-center {
  text-align: center;
}
.contact-email {
  display: block;
  font-family: var(--font-title);
  font-size: clamp(1rem, 2.8vw, 1.8rem);
  letter-spacing: 0.15em;
  color: var(--ink);
  filter: url(#f-scratch);
  margin: 2rem auto;
  transition: opacity 0.2s;
}
.contact-email:hover { opacity: 0.65; }

.social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.social-link {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--dim);
  transition: color 0.2s;
}
.social-link:hover { color: var(--ink); }
.social-sep {
  color: var(--faint);
  font-size: 0.7rem;
}


/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--faint);
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--dim);
  opacity: 0.45;
}
.footer-mark {
  letter-spacing: 0.2em;
}


/* ═══════════════════════════════════════════════════
   BODY FLICKER (triggered by JS periodically)
═══════════════════════════════════════════════════ */
@keyframes page-flicker {
  0%,  100% { opacity: 1;    }
  20%        { opacity: 0.88; }
  45%        { opacity: 1;    }
  65%        { opacity: 0.92; }
  80%        { opacity: 1;    }
}
body.is-flickering {
  animation: page-flicker 0.18s linear forwards;
}


/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.5rem; }

  .manifesto-grid { grid-template-columns: 1fr; }
  .manifesto-num  { display: none; }

  .footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title-solid,
  .hero-title-outline {
    font-size: clamp(3.5rem, 22vw, 6rem);
  }
}


/* ═══════════════════════════════════════════════════
   GAME DETAIL PAGE  (umbra.html etc.)
═══════════════════════════════════════════════════ */

/* ── Game Hero (full-viewport title card) ── */
.game-hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.game-hero-img {
  position: absolute;
  inset: 0;
  background-image: url('assets/hero.jpg');  /* swap per game */
  background-size: cover;
  background-position: center 42%;
  filter: grayscale(1) contrast(1.3) brightness(0.28);
}

/* Radial burn: darken edges more heavily than main hero */
.game-hero-burn {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 40%,
    transparent 10%,
    rgba(8,8,8, 0.55) 55%,
    rgba(8,8,8, 0.92) 100%
  );
  z-index: 1;
}

/* Fade bottom into page */
.game-hero-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 32%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  z-index: 2;
}

.game-hero-body {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Hero elements animate in after curtain via CSS (no JS needed on game page) */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.game-hero-body > * {
  animation: heroIn 0.9s var(--ease-out) both;
}
.game-hero-body > *:nth-child(1) { animation-delay: 1.3s; }
.game-hero-body > *:nth-child(2) { animation-delay: 1.5s; }
.game-hero-body > *:nth-child(3) { animation-delay: 1.7s; }
.game-hero-body > *:nth-child(4) { animation-delay: 1.9s; }
.game-hero-body > *:nth-child(5) { animation-delay: 2.1s; }

.game-back {
  font-size: 0.56rem;
  letter-spacing: 0.4em;
  color: var(--dim);
  opacity: 0.55;
  transition: opacity 0.2s;
  margin-bottom: 0.4rem;
}
.game-back:hover { opacity: 1; }

.game-status-tag {
  font-size: 0.5rem;
  letter-spacing: 0.5em;
  color: var(--dim);
  border: 1px solid var(--faint);
  padding: 0.32em 1.1em;
  filter: url(#f-scratch);
}

.game-page-title {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 18vw, 14rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
  filter: url(#f-scratch-heavy);
  line-height: 1;
  text-shadow:
    0 0 100px rgba(255,255,255, 0.07),
    0 3px 8px rgba(0,0,0, 0.95);
}

.game-page-sub {
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 1.4vw, 0.9rem);
  letter-spacing: 0.32em;
  color: var(--dim);
  filter: url(#f-scratch);
  max-width: 52ch;
  line-height: 1.6;
}

.game-hero-ctas {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 0.5rem;
}

/* Shared button base */
.btn {
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  padding: 0.72em 1.9em;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  filter: url(#f-scratch);
  border: 1px solid var(--faint);
  color: var(--ink);
  background: rgba(232,228,216, 0.06);
}
.btn:hover { background: rgba(232,228,216, 0.12); }

.btn-ghost {
  background: transparent;
  border: none;
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: var(--dim);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-ghost:hover { opacity: 1; }


/* ── Overview: two-column description + details ── */
.game-overview-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 5rem;
  align-items: start;
}

.game-details-col {
  border-left: 1px solid var(--faint);
  padding-left: 2rem;
}

.detail-row {
  margin-bottom: 1.8rem;
}

.detail-label {
  display: block;
  font-size: 0.5rem;
  letter-spacing: 0.48em;
  color: var(--dim);
  opacity: 0.45;
  margin-bottom: 0.3rem;
}

.detail-value {
  display: block;
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1.5;
}


/* ── Features 2×2 grid ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 2px;
  margin-top: 2.5rem;
}

.feature-card {
  background: var(--bg-raised);
  padding: 2rem 1.6rem 2.2rem;
}

.feature-glyph {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 1.1rem;
  opacity: 0.3;
}

.feature-title {
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink);
  filter: url(#f-scratch);
  margin-bottom: 0.65rem;
}

.feature-desc {
  font-size: 0.78rem;
  line-height: 1.75;
  color: var(--dim);
  opacity: 0.75;
}


/* ── Screenshots/Glimpses grid ── */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  margin-top: 2.5rem;
}

.screenshot-item {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-raised);
  position: relative;
}

.screenshot-bg {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.18) brightness(0.5);
  transition: filter 0.5s ease, transform 0.6s var(--ease-out);
}

.screenshot-item:hover .screenshot-bg {
  filter: grayscale(1) contrast(1.22) brightness(0.62);
  transform: scale(1.03);
}

/* Placeholder when no screenshot is available */
.screenshot-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-raised) 100%);
}

.screenshot-placeholder-label {
  font-size: 0.5rem;
  letter-spacing: 0.45em;
  color: var(--dim);
  opacity: 0.2;
  filter: url(#f-scratch);
}


/* ── Notify / Wishlist CTA ── */
.notify-form {
  display: flex;
  max-width: 480px;
  width: 100%;
  margin: 2rem auto 0;
}

.notify-input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--faint);
  border-right: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  padding: 0.8em 1.2em;
  outline: none;
  transition: border-color 0.2s;
}
.notify-input::placeholder { color: var(--dim); opacity: 0.35; }
.notify-input:focus { border-color: rgba(232,228,216, 0.3); }

.notify-btn {
  background: rgba(232,228,216, 0.06);
  border: 1px solid var(--faint);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.58rem;
  letter-spacing: 0.35em;
  padding: 0.8em 1.6em;
  cursor: pointer;
  filter: url(#f-scratch);
  transition: background 0.2s;
}
.notify-btn:hover { background: rgba(232,228,216, 0.13); }


/* ── Game page responsive ── */
@media (max-width: 768px) {
  .game-overview-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .game-details-col {
    border-left: none;
    border-top: 1px solid var(--faint);
    padding-left: 0;
    padding-top: 2rem;
  }
  .screenshots-grid { grid-template-columns: 1fr; }
  .notify-form { flex-direction: column; }
  .notify-input { border-right: 1px solid var(--faint); border-bottom: none; }
  .notify-btn { border-top: none; }
  .game-hero-ctas { flex-direction: column; gap: 1rem; }
}
