:root {
  --bg: #0d1218;
  --bg-soft: #111820;
  --panel: #1a222d;
  --panel-2: #212b38;
  --text: #eef2f6;
  --muted: #9aa8ba;
  --muted-2: #7d8fa6;
  --accent: #d4a24a;
  --accent-dim: rgba(212, 162, 74, 0.14);
  --blue: #4a9fd4;
  --blue-dim: rgba(74, 159, 212, 0.12);
  --ok: #3ecf8e;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(74, 159, 212, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(212, 162, 74, 0.08), transparent 50%),
    linear-gradient(180deg, #131a24 0%, var(--bg) 40%);
  z-index: -1;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: #6eb8e8; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(0.85rem + env(safe-area-inset-top, 0px)) calc(1.5rem + env(safe-area-inset-right, 0px))
    0.85rem calc(1.5rem + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--border);
  background: rgba(13, 18, 24, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.site-brand:hover { color: var(--text); }

.site-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-nav a {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--blue-dim);
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
}

.wrap-wide {
  max-width: 68rem;
}

.page-hero {
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.page-hero.left {
  text-align: left;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 999px;
  border: 1px solid rgba(212, 162, 74, 0.25);
}

h1 {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 0.85rem;
  font-weight: 800;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  line-height: 1.65;
}

.page-hero.left .lead {
  margin-left: 0;
  margin-right: 0;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.hero-stat {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
}

.hero-stat strong {
  color: var(--text);
  margin-right: 0.25rem;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted-2);
  margin-bottom: 0.75rem;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }

.section-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 2.25rem 0 1rem;
}

.card {
  background: linear-gradient(165deg, var(--panel) 0%, rgba(26, 34, 45, 0.92) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card h2, .card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.card p + p { margin-top: 0.65rem; }

.card ul, .card ol {
  margin: 0.65rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.card li { margin-bottom: 0.35rem; }

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.grid-3 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.feature-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.feature-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.faq-category {
  margin-bottom: 2rem;
}

.faq-category h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  transition: background 0.15s;
}

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

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 400;
  font-size: 1.1rem;
}

.faq-item[open] summary::after {
  content: "−";
  background: var(--blue-dim);
  color: var(--blue);
}

.faq-item summary:hover { background: rgba(255, 255, 255, 0.03); }

.faq-item .faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.faq-item .faq-body p { margin: 0 0 0.5rem; }
.faq-item .faq-body p:last-child { margin-bottom: 0; }

.post-grid {
  display: grid;
  gap: 1.15rem;
}

@media (min-width: 640px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  border-color: rgba(74, 159, 212, 0.35);
  box-shadow: var(--shadow);
  color: inherit;
}

.post-card-featured {
  grid-column: 1 / -1;
  flex-direction: row;
  background: linear-gradient(135deg, rgba(74, 159, 212, 0.1), var(--panel) 45%);
}

@media (max-width: 639px) {
  .post-card-featured { flex-direction: column; }
}

.post-card-visual {
  position: relative;
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #151c26;
}

.post-card-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
}

.post-card-visual::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
}

.post-card-visual svg {
  position: relative;
  z-index: 1;
  width: 52px;
  height: 52px;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.post-card:hover .post-card-visual svg {
  transform: scale(1.06) translateY(-2px);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.post-card-featured .post-card-visual svg {
  width: 72px;
  height: 72px;
}

.visual-guide {
  background: linear-gradient(145deg, #1a2838 0%, #121a24 55%, #1e2a1a 100%);
}

.visual-guide::after {
  background: var(--blue);
  top: -20%;
  right: 10%;
}

.visual-tips {
  background: linear-gradient(145deg, #1e2430 0%, #1a1e28 50%, #282018 100%);
}

.visual-tips::after {
  background: var(--accent);
  bottom: -30%;
  left: 15%;
}

.visual-score {
  background: linear-gradient(145deg, #1a2230 0%, #221a30 50%, #121820 100%);
}

.visual-score::after {
  background: #9b7bff;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
}

.visual-faq {
  background: linear-gradient(145deg, #142218 0%, #121820 50%, #182428 100%);
}

.visual-faq::after {
  background: var(--ok);
  bottom: -25%;
  right: 20%;
}

.post-card-featured .post-card-visual {
  flex: 0 0 42%;
  min-height: 200px;
  border-bottom: none;
  border-right: 1px solid var(--border);
}

@media (max-width: 639px) {
  .post-card-featured .post-card-visual {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

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

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.tag-accent {
  background: var(--accent-dim);
  color: var(--accent);
}

.post-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.post-card p.excerpt {
  margin: 0;
  flex: 1;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.post-meta {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--muted-2);
  font-weight: 600;
}

.prose {
  font-size: 0.96rem;
  color: var(--muted);
}

.prose h2 {
  color: var(--text);
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.prose h3 {
  color: var(--text);
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

.prose p { margin: 0 0 1rem; }

.prose ul, .prose ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

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

.prose strong { color: var(--text); }

.callout {
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  margin: 1.25rem 0;
}

.callout-blue {
  border-left-color: var(--blue);
  background: var(--blue-dim);
}

.callout p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 1rem 0;
}

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

.data-table th {
  color: var(--text);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

.data-table td { color: var(--muted); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 2rem;
  align-items: center;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #c4923f);
  color: #111820;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(212, 162, 74, 0.25);
  transition: filter 0.15s, transform 0.15s;
}

.cta:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  text-decoration: none;
  color: #111820;
}

.cta-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.cta-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.related-box {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border-light);
  background: rgba(255, 255, 255, 0.02);
}

.related-box h2 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}

.related-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-links li { margin-bottom: 0.4rem; }

.site-footer {
  margin-top: 2rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--blue); }

.toc {
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.toc-title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

.toc ol {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
}

.toc a { color: var(--muted); }
.toc a:hover { color: var(--blue); }

@media (max-width: 640px) {
  .site-header {
    padding-left: calc(1rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1rem + env(safe-area-inset-right, 0px));
  }

  .site-nav a {
    padding: 0.5rem 0.6rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .wrap,
  .wrap-wide {
    padding-left: calc(1rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1rem + env(safe-area-inset-right, 0px));
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
  }

  .post-card-featured {
    flex-direction: column;
  }

  .post-card-featured .post-card-visual {
    min-height: 100px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .hero-stats {
    justify-content: flex-start;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cta-row .cta {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 44px;
  }

  .site-footer {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
}
