/* =====================================================
 Grigsbys World Productions — styles.css (rev w/ brand)
 Compatible with: index.html, project-a/b/c.html shells
 Keeps ember vibe, adds:
 - Card grid for homepage
 - Project hero + CTAs
 - Media grid, info grid, press kit polish
 - Brand logo background + nav lockup
 - Tokenized color variables for quick theming
===================================================== */

/* -------------------------------------
   THEME TOKENS
------------------------------------- */
:root {
  /* Palette */
  --bg: #1a1110;
  --bg-elev: #1f1514;
  --text: #fceee3;
  --text-dim: #d9cabe;
  --accent: #e1b382; /* gold */
  --accent-2: #d19b69; /* ember */
  --border: #3b2b28;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);

  /* Brand background */
  --bg-img: url("");
  --bg-mark-size: clamp(420px, 55vmin, 720px);
  --bg-mark-offset: 38%;

  /* Radii + spacing */
  --r-6: 6px; --r-8: 8px; --r-10: 10px; --r-12: 12px; --r-16: 16px; --r-24: 24px;
  --gap-8: 8px; --gap-10: 10px; --gap-12: 12px; --gap-16: 16px; --gap-20: 20px; --gap-24: 24px; --gap-32: 32px; --gap-40: 40px; --gap-56: 56px;
}

/* -------------------------------------
   GLOBALS
------------------------------------- */
:root { color-scheme: dark; }
#site { display: none; }
html.loaded #site { display: block; }

html, body { height: 100%; }
body {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; text-align: center; padding: 2rem; margin-top: 1.5rem;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background-color: var(--bg); color: var(--text);
}

/* Background fade-in once loaded */
#background {
  position: fixed; inset: 0; z-index: -1; opacity: 0; transition: opacity 1.5s ease-in;
  background: var(--bg-img);
  background-size: cover; background-position: center; background-repeat: no-repeat; background-attachment: fixed;
  background-color: #0f0b0a;
}
body.loaded #background { opacity: 1; }

/* Watermark logo */
#background::after {
content: "";
position: absolute; inset: 0;
background: url('/assets/gwp-logo-gold.png') no-repeat center;
background-size: clamp(420px, 55vmin, 720px) auto;
opacity: 0.07; /* subtle watermark */
pointer-events: none;
filter: drop-shadow(0 0 12px rgba(0,0,0,0.6));
}

/* Typography */
h1, h2, h3 { color: var(--text); }
h1 { font-family: 'Cinzel', serif; font-size: clamp(2.2rem, 3.8vw, 3.2rem); font-weight: 700; text-shadow: 0 0 10px rgba(255,236,210,0.6), 0 0 20px rgba(255,156,110,0.4); }
h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); margin: 0 0 var(--gap-16); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin: 0 0 var(--gap-12); }

main { text-align: center; padding: 6rem 2rem 2rem; max-width: 1100px; margin: 0 auto; }
main p { color: var(--text); opacity: .95; }

/* Links */
a { color: var(--bg); text-decoration: none; }
a.btn, .btn-primary, .btn-secondary {
  display: inline-block; margin: 1rem; padding: 0.75rem 1.2rem; border-radius: var(--r-10); font-weight: 700; cursor: pointer; border: none;
}
.btn-primary { background: var(--accent); color: var(--bg); box-shadow: 0 6px 18px rgba(225,179,130,.15); }
.btn-primary:hover { filter: brightness(.95); }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-secondary:hover { background: rgba(225,179,130,0.1); }

:where(a, button, input, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-8); }

/* Embers */
.ember { position: absolute; width: 2px; height: 2px; background: var(--accent-2); border-radius: 50%; opacity: 0; animation: ember-drift 8s ease-in forwards; box-shadow: 0 0 6px #d19b69aa; }
@keyframes ember-drift { 0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; } 10% { opacity: 1; } 50% { transform: translateY(-40vh) translateX(-5vw) scale(.9); opacity: .8; } 90% { opacity: .1; } 100%{ transform: translateY(-100vh) translateX(5vw) scale(.7); opacity: 0; } }

/* -------------------------------------
   NAVIGATION
------------------------------------- */
#nav-bar { position: fixed; top: 20px; left: 20px; z-index: 1000; display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 36px; width: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.brand .brand-text { font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: .02em; color: var(--text); text-shadow: 0 1px 2px rgba(0,0,0,.35); }

#hamburger { display: none; font-size: 24px; padding: 10px 14px; background-color: rgba(0,0,0,0.7); color: #fff; border: none; border-radius: var(--r-8); cursor: pointer; transition: opacity .3s; }
#hamburger:hover { opacity: .85; }

.nav-buttons { position: fixed; top: 2rem; left: 50%; transform: translateX(-50%); display: flex; gap: 1.5rem; z-index: 10; }
.nav-buttons a { display: block; padding: .5rem .8rem; min-width: 120px; text-align: center; border-radius: var(--r-8); font-weight: 700; background: var(--accent-2); color: #000; transition: background-color .25s, box-shadow .25s; }
.nav-buttons a:hover { background-color: #e2b07c; box-shadow: 0 0 8px #d19b69aa; }

#nav-bar.collapsed #hamburger { display: inline-block; }
#nav-bar.collapsed .nav-buttons { display: none; }
#nav-bar.expanded .nav-buttons { display: flex; flex-direction: column; background: rgba(0,0,0,0.9); padding: 10px; border-radius: var(--r-8); margin-top: 10px; gap: 10px; align-items: flex-start; animation: slideIn .3s ease-out; position: static; transform: none; }
@keyframes slideIn { from { transform: translateX(-10px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.nav-buttons a[aria-current="page"], .nav-buttons a.active { background: #f5c793; }

/* -------------------------------------
   HOMEPAGE: FEATURED CARDS
------------------------------------- */
.cards { display: grid; grid-template-columns: 1fr; gap: var(--gap-16); margin: var(--gap-32) auto; width: min(1100px, 92vw); }
.card { display: grid; gap: var(--gap-8); padding: 20px; text-align: left; color: var(--text); background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--r-16); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0,0,0,0.5); background: rgba(0,0,0,0.42); }
.card h3 { font-family: 'Cinzel', serif; margin: 0; }
.card .logline { color: var(--text-dim); margin: 0; }
.card .cta { margin-top: 6px; color: var(--accent); font-weight: 700; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(3, 1fr); } }

/* -------------------------------------
   PROJECT PAGES: HERO + LAYOUT
------------------------------------- */
.project-hero { width: min(1100px, 94vw); margin: 7rem auto 2.5rem; padding: 2.2rem 1.2rem; text-align: center; background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.25)); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--r-24); box-shadow: var(--shadow); }
.hero-logo { display: block; margin: 0 auto var(--gap-16); width: min(520px, 80vw); height: auto; filter: drop-shadow(0 8px 24px rgba(0,0,0,.45)); }
.project-title { font-family: 'Cinzel', serif; font-size: clamp(2rem, 3.3vw, 3rem); margin: 0 0 .4rem; }
.project-logline { color: var(--text-dim); margin: 0 0 1rem; }
.project-ctas { display: flex; flex-wrap: wrap; gap: var(--gap-12); justify-content: center; margin-top: .5rem; }

.project-main { width: min(1100px, 94vw); margin: 0 auto 5rem; text-align: left; }
.project-main section { margin: 2.8rem 0; }

.bullets { padding-left: 1.2rem; margin: .6rem 0 0; }
.bullets li { margin: .3rem 0; color: var(--text-dim); }

.info-grid { display: grid; grid-template-columns: 1fr; gap: var(--gap-20); }
@media (min-width: 900px) { .info-grid { grid-template-columns: 1fr 1fr; } }

.media-grid { display: grid; grid-template-columns: 1fr; gap: var(--gap-16); }
.media-item { overflow: hidden; border-radius: var(--r-16); border: 1px solid rgba(255,255,255,0.06); box-shadow: var(--shadow); background: rgba(0,0,0,0.3); }
.media-item img, .media-item video { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
@media (min-width: 720px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .media-grid { grid-template-columns: repeat(3, 1fr); } }

.press-assets { display: flex; flex-wrap: wrap; gap: var(--gap-12); }
.press-assets .btn-secondary { margin: 0; }

/* -------------------------------------
   SUBSCRIBE BLOCK
------------------------------------- */
#subscribe { width: 100%; text-align: center; padding: 2rem 1rem 4rem; }
#subscribe form { display: inline-block; margin-top: 1rem; }
#subscribe input[type="email"] { padding: .6rem .7rem; width: min(340px, 90vw); background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); border-radius: var(--r-8); }
#subscribe input[type="email"]::placeholder { color: #c9b7aa; opacity: .85; }
#subscribe input[type="submit"] { margin-top: 1rem; padding: .6rem 1rem; background-color: var(--accent); color: var(--bg); border: none; border-radius: var(--r-8); font-weight: 700; cursor: pointer; }

/* -------------------------------------
   ABOUT
------------------------------------- */
#about { max-width: 700px; margin: 4rem auto; padding: 2rem; text-align: center; }
#about h3 { font-family: 'Cinzel', serif; font-size: clamp(1.6rem, 3vw, 2.5rem); margin-bottom: 1rem; }
#about p { font-size: 1rem; line-height: 1.65; color: var(--text); opacity: .95; }
#about a { color: var(--bg); background: var(--accent); padding: .3rem .6rem; border-radius: var(--r-6); }

/* -------------------------------------
   GATE OVERLAY
------------------------------------- */
#email-gate { position: fixed; inset: 0; display: grid; place-items: center; z-index: 999; background: rgba(0,0,0,0.35); animation: fadeInGate 300ms ease forwards; isolation: isolate; }
#email-gate, #email-gate *, #email-gate *::before, #email-gate *::after { box-sizing: border-box; }
#email-gate .visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
#email-gate .gate-title { font-family: 'Cinzel', serif; font-size: .95rem; letter-spacing: .06em; color: #f6e8dc; opacity: .9; margin-bottom: 20px; }
#email-gate .gate-headline { font-family: 'Cinzel', serif; font-size: clamp(1.5rem, 2vw + 1rem, 2.4rem); line-height: 1.25; color: var(--text); text-align: center; max-width: 56ch; margin: 0 auto 24px; padding: 0 12px; }
#email-gate .gate-sub { font-size: 1rem; color: var(--text); opacity: .9; text-align: center; max-width: 60ch; margin: 0 auto 28px; padding: 0 12px; }

#gate-form { background: rgba(26,17,16,.92); backdrop-filter: blur(2px); padding: 28px; border-radius: var(--r-12); box-shadow: var(--shadow); width: min(680px, 92vw); margin: 0 auto; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
#gate-email { padding: 12px 14px; border-radius: var(--r-8); border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); width: 100%; outline: none; }
#gate-email::placeholder { color: #c9b7aa; opacity: .8; }
#gate-email:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(225,179,130,.25); }

.btn-primary, .btn-secondary { padding: 12px 18px; border-radius: var(--r-10); font-weight: 700; border: none; cursor: pointer; }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); margin-top: 18px; }
.gate-post { font-size: .9rem; color: var(--text-dim); text-align: center; margin-top: 10px; }
html.loaded #email-gate { display: none; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr auto; align-items: center; } }
@media (prefers-reduced-motion: reduce) { #email-gate { animation: none; } }
@keyframes fadeInGate { from { opacity: 0 } to { opacity: 1 } }

/* Gate embers */
#gate-embers { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.gate-content { position: relative; z-index: 1; }
.g-ember { position: absolute; width: 2px; height: 2px; background: var(--accent-2); border-radius: 50%; opacity: 0; animation: g-ember-drift 8s ease-in forwards; box-shadow: 0 0 6px #d19b69aa; }
@keyframes g-ember-drift { 0%{ transform: translateY(0) translateX(0) scale(1); opacity: 0; } 10%{ opacity: 1; } 50%{ transform: translateY(-40vh) translateX(-5vw) scale(.9); opacity: .8; } 90%{ opacity: .1; } 100%{ transform: translateY(-100vh) translateX(5vw) scale(.7); opacity: 0; } }
#gate-embers.fade-out { transition: opacity 400ms ease; opacity: 0; }

/* -------------------------------------
   ANIMATIONS (carryover)
------------------------------------- */
@keyframes fadeInTitle { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInTagline { to { opacity: 1; transform: translateY(0); } }

h1 { opacity: 0; transform: translateY(20px); animation: fadeInTitle 1.8s ease-out 1.2s forwards; }
main p { opacity: 0; transform: translateY(10px); animation: fadeInTagline 1.5s ease-out 1.6s forwards; }
#subscribe { opacity: 0; transform: translateY(20px); animation: fadeInSub 1.4s ease-out 2s forwards; }
@keyframes fadeInSub { to { opacity: 1; transform: translateY(0); } }

/* -------------------------------------
   UTILITIES
------------------------------------- */
.hidden-section { opacity: 0; transform: translateY(20px); transition: opacity 1.2s ease-out, transform 1.2s ease-out; padding: 4rem 2rem; max-width: 800px; margin: 0 auto; text-align: center; }
#what-is-this { opacity: 0; transform: translateY(20px); transition: all .6s ease; }
#what-is-this.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .ember, .g-ember { animation: none !important; opacity: .4; }
  h1, main p, #subscribe, .nav-link { animation: none !important; }
  * { transition: none !important; }
}

/* iOS Safari: background-attachment fallback */
@supports (-webkit-touch-callout: none) { #background { background-attachment: scroll; } }

.footer-links a {
  color: var(--accent);
  margin: 0 10px;
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
}