:root {
  --bg-dark: #1a0505;
  --bg-panel: #1a1a1a;
  --card: rgba(0, 0, 0, 0.4);
  --card-border: rgba(255, 215, 64, 0.15);
  --line: rgba(255, 255, 255, 0.10);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --accent: #00a8ff;
  --accent-glow: rgba(0, 168, 255, 0.3);
  --gold: #ffd740;
  --gold-glow: rgba(255, 215, 64, 0.25);
  --btn-primary-bg: #ff6d00;
  --btn-primary-hover: #ff8528;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  --radius: 12px;
  --max: 1160px;
  --sans: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  background-color: var(--bg-dark);
  /* Lightning background effect */
  background-image:
    radial-gradient(circle at 50% -20%, #890b0b 0%, transparent 60%),
    /* Top red glow */
    linear-gradient(135deg, transparent 45%, rgba(255, 215, 64, 0.05) 48%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 215, 64, 0.05) 52%, transparent 55%),
    /* Lightning hint 1 */
    linear-gradient(225deg, transparent 40%, rgba(0, 168, 255, 0.03) 48%, rgba(255, 255, 255, 0.05) 50%, rgba(0, 168, 255, 0.03) 52%, transparent 60%);
  /* Lightning hint 2 */
  background-attachment: fixed;
  /* Keeps background static on scroll */
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
}

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

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
  /* Ensure padding on all screens, but specifically for mobile */
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  background: #fff;
  color: #000;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 9999;
}

.skip-link:focus {
  left: 12px;
}

/* Topbar */
.topbar {
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.topbar-text {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.topbar-close {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.topbar.is-hidden {
  display: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(26, 5, 5, 0.85);
  border-bottom: 1px solid var(--gold-glow);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo {
  height: 90px;
  /* Increased logo size significantly */
  width: auto;
  filter: drop-shadow(0 0 8px rgba(255, 215, 64, 0.3));
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 10px 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 1rem;
  /* Fixed transition: all anti-pattern */
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border: 1px solid rgba(255, 109, 0, 0.5);
  background: linear-gradient(180deg, var(--btn-primary-bg), #e65100);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 109, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--btn-primary-hover), #f57c00);
  box-shadow: 0 0 20px rgba(255, 109, 0, 0.6);
  border-color: #ff9800;
}

.btn-secondary {
  border-color: var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.9rem;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  /* Sidebar left, content right */
  gap: 24px;
  padding: 24px 0 40px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 100px;
}

.content {
  min-width: 0;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(4px);
}

.card-title {
  margin: 0 0 12px 0;
  font-size: 1.15rem;
  color: var(--gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.kicker {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.dot {
  opacity: 0.5;
  margin: 0 6px;
}

h1 {
  line-height: 1.15;
  margin: 0 0 16px;
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
  letter-spacing: -0.5px;
  background: linear-gradient(to bottom, #fff, #ffd740);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.lede {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.7;
}


/* Author & Meta */
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.meta a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.meta a:hover {
  color: #ffe082;
  text-decoration: underline;
}

.date {
  position: relative;
  padding-left: 16px;
}

.date::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--line);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.hero-figure {
  margin: 0;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.hero-figure figcaption {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Typography & Content */
.section {
  margin-top: 32px;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.6rem;
  letter-spacing: -0.2px;
  color: var(--gold);
  display: flex;
  align-items: center;
}

h2::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  flex: 1;
  margin-left: 16px;
  opacity: 0.3;
}

h3 {
  margin: 24px 0 10px;
  font-size: 1.25rem;
  color: var(--text);
}

p {
  margin: 12px 0;
  color: rgba(255, 255, 255, 0.9);
}

.bullets,
.steps {
  margin: 12px 0 16px;
  padding-left: 20px;
}

.bullets li,
.steps li {
  margin: 8px 0;
  color: var(--text-muted);
}

.callout {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 168, 255, 0.3);
  background: rgba(0, 168, 255, 0.08);
  color: #fff;
}

/* Tables */
.table-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.facts th,
.facts td {
  padding: 3px 6px;
  /* Ultra-compact padding for Quick Facts */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  font-size: 0.8rem;
  /* Smaller font to fit full list */
  line-height: 1.3;
  line-height: 1.3;
}

.mobile-facts {
  display: none;
}

.facts th {
  width: 40%;
  text-align: left;
  color: var(--gold);
  font-weight: 700;
}

.facts td {
  color: var(--text);
}

.facts tr:last-child th,
.facts tr:last-child td {
  border-bottom: 0;
}

/* Media */
.media {
  margin: 20px 0;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
}

.media img {
  border-radius: 8px;
  display: block;
}

.media figcaption {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Columns */
.columns-2 {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 16px;
}

.col {
  flex: 1;
  min-width: 250px;
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.col h3 {
  margin-top: 0;
  color: var(--gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* Demo Iframe */
.iframe-wrap {
  margin-top: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #000;
  box-shadow: var(--shadow);
  position: relative;
  aspect-ratio: 16/9;
}

.iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.demo-placeholder {
  display: none;
  /* Removed as requested - auto load lazy */
}

.demo-controls {
  display: none;
  /* Removed fullscreen button */
}

/* FAQ */
.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  margin: 10px 0;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 16px;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--gold);
}

.faq[open] summary::after {
  content: '\2212';
  /* minus sign */
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq[open] summary {
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.faq-body {
  padding: 16px;
  color: var(--text-muted);
}

/* Forms */
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 24px;
}

@media (min-width: 800px) {
  .contact-grid {
    flex-direction: row;
    align-items: flex-start;
    gap: 60px;
  }
}

.contact-info {
  flex: 1;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.contact-info p {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.9);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.03);
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.contact-form label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: var(--gold);
  font-size: 0.95rem;
  gap: 8px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.cf-turnstile-wrap {
  margin-top: 10px;
}

.contact-form .btn {
  align-self: flex-start;
  padding: 12px 32px;
  font-size: 1.05rem;
}

/* Footer */
.site-footer {
  margin-top: 40px;
  padding: 30px 0 40px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-brand {
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
  color: #fff;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.footer-disclaimer {
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-disclaimer p {
  margin: 6px 0;
  color: rgba(255, 255, 255, 0.5);
}

/* Header Menu / Dropdown */
.header-menu-wrap {
  position: relative;
  /* Wrapper for dropdown positioning */
}

.menu-btn-trigger {
  /* Style matches .btn-secondary, adjusted for trigger purpose */
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.header-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 260px;
  background: #150505;
  /* Dark Burgundy Panel */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  display: none;
  z-index: 100;
  max-height: 80vh;
  overflow-y: auto;
}

.header-dropdown.is-open {
  display: block;
}

.header-dropdown a {
  display: block;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
}

.header-dropdown a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Language Selector */
.lang {
  position: relative;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 180px;
  background: #150505;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
}

.lang.is-open .lang-menu {
  display: block;
}

.lang-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
}

.lang-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.lang-flag {
  width: 20px;
  height: auto;
  border-radius: 2px;
}

/* Mobile */
@media (max-width: 980px) {
  .layout {
    display: flex;
    flex-direction: column;
  }

  .main-article {
    display: contents;
  }

  .hero {
    order: 1;
  }

  .sidebar {
    display: block;
    position: static;
    order: 2;
    margin: 10px 0 30px;
  }

  .main-article>.separator,
  .main-article>section:not(.hero),
  .main-article>.site-footer {
    order: 3;
  }
}

/* Mobile Logo (Hidden by default) */
.mobile-logo-wrap {
  display: none;
  text-align: center;
  margin-bottom: 20px;
}

.mobile-logo {
  height: 80px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(255, 215, 64, 0.3));
}

.rtp-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--gold);
  padding: 12px 16px;
  border-radius: var(--radius);
}

/* Mobile Portrait Tweaks */
@media (max-width: 600px) {
  .header-inner .brand {
    display: none;
    /* Hide header logo on mobile portrait */
  }

  .mobile-logo-wrap {
    display: block;
    /* Show content logo */
  }

  .header-inner {
    justify-content: flex-end;
    /* Align remaining items to right */
    padding: 8px 0;
  }

  .meta {
    justify-content: center;
    /* Center author block on mobile */
    text-align: center;
    font-size: 0.85rem;
  }

  /* Fix overflow in Quick Facts on narrow screens */
  .facts th,
  .facts td {
    white-space: normal;
    /* Allow wrap */
    word-wrap: break-word;
  }

  .facts th {
    width: 35%;
    /* Give more space to values */
  }
}

/* Landscape/Desktop tweaks */
@media (max-width: 980px) and (min-width: 601px) {

  /* Ensure logo stays in header for landscape/tablet */
  .header-inner .brand {
    display: flex;
  }
}

/* Mobile Padding Fix for Landscape/Portrait */
@media (max-width: 768px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Improved Scroll to Top */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--btn-primary-bg);
  color: #fff;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
  visibility: hidden;
  opacity: 0;
}

.scroll-top.is-visible {
  visibility: visible;
  opacity: 1;
}

.scroll-top:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-4px);
}

.scroll-top-ico {
  line-height: 1;
}

@media (max-width: 768px) {
  .logo {
    height: 44px;
  }

  h1 {
    font-size: 2rem;
  }
}