:root {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background-color: #030711;
  color: #f5f5ff;
  --bg: #030711;
  --bg-alt: #050a14;
  --card: rgba(8, 13, 25, 0.95);
  --border: rgba(148, 163, 184, 0.35);
  --text: #f5f5ff;
  --text-muted: #cbd5f5;
  --accent: #0ea5e9;
  --link: #38bdf8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: url("bg-tech-pattern.svg");
  background-repeat: repeat;
  background-position: center;
  color: var(--text);
}

[data-theme="light"] body {
  background-color: var(--bg);
  background-image: url("bg-tech-pattern-light.svg");
  background-repeat: repeat;
  background-position: center;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --card: #f1f5f9;
  --border: rgba(15, 23, 42, 0.12);
  --text: #000000;
  --text-muted: #1e293b;
  --accent: #2563eb;
  --link: #1d4ed8;
}

header.site-header {
  padding: 1.6rem clamp(1rem, 3vw, 2.25rem);
  background: rgba(1, 1, 8, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.65);
}

[data-theme="light"] header.site-header {
  background: #1e293b;
  border-bottom-color: rgba(15, 23, 42, 0.2);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
}

[data-theme="light"] .brand-title,
[data-theme="light"] .brand-subtitle,
[data-theme="light"] .header-nav a {
  color: #f1f5f9;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  margin: 0;
  font-weight: 600;
  font-size: 1.15rem;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.header-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition: background 150ms ease;
}

.header-nav a.nav-guide {
  font-weight: 700;
}

.header-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 14px 0 rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

[data-theme="light"] .header-nav a:hover {
  background: rgba(15, 23, 42, 0.08);
  box-shadow: 0 0 14px 0 rgba(56, 189, 248, 0.35);
}

.header-nav a.nav-guide:focus,
.header-nav a.nav-guide:hover,
.header-nav a.nav-guide[aria-current="page"] {
  box-shadow: 0 0 16px 0 rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}

.header-disclaimer {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
}

[data-theme="light"] .header-disclaimer {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
}

.theme-switch {
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 180ms ease;
}

.theme-switch:hover {
  transform: translateY(-1px);
}

.theme-switch svg {
  width: 16px;
  height: 16px;
}

.article-disclaimer-top {
  margin: 0 0 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-disclaimer-top a {
  color: var(--link);
  text-decoration: underline;
  font-weight: 600;
}

[data-theme="light"] .article-disclaimer-top {
  background: rgba(15, 23, 42, 0.05);
}

.article-disclaimer-text {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.95rem;
}

.article-disclaimer-text a {
  color: var(--link);
  text-decoration: underline;
  font-weight: 600;
}

[data-theme="light"] .article-disclaimer-text {
  background: rgba(15, 23, 42, 0.05);
}
main {
  flex: 1;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.hero {
  text-align: center;
  padding-bottom: 2.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.75rem, 4vw, 3.75rem);
}

.lead {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin: 0.75rem auto 0;
  max-width: 620px;
}

.intro {
  text-align: center;
  max-width: 560px;
  margin: 2.5rem auto 0;
  padding: 0 1rem;
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

.intro-label {
  font-weight: 600;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-bottom: 0.4rem !important;
  text-align: center;
  letter-spacing: 0.05em;
}

.intro p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

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

.grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-radius: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(22px);
  min-height: 520px;
  text-decoration: none;
  color: inherit;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 250ms ease;
}

.card-media {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .card-media {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.04);
}

.card-body {
  padding: 1rem 0.25rem 0.35rem;
}

.card:hover {
  transform: translateY(-7px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.55);
}

[data-theme="light"] .card:hover {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  margin: 1.25rem 0 0;
}

.page-nav a {
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}

.guide-hero {
  padding: 1.5rem 1.5rem;
  text-align: center;
  max-width: 720px;
  margin: 0 auto 1rem;
}

.guide-hero h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 3vw, 3rem);
}

.guide-hero p {
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 520px;
  line-height: 1.6;
}

.guide-grid {
  width: min(950px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1.2rem;
}

.guide-section {
  border-radius: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.45);
}

.guide-section h2 {
  margin-top: 0;
  color: var(--text);
}

.guide-section p {
  color: var(--text-muted);
  line-height: 1.6;
}

.article-note {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.article-block {
  margin-top: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.7);
}

.article-block h2 {
  margin-top: 0;
  color: var(--text);
}

.article-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.article-media img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.55);
}

[data-theme="light"] .article-media img {
  border-color: rgba(15, 23, 42, 0.15);
}

.article-content {
  color: var(--text-muted);
  line-height: 1.7;
}

.source-preview {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  color: #f8fafc;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 0.9rem;
  overflow-x: auto;
}

[data-theme="light"] .source-preview {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.article-content ul {
  padding-left: 1.25rem;
}

.disclaimer-page {
  width: min(1100px, 100%);
  margin: 2rem auto 3rem;
  padding: 2.5rem;
  border-radius: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.6);
}

.disclaimer-page h1 {
  margin-top: 0;
  font-size: clamp(2rem, 3vw, 2.75rem);
}

.disclaimer-page h2 {
  color: var(--text);
  margin-bottom: 0.4rem;
}

.disclaimer-page p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.disclaimer-page ul {
  padding-left: 1.2rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.article-content th,
.article-content td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.article-content th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.article-content tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .article-content tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.04);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  color: #a5b4fc;
}

/* --- MOBILE HEADER FIX --- */
@media (max-width: 992px) {
  /* 1. Reduce the massive gap around the header */
  header.site-header {
    padding: 0.75rem 0.5rem !important;
  }

  /* 2. Stack items neatly but tightly */
  .header-top {
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  /* 3. Hide the long subtitle text on phones (Saves huge space) */
  .site-header .brand-subtitle {
    display: none !important;
  }

  /* 4. Make the logo/title smaller */
  .site-header .brand-mark {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px;
  }
  .site-header .brand-mark img {
    height: 32px !important;
    width: auto !important;
    max-width: 32px;
  }
  .site-header .brand-title {
    font-size: 1.1rem !important;
  }

  /* 5. Make the navigation menu compact - single row wrap, centered */
  .site-header .header-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px 8px !important;
    width: 100%;
    max-width: 100%;
  }

  .site-header .header-nav a {
    font-size: 0.8rem !important;
    padding: 5px 8px !important;
  }

  .site-header .theme-switch {
    transform: scale(0.85);
  }
}

@media (max-width: 600px) {
  main {
    padding: 3.5rem 1rem 2rem;
  }

  .card {
    padding: 1rem;
  }

  .card-media {
    height: 220px;
  }
}

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

.link-preview-card {
  margin: 1.5rem 0;
}

.link-preview {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.link-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.link-preview-image {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  background: linear-gradient(135deg, #1e293b, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.link-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.link-preview-image svg {
  width: 100%;
  height: 100%;
}

.link-preview-content {
  flex: 1;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.link-preview-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.link-preview-description {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.link-preview-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .link-preview-specs {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

.spec-column {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.spec-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.spec-label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  min-width: 50px;
  flex-shrink: 0;
}

.spec-value {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.link-preview-url {
  font-size: 0.85rem;
  color: var(--link);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .link-preview-specs {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .link-preview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .link-preview-url {
    align-self: flex-end;
  }
}

[data-theme="light"] .link-preview-image {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

@media (max-width: 640px) {
  .link-preview {
    flex-direction: column;
  }
  
  .link-preview-image {
    width: 100%;
    height: 180px;
  }
}

/* Site footer */
.site-footer {
  padding: 1.25rem clamp(1rem, 3vw, 2.25rem);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
}

