/* =========================================================
   Raw Tale Games — Dreadwoods Gatekeeper
   ========================================================= */

:root {
  --bg:            #141110;
  --bg-2:          #1b1613;
  --bg-3:          #241d18;
  --ink:           #ece4d8;
  --ink-dim:       #a99a8a;
  --blood:         #9a3b2e;
  --blood-bright:  #c6543f;
  --ember:         #e0a24b;
  --line:          rgba(236, 228, 216, 0.10);
  --line-strong:   rgba(236, 228, 216, 0.20);
  --header-h:      70px;
  --maxw:          1200px;
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
  --font-display:  "Bebas Neue", "Arial Narrow", sans-serif;
  --font-body:     "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif:    "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; font-weight: 400; line-height: .95; letter-spacing: .01em; }
.display { font-family: var(--font-display); text-transform: uppercase; }

p { margin: 0 0 1.1rem; }

::selection { background: var(--blood); color: #fff; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Film grain overlay */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 10;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: no-preference) {
  .grain { animation: grain 6s steps(6) infinite; }
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  10% { transform: translate(-4%,-4%); }
  30% { transform: translate(3%,-2%); }
  50% { transform: translate(-2%,4%); }
  70% { transform: translate(4%,2%); }
  90% { transform: translate(-3%,3%); }
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
}

.section { padding: clamp(72px, 13vw, 150px) 0; position: relative; }
.section--tint { background: var(--bg-2); }

.kicker {
  display: inline-block;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(2.6rem, 7vw, 5rem);
  letter-spacing: .015em;
  margin-bottom: .5em;
}

.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink); max-width: 60ch; }
.muted { color: var(--ink-dim); }

/* Thorn divider */
.divider {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--line-strong);
  margin: 0 auto;
  max-width: 340px;
}
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: currentColor; }
.divider svg { width: 34px; height: 34px; fill: none; stroke: var(--blood-bright); stroke-width: 1.5; opacity: .8; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--blood);
  color: #fdf6ef;
  border: 1px solid var(--blood);
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.btn:hover { background: var(--blood-bright); border-color: var(--blood-bright); transform: translateY(-2px); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: rgba(236,228,216,.06); border-color: var(--ink-dim); }

.btn-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(20, 17, 16, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { width: 34px; height: auto; }
.brand span {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 30px; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color .15s var(--ease);
}
.nav-links a:hover { color: var(--ink); }

.nav .btn { padding: 10px 20px; font-size: .95rem; }

.menu-toggle {
  display: none;
  background: none; border: none; color: var(--ink);
  width: 44px; height: 44px; cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-toggle svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 2; fill: none; }

@media (max-width: 940px) {
  .menu-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    background: rgba(16, 13, 12, .98);
    border-bottom: 1px solid var(--line);
    padding: 10px 0 22px;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s var(--ease), transform .22s var(--ease);
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a { padding: 15px clamp(20px, 5vw, 56px); font-size: 1rem; border-bottom: 1px solid var(--line); }
  .nav .btn { margin: 16px clamp(20px, 5vw, 56px) 0; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 40px) 0 clamp(48px, 9vw, 96px);
  overflow: hidden;
  background: var(--bg);
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0c0a09 url("../assets/hero-promo.jpg") center / cover no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .hero__bg { animation: heroZoom 26s ease-in-out infinite alternate; }
}
@keyframes heroZoom {
  from { transform: scale(1.02); }
  to   { transform: scale(1.12); }
}
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(12,10,9,.88) 0%, rgba(12,10,9,.5) 38%, rgba(12,10,9,.15) 70%, rgba(12,10,9,.35) 100%),
    linear-gradient(0deg, var(--bg) 2%, rgba(12,10,9,.55) 30%, rgba(12,10,9,0) 62%),
    radial-gradient(130% 100% at 50% 35%, transparent 50%, rgba(0,0,0,.5) 100%);
}
.hero .wrap { position: relative; z-index: 2; }
.hero__inner { max-width: 620px; }
.hero__title {
  width: min(540px, 80vw);
  margin: -34px 0 6px -6px;
  filter: drop-shadow(0 12px 30px rgba(0,0,0,.6));
}
.hero__tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.35rem, 3.4vw, 2.1rem);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 14px;
  text-shadow: 0 2px 20px rgba(0,0,0,.7);
}
.hero__sub {
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 30px;
}
.hero__note {
  margin-top: 20px;
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.hero__note::before { content: "▸ "; color: var(--blood-bright); }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--ink-dim);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.scroll-cue span { width: 1px; height: 34px; background: linear-gradient(var(--ink-dim), transparent); }
@media (max-width: 700px) { .scroll-cue { display: none; } }

/* ---------- The game ---------- */
.game-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.game-copy .feature-list {
  list-style: none;
  margin: 26px 0 32px;
  padding: 0;
  display: grid;
  gap: 14px;
}
.game-copy .feature-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--ink);
}
.game-copy .feature-list svg {
  flex-shrink: 0;
  width: 22px; height: 22px;
  stroke: var(--blood-bright);
  fill: none; stroke-width: 1.6;
  margin-top: 3px;
}
.game-media {
  position: relative;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
.game-media img { width: 100%; height: 100%; object-fit: cover; }
.game-media figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 18px 12px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
  background: linear-gradient(0deg, rgba(10,8,7,.9), transparent);
}
.steam-callout {
  margin-top: 8px;
  padding: 22px 26px;
  border-left: 3px solid var(--blood);
  background: var(--bg-3);
  color: var(--ink-dim);
}
.steam-callout a { color: var(--ember); }
.steam-callout a:hover { color: #f2c078; }

@media (max-width: 860px) {
  .game-grid { grid-template-columns: 1fr; }
}

/* ---------- Media / screenshots ---------- */
.shots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.shot {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
}
.shot:nth-child(1) { grid-column: span 4; grid-row: span 2; aspect-ratio: auto; }
.shot:nth-child(2) { grid-column: span 2; }
.shot:nth-child(3) { grid-column: span 2; }
.shot:nth-child(4) { grid-column: span 2; }
.shot:nth-child(5) { grid-column: span 2; }
.shot:nth-child(6) { grid-column: span 2; }
.shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease), filter .3s var(--ease);
  filter: saturate(.92) contrast(1.02);
}
.shot:hover img { transform: scale(1.05); filter: none; }
.shot::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 60px rgba(0,0,0,.5);
  pointer-events: none;
}
@media (max-width: 760px) {
  .shots { grid-template-columns: repeat(2, 1fr); }
  .shot, .shot:nth-child(n) { grid-column: span 1; grid-row: auto; aspect-ratio: 16 / 9; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 6, 5, .95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease);
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 90vh; border: 1px solid var(--line-strong); }
.lightbox__close {
  position: absolute;
  top: 20px; right: 24px;
  background: none; border: none;
  color: var(--ink); font-size: 2rem; line-height: 1;
  cursor: pointer; width: 44px; height: 44px;
}

/* ---------- Studio ---------- */
.studio {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(28px, 6vw, 64px);
  align-items: center;
  max-width: 900px;
}
.studio img { width: 100%; max-width: 200px; }
.studio blockquote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--ink);
}
.studio blockquote span { color: var(--ink-dim); font-size: .95rem; font-style: normal; font-family: var(--font-body); display: block; margin-top: 18px; letter-spacing: .04em; }
.studio blockquote a { color: var(--ember); }
@media (max-width: 640px) {
  .studio { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

/* ---------- Get involved ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  padding: 30px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.card:hover { border-color: var(--blood); transform: translateY(-3px); background: #2a221b; }
.card__label {
  font-size: .68rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 12px;
}
.card h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.7rem;
  letter-spacing: .02em;
  margin-bottom: 10px;
}
.card p { color: var(--ink-dim); font-size: .95rem; margin-bottom: 20px; }
.card__go {
  margin-top: auto;
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.card__go::after { content: "→"; transition: transform .2s var(--ease); }
.card:hover .card__go::after { transform: translateX(5px); }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact-inner { max-width: 640px; }
.contact-mail {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: .04em;
  text-transform: lowercase;
  color: var(--ink);
  margin: 6px 0 30px;
  border-bottom: 2px solid var(--blood);
  padding-bottom: 4px;
}
.contact-mail:hover { color: var(--blood-bright); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: clamp(44px, 7vw, 72px) 0 40px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 46px; }
.footer-brand span { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .16em; text-transform: uppercase; }
.footer-social { display: flex; gap: 18px; }
.footer-social a { color: var(--ink-dim); transition: color .15s var(--ease), transform .15s var(--ease); }
.footer-social a:hover { color: var(--ink); transform: translateY(-2px); }
.footer-social svg { width: 22px; height: 22px; fill: currentColor; }
.footer-bottom {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

/* ---------- Reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
html.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; } }
