/* ==========================================================================
   XE66 BD — base styles
   ========================================================================== */

:root {
  --color-bg: #0c0c10;
  --color-surface: #16151c;
  --color-surface-alt: #1e1c26;
  --color-border: #2c2a35;
  --color-text: #eae7f0;
  --color-text-muted: #a9a5b8;
  --color-gold: #e8b84b;
  --color-gold-light: #ffd873;
  --color-red: #c8283c;
  --color-red-light: #e2465a;
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 72px;
  --max-width: 1180px;
  --shadow-1: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-gold-light);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.25;
  color: #fff;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin: 0 0 0.6em;
}

h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  margin: 1.6em 0 0.6em;
}

h3 {
  font-size: 1.15rem;
  margin: 1.4em 0 0.5em;
  color: var(--color-gold-light);
}

p {
  margin: 0 0 1em;
  color: var(--color-text-muted);
}

ul, ol {
  color: var(--color-text-muted);
  padding-left: 1.3em;
}

li {
  margin-bottom: 0.4em;
}

.updated-date {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 0.65em 1.4em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  color: #201400;
  box-shadow: 0 6px 18px rgba(232, 184, 75, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 8px 22px rgba(232, 184, 75, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-gold);
  color: var(--color-gold-light);
}

.btn-cta {
  background: linear-gradient(135deg, var(--color-red-light), var(--color-red));
  color: #fff;
  box-shadow: 0 8px 22px rgba(200, 40, 60, 0.45);
  font-size: 1.05rem;
  padding: 0.8em 1.8em;
}

.btn-cta:hover {
  box-shadow: 0 10px 26px rgba(200, 40, 60, 0.6);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em;
  margin-top: 1.4em;
}

/* Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 16, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  flex-wrap: nowrap;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  height: 38px;
  width: auto;
}

.site-nav {
  flex: 1 1 auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1.7rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.98rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-gold-light);
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  margin-left: auto;
}

.header-actions {
  display: flex;
  gap: 0.6rem;
}

.header-actions .btn {
  padding: 0.55em 1.1em;
  font-size: 0.9rem;
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  cursor: pointer;
  flex-shrink: 0;
}

.burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Breadcrumbs
   ========================================================================== */

.breadcrumbs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.breadcrumbs li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--color-border);
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-gold-light);
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-text);
}

/* Hero
   ========================================================================== */

.hero {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 380px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-1);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2.4rem 2.2rem;
  max-width: 560px;
}

.hero-content h1 {
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.hero-content p {
  color: #e6e2f0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 1.4em;
}

.hero-content .updated-date {
  color: #cfc9de;
}

/* Main content
   ========================================================================== */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.intro p:last-of-type {
  margin-bottom: 0;
}

article > section {
  border-top: 1px solid var(--color-border);
  padding-top: 1.6rem;
  margin-top: 1.6rem;
}

/* TOC accordion
   ========================================================================== */

.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.2rem 1.2rem;
  margin: 1.6rem 0 2rem;
}

.toc summary {
  cursor: pointer;
  padding: 1rem 0;
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.toc summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--color-gold);
  transition: transform 0.2s ease;
  line-height: 1;
}

.toc[open] summary::after {
  transform: rotate(45deg);
}

.toc summary:hover {
  color: var(--color-gold-light);
}

.toc-list {
  margin: 0;
  padding: 0 0 1.1rem;
  columns: 2;
  column-gap: 2rem;
  list-style: none;
}

.toc-list li {
  break-inside: avoid;
  margin-bottom: 0.55em;
  font-size: 0.94rem;
}

.toc-list a {
  color: var(--color-text-muted);
}

.toc-list a:hover {
  color: var(--color-gold-light);
}

/* Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 2.2rem 1rem 2.6rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-inner nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin: 0 0 1.2rem;
  padding: 0;
}

.footer-inner nav a {
  color: var(--color-text);
  font-weight: 500;
}

.footer-inner nav a:hover {
  color: var(--color-gold-light);
}

.footer-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  max-width: 70ch;
  margin: 0;
}

/* Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .toc-list {
    columns: 1;
  }

  .hero {
    min-height: 320px;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 62px;
  }

  .header-inner {
    padding: 0 0.75rem;
  }

  .logo img {
    height: 30px;
  }

  .burger {
    display: flex;
  }

  .site-nav {
    order: 3;
    flex: 0 0 100%;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.4rem 1rem 0.8rem;
  }

  .site-nav li {
    width: 100%;
  }

  .site-nav a {
    display: block;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav li:last-child a {
    border-bottom: none;
  }

  .nav-toggle:checked ~ .site-nav {
    max-height: 60vh;
    overflow-y: auto;
  }

  .header-actions .btn {
    padding: 0.5em 0.8em;
    font-size: 0.82rem;
  }

  .hero-content {
    padding: 1.6rem 1.2rem;
    max-width: 100%;
  }

  .hero {
    min-height: 300px;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-row .btn {
    text-align: center;
  }
}

@media (max-width: 420px) {
  .header-actions .btn {
    padding: 0.5em 0.6em;
    font-size: 0.76rem;
  }

  .hero {
    min-height: 260px;
  }
}
