:root {
  color-scheme: dark;
  --title-font: "Knight Warrior", "Times New Roman", serif;
  --body-font: Roboto, Helvetica, Arial, sans-serif;
  --ink: #f5ead2;
  --muted: #c8bda6;
  --paper: #130f12;
  --surface: #21181a;
  --surface-strong: #2f2020;
  --line: #7b5a32;
  --line-soft: rgba(196, 145, 71, 0.34);
  --accent: #d49a45;
  --accent-strong: #f0c879;
  --blood: #8d2f35;
  --green: #2f5b45;
  --blue: #253e55;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
}

@font-face {
  font-family: "Knight Warrior";
  src: url("assets/fonts/KnightWarrior-w16n8.otf") format("opentype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(141, 47, 53, 0.28), transparent 26rem),
    radial-gradient(circle at 88% 6%, rgba(47, 91, 69, 0.24), transparent 28rem),
    linear-gradient(180deg, #0b1210 0, var(--paper) 34rem, #0d0a0b 100%);
  font-family: var(--body-font);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 234, 210, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 234, 210, 0.026) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 82%);
}

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(13, 10, 11, 0.9);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.brand,
.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand {
  color: var(--accent-strong);
  font-family: var(--title-font);
  font-size: 1.54rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand::before,
.brand::after {
  content: "";
  display: block;
  width: 34px;
  height: 1px;
  background: var(--line);
}

.site-nav a,
.back-link,
.site-footer a {
  color: var(--accent-strong);
  font-family: var(--title-font);
  font-size: 1.08rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav a:hover,
.back-link:hover,
.site-footer a:hover {
  color: #fff3c8;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 540px);
  gap: clamp(32px, 6vw, 84px);
  align-items: center;
  min-height: calc(82vh - 72px);
  padding: clamp(44px, 6vw, 76px) clamp(18px, 4vw, 56px) clamp(22px, 3vw, 40px);
}

.hero > * {
  min-width: 0;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--title-font);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 0.98;
  letter-spacing: 0;
  font-family: var(--title-font);
}

h1 {
  max-width: 900px;
  color: #fff1cc;
  font-size: clamp(3rem, 7.2vw, 6.6rem);
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.48);
  hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
}

h2 {
  color: #fff1cc;
  font-size: clamp(2rem, 5vw, 4.4rem);
}

.hero p:not(.eyebrow),
.detail-copy p {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-showcase {
  position: relative;
  min-height: 540px;
  overflow: hidden;
}

.hero-showcase::before {
  content: "";
  position: absolute;
  inset: 52px 30px 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(141, 47, 53, 0.44), rgba(37, 62, 85, 0.52)),
    #21181a;
  box-shadow: var(--shadow);
}

.hero-showcase::after {
  content: "";
  position: absolute;
  inset: 78px 56px 48px;
  border: 1px solid rgba(240, 200, 121, 0.38);
  pointer-events: none;
}

.hero-showcase img {
  position: absolute;
  object-fit: cover;
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.showcase-main {
  right: 48px;
  bottom: 0;
  z-index: 2;
  width: min(72%, 360px);
  aspect-ratio: 4 / 5;
}

.showcase-side {
  width: min(38%, 185px);
  aspect-ratio: 4 / 5;
  filter: saturate(0.88) brightness(0.9);
}

.showcase-side-top {
  top: 20px;
  left: 0;
  transform: rotate(-5deg);
}

.showcase-side-bottom {
  right: 0;
  top: 62px;
  transform: rotate(4deg);
}

.gallery-section {
  padding: clamp(18px, 3vw, 34px) clamp(18px, 4vw, 56px) clamp(42px, 7vw, 86px);
}

.detail-layout {
  padding: clamp(42px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

.section-heading {
  margin-bottom: 28px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 22px;
}

.character-card {
  display: grid;
  gap: 14px;
  min-height: 100%;
  padding: 10px 10px 18px;
  background:
    linear-gradient(180deg, rgba(245, 234, 210, 0.055), transparent 36%),
    var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.character-card:hover {
  border-color: var(--accent);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.52);
  transform: translateY(-4px);
}

.portrait-frame {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #0f0b0c;
  border: 1px solid rgba(240, 200, 121, 0.32);
  border-radius: 2px;
}

.portrait-frame img,
.detail-art img {
  height: 100%;
  object-fit: cover;
}

.character-card.is-claimed .portrait-frame img {
  filter: grayscale(0.82) brightness(0.58);
}

.claim-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 6px 10px;
  color: #130f12;
  background: var(--accent-strong);
  border: 1px solid #fff1cc;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
  font-family: var(--title-font);
  font-size: 0.92rem;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-copy {
  display: grid;
  gap: 2px;
  padding: 0 4px;
}

.character-name {
  color: #fff1cc;
  font-family: var(--title-font);
  font-size: 1.44rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.character-meta {
  color: var(--accent);
  font-family: var(--body-font);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 68px);
  align-items: start;
  min-height: calc(100vh - 144px);
}

.detail-art {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.detail-copy {
  padding: clamp(20px, 3vw, 34px);
  background: rgba(33, 24, 26, 0.74);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}

.detail-copy h1 {
  margin-top: 8px;
  font-size: clamp(2.8rem, 7vw, 6rem);
}

.tagline {
  color: #fff1cc !important;
  font-size: clamp(1.25rem, 2vw, 1.7rem) !important;
  font-weight: 800;
}

.detail-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.detail-section h2 {
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-family: var(--title-font);
  font-size: 1.14rem;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-section ul {
  display: grid;
  gap: 8px;
  max-width: 68ch;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.detail-section li::marker {
  color: var(--accent);
}

.detail-section p {
  margin: 0;
}

.sheet-actions {
  margin-top: 30px;
}

.sheet-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  color: #130f12;
  background: var(--accent-strong);
  border: 1px solid #fff1cc;
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  font-family: var(--title-font);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.sheet-link:hover {
  background: #fff1cc;
}

.empty-state {
  max-width: 720px;
  padding: clamp(34px, 6vw, 64px);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 16px;
  color: #130f12;
  background: var(--accent-strong);
  border-radius: 3px;
  font-family: var(--title-font);
  font-weight: 900;
  text-decoration: none;
}

.site-footer {
  padding: 28px clamp(18px, 4vw, 56px);
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 900px) {
  .hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-showcase {
    min-height: 430px;
  }

  .detail-art {
    max-width: 520px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  h1 {
    font-size: clamp(4rem, 6.6vw, 5.4rem);
  }
}

@media (max-width: 520px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand::before,
  .brand::after {
    width: 22px;
  }

  h1 {
    font-size: clamp(2.6rem, 14vw, 3.4rem);
  }

  .character-grid {
    grid-template-columns: 1fr;
  }

  .hero-showcase {
    min-height: 360px;
  }

  .showcase-main {
    right: 24px;
    width: min(72%, 290px);
  }

  .showcase-side {
    width: min(36%, 140px);
  }

  .showcase-side-bottom {
    right: 10px;
  }
}
