:root {
  --bg: #0b1220;
  --bg-2: #111a2e;
  --bg-3: #16233b;
  --surface: rgba(22, 35, 59, 0.72);
  --line: rgba(148, 180, 220, 0.16);
  --text: #e8eef8;
  --muted: #9aadc7;
  --brand: #3b9dff;
  --brand-2: #1e6fd9;
  --accent: #f0c75e;
  --ok: #3dd68c;
  --danger: #ff6b7a;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --nav-h: 72px;
  --max: 1160px;
  --font-display: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --font-body: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(59, 157, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(240, 199, 94, 0.08), transparent 55%),
    linear-gradient(180deg, #0a101c 0%, #0d1526 45%, #0b1220 100%);
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: #7cbcff;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 0.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  backdrop-filter: blur(16px);
  background: rgba(8, 14, 26, 0.82);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  flex-shrink: 0;
  max-height: calc(var(--nav-h) - 20px);
}

.brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.15rem;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.nav-desktop a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--text);
  background: rgba(59, 157, 255, 0.12);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(30, 111, 217, 0.35);
}

.btn-primary:hover {
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(59, 157, 255, 0.45);
  color: #fff;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(59, 157, 255, 0.1);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  width: min(100%, 320px);
  height: calc(100vh - var(--nav-h));
  background: rgba(10, 16, 28, 0.98);
  border-left: 1px solid var(--line);
  transform: translateX(105%);
  transition: transform 0.28s ease;
  z-index: 999;
  padding: 1.25rem;
  overflow-y: auto;
}

.mobile-panel.open {
  transform: translateX(0);
}

.mobile-panel a {
  display: block;
  color: var(--text);
  padding: 0.85rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

.mobile-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

main {
  padding-top: var(--nav-h);
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 14, 26, 0.92) 0%, rgba(8, 14, 26, 0.72) 48%, rgba(8, 14, 26, 0.45) 100%),
    linear-gradient(180deg, rgba(8, 14, 26, 0.2) 0%, rgba(8, 14, 26, 0.85) 100%);
}

.hero-content {
  padding: 3.5rem 0 4rem;
  max-width: 640px;
  animation: rise 0.8s ease both;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.hero-brand img {
  height: 48px;
  width: auto;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.3rem);
  margin-bottom: 1rem;
  color: #fff;
}

.hero .lead {
  font-size: 1.05rem;
  max-width: 34rem;
  margin-bottom: 1.6rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Sections */
.section {
  padding: 4.2rem 0;
}

.section-alt {
  background:
    linear-gradient(180deg, rgba(22, 35, 59, 0.35), rgba(22, 35, 59, 0.12));
  border-block: 1px solid var(--line);
}

.section-head {
  margin-bottom: 1.8rem;
  max-width: 640px;
}

.section-head h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.grid-2 {
  display: grid;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  gap: 1.2rem;
}

.grid-4 {
  display: grid;
  gap: 1rem;
}

.intro-block {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.intro-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  min-height: 260px;
}

.intro-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 260px;
}

.prose {
  color: var(--muted);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose h2,
.prose h3 {
  color: var(--text);
  margin-top: 1.6rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem 1.1rem;
  padding: 0;
  color: var(--muted);
}

.prose li {
  margin-bottom: 0.45rem;
  list-style: disc;
}

.prose ol li {
  list-style: decimal;
}

/* Category tiles */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.cat-item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
  min-height: 150px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 157, 255, 0.45);
}

.cat-item img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: radial-gradient(circle at center, #1a2740 0%, #0d1524 75%);
  padding: 0.75rem;
}

.cat-item span {
  display: block;
  padding: 0.75rem 0.9rem 0.95rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(8, 14, 26, 0.55);
}

/* Article cards - interaction containers */
.card-grid {
  display: grid;
  gap: 1.1rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  color: inherit;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 157, 255, 0.4);
  box-shadow: var(--shadow);
  color: inherit;
}

.article-card .thumb {
  aspect-ratio: 16 / 10;
  background: #101926;
  overflow: hidden;
}

.article-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.article-card:hover .thumb img {
  transform: scale(1.04);
}

.article-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.article-card .meta {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

.article-card h3 {
  font-size: 1.05rem;
  margin: 0;
  color: var(--text);
}

.article-card p {
  font-size: 0.92rem;
  margin: 0;
  flex: 1;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 26, 46, 0.7);
  overflow: hidden;
}

.faq-item button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 1rem 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item button span:last-child {
  color: var(--brand);
  font-size: 1.2rem;
  line-height: 1;
}

.faq-panel {
  display: none;
  padding: 0 1.1rem 1.05rem;
  color: var(--muted);
}

.faq-item.open .faq-panel {
  display: block;
  animation: rise 0.3s ease;
}

/* Page hero compact */
.page-hero {
  padding: 2.6rem 0 1.4rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(59, 157, 255, 0.08), transparent);
}

.page-hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb span {
  opacity: 0.5;
}

/* Content layout */
.content-wrap {
  display: grid;
  gap: 1.5rem;
  padding: 2.2rem 0 3.5rem;
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-3);
  margin-bottom: 1.4rem;
}

.article-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.related-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.promo-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0 0;
}

.promo-strip img {
  max-width: min(100%, 420px);
}

.brand-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.brand-row img {
  width: 100%;
  height: 48px;
  object-fit: contain;
  opacity: 0.85;
  filter: grayscale(0.15);
  transition: opacity 0.2s ease;
}

.brand-row img:hover {
  opacity: 1;
}

.error-page {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1rem;
}

.error-page .code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 0.6rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #080e1a;
  padding: 3rem 0 1.5rem;
  margin-top: 1rem;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.footer-col h3 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  color: var(--muted);
  padding: 0.28rem 0;
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.footer-brand img {
  height: 36px;
  width: auto;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(59, 157, 255, 0.14);
  color: #9fd0ff;
  font-weight: 600;
}

.list-page .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.list-page .filters a {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.list-page .filters a.active,
.list-page .filters a:hover {
  color: #fff;
  border-color: rgba(59, 157, 255, 0.5);
  background: rgba(59, 157, 255, 0.12);
}

@media (min-width: 768px) {
  .grid-2,
  .intro-block {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .grid-3,
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4,
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }

  .content-wrap.with-aside {
    grid-template-columns: 1fr 300px;
  }
}

@media (min-width: 992px) {
  .nav-desktop,
  .header-actions {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .mobile-panel,
  .overlay {
    display: none !important;
  }

  .brand img {
    height: 44px;
  }
}

@media (max-width: 991px) {
  .header-actions.desktop-only {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
