:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --bg-soft: #f2f4fb;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --surface: #f5f3ff;
  --surface-strong: #ece9ff;
  --border: #e5e7ef;
  --border-strong: #d8dcf0;
  --text: #111827;
  --muted: #667085;
  --faint: #98a2b3;
  --brand: #5b5cf6;
  --brand-strong: #4f46e5;
  --brand-soft: #f0efff;
  --brand-2: #17b26a;
  --success: #17b26a;
  --warning: #f79009;
  --shadow: 0 18px 55px rgba(17, 24, 39, 0.08);
  --shadow-soft: 0 10px 30px rgba(17, 24, 39, 0.055);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 15px;
  --radius-sm: 11px;
  --max: 1120px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-soft: #111827;
  --bg-card: #151b2d;
  --bg-card-solid: #151b2d;
  --surface: rgba(91, 92, 246, 0.12);
  --surface-strong: rgba(91, 92, 246, 0.2);
  --border: rgba(226, 232, 240, 0.13);
  --border-strong: rgba(167, 169, 255, 0.35);
  --text: #f8fafc;
  --muted: #b7c0d1;
  --faint: #8591a7;
  --brand: #8b8dff;
  --brand-strong: #a5b4fc;
  --brand-soft: rgba(139, 141, 255, 0.15);
  --brand-2: #34d399;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 6%, rgba(91, 92, 246, 0.095), transparent 28rem),
    radial-gradient(circle at 86% 4%, rgba(45, 212, 191, 0.075), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 44%, var(--bg-soft) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 16% 6%, rgba(91, 92, 246, 0.22), transparent 29rem),
    radial-gradient(circle at 86% 4%, rgba(45, 212, 191, 0.11), transparent 24rem),
    linear-gradient(180deg, #0b1020 0%, #111827 58%, #0f172a 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image: radial-gradient(rgba(91, 92, 246, 0.22) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 48%);
}

body.nav-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-strong); }

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

button,
input,
select { font: inherit; }

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(229, 231, 239, 0.78);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

html[data-theme="dark"] .site-header {
  border-color: rgba(226, 232, 240, 0.1);
  background: rgba(15, 23, 42, 0.82);
}

.nav-shell {
  width: min(1220px, calc(100% - 36px));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 850;
  letter-spacing: -0.035em;
  color: var(--text);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.07);
}

.brand-mark img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a,
.nav-toggle,
.theme-toggle,
.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 13px;
  font-size: 0.92rem;
  font-weight: 750;
}

.nav-links a {
  padding: 0 14px;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.nav-links .nav-cta,
.button.primary {
  color: #fff;
  background: linear-gradient(135deg, #5b5cf6, #6d5dfc);
  box-shadow: 0 14px 32px rgba(91, 92, 246, 0.23);
}

.nav-links .nav-cta:hover,
.button.primary:hover {
  color: #fff;
  transform: translateY(-1px);
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-actions + .nav-links { margin-left: 0; }

.theme-toggle,
.nav-toggle {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-card-solid);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
}

.theme-toggle { width: 42px; padding: 0; }
.theme-toggle [data-theme-label] { display: none; }

.theme-icon {
  width: 12px;
  height: 12px;
  display: block;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 7px var(--brand-soft);
}

.nav-toggle {
  display: none;
  padding: 0 16px;
}

.page-hero,
.hero-section {
  padding: clamp(58px, 9vw, 112px) 0 clamp(28px, 5vw, 54px);
}

.hero-grid,
.content-page,
.wiki-layout,
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
  gap: clamp(22px, 4vw, 46px);
  align-items: start;
}

.hero-copy,
.page-hero .content-page > div:first-child {
  max-width: 780px;
}

.eyebrow,
.category-kicker,
.guide-card span,
.model-note span {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--bg-card-solid);
  box-shadow: 0 5px 18px rgba(17, 24, 39, 0.045);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: -0.01em;
  text-transform: none;
}

.eyebrow::before {
  content: "✦";
  color: var(--brand);
}

h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(3.25rem, 7.2vw, 6.9rem);
  font-weight: 900;
}

h2 {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 3vw, 3.15rem);
  font-weight: 900;
}

h3 {
  margin: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 840;
}

p { color: var(--muted); }

.lead,
.hero-text {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.6vw, 1.25rem);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  border: 1px solid var(--border);
  padding: 0 18px;
  color: var(--text);
  background: var(--bg-card-solid);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.button:hover {
  border-color: var(--border-strong);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
}

.page-section {
  padding: clamp(32px, 6vw, 76px) 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.callout-card,
.sidebar-card,
.wiki-infobox,
.wiki-toc,
.wiki-search-panel,
.hero-card,
.feature-card,
.category-link,
.guide-card,
.model-note,
.wiki-result,
.wiki-main > section,
.table-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

html[data-theme="dark"] .callout-card,
html[data-theme="dark"] .sidebar-card,
html[data-theme="dark"] .wiki-infobox,
html[data-theme="dark"] .wiki-toc,
html[data-theme="dark"] .wiki-search-panel,
html[data-theme="dark"] .hero-card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .category-link,
html[data-theme="dark"] .guide-card,
html[data-theme="dark"] .model-note,
html[data-theme="dark"] .wiki-result,
html[data-theme="dark"] .wiki-main > section,
html[data-theme="dark"] .table-shell {
  background: rgba(17, 24, 39, 0.86);
}

.callout-card,
.sidebar-card,
.wiki-infobox,
.wiki-toc,
.wiki-search-panel,
.hero-card,
.feature-card,
.wiki-main > section {
  padding: clamp(18px, 2.4vw, 28px);
}

.category-link-grid,
.guide-grid,
.model-note-grid,
.feature-grid,
.stats-grid,
.wiki-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.category-link,
.guide-card,
.model-note,
.wiki-result {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 18px;
  color: var(--text);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.category-link:hover,
.guide-card:hover,
.wiki-result:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-link p,
.guide-card p,
.model-note p,
.wiki-result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.guide-card strong,
.model-note strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.15;
}

.wiki-search-panel label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 850;
}

.wiki-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input[type="search"],
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: var(--bg-card-solid);
  outline: none;
  padding: 0 14px;
}

input[type="search"]:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.wiki-empty { display: none; }
.wiki-empty.is-visible { display: block; }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--faint);
  font-size: 0.9rem;
  font-weight: 700;
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand-strong); }

.table-shell {
  overflow: hidden;
  padding: 0;
}

.hardware-table,
.specs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card-solid);
}

.hardware-table th,
.hardware-table td,
.specs-table th,
.specs-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.hardware-table th,
.specs-table th {
  color: var(--text);
  background: var(--bg-soft);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.hardware-table td:first-child,
.specs-table td:first-child {
  width: 230px;
  color: var(--text);
  font-weight: 820;
}

.hardware-table tr:last-child td,
.specs-table tr:last-child td { border-bottom: 0; }

.wiki-infobox dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.wiki-infobox dl > div {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card-solid);
}

.wiki-infobox dt {
  color: var(--muted);
  font-weight: 800;
}

.wiki-infobox dd {
  margin: 0;
  color: var(--text);
  font-weight: 850;
}

.wiki-main {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.wiki-sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 94px;
}

.wiki-toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 720;
}

.wiki-toc a::after {
  content: "›";
  color: var(--faint);
  font-size: 1.2rem;
}

.wiki-toc a:last-child { border-bottom: 0; }

.article-list {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.article-list li {
  position: relative;
  padding: 12px 14px 12px 38px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card-solid);
  color: var(--muted);
}

.article-list li::before {
  content: "✓";
  position: absolute;
  left: 13px;
  top: 11px;
  color: var(--brand-2);
  font-weight: 900;
}

.site-footer {
  margin-top: 50px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.footer-grid {
  grid-template-columns: 1fr auto auto;
  padding: 34px 0;
}

.site-footer h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.site-footer a:not(.brand) {
  display: block;
  margin: 7px 0;
  color: var(--muted);
  font-weight: 700;
}

.hidden-by-filter { display: none !important; }

@media (max-width: 1080px) {
  .hero-grid,
  .content-page,
  .wiki-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .wiki-sidebar { position: static; }
}

@media (max-width: 880px) {
  .category-link-grid,
  .guide-grid,
  .model-note-grid,
  .feature-grid,
  .stats-grid,
  .wiki-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 82px;
    background:
      radial-gradient(circle at 50% 0%, rgba(91, 92, 246, 0.14), transparent 24rem),
      linear-gradient(180deg, #fff 0%, #f7f8fc 52%, #f2f4fb 100%);
  }

  .container { width: min(100% - 28px, var(--max)); }

  .site-header {
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.92);
  }

  .nav-shell {
    width: calc(100% - 28px);
    min-height: 64px;
    gap: 10px;
  }

  .brand span:last-child {
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.97rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .nav-toggle { display: inline-flex; }
  .theme-toggle { width: 40px; min-height: 40px; }

  .nav-links {
    position: fixed;
    z-index: 120;
    left: 14px;
    right: 14px;
    bottom: 10px;
    margin: 0;
    height: 64px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 44px rgba(17, 24, 39, 0.16);
    backdrop-filter: blur(18px);
    transform: translateY(0);
    transition: transform 0.18s ease, opacity 0.18s ease, border-radius 0.18s ease;
  }

  html[data-theme="dark"] .nav-links {
    background: rgba(17, 24, 39, 0.94);
  }

  .nav-links:not(.is-open) a:nth-child(n + 5) { display: none; }

  .nav-links:not(.is-open) a {
    min-height: 48px;
    padding: 0 4px;
    flex-direction: column;
    gap: 2px;
    border-radius: 16px;
    font-size: 0.72rem;
    color: var(--muted);
  }

  .nav-links:not(.is-open) a::before {
    font-size: 1.05rem;
    line-height: 1;
  }

  .nav-links:not(.is-open) a:nth-child(1)::before { content: "⌂"; }
  .nav-links:not(.is-open) a:nth-child(2)::before { content: "▦"; }
  .nav-links:not(.is-open) a:nth-child(3)::before { content: "⌕"; }
  .nav-links:not(.is-open) a:nth-child(4)::before { content: "•••"; letter-spacing: 0; }

  .nav-links.is-open {
    top: 74px;
    bottom: auto;
    height: auto;
    max-height: calc(100dvh - 92px);
    overflow: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px;
    border-radius: 26px;
  }

  .nav-links.is-open a {
    justify-content: flex-start;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 15px;
    color: var(--text);
    background: transparent;
    font-size: 0.95rem;
  }

  .nav-links.is-open a:hover,
  .nav-links.is-open a:first-child {
    background: var(--brand-soft);
    color: var(--brand-strong);
  }

  .nav-links.is-open .nav-cta {
    background: linear-gradient(135deg, #5b5cf6, #6d5dfc);
    color: #fff;
  }

  .page-hero,
  .hero-section {
    padding: 36px 0 24px;
    text-align: center;
  }

  .page-hero .content-page > div:first-child,
  .hero-copy {
    margin: 0 auto;
  }

  .eyebrow {
    margin-left: auto;
    margin-right: auto;
  }

  h1 {
    font-size: clamp(2.45rem, 12vw, 4.15rem);
    letter-spacing: -0.065em;
  }

  h2 { font-size: clamp(1.55rem, 7vw, 2.35rem); }

  .lead,
  .hero-text {
    margin-left: auto;
    margin-right: auto;
    font-size: 1.02rem;
  }

  .hero-actions,
  .button-row {
    justify-content: center;
  }

  .hero-actions .button,
  .button-row .button,
  .button.primary {
    width: 100%;
  }

  .category-link-grid,
  .guide-grid,
  .model-note-grid,
  .feature-grid,
  .stats-grid,
  .wiki-results {
    grid-template-columns: 1fr;
  }

  .category-link,
  .guide-card,
  .wiki-result,
  .model-note {
    text-align: left;
    border-radius: 18px;
    padding: 16px;
  }

  .wiki-filter-row { grid-template-columns: 1fr; }

  .table-shell {
    border-radius: 18px;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .hardware-table,
  .hardware-table thead,
  .hardware-table tbody,
  .hardware-table tr,
  .hardware-table th,
  .hardware-table td,
  .specs-table,
  .specs-table thead,
  .specs-table tbody,
  .specs-table tr,
  .specs-table th,
  .specs-table td {
    display: block;
    width: 100%;
  }

  .hardware-table thead,
  .specs-table thead { display: none; }

  .hardware-table tr,
  .specs-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--bg-card-solid);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
  }

  .hardware-table td,
  .specs-table td {
    border: 0;
    padding: 13px 15px;
  }

  .hardware-table td:first-child,
  .specs-table td:first-child {
    width: 100%;
    background: var(--bg-soft);
  }

  .hardware-table td::before,
  .specs-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--faint);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .site-footer {
    margin-bottom: 76px;
  }
}

@media (max-width: 430px) {
  .container { width: calc(100% - 24px); }
  .nav-shell { width: calc(100% - 24px); }
  .page-section { padding: 28px 0; }
  .callout-card,
  .sidebar-card,
  .wiki-infobox,
  .wiki-toc,
  .wiki-search-panel,
  .hero-card,
  .feature-card,
  .wiki-main > section { padding: 16px; }
}
