/* ==============================
   Taverna20 – Legal Pages
   Retro 8-bit aesthetic
   ============================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: #1a1a3e;
  --text-primary: #e0e0ff;
  --text-secondary: #a0a0cc;
  --accent-gold: #f0c040;
  --accent-cyan: #40e0d0;
  --accent-magenta: #e040a0;
  --accent-green: #40e070;
  --border-color: #2a2a5e;
  --scanline-opacity: 0.03;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'VT323', monospace;
  font-size: 1.35rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Scanline overlay ---------- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, var(--scanline-opacity)) 2px,
    rgba(0, 0, 0, var(--scanline-opacity)) 4px
  );
}

/* ---------- CRT glow on wrapper ---------- */
.page-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 3px solid var(--accent-gold);
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(240, 192, 64, 0.15);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.1rem;
  color: var(--accent-gold);
  text-decoration: none;
  text-shadow: 0 0 10px rgba(240, 192, 64, 0.5);
  transition: text-shadow 0.3s;
  white-space: nowrap;
}

.logo:hover {
  text-shadow: 0 0 20px rgba(240, 192, 64, 0.8);
}

.logo .dice {
  display: inline-block;
  margin-right: 0.4rem;
}

nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: all 0.3s;
  white-space: nowrap;
}

nav a:hover,
nav a.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(64, 224, 208, 0.5);
  box-shadow: 0 0 10px rgba(64, 224, 208, 0.15);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  background: linear-gradient(
    180deg,
    var(--bg-secondary) 0%,
    var(--bg-primary) 100%
  );
  border-bottom: 2px solid var(--border-color);
}

.hero h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(240, 192, 64, 0.4);
  margin-bottom: 1rem;
}

.hero .subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.hero .badge {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5rem 1.2rem;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.5rem;
  color: var(--accent-green);
  border: 2px solid var(--accent-green);
  border-radius: 4px;
  text-shadow: 0 0 6px rgba(64, 224, 112, 0.4);
}

/* ---------- Main content ---------- */
.content {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  width: 100%;
}

/* ---------- Legal text styles ---------- */
.legal-text {
  color: var(--text-primary);
}

.legal-text .update-date {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.55rem;
  color: var(--accent-cyan);
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--border-color);
}

.legal-text h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.75rem;
  color: var(--accent-gold);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  text-shadow: 0 0 8px rgba(240, 192, 64, 0.3);
  line-height: 1.8;
}

.legal-text h3 {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  color: var(--accent-cyan);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.legal-text p {
  margin-bottom: 1rem;
  text-align: justify;
}

.legal-text ul,
.legal-text ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-text li {
  margin-bottom: 0.5rem;
  position: relative;
}

.legal-text ul li::marker {
  color: var(--accent-magenta);
}

.legal-text ol li::marker {
  color: var(--accent-cyan);
}

.legal-text strong {
  color: var(--accent-gold);
}

.legal-text a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s;
}

.legal-text a:hover {
  color: var(--accent-gold);
}

/* highlight box */
.legal-text .highlight-box {
  background: var(--bg-card);
  border-left: 4px solid var(--accent-gold);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
}

.legal-text .highlight-box.info {
  border-left-color: var(--accent-cyan);
}

.legal-text .highlight-box.warning {
  border-left-color: var(--accent-magenta);
}

/* table of contents */
.toc {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin-bottom: 3rem;
}

.toc h3 {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.6rem;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  margin-top: 0;
}

.toc ol {
  padding-left: 1.2rem;
}

.toc li {
  margin-bottom: 0.4rem;
}

.toc a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.3s;
}

.toc a:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 3px solid var(--border-color);
  padding: 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
}

.footer-inner .brand {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: var(--accent-gold);
  margin-bottom: 0.8rem;
  text-shadow: 0 0 8px rgba(240, 192, 64, 0.3);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-inner .copyright {
  font-size: 1rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ---------- Index page ---------- */
.index-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.index-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  text-decoration: none;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.index-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(64, 224, 208, 0.15);
  transform: translateY(-3px);
}

.index-card .card-icon {
  font-size: 2.5rem;
}

.index-card h2 {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.7rem;
  color: var(--accent-gold);
  line-height: 1.6;
}

.index-card p {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .site-header {
    padding: 1rem;
  }

  .header-inner {
    flex-direction: column;
    text-align: center;
  }

  nav {
    justify-content: center;
  }

  .hero {
    padding: 2.5rem 1rem 2rem;
  }

  .content {
    padding: 2rem 1rem 3rem;
  }

  .legal-text h2 {
    font-size: 0.65rem;
  }

  .toc {
    padding: 1rem 1.2rem;
  }
}
