/* Brainstatic Games — studio site. Plain CSS, no build step. */

@font-face { font-family: "Oswald"; src: url("/fonts/oswald_400.ttf") format("truetype"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Pirata One"; src: url("/fonts/pirata_one_400.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "IM Fell English SC"; src: url("/fonts/im_fell_english_sc_400.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/eb_garamond_400.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0d0c0b;
  --bg-2: #14120f;
  --bg-3: #1c1915;
  --line: #2c2823;
  --text: #ece5d6;
  --muted: #a39a88;
  --dim: #6f6759;
  --static: #5ee8d2;      /* studio accent: the green-blue spark */
  --static-deep: #1f6f66;
  --ember: #f0923a;       /* Hollowmarch accent: the brazier */
  --ember-deep: #8a3f12;
  --sans: "Oswald", "Arial Narrow", system-ui, sans-serif;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.125rem/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
em { font-style: italic; color: #fff; }
h1, h2, h3 { font-family: var(--sans); font-weight: 500; letter-spacing: .02em; line-height: 1.05; margin: 0 0 .5em; text-transform: uppercase; }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h3 { font-size: 1.3rem; letter-spacing: .04em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font: 500 .8rem/1 var(--sans); letter-spacing: .28em; text-transform: uppercase;
  color: var(--static); margin: 0 0 1rem;
  display: inline-flex; align-items: center; gap: .7em;
}
.eyebrow::before { content: ""; width: 1.8em; height: 2px; background: currentColor; box-shadow: 0 0 8px currentColor; }

/* pixel art stays crisp at any size */
.hero-art, .pillars img, .gallery img, .boss-row img, .studio-art img, .title-art img, .ledge {
  image-rendering: pixelated; image-rendering: crisp-edges;
}

.skip { position: absolute; left: -999px; top: 0; background: var(--static); color: #000; padding: .6em 1em; z-index: 100; font-family: var(--sans); }
.skip:focus { left: 1rem; top: 1rem; }

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

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 18px var(--gutter);
  transition: background .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(13,12,11,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding-top: 12px; padding-bottom: 12px; border-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font: 500 1.15rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.brand b { font-weight: 500; color: var(--static); margin-left: .35em; }
.brand img { image-rendering: pixelated; }
.brand.small { font-size: .95rem; }
.nav nav { display: flex; gap: clamp(.9rem, 3vw, 2.2rem); }
.nav nav a {
  font: 400 .85rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; text-decoration: none; color: var(--muted);
  position: relative; padding: .4em 0; transition: color .2s;
}
.nav nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px; background: var(--static); transition: right .25s; }
.nav nav a:hover { color: var(--text); }
.nav nav a:hover::after { right: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 .9rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  padding: 1.05em 1.7em; border: 1px solid transparent;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background .2s, color .2s, box-shadow .2s, transform .2s;
}
.btn-primary { background: var(--static); color: #04110f; }
.btn-primary:hover { background: #8ff3e3; transform: translateY(-1px); }
.btn-ghost { border-color: rgba(236,229,214,.35); color: var(--text); background: rgba(13,12,11,.35); }
.btn-ghost:hover { border-color: var(--text); background: rgba(236,229,214,.08); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.hero-art {
  position: absolute; inset: -4%; z-index: -3;
  background: url("/img/act_1_end.png") center 60% / cover no-repeat;
  animation: drift 40s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1.02) translateX(-1%); } to { transform: scale(1.08) translateX(1%); } }
.static { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: .07; mix-blend-mode: screen; image-rendering: pixelated; pointer-events: none; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(13,12,11,.55) 0%, rgba(13,12,11,0) 22%, rgba(13,12,11,0) 45%, rgba(13,12,11,.85) 80%, var(--bg) 100%),
    radial-gradient(ellipse at 20% 80%, rgba(13,12,11,.6), transparent 60%);
}
.hero-shade::after { /* faint scanlines */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.hero-copy { padding-bottom: clamp(5rem, 12vh, 8rem); padding-top: 8rem; }
.hero h1 {
  font-size: clamp(3rem, 9vw, 7.5rem); font-weight: 600; line-height: .92; letter-spacing: .01em; margin-bottom: .35em;
  text-shadow: 0 2px 30px rgba(0,0,0,.6);
}
.lede { font-size: clamp(1.1rem, 1.6vw, 1.35rem); max-width: 34em; color: #d9d1c0; text-shadow: 0 1px 12px rgba(0,0,0,.7); }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.scroll-cue { position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%); width: 22px; height: 36px; border: 1px solid rgba(236,229,214,.4); border-radius: 12px; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 2px; height: 7px; margin-left: -1px; background: var(--static); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* glitch flicker on the headline, once in a while */
.hero h1 { position: relative; }
.hero h1.glitch { animation: glitch .35s steps(2) 1; }
@keyframes glitch {
  0% { text-shadow: -3px 0 var(--static), 3px 0 #ff3d6e; transform: translateX(1px); }
  50% { text-shadow: 3px 0 var(--static), -3px 0 #ff3d6e; transform: translateX(-1px); }
  100% { text-shadow: 0 2px 30px rgba(0,0,0,.6); transform: none; }
}

/* ---------- Hollowmarch ---------- */
.game { position: relative; padding: clamp(5rem, 10vw, 8rem) 0; background: radial-gradient(ellipse at 50% 0%, rgba(240,146,58,.10), transparent 55%), var(--bg); }
.game .eyebrow, .game h3 { color: var(--ember); }
.game-head { text-align: center; display: flex; flex-direction: column; align-items: center; margin-bottom: clamp(3rem, 6vw, 5rem); }
/* The title fire, as on the game's main menu: art pixels at 4x. The basket
   is 34x30, three 10x16 flames from the kit sheet flicker out of step, and
   the glow is centred on (17, 12). */
.title-art { position: relative; width: 136px; height: 120px; margin-bottom: .2rem; }
.title-art .glow { position: absolute; left: -70px; top: -90px; width: 276px; height: 276px; max-width: none; opacity: .75; animation: breathe 3.2s ease-in-out infinite; }
.title-art .brazier { position: absolute; left: 0; top: 0; width: 136px; height: 120px; }
@keyframes breathe { 0%,100% { opacity: .6; } 45% { opacity: .9; } 70% { opacity: .7; } }
.flame {
  position: absolute; width: 40px; height: 64px;
  background: url("/img/flame.png") 0 0 / 240px 64px no-repeat;
  image-rendering: pixelated;
  animation: flicker .6s steps(6) infinite;
}
.flame.f1 { left: 24px; top: 12px; animation-delay: -.3s; }
.flame.f2 { left: 72px; top: 16px; animation-delay: -.1s; }
.flame.f3 { left: 48px; top: 0; }
@keyframes flicker { to { background-position: -240px 0; } }
.ember { position: absolute; left: 68px; top: 24px; width: 4px; height: 4px; background: #fde3a1; opacity: 0; animation: rise 2.4s linear infinite; }
.ember:nth-of-type(4) { left: 40px;  animation-delay: 0s; }
.ember:nth-of-type(5) { left: 84px;  animation-delay: -.4s; animation-duration: 2.8s; }
.ember:nth-of-type(6) { left: 60px;  animation-delay: -.9s; }
.ember:nth-of-type(7) { left: 100px; animation-delay: -1.3s; animation-duration: 2.1s; }
.ember:nth-of-type(8) { left: 52px;  animation-delay: -1.7s; animation-duration: 2.6s; }
.ember:nth-of-type(9) { left: 76px;  animation-delay: -2.1s; }
@keyframes rise {
  0%   { opacity: 1;  transform: translate(0, 0); background: #fde3a1; }
  50%  { opacity: .9; transform: translate(6px, -40px); background: #f2b859; }
  100% { opacity: 0;  transform: translate(16px, -84px); background: #e07a2e; }
}
.hm-title { font-family: "Pirata One", var(--serif); text-transform: none; font-weight: 400; letter-spacing: .01em; font-size: clamp(3.4rem, 10vw, 7rem); line-height: 1; margin: 0; color: #f0dc8c; text-shadow: 0 4px 0 #5a2a12, 0 0 40px rgba(240,146,58,.25); }
.ledge { width: min(420px, 80%); height: auto; margin: .2rem 0 1.8rem; opacity: .9; }
.hm-line { font-family: "IM Fell English SC", var(--serif); font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.5; color: #e2d6bf; max-width: 40em; }
.facts { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; border: 1px solid var(--line); background: var(--bg-2); }
.facts li { padding: .9rem 1.5rem; font: 400 1rem/1.2 var(--sans); letter-spacing: .06em; border-right: 1px solid var(--line); text-align: left; }
.facts li:last-child { border-right: 0; }
.facts span { display: block; font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); margin-bottom: .35em; }

.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 2rem); }
.pillars article { background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; transition: border-color .3s, transform .3s; }
.pillars article:hover { border-color: rgba(240,146,58,.5); transform: translateY(-3px); }
.pillars img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .6s; }
.pillars article:hover img { transform: scale(1.04); }
.pillars h3 { margin: 1.4rem 1.5rem .5rem; }
.pillars p { margin: 0 1.5rem 1.6rem; color: var(--muted); }
.for-fans { text-align: center; margin: clamp(2.5rem, 5vw, 4rem) auto 0; color: var(--muted); font-size: 1.15rem; }

/* ---------- Places + bosses ---------- */
.places, .bosses { padding: clamp(4rem, 8vw, 6.5rem) 0; border-top: 1px solid var(--line); }
.places { background: var(--bg-2); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.6rem, 1.5vw, 1rem); margin-top: 2rem; }
figure { margin: 0; position: relative; overflow: hidden; background: #000; }
figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .7s, filter .4s; filter: saturate(.9); }
figure:hover img { transform: scale(1.05); filter: saturate(1.1); }
figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2.2rem 1rem .8rem;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  font: 400 .8rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase;
}
.boss-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(.6rem, 1.5vw, 1rem); margin-top: 2rem; }
.boss-row img { aspect-ratio: 3 / 4; object-position: 50% 60%; }
.bosses .eyebrow { color: #ff6b5e; }

/* ---------- Studio ---------- */
.studio { padding: clamp(5rem, 10vw, 8rem) 0; border-top: 1px solid var(--line); }
.studio-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.studio-art { position: relative; }
.studio-art img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line); }
.studio-art::after { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 1px solid var(--static-deep); z-index: -1; }
.studio p { color: #d6cebd; }
.values { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 1rem; }
.values li { padding-left: 1.3rem; border-left: 2px solid var(--static); color: var(--muted); }
.values b { display: block; font: 500 1.05rem/1.3 var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--text); margin-bottom: .15rem; }

/* ---------- Contact ---------- */
.contact { padding: 0 0 clamp(5rem, 10vw, 8rem); }
.contact-card {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  padding-top: clamp(2.5rem, 5vw, 3.5rem); padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
  background:
    linear-gradient(135deg, rgba(94,232,210,.10), transparent 60%),
    var(--bg-3);
  border: 1px solid var(--line);
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--wrap) - 2 * var(--gutter));
}
.contact-card > div { max-width: 36em; }
.contact-card p { color: var(--muted); margin: 0; }
.contact h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.mail { text-transform: none; letter-spacing: .06em; font-size: 1rem; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--dim); font: 400 .85rem/1.4 var(--sans); letter-spacing: .08em; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot p { margin: 0; }
.foot .brand { color: var(--muted); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .boss-row { grid-template-columns: repeat(3, 1fr); }
  .boss-row figure:nth-child(n+4) { display: none; }
  .studio-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .nav nav a:not(:last-child) { display: none; }
  .pillars, .gallery { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .facts { flex-direction: column; width: 100%; }
  .facts li { border-right: 0; border-bottom: 1px solid var(--line); }
  .facts li:last-child { border-bottom: 0; }
  .boss-row { grid-template-columns: repeat(2, 1fr); }
  .boss-row figure:nth-child(n+4) { display: block; }
  .boss-row figure:nth-child(5) { display: none; }
  .studio-art::after { display: none; }
  .mail { width: 100%; font-size: .9rem; letter-spacing: .03em; padding-left: 1em; padding-right: 1em; }
  .hm-line br { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
