:root {
  color-scheme: dark;
  --bg: #090a08;
  --bg-raised: #11130f;
  --bg-warm: #17130e;
  --surface: #151712;
  --line: rgba(228, 204, 151, 0.22);
  --text: #f2eadb;
  --text-soft: #c4bdaf;
  --gold: #e4cc97;
  --gold-strong: #caa35f;
  --ember: #b94d34;
  --forest: #5f7c53;
  --frost: #78a9c3;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  min-width: 320px;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.wrapper { width: min(var(--maxw), calc(100% - 2.5rem)); margin-inline: auto; }

.hero {
  position: relative;
  min-height: min(900px, 92svh);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #17140f;
}
.hero-media, .hero-media img, .hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-media img { object-fit: cover; object-position: center; }
.hero-shade {
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 6, 5, 0.92) 0%, rgba(5, 6, 5, 0.54) 38%, transparent 70%),
    linear-gradient(180deg, rgba(5, 6, 5, 0.5) 0%, transparent 22%, rgba(5, 6, 5, 0.78) 100%);
}
.top-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-decoration: none;
}
.brand picture, .brand img { width: 42px; height: 42px; flex: 0 0 42px; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a, .nav-link {
  color: rgba(242, 234, 219, 0.82);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease;
}
.nav-links a:hover, .nav-link:hover { color: var(--gold); }
.hero-content {
  position: relative;
  z-index: 2;
  align-self: end;
  padding-block: 5rem max(4.5rem, calc(3.5rem + env(safe-area-inset-bottom)));
  animation: rise 700ms ease-out both;
}
.eyebrow {
  margin: 0;
  color: var(--gold-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3 {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0;
  line-height: 1.14;
}
h1 { margin-top: 0.25rem; font-size: 6.2rem; text-transform: uppercase; }
h2 { margin-top: 0.35rem; font-size: 3rem; }
h3 { font-size: 1.65rem; }
.hero-tagline {
  margin: 0.4rem 0 0;
  max-width: 22ch;
  color: var(--gold);
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.35;
}
.lead { max-width: 49ch; margin: 1rem 0 0; color: rgba(242, 234, 219, 0.86); font-size: 1.05rem; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}
.btn-store {
  gap: 0.6rem;
  min-width: 174px;
  color: #17140f;
  background: var(--text);
}
.btn-store:hover { background: #fffaf0; }
.btn-store > img { width: 24px; height: 24px; flex: 0 0 24px; }
.store-copy { display: grid; gap: 0.08rem; line-height: 1; }
.store-kicker { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.store-name { font-size: 1rem; }
.text-link { color: var(--text); font-weight: 600; text-underline-offset: 0.25rem; }
.text-link span { display: inline-block; margin-left: 0.3rem; color: var(--gold); }

.section { padding-block: clamp(4rem, 8vw, 7rem); }
.world-intro { background: var(--bg); }
.intro-layout, .section-heading-wide {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: start;
}
.intro-copy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.intro-copy p, .section-heading-wide > p { margin: 0; color: var(--text-soft); }

.portal-feature {
  position: relative;
  width: min(1400px, 100%);
  min-height: min(780px, 82svh);
  margin-inline: auto;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: #12100e;
}
.portal-media, .portal-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.portal-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 7, 6, 0.86), rgba(7, 7, 6, 0.16) 64%),
    linear-gradient(180deg, transparent 54%, rgba(7, 7, 6, 0.82));
}
.portal-media img { object-fit: cover; object-position: center 54%; }
.portal-copy { position: relative; z-index: 1; padding-block: 4rem; }
.portal-copy h2 { max-width: 13ch; }
.portal-copy > p:last-child { max-width: 48ch; margin: 1rem 0 0; color: rgba(242, 234, 219, 0.82); }

.clans-section { background: var(--bg-raised); }
.section-heading-wide { margin-bottom: 2.2rem; align-items: end; }
.section-heading-wide > p { max-width: 48ch; padding-bottom: 0.35rem; }
.clan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.clan-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 0.75;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.clan-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 44%, rgba(4, 5, 4, 0.96) 100%);
  pointer-events: none;
}
.clan-card picture, .clan-card img { width: 100%; height: 100%; }
.clan-card img { object-fit: cover; transition: transform 500ms ease; }
.clan-card:hover img { transform: scale(1.025); }
.clan-copy { position: absolute; z-index: 1; right: 1rem; bottom: 1.05rem; left: 1rem; }
.clan-number { margin: 0 0 0.2rem; color: var(--gold); font-family: "Cinzel", Georgia, serif; font-size: 0.72rem; }
.clan-copy p:last-child { margin: 0.45rem 0 0; color: rgba(242, 234, 219, 0.78); font-size: 0.88rem; line-height: 1.45; }
.clan-anims { border-bottom-color: var(--ember); }
.clan-sylvaris { border-bottom-color: var(--forest); }
.clan-frostfire { border-bottom-color: var(--frost); }
.clan-mekanes { border-bottom-color: var(--gold-strong); }

.heroes-section {
  overflow: hidden;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 35%),
    #0c0e0b;
}
.hero-roster {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}
.hero-figure {
  min-width: 0;
  margin: 0;
  text-align: center;
}
.hero-figure picture {
  display: block;
  aspect-ratio: 1;
}
.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.48));
  transition: transform 280ms ease;
}
.hero-figure:hover img { transform: translateY(-6px); }
.hero-figure figcaption {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-family: "Cinzel", Georgia, serif;
}
.hero-figure figcaption span { color: var(--gold-strong); font-size: 0.68rem; }
.hero-figure figcaption strong { font-size: 1rem; }
.hero-figure-anims figcaption { border-top-color: var(--ember); }
.hero-figure-sylvaris figcaption { border-top-color: var(--forest); }
.hero-figure-frostfire figcaption { border-top-color: var(--frost); }
.hero-figure-mekane figcaption { border-top-color: var(--gold-strong); }

.adventure-section { overflow: hidden; background: var(--bg); }
.feature-list { display: grid; gap: clamp(4rem, 10vw, 8rem); margin-top: clamp(2.5rem, 6vw, 5rem); }
.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.feature-row-reverse { grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.35fr); }
.feature-row-reverse .feature-media { grid-column: 2; grid-row: 1; }
.feature-row-reverse .feature-copy { grid-column: 1; grid-row: 1; }
.feature-media {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.feature-media img { width: 100%; height: 100%; object-fit: cover; }
.feature-copy { position: relative; }
.feature-copy h3 { margin-top: 0.45rem; }
.feature-copy > p:last-child { margin: 1rem 0 0; color: var(--text-soft); }
.feature-index {
  position: absolute;
  top: -3.4rem;
  right: 0;
  margin: 0;
  color: rgba(228, 204, 151, 0.12);
  font-family: "Cinzel", Georgia, serif;
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
}

.bestiary-section {
  overflow: hidden;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(185, 77, 52, 0.045), transparent 40%),
    #0b0b09;
}
.bestiary-stage {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: end;
  padding-top: 1rem;
}
.monster-figure {
  min-width: 0;
  margin: 0;
  text-align: center;
}
.monster-figure picture {
  display: block;
  aspect-ratio: 1;
}
.monster-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 15px rgba(0, 0, 0, 0.52));
  transition: transform 280ms ease;
}
.monster-figure:hover img { transform: translateY(-5px); }
.monster-figure-main img { transform: scale(1.06); }
.monster-figure-main:hover img { transform: translateY(-5px) scale(1.06); }
.monster-figure figcaption {
  min-height: 3.1rem;
  display: grid;
  place-items: center;
  padding: 0.75rem 0.35rem 0;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-family: "Cinzel", Georgia, serif;
  font-size: 0.82rem;
  line-height: 1.3;
}

.closing-section {
  border-block: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(185, 77, 52, 0.1), transparent 34%),
    linear-gradient(240deg, rgba(120, 169, 195, 0.1), transparent 34%),
    var(--bg-warm);
}
.closing-content {
  min-height: 340px;
  display: grid;
  grid-template-columns: 190px minmax(0, 620px);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  justify-content: center;
  padding-block: 4rem;
}
.closing-emblem, .closing-emblem img { width: 160px; height: 160px; }
.closing-content h2 { font-size: 2.65rem; }
.closing-content > div > p:last-child { margin: 1rem 0 0; color: var(--text-soft); }

.footer { background: #060705; }
.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 1.25rem max(1.25rem, env(safe-area-inset-bottom));
}
.footer p { margin: 0; color: #918c82; font-size: 0.85rem; }
.footer a { color: var(--text-soft); text-underline-offset: 0.2rem; }
.footer span { margin-inline: 0.4rem; }

.small-header { border-bottom: 1px solid var(--line); background: #0c0d0b; }
.small-header .top-nav { min-height: 68px; border-bottom: 0; }
.legal { max-width: 880px; padding-block: 3rem 4rem; }
.legal h1 { font-size: 2.8rem; text-transform: none; }
.legal-date { margin: 0.5rem 0 2rem; color: var(--text-soft); }
.legal section { padding-block: 1.25rem; border-top: 1px solid var(--line); }
.legal section:last-child { border-bottom: 1px solid var(--line); }
.legal h2 { font-size: 1.15rem; }
.legal p, .legal li { color: var(--text-soft); }
.legal a { color: var(--gold); }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  h1 { font-size: 4.8rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.5rem; }
  .clan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clan-card { aspect-ratio: 0.88; }
  .feature-row, .feature-row-reverse { grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr); gap: 2rem; }
}

@media (max-width: 760px) {
  .wrapper { width: min(var(--maxw), calc(100% - 1.5rem)); }
  .hero { min-height: 88svh; }
  .hero-media img { object-position: center 48%; }
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(4, 5, 4, 0.52) 0%, transparent 26%, rgba(4, 5, 4, 0.9) 76%),
      linear-gradient(90deg, rgba(4, 5, 4, 0.44), transparent 80%);
  }
  .top-nav { min-height: 62px; }
  .brand picture, .brand img { width: 36px; height: 36px; flex-basis: 36px; }
  .nav-links { display: none; }
  .hero-content { padding-block: 4rem max(2.5rem, calc(1.5rem + env(safe-area-inset-bottom))); }
  h1 { font-size: 3.25rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.35rem; }
  .hero-tagline { font-size: 1.2rem; }
  .lead { max-width: 36ch; font-size: 0.98rem; }
  .hero-actions { gap: 0.85rem; }
  .intro-layout, .section-heading-wide, .intro-copy { grid-template-columns: 1fr; gap: 1.25rem; }
  .intro-copy { gap: 1rem; }
  .portal-feature { min-height: 72svh; }
  .portal-media::after { background: linear-gradient(180deg, transparent 36%, rgba(7, 7, 6, 0.94) 88%); }
  .portal-copy { padding-block: 2.5rem; }
  .section-heading-wide { margin-bottom: 1.5rem; }
  .clan-grid {
    width: calc(100% + 0.75rem);
    margin-right: -0.75rem;
    padding-right: 0.75rem;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .clan-grid::-webkit-scrollbar { display: none; }
  .clan-card {
    width: min(78vw, 340px);
    min-width: min(78vw, 340px);
    aspect-ratio: 0.76;
    scroll-snap-align: start;
  }
  .hero-roster,
  .bestiary-stage {
    width: calc(100% + 0.75rem);
    margin-right: -0.75rem;
    padding-right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .hero-roster::-webkit-scrollbar,
  .bestiary-stage::-webkit-scrollbar { display: none; }
  .hero-figure {
    width: min(68vw, 300px);
    min-width: min(68vw, 300px);
    scroll-snap-align: start;
  }
  .monster-figure,
  .monster-figure-main {
    width: min(62vw, 270px);
    min-width: min(62vw, 270px);
    scroll-snap-align: start;
  }
  .monster-figure-main img { transform: none; }
  .monster-figure-main:hover img { transform: translateY(-5px); }
  .feature-list { gap: 4.5rem; }
  .feature-row, .feature-row-reverse { width: 100%; grid-template-columns: 1fr; gap: 1.4rem; }
  .feature-row-reverse .feature-media, .feature-row-reverse .feature-copy { grid-column: 1; }
  .feature-row-reverse .feature-media { grid-row: 1; }
  .feature-row-reverse .feature-copy { grid-row: 2; }
  .feature-media { border-radius: 0; border-inline: 0; }
  .feature-copy { width: calc(100% - 1.5rem); margin-inline: auto; }
  .feature-index { top: -2.5rem; font-size: 3.5rem; }
  .closing-content { min-height: 0; grid-template-columns: 88px 1fr; gap: 1.25rem; padding-block: 3rem; }
  .closing-emblem, .closing-emblem img { width: 88px; height: 88px; }
  .footer-content { display: grid; gap: 0.35rem; }
  .legal { padding-block: 2rem 3rem; overflow-wrap: anywhere; }
  .legal h1 { font-size: 2rem; }
}

@media (max-width: 440px) {
  .brand { font-size: 0.9rem; }
  .nav-links a { font-size: 0.82rem; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .closing-content { grid-template-columns: 1fr; }
  .closing-emblem, .closing-emblem img { width: 72px; height: 72px; }
}

@media (max-width: 360px) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 1.75rem; }
  .hero-tagline { font-size: 1.08rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-content { animation: none; }
  .clan-card img,
  .hero-figure img,
  .monster-figure img { transition: none; }
}
