/* =====================================================================
   STINKIN LINKIN — Main Stylesheet
   ---------------------------------------------------------------------
   This single file controls how the WHOLE site looks. It's organized
   into clearly-labelled sections. To change a colour, font, or spacing
   everywhere at once, edit the variables in ":root" right below.

   Theme: dark, mythic, Norse — fire (ember) and ice (frost) duality.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. DESIGN TOKENS  (the master controls — change these first)
   --------------------------------------------------------------------- */
:root {
  /* Colours (taken straight from the logo) */
  --ink:        #0E0E10;   /* near-black background */
  --ink-soft:   #141417;   /* slightly lighter background panels */
  --stone:      #1B1B20;   /* raised surfaces / cards */
  --stone-edge: #2A2A31;   /* card borders, hairlines */

  --frost:      #3B8EA5;   /* ICE accent (steel teal-blue) */
  --frost-lit:  #5BB8D4;   /* ICE highlight */
  --ember:      #E1721C;   /* FIRE accent (ember orange) */
  --ember-lit:  #FFB347;   /* FIRE glow highlight */

  --parchment:  #EDE8E0;   /* main text (warm off-white) */
  --muted:      #9A958C;   /* secondary / caption text */
  --muted-dim:  #6E6A63;   /* faint text */

  /* Typography */
  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing scale */
  --gap-xs: 0.5rem;
  --gap-sm: 1rem;
  --gap-md: 2rem;
  --gap-lg: 4rem;
  --gap-xl: 7rem;

  /* Shape & depth */
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  --max-width: 1180px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --speed: 0.35s;
}

/* ---------------------------------------------------------------------
   2. RESET & BASE
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--ink);
  /* Faint stone texture: layered radial glows over near-black.
     Cheap to render (pure CSS), no image file needed. */
  background-image:
    radial-gradient(1100px 600px at 50% -8%, rgba(59, 142, 165, 0.10), transparent 60%),
    radial-gradient(900px 600px at 50% 112%, rgba(225, 114, 28, 0.12), transparent 60%);
  background-attachment: fixed;
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--frost-lit); text-decoration: none; transition: color var(--speed) var(--ease); }
a:hover { color: var(--ember-lit); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.5px;
  margin: 0 0 var(--gap-sm);
}

/* ---------------------------------------------------------------------
   3. LAYOUT HELPERS
   --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: var(--gap-xl) 0; }
.section--tight { padding: var(--gap-lg) 0; }

/* The signature "duality seam": a thin rule that fades ice -> ember.
   Used to divide sections, echoing the blue/orange split in the logo. */
.seam {
  height: 2px;
  border: 0;
  background: linear-gradient(90deg,
      transparent, var(--frost) 30%, var(--ember) 70%, transparent);
  opacity: 0.6;
  margin: 0 auto;
  max-width: var(--max-width);
}

/* Eyebrow label above section titles (small, letterspaced, runic feel) */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--frost-lit);
  margin: 0 0 0.75rem;
}

.section-head { max-width: 720px; margin-bottom: var(--gap-md); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.section-head .lead { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* ---------------------------------------------------------------------
   4. BUTTONS
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease),
              background var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.btn:hover { transform: translateY(-2px); }

/* Fire button — primary action */
.btn--fire {
  background: linear-gradient(135deg, var(--ember), #c25e12);
  color: #fff;
  box-shadow: 0 8px 22px rgba(225, 114, 28, 0.28);
}
.btn--fire:hover { color: #fff; box-shadow: 0 12px 30px rgba(255, 179, 71, 0.42); }

/* Ice button — secondary action */
.btn--ice {
  background: transparent;
  color: var(--frost-lit);
  border-color: var(--frost);
}
.btn--ice:hover { color: var(--ember-lit); border-color: var(--ember); }

.btn--ghost { background: transparent; color: var(--parchment); border-color: var(--stone-edge); }
.btn--ghost:hover { border-color: var(--frost); color: var(--frost-lit); }

.btn[disabled], .btn--disabled {
  opacity: 0.45; cursor: not-allowed; pointer-events: none;
}

/* ---------------------------------------------------------------------
   5. TOP NAVIGATION  (built by js/partials.js, styled here)
   --------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 14, 16, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stone-edge);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav__brand { display: flex; align-items: center; gap: 0.7rem; }
.nav__brand img { width: 38px; height: 38px; }
.nav__brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 1rem;
  color: var(--parchment);
  text-transform: uppercase;
}
.nav__links { display: flex; align-items: center; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--parchment);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
.nav__links a:hover { background: var(--stone); color: var(--frost-lit); }
.nav__links a.is-active { color: var(--ember-lit); }

/* "Store — Soon" pill: reserved nav space for the future shop */
.nav__soon {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.62rem; letter-spacing: 0.1em;
  color: var(--muted-dim);
  border: 1px dashed var(--stone-edge);
  padding: 0.15rem 0.5rem; border-radius: 999px;
  cursor: not-allowed;
}

.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 10px;
}
.nav__toggle span { display: block; height: 2px; background: var(--parchment); margin: 5px 0; transition: var(--speed); }

/* ---------------------------------------------------------------------
   6. HERO  (home page)
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--gap-lg) 1.5rem var(--gap-xl);
  overflow: hidden;
}
/* The ember particle canvas sits behind everything in the hero */
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__inner { position: relative; z-index: 2; max-width: 760px; }

.hero__logo-wrap { position: relative; display: inline-block; margin-bottom: var(--gap-md); }
.hero__logo {
  /* Size of the emblem. Bigger number = bigger logo. On shorter screens a very
     large logo can push the buttons down, so ~600 is a good "big but balanced". */
  width: min(600px, 84vw);
  height: auto;            /* keeps it a perfect circle at any width (no squish) */
  aspect-ratio: 1 / 1;     /* belt-and-suspenders: force a square box */
  border-radius: 50%;
  /* ice glow above, ember glow below — the duality, around the emblem */
  filter:
    drop-shadow(0 -6px 34px rgba(91, 184, 212, 0.30))
    drop-shadow(0 18px 46px rgba(225, 114, 28, 0.38));
  animation: emberPulse 6s ease-in-out infinite;
}
@keyframes emberPulse {
  0%, 100% { filter: drop-shadow(0 -6px 30px rgba(91,184,212,0.26)) drop-shadow(0 16px 40px rgba(225,114,28,0.34)); }
  50%      { filter: drop-shadow(0 -6px 40px rgba(91,184,212,0.36)) drop-shadow(0 22px 56px rgba(255,179,71,0.48)); }
}

.hero__tagline {
  font-family: var(--font-display);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-size: clamp(0.8rem, 2.4vw, 1.05rem);
  color: var(--frost-lit);
  margin: 0 0 1.2rem;
}
.hero__intro { font-size: 1.18rem; color: var(--parchment); margin: 0 auto var(--gap-md); max-width: 560px; }
.hero__cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

.hero__scroll {
  position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  z-index: 2; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100%{ transform: translate(-50%, 0);} 50%{ transform: translate(-50%, 6px);} }

/* ---------------------------------------------------------------------
   7. PILLAR CARDS  (the four content areas on the home page)
   --------------------------------------------------------------------- */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.pillar {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--stone);
  border: 1px solid var(--stone-edge);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.5rem;
  overflow: hidden;
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
/* top edge lights up: frost by default, ember on hover (duality) */
.pillar::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--frost); opacity: 0.7; transition: background var(--speed) var(--ease);
}
.pillar:hover { transform: translateY(-6px); border-color: var(--ember); }
.pillar:hover::before { background: var(--ember); }
.pillar__icon { width: 40px; height: 40px; margin-bottom: 1rem; color: var(--frost-lit); }
.pillar:hover .pillar__icon { color: var(--ember-lit); }
.pillar h3 { font-size: 1.25rem; }
.pillar p { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.2rem; flex-grow: 1; }
.pillar__more { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--parchment); }
.pillar:hover .pillar__more { color: var(--ember-lit); }

/* ---------------------------------------------------------------------
   8. GAME CARDS  (games page — built from content.js by render.js)
   --------------------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.6rem; }

.game-card {
  display: flex; flex-direction: column;
  background: var(--stone);
  border: 1px solid var(--stone-edge);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--speed) var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.game-card:hover { transform: translateY(-6px); border-color: var(--ember); box-shadow: var(--shadow); }
.game-card__thumb { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--ink-soft); }
.game-card__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.game-card__body h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.game-card__body p { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.3rem; flex-grow: 1; }
.game-card__tag {
  align-self: flex-start; font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--frost-lit); border: 1px solid var(--stone-edge); border-radius: 999px;
  padding: 0.2rem 0.6rem; margin-bottom: 0.9rem;
}

/* When a game is played "embedded", it loads into this stage via iframe */
.game-stage {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(8, 8, 10, 0.94);
  display: none; align-items: center; justify-content: center; flex-direction: column;
  padding: 1.5rem;
}
.game-stage.is-open { display: flex; }
.game-stage__frame {
  width: min(960px, 100%); aspect-ratio: 4 / 3; max-height: 80vh;
  border: 1px solid var(--stone-edge); border-radius: var(--radius);
  background: #000; overflow: hidden;
}
.game-stage__frame iframe { width: 100%; height: 100%; border: 0; }
.game-stage__bar { display: flex; align-items: center; justify-content: space-between; width: min(960px, 100%); margin-bottom: 0.8rem; }
.game-stage__title { font-family: var(--font-display); letter-spacing: 0.1em; }

/* ---------------------------------------------------------------------
   9. VIDEO EMBEDS  (animated shorts page)
   --------------------------------------------------------------------- */
.short { margin-bottom: var(--gap-lg); }
.short__frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--stone-edge); background: #000;
}
.short__frame iframe, .short__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.short h3 { margin-top: 1.1rem; font-size: 1.4rem; }
.short p { color: var(--muted); margin: 0.3rem 0 0; }

/* ---------------------------------------------------------------------
   10. MUSIC  (Spotify embed + links)
   --------------------------------------------------------------------- */
.music-embed {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--stone-edge); margin-bottom: var(--gap-md);
}
.music-embed iframe { display: block; width: 100%; border: 0; }

/* ---------------------------------------------------------------------
   11. CONCEPT ART GALLERY + LIGHTBOX
   --------------------------------------------------------------------- */
/* Responsive masonry-style columns. Images flow and keep their ratios. */
.gallery { columns: 3 280px; column-gap: 1rem; }
.gallery__item {
  break-inside: avoid; margin-bottom: 1rem; position: relative;
  border-radius: var(--radius); overflow: hidden; cursor: zoom-in;
  border: 1px solid var(--stone-edge); background: var(--ink-soft);
}
.gallery__item img { width: 100%; transition: transform 0.6s var(--ease), filter var(--speed) var(--ease); }
.gallery__item:hover img { transform: scale(1.05); }
.gallery__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.5rem 1rem 0.7rem;
  background: linear-gradient(transparent, rgba(8,8,10,0.85));
  font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.05em;
  opacity: 0; transition: opacity var(--speed) var(--ease);
}
.gallery__item:hover .gallery__cap { opacity: 1; }

.lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center;
  background: rgba(6, 6, 8, 0.95); padding: 2rem;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: var(--radius); box-shadow: var(--shadow); }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(27,27,32,0.7); border: 1px solid var(--stone-edge);
  color: var(--parchment); width: 48px; height: 48px; border-radius: 50%; font-size: 1.3rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--speed);
}
.lightbox__close:hover, .lightbox__nav:hover { border-color: var(--ember); color: var(--ember-lit); }
.lightbox__close { top: 1.5rem; right: 1.5rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 1.5rem; }
.lightbox__nav--next { right: 1.5rem; }

/* ---------------------------------------------------------------------
   12. CONNECT  (contact form, socials, newsletter)
   --------------------------------------------------------------------- */
.connect-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--gap-lg); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.85rem; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 0.4rem; }
.field input, .field textarea {
  width: 100%; background: var(--ink-soft); border: 1px solid var(--stone-edge);
  border-radius: var(--radius); color: var(--parchment); font-family: var(--font-body);
  font-size: 1rem; padding: 0.8rem 1rem; transition: border-color var(--speed) var(--ease);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--frost); }
.field textarea { min-height: 140px; resize: vertical; }

.socials { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }
.social-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--stone); border: 1px solid var(--stone-edge);
  border-radius: 999px; padding: 0.6rem 1.1rem;
  font-size: 0.9rem; color: var(--parchment);
  transition: border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.social-link:hover { border-color: var(--ember); color: var(--ember-lit); }
.social-link svg { width: 18px; height: 18px; }

.newsletter { background: var(--stone); border: 1px solid var(--stone-edge); border-radius: var(--radius-lg); padding: 1.6rem; margin-top: var(--gap-md); }
.newsletter h3 { font-size: 1.2rem; }
.newsletter p { color: var(--muted); font-size: 0.92rem; margin: 0 0 1rem; }
.newsletter__row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.newsletter__row input { flex: 1 1 220px; }

/* ---------------------------------------------------------------------
   13. STORE — placeholder (reserved, not built yet)
   --------------------------------------------------------------------- */
.store-soon { text-align: center; max-width: 620px; margin: 0 auto; }
.store-soon .rune { font-size: 3rem; color: var(--ember); margin-bottom: 1rem; }

/* ---------------------------------------------------------------------
   14. ABOUT
   --------------------------------------------------------------------- */
.prose { max-width: 720px; }
.prose p { margin: 0 0 1.3rem; color: var(--parchment); }
.prose p.intro { font-size: 1.25rem; color: var(--parchment); }

/* ---------------------------------------------------------------------
   15. FOOTER  (hub-and-spoke outbound links)
   --------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--stone-edge); background: var(--ink-soft); padding: var(--gap-lg) 0 var(--gap-md); margin-top: var(--gap-lg); }
.footer-grid { display: flex; justify-content: space-between; gap: var(--gap-md); flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 0.7rem; }
.footer-brand img { width: 44px; height: 44px; }
.footer-brand strong { font-family: var(--font-display); letter-spacing: 0.12em; }
.footer-links { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--frost-lit); margin: 0 0 0.8rem; }
.footer-col a { display: block; color: var(--muted); font-size: 0.9rem; padding: 0.2rem 0; }
.footer-col a:hover { color: var(--ember-lit); }
.footer-bottom { text-align: center; color: var(--muted-dim); font-size: 0.8rem; margin-top: var(--gap-md); }

/* ---------------------------------------------------------------------
   16. PAGE HEADER (inner pages — small banner under the nav)
   --------------------------------------------------------------------- */
.page-head { padding: var(--gap-lg) 0 var(--gap-md); text-align: center; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page-head p { color: var(--muted); font-size: 1.15rem; max-width: 620px; margin: 0 auto; }

/* small helper to fade content in on scroll (added by main.js) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------
   17. RESPONSIVE  (mobile-first adjustments)
   --------------------------------------------------------------------- */
@media (max-width: 960px) {
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .connect-grid { grid-template-columns: 1fr; gap: var(--gap-md); }
  .gallery { columns: 2 220px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .section { padding: var(--gap-lg) 0; }
  /* Mobile nav: hide links, show hamburger; links drop into a panel */
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; top: 68px; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(14,14,16,0.98); border-bottom: 1px solid var(--stone-edge);
    padding: 0.5rem 1rem 1.2rem; transform: translateY(-130%);
    transition: transform var(--speed) var(--ease);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { padding: 0.9rem 0.5rem; border-bottom: 1px solid var(--stone-edge); }
  .nav__soon { margin: 0.6rem 0.5rem 0; }
}
@media (max-width: 480px) {
  .pillars { grid-template-columns: 1fr; }
  .gallery { columns: 1; }
}

/* ---------------------------------------------------------------------
   18. ACCESSIBILITY — focus + reduced motion
   --------------------------------------------------------------------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--frost-lit);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
