/* Mistfall: Armageddon — global styles
   Visual identity: "The Fracture" — grounded in the game's own art
   (the glowing crack-lines across Portland's cobblestones, the torn
   sky on the book cover) rather than borrowed from either the old
   Wix draft (purple/Cinzel) or the 7th Reality Games studio identity
   (brass/ember/Fraunces). Deep indigo night + amber streetlamp glow,
   with a cool arcane teal held in reserve for magic/interactive accents.
   Type: Alegreya / Alegreya Sans — the same family already chosen for
   the printed Core Rule Book's interior layout, so the site reads as
   one continuous object with the physical book. Cinzel is retired. */

:root {
  --color-bg: #0e1220;
  --color-bg-raised: #171d34;
  --color-bg-deep: #080a13;
  --color-text: #ece6d6;
  --color-text-dim: #a6a9c4;
  --color-accent: #e2a13d;
  --color-accent-soft: #7a5a26;
  --color-arcane: #4fd6c4;
  --color-danger: #b23b3b;
  --color-border: #2a2f52;

  --font-display: "Alegreya", Georgia, serif;
  --font-ui: "Alegreya Sans", "Segoe UI", sans-serif;

  --max-width: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-display);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(226, 161, 61, 0.08), transparent 45%),
    radial-gradient(ellipse at 90% 10%, rgba(79, 214, 196, 0.06), transparent 40%);
  background-attachment: fixed;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.4rem; }

p {
  line-height: 1.65;
  margin: 0 0 1em;
  color: var(--color-text);
}

a {
  color: inherit;
  text-decoration: none;
}

.eyebrow {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

/* "Fracture" rule — a thin glowing crack, standing in for a divider */
.fracture {
  border: none;
  height: 2px;
  margin: 3rem 0;
  background: linear-gradient(90deg, transparent, var(--color-accent) 20%, var(--color-arcane) 55%, transparent 85%);
  opacity: 0.55;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.6em;
  height: 1px;
  background: linear-gradient(90deg, var(--color-arcane), var(--color-accent));
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 0.85em 1.6em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: #14100a;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(226, 161, 61, 0.35); }

.btn-ghost {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-ghost:hover { border-color: var(--color-arcane); color: var(--color-arcane); }

/* Site chrome */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 50;
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.7em 1.2em;
  border-radius: 3px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 10, 19, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 24px;
  max-width: 1440px;
  margin: 0 auto;
  gap: 1.5rem;
}
.brand-mark { display: flex; align-items: center; gap: 0.6em; }
.brand-mark .wordmark {
  display: inline-block;
  width: 165px;
  height: 27px;
  background-color: var(--color-text);
  -webkit-mask: url(/images/brand/wordmark-mistfall.svg) no-repeat left center / contain;
  mask: url(/images/brand/wordmark-mistfall.svg) no-repeat left center / contain;
  transition: background-color 0.15s ease;
}
.brand-mark:hover .wordmark { background-color: var(--color-accent); }
.brand-mark span:not(.wordmark) {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--color-text-dim);
}
nav.site-nav { display: flex; gap: 1.3rem; align-items: center; flex-wrap: nowrap; }
nav.site-nav a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
nav.site-nav a:hover { color: var(--color-accent); border-color: var(--color-accent); }
nav.site-nav a.btn, .mobile-nav-panel a.btn {
  color: #14100a;
  border-bottom: none;
  text-transform: uppercase;
}
nav.site-nav a.btn:hover, .mobile-nav-panel a.btn:hover { color: #14100a; }

.nav-dropdown { position: relative; }
.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35em;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
  margin-top: 1px;
  transition: transform 0.15s ease;
}
.nav-dropdown[open] summary::after { transform: rotate(180deg); }
.nav-dropdown summary:hover,
.nav-dropdown[open] summary { color: var(--color-accent); border-color: var(--color-accent); }
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-deep);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.4rem 0;
  display: flex;
  flex-direction: column;
  min-width: 150px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  z-index: 30;
}
.nav-dropdown-panel a {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  padding: 0.55rem 1.1rem;
  white-space: nowrap;
  border-bottom: none;
  display: block;
}
.nav-dropdown-panel a:hover { background: rgba(255, 255, 255, 0.05); color: var(--color-accent); }

.mobile-nav { display: none; }
.mobile-nav summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 6px;
  width: 26px;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-text);
  border-radius: 1px;
}
.mobile-nav[open] summary span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav[open] summary span:nth-child(2) { opacity: 0; }
.mobile-nav[open] summary span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--color-bg-deep);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 0.5rem 24px 1.5rem;
}
.mobile-nav-panel a {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  color: var(--color-text-dim);
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav-panel a.btn { margin-top: 1rem; align-self: flex-start; border-bottom: none; }

.mobile-subnav { border-bottom: 1px solid var(--color-border); }
.mobile-subnav summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.9rem;
  color: var(--color-text-dim);
  padding: 0.9rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-subnav summary::-webkit-details-marker { display: none; }
.mobile-subnav summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.mobile-subnav[open] summary::after { transform: rotate(180deg); }
.mobile-subnav-panel { display: flex; flex-direction: column; padding-bottom: 0.4rem; }
.mobile-subnav-panel a {
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: var(--color-text-dim);
  padding: 0.7rem 0 0.7rem 1rem;
  border-bottom: none;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 5rem;
  padding: 3rem 0 2.5rem;
  color: var(--color-text-dim);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}
.site-footer a { color: var(--color-text-dim); }
.site-footer a:hover { color: var(--color-accent); }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-footer .footer-legal { display: block; font-family: var(--font-ui); font-size: 0.78rem; margin-top: 2rem; opacity: 0.7; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem;
}
/* Centered, row-capped card grids: caps the row to an exact card count so a
   short last row centers under the row(s) above it instead of stretching
   full-width or sticking to the left edge. */
.card-grid-centered {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 0 auto;
}
.card-grid-centered .card {
  flex: 1 1 230px;
  max-width: 270px;
}
.card-grid-centered.cols-2 { max-width: 564px; }
.card-grid-centered.cols-3 { max-width: 858px; }
.card-grid-centered.cols-4 { max-width: 1152px; }
.card {
  position: relative;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--color-accent); transform: translateY(-3px); }
.card .portrait {
  aspect-ratio: 0.8 / 1;
  overflow: hidden;
  background: var(--color-bg-deep);
}
.card .portrait img { width: 100%; height: 100%; object-fit: cover; }
.card .card-body { padding: 1rem 1.1rem 1.3rem; }
.card h3 { font-size: 1.15rem; margin-bottom: 0.2em; }
.card .card-tagline {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--color-arcane);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.6em;
}
.card p.summary { font-size: 0.92rem; color: var(--color-text-dim); margin-bottom: 0; }

.pill-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.pill {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3em 0.7em;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-dim);
}

/* Hero */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}
.hero img.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.hero .scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, var(--color-bg) 5%, rgba(14,18,32,0.55) 45%, rgba(14,18,32,0.15) 75%),
    linear-gradient(180deg, rgba(8,10,19,0.55), transparent 30%);
}
.hero .hero-content {
  position: relative;
  z-index: 1;
  padding: 4rem 24px 4.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.hero .hero-actions { display: flex; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }

.section { padding: 5rem 0; }
.section-head { max-width: 68ch; margin-bottom: 2.5rem; }
.section-head p { color: var(--color-text-dim); }
.section-alt { background: var(--color-bg-raised); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.feature {
  border-left: 2px solid var(--color-accent-soft);
  padding-left: 1.2rem;
}
.feature h3 { color: var(--color-accent); }
.feature p { color: var(--color-text-dim); font-size: 0.95rem; }

.banner-cta {
  border: 1px solid var(--color-border);
  background: linear-gradient(135deg, rgba(226,161,61,0.08), rgba(79,214,196,0.05));
  border-radius: 4px;
  padding: 3rem;
  text-align: center;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  max-width: 420px;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  background: var(--color-bg-deep);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 0.85em 1em;
  font-family: var(--font-ui);
  border-radius: 2px;
}
.newsletter-form input[type="email"]:focus { outline: none; border-color: var(--color-arcane); }

.quote-block {
  font-size: 1.4rem;
  font-style: italic;
  max-width: 50ch;
  border-left: 2px solid var(--color-arcane);
  padding-left: 1.3rem;
  color: var(--color-text);
}
.quote-block cite {
  display: block;
  font-style: normal;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  margin-top: 0.8rem;
}

.detail-hero {
  position: relative;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 3.5rem 0;
}
.detail-hero .portrait {
  border: 1px solid var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}
.tag-kind {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-bg);
  background: var(--color-accent);
  padding: 0.25em 0.7em;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}

/* Nav switches to the hamburger menu earlier than the other 900px breakpoint below -
   the desktop nav is now 5 top-level items (World/Heritages/Classes/Cast/Places are
   grouped under a single "World" dropdown) + the CTA button + brand mark, so it needs
   ~1100px to lay out on one line without crowding or overflowing the header bar (tested
   at 1040/1080/1100/1440px by rendering the actual header, not eyeballed - 1040px
   already clips the CTA button, 1080px is clean, 1100px adds a safety margin). */
@media (max-width: 1100px) {
  nav.site-nav { display: none; }
  .mobile-nav { display: block; }
}

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .hero { min-height: 80vh; }
}

/* Screenshot placeholder frame (Book of Creation coming-soon page) */
.screenshot-frame {
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-bg-raised);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.screenshot-frame-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  background: var(--color-bg-deep);
  border-bottom: 1px solid var(--color-border);
}
.screenshot-frame-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
}
.screenshot-frame-body {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  text-align: center;
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(226, 161, 61, 0.06), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(79, 214, 196, 0.06), transparent 45%);
}
.screenshot-frame-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.screenshot-frame > img {
  display: block;
  width: 100%;
  height: auto;
}
