:root {
  --bg: #0f1419;
  --bg-alt: #161d24;
  --bg-card: #1c252e;
  --border: #2a3540;
  --text: #e6edf3;
  --text-muted: #8b98a5;
  --accent: #5cb85c;
  --accent-hover: #4cae4c;
  --gold: #ffaa00;
  --diamond: #4dd0e1;
  --redstone: #c0392b;
  --font-display: 'Press Start 2P', 'Courier New', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

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

/* ============ HEADER ============ */
.site-header {
  background: var(--bg-alt);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.logo-block {
  width: 36px;
  height: 36px;
  display: inline-block;
  background-image: url('../img/logo.png');
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  border-radius: 4px;
}

.logo-text-accent {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a.active {
  color: var(--accent);
  text-decoration: none;
}

/* ============ MAIN ============ */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* ============ HERO ============ */
.hero {
  background-image:
    linear-gradient(135deg, rgba(15, 20, 25, 0.85) 0%, rgba(15, 20, 25, 0.65) 50%, rgba(15, 20, 25, 0.85) 100%),
    url('../img/hero/home-hero.png');
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5rem 2rem;
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(92, 184, 92, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 184, 92, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero h1 {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.hero p {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  font-weight: 600;
  border: 2px solid #3a6b3a;
  transition: transform 0.1s, background 0.2s;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  text-decoration: none;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  margin-left: 0.5rem;
}

.btn-outline:hover {
  background: var(--bg-card);
}

/* ============ SECTIONS ============ */
.section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-header h2::before {
  content: '';
  width: 6px;
  height: 24px;
  background: var(--accent);
  display: inline-block;
  border-radius: 2px;
}

.section-header a {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============ CARD GRID ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.card-thumb {
  height: 180px;
  background: linear-gradient(135deg, #2a3540, #1c252e);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
}

.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-body h3 a {
  color: var(--text);
}

.card-body h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* ============ ARTICLE ============ */
.article-header {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.article-header .tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.article-meta span {
  margin: 0 0.5rem;
}

.article {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.article p {
  margin-bottom: 1.25rem;
  color: #d4dce4;
}

.article h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

.article h3 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.75rem;
  color: var(--text);
}

.article ul,
.article ol {
  margin: 0 0 1.25rem 1.5rem;
  color: #d4dce4;
}

.article li {
  margin-bottom: 0.5rem;
}

.article blockquote {
  border-left: 4px solid var(--accent);
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
  border-radius: 0 4px 4px 0;
}

.article code {
  background: var(--bg-card);
  color: var(--gold);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.92em;
  font-family: 'Courier New', monospace;
}

.article pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.article pre code {
  background: none;
  color: var(--text);
  padding: 0;
}

.tip-box {
  background: linear-gradient(135deg, #1a3a1a 0%, #0f2419 100%);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.tip-box strong {
  color: var(--accent);
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.warn-box {
  background: linear-gradient(135deg, #3a1a1a 0%, #240f0f 100%);
  border: 1px solid var(--redstone);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.warn-box strong {
  color: var(--redstone);
  display: block;
  margin-bottom: 0.3rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-alt);
  color: var(--accent);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

/* ============ AD SLOTS ============ */
.ad-slot {
  background:
    repeating-linear-gradient(45deg, var(--bg-card), var(--bg-card) 10px, var(--bg-alt) 10px, var(--bg-alt) 20px);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin: 2rem auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ad-slot::before {
  content: 'AD';
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.5;
  letter-spacing: 1px;
}

/* Leaderboard 728x90 (default in-article) */
.ad-slot.ad-leaderboard {
  max-width: 728px;
  min-height: 90px;
}

/* Medium Rectangle 300x250 (square-ish, sidebar/inline) */
.ad-slot.ad-square {
  width: 300px;
  height: 250px;
  margin: 1.5rem auto;
  padding: 0;
}

/* Mobile Banner 320x50 */
.ad-slot.ad-mobile {
  max-width: 320px;
  min-height: 50px;
  padding: 0.5rem;
}

/* Large Skyscraper 160x600 (sidebar) */
.ad-slot.ad-sky {
  width: 160px;
  height: 600px;
  margin: 0 auto;
  padding: 0;
}

/* Default fallback - leaderboard */
.ad-slot:not(.ad-leaderboard):not(.ad-square):not(.ad-mobile):not(.ad-sky) {
  max-width: 728px;
  min-height: 90px;
}

/* Square ad row - two side by side */
.ad-row {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
}

/* In-article image */
.article-img {
  margin: 1.5rem auto;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.article-img img {
  width: 100%;
  height: auto;
  display: block;
}

.article-img figcaption {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-card);
  text-align: center;
  font-style: italic;
}

/* Hero image inside article header */
.article-hero-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--bg-alt);
  border-top: 2px solid var(--border);
  padding: 2.5rem 1.5rem 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-col p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 1200px;
  margin: 0 auto;
}

.disclaimer {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* ============ CONTACT FORM ============ */
.contact-wrap {
  max-width: 640px;
  margin: 0 auto;
}

.contact-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.contact-info a {
  font-size: 1.1rem;
  font-weight: 600;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

/* ============ LEGAL PAGES ============ */
.legal {
  max-width: 800px;
  margin: 0 auto;
}

.legal h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.legal .updated {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.legal h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
  color: var(--accent);
}

.legal p,
.legal li {
  color: #d4dce4;
  margin-bottom: 0.75rem;
}

.legal ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
    gap: 1rem;
  }

  .hero {
    padding: 2.5rem 1.25rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
