/* ============================================
   THE LUCID RUIN — style.css
   Full base layout + responsive hero image
   ============================================ */

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  background: #0d0d0d;
  color: #c8b878;
  font-family: 'Georgia', serif;
  font-size: 16px;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #c8b878;
  text-decoration: none;
}

a:hover {
  color: #c8b878;
}

/* ── Header ── */
.siteHeader {
  border-bottom: 1px solid #1e1e1e;
  padding: 10px 0;
  background: #0d0d0d;
}

.headerInner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.logoImg {
  width: min(208px, 34vw);
  height: auto;
  display: block;
}

.brandBig {
  font-size: 0.82rem;
  font-weight: bold;
  letter-spacing: 0.14em;
  color: #c8b878;
  line-height: 1.3;
}

.brandTitle {
  font-size: 0.7rem;
  color: #8a7040;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

/* ── Nav ── */
.nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;

}

.nav a {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid #7a6a40;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: #c8b878;
  background: #111008;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.nav a:hover {
  background: #1e1a08;
  color: #f0e0a0;
  border-color: #c8a84a;
}

/* ── Main Wrap ── */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ── Panel ── */
.panel {
  width: 100%;
}

.panelInner {
  text-align: center;
}

/* ── Typography ── */
.h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.2em;
  color: #c8b878;
  margin-bottom: 10px;
}

.sub {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  letter-spacing: 0.15em;
  color: #a08840;
  margin-bottom: 16px;
}

.rule {
  width: 60px;
  height: 1px;
  background: #3a3530;
  margin: 0 auto 24px;
}

/* ── Hero Image ── */
.heroCard {
  width: 100%;
  max-width: min(720px, 92vw);  /* large on desktop, scales on mobile */
  margin: 0 auto 24px;
}

.heroArt {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 10px 28px;
  border: 1px solid #7a6a40;
  color: #c8b878;
  background: #111008;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:hover {
  background: #1e1a08;
  color: #f0e0a0;
  border-color: #c8a84a;
}

.btn.primary {
  background: #111008;
  border-color: #7a6a40;
  color: #c8b878;
}

.btn.primary:hover {
  background: #1e1a08;
  color: #f0e0a0;
  border-color: #c8a84a;
}

/* ── Footer ── */
.footer {
  margin-top: 48px;
  font-size: 0.75rem;
  color: #7a6a30;
  letter-spacing: 0.08em;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .headerInner {
    flex-direction: column;
    gap: 12px;
  }

  .nav {
    margin-left: 0;
    gap: 14px;
  }

  .heroCard {
    max-width: 100%;
  }

  .wrap {
    padding: 28px 16px 48px;
  }
}

/* ── Tablet: allow nav to wrap below logo if needed ── */
@media (max-width: 860px) {
  .headerInner {
    flex-wrap: wrap;
  }
  .nav {
    margin-left: 0;
    justify-content: flex-start;
    gap: 8px;
  }
  .nav a {
    padding: 6px 12px;
    font-size: 0.72rem;
  }
}

/* ============================================
   GRIT + GLITCH EFFECTS
   ============================================ */

/* ── Grain overlay (CSS noise via SVG data URI) ── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

/* ── Scanlines overlay ── */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9997;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.10) 3px,
    rgba(0, 0, 0, 0.10) 4px
  );
}

/* ── Vignette ── */
.wrap::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9996;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* ── Glitch animation on h1 headings ── */
@keyframes glitch-shift {
  0%   { clip-path: inset(0 0 98% 0); transform: translate(-3px, 0); opacity: 1; }
  10%  { clip-path: inset(30% 0 50% 0); transform: translate(3px, 0); }
  20%  { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 0); }
  30%  { clip-path: inset(80% 0 5% 0); transform: translate(2px, 0); }
  40%  { clip-path: inset(10% 0 70% 0); transform: translate(-3px, 0); }
  100% { clip-path: inset(0 0 98% 0); transform: translate(0); opacity: 0; }
}

@keyframes glitch-trigger {
  0%, 89%   { opacity: 0; }
  90%        { opacity: 1; }
  95%        { opacity: 0; }
  97%        { opacity: 1; }
  100%       { opacity: 0; }
}

.h1 {
  position: relative;
}

.h1::before,
.h1::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  pointer-events: none;
  font-size: inherit;
  letter-spacing: inherit;
}

.h1::before {
  color: #c8a84a;
  animation:
    glitch-trigger 7s infinite,
    glitch-shift 0.18s steps(1) infinite;
  animation-delay: 0s, 0s;
  mix-blend-mode: screen;
  opacity: 0;
}

.h1::after {
  color: #60a0c0;
  animation:
    glitch-trigger 7s infinite,
    glitch-shift 0.18s steps(1) reverse infinite;
  animation-delay: 3.5s, 0.04s;
  mix-blend-mode: screen;
  opacity: 0;
}

/* ── Subtle flicker on the header border ── */
@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96%            { opacity: 0.6; }
  97%            { opacity: 1; }
  98%            { opacity: 0.7; }
  99%            { opacity: 1; }
}

.siteHeader {
  animation: flicker 8s infinite;
}

/* ── Background Video ── */
.bgVideo {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0.48;
  pointer-events: none;
}

/* Body must create a stacking context for z-index:-1 on video to work */
body {
  background: #050503;
  position: relative;
  isolation: isolate;
}

/* Header and main above video */
.siteHeader, main {
  position: relative;
  z-index: 1;
}

/* Ensure all content sits above the video */
.siteHeader, main {
  position: relative;
  z-index: 1;
}
