:root {
  --paper: #eee3c9;
  --parchment: #d6c09a;
  --brass: #b58b45;
  --old-gold: #d8b86a;
  --deep-ink: #17120f;
  --scanline: rgba(238,227,201,.045);

  --divider-1: url("../assets/Brass/bespokebrass1.png");
  --divider-2: url("../assets/Brass/bespokebrass2.png");
  --divider-3: url("../assets/Brass/bespokebrass3.png");
  --divider-4: url("../assets/Brass/bespokebrass4.png");
  --divider-6: url("../assets/Brass/bespokebrass6.png");
  --divider-7: url("../assets/Brass/bespokebrass7.png");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
  background:
    radial-gradient(circle at 50% 6%, rgba(216,184,106,.14), transparent 24%),
    radial-gradient(circle at 15% 38%, rgba(122,79,163,.10), transparent 24%),
    radial-gradient(circle at 83% 68%, rgba(181,139,69,.10), transparent 26%),
    linear-gradient(180deg, #050609 0%, #0f1723 42%, #090806 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0) 50%, var(--scanline) 50%),
    linear-gradient(90deg, rgba(255,0,0,.018), rgba(0,255,255,.014), rgba(0,0,255,.018)),
    radial-gradient(circle, transparent 62%, rgba(0,0,0,.58) 100%);
  background-size: 100% 4px, 6px 100%, 100% 100%;
  mix-blend-mode: screen;
}

.wheel-watermark {
  position: fixed;
  width: min(84vw, 880px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: .05;
  z-index: 0;
  pointer-events: none;
  animation: wheelTurn 600s linear infinite;
}

@keyframes wheelTurn {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.dust { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

.mote {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  left: var(--x);
  top: var(--y);
  opacity: var(--o);
  background: rgba(238,227,201,.32);
  box-shadow: 0 0 8px rgba(238,227,201,.35);
  animation: floatDust var(--duration) linear infinite;
}

@keyframes floatDust {
  0% { transform: translate3d(0,0,0); }
  50% { transform: translate3d(22px,-42px,0); }
  100% { transform: translate3d(-14px,-88px,0); opacity: .05; }
}

.site-shell {
  width: min(1160px, calc(100% - 24px));
  margin: 22px auto;
  padding: 18px clamp(10px, 2vw, 24px) 24px;
  position: relative;
  z-index: 3;
  border: 1px solid rgba(181,139,69,.56);
  background:
    linear-gradient(180deg, rgba(15,23,35,.86), rgba(23,18,15,.92)),
    radial-gradient(circle at 50% 0%, rgba(216,184,106,.08), transparent 28%);
  box-shadow: 0 0 44px rgba(0,0,0,.78), inset 0 0 48px rgba(216,184,106,.055);
}

.archive-header-art,
.archive-footer-art {
  width: calc(100% + 36px);
  margin-left: -18px;
  line-height: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(216,184,106,.20));
}

.archive-header-art { margin-bottom: 4px; }
.archive-footer-art { margin-top: 26px; }
.archive-header-art img,
.archive-footer-art img { display: block; width: 100%; height: auto; }

.dossier-header {
  padding: 10px 18px 34px;
  text-align: center;
}

.system-line,
.kicker {
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.system-line {
  margin-bottom: 12px;
  color: rgba(238,227,201,.76);
  font-size: 12px;
}

h1 {
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 0 0 22px rgba(216,184,106,.22);
}

.subtitle {
  margin-top: 12px;
  color: var(--old-gold);
  font-size: clamp(16px, 2vw, 21px);
}

.tagline {
  width: min(790px, 100%);
  margin: 20px auto 0;
  color: rgba(238,227,201,.84);
  font-size: 15px;
}

main { padding: 8px 2px 10px; }

.artifact-section { padding: clamp(12px, 2vw, 24px); }

.artifact-card {
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(216,184,106,.24);
  background: #0a0907;
  box-shadow: 0 16px 38px rgba(0,0,0,.48), inset 0 0 18px rgba(216,184,106,.08);
}

.artifact-card img { display: block; width: 100%; height: auto; }
.infographic-section { padding-top: 0; }

/* INVISIBLE BUTTON OVERLAYS
   Positioned over the painted buttons in card_character_infographic.png. */
.debug-hitbox {
  position: absolute;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: transparent;
  text-decoration: none;
  overflow: visible;
}

.debug-hitbox span {
  display: none;
}

.debug-hitbox::after {
  content: "";
  width: clamp(34px, 4.2vw, 52px);
  aspect-ratio: 1;
  background: url("../assets/Icons/crossroads_compass.png") center / contain no-repeat;
  opacity: 0;
  transform: scale(.82);
  filter: drop-shadow(0 0 10px rgba(216,184,106,.45));
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.debug-hitbox:hover::after,
.debug-hitbox:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.debug-return {
  left: 4.0%;
  top: calc(92.0% + 10px);
  width: 42.5%;
  height: 5.2%;
  cursor: pointer;
}

.debug-builder {
  left: 53.5%;
  top: calc(92.0% + 10px);
  width: 42.5%;
  height: 5.2%;
  cursor: not-allowed;
  opacity: 1;
}

.brass-divider {
  width: min(890px, 100%);
  height: clamp(54px, 8vw, 94px);
  margin: 24px auto 16px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 0 10px rgba(216,184,106,.15));
}

.d1 { background-image: var(--divider-1); height: clamp(70px, 10vw, 118px); }
.d2 { background-image: var(--divider-2); }
.d3 { background-image: var(--divider-3); }
.d4 { background-image: var(--divider-4); }
.d6 { background-image: var(--divider-6); }
.d7 { background-image: var(--divider-7); }

.deviations-section {
  padding: clamp(38px, 5vw, 60px);
  border: 1px solid rgba(181,139,69,.42);
  background:
    radial-gradient(circle at 70% 20%, rgba(216,184,106,.06), transparent 25%),
    linear-gradient(180deg, rgba(7,9,14,.88), rgba(15,23,35,.83));
  box-shadow: inset 0 0 24px rgba(216,184,106,.05), 0 12px 28px rgba(0,0,0,.28);
}

.section-heading {
  max-width: 820px;
  margin: 0 auto 28px;
  text-align: center;
}

.kicker { margin-bottom: 10px; color: var(--old-gold); font-size: 12px; }

h2 {
  margin-bottom: 12px;
  color: var(--paper);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
}

.section-heading p { color: rgba(238,227,201,.80); }

.deviation-list {
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.deviation-entry {
  border: 1px solid rgba(216,184,106,.42);
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.18), transparent 24%),
    linear-gradient(180deg, rgba(238,227,201,.96), rgba(214,192,154,.94));
  color: var(--deep-ink);
  box-shadow: inset 0 0 18px rgba(75,47,19,.10), 0 8px 20px rgba(0,0,0,.24);
}

.deviation-entry summary {
  min-height: 74px;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  cursor: pointer;
  list-style: none;
}

.deviation-entry summary::-webkit-details-marker { display: none; }
.deviation-entry summary::after {
  content: "⌄";
  color: #6b471e;
  font-size: 26px;
  transition: transform .2s ease;
}
.deviation-entry[open] summary::after { transform: rotate(180deg); }

.tier-mark {
  color: #6b471e;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.deviation-name {
  color: #251a10;
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: bold;
}

.deviation-copy {
  padding: 4px 22px 24px 150px;
  border-top: 1px solid rgba(75,47,19,.20);
}

.deviation-copy p { margin-top: 14px; color: rgba(23,18,15,.88); }

footer {
  margin-top: 10px;
  padding: 6px 16px 38px;
  text-align: center;
  color: rgba(238,227,201,.58);
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
}

@media (max-width: 900px) {
  .site-shell { padding: 10px; }
  .archive-header-art,
  .archive-footer-art { width: calc(100% + 20px); margin-left: -10px; }
  .artifact-section { padding-inline: 4px; }
  .deviation-copy { padding-left: 22px; }
}

@media (max-width: 560px) {
  h1 { letter-spacing: 2px; }
  .dossier-header { padding-inline: 6px; }
  .deviations-section { padding: 30px 18px; }
  .deviation-entry summary { grid-template-columns: 1fr auto; gap: 8px 14px; }
  .tier-mark { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
