/* ============================================================
   DS4 Hub — Design Tokens & Component Styles
   Dark technical editorial — warm amber accent on deep slate
   ============================================================ */

/* ── Type Scale ────────────────────────────────────────────── */
:root {
  --text-xs:  clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:  clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:  clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:  clamp(1.5rem, 1.2rem + 1.25vw, 2.5rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 4rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 7rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem;   --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;   --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;  --space-20: 5rem;   --space-24: 6rem;
  --space-32: 8rem;  --space-48: 12rem;

  --radius-sm: 0.375rem; --radius-md: 0.5rem;
  --radius-lg: 0.75rem;  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 640px;  --content-default: 960px;
  --content-wide: 1200px;   --content-full: 100%;

  --font-body: 'Inter', 'Helvetica Neue', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
}

/* ── Dark Mode (default) ───────────────────────────────────── */
:root, [data-theme='dark'] {
  --color-bg: #0c0c0e;
  --color-surface: #121216;
  --color-surface-2: #18181d;
  --color-surface-offset: #1c1c22;
  --color-surface-offset-2: #222229;
  --color-divider: #2a2a33;
  --color-border: #353540;

  --color-text: #e2e1dc;
  --color-text-muted: #8a8894;
  --color-text-faint: #5c5a66;
  --color-text-inverse: #0c0c0e;

  --color-accent: #f4a261;
  --color-accent-hover: #e0853a;
  --color-accent-active: #c46a24;
  --color-accent-highlight: #2d2220;

  --color-success: #6daa45;
  --color-error:   #e07a5f;
  --color-info:    #4d9de0;
  --color-muted:   #6c6a7a;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.45);
}

/* Unused light-mode fallback kept for toggle completeness */
[data-theme='light'] {
  --color-bg: #f8f7f3;
  --color-surface: #ffffff;
  --color-surface-2: #fdfcfa;
  --color-surface-offset: #f3f1ec;
  --color-surface-offset-2: #edeae3;
  --color-divider: #e3dfd7;
  --color-border: #d7d3ca;

  --color-text: #1a1914;
  --color-text-muted: #5e5c54;
  --color-text-faint: #9b9890;
  --color-text-inverse: #ffffff;

  --color-accent: #b85a0f;
  --color-accent-hover: #9a4808;
  --color-accent-active: #7a3a08;
  --color-accent-highlight: #f2e6d4;

  --color-success: #3a7a1a;
  --color-error:   #b8402a;
  --color-info:    #2a6db8;
  --color-muted:   #7a786e;

  --shadow-sm: 0 1px 2px oklch(0.4 0.01 80 / 0.06);
  --shadow-md: 0 4px 16px oklch(0.4 0.01 80 / 0.08);
  --shadow-lg: 0 12px 40px oklch(0.4 0.01 80 / 0.10);
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-6), 4vw, var(--space-16));
}

.container--narrow { max-width: var(--content-narrow); }

/* ── Header ────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.85);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--color-divider);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.header__logo-mark {
  width: 36px; height: 36px;
}

.header__logo-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.header__logo-text span { color: var(--color-accent); }

.nav { display: flex; align-items: center; gap: var(--space-6); }

.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav__link:hover { color: var(--color-accent); }

.theme-toggle {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

.theme-toggle:hover {
  background: var(--color-surface-2);
  color: var(--color-accent);
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding-block: clamp(var(--space-24), 14vw, var(--space-48));
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(oklch(from var(--color-accent) l c h / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, oklch(from var(--color-accent) l c h / 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black, transparent);
}

.hero__bg-glow {
  position: absolute;
  width: 600px; height: 400px;
  top: 10%; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, oklch(from var(--color-accent) l c h / 0.15), transparent 70%);
  filter: blur(80px);
}

.hero__eyebrow {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-6);
}

.hero__title {
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: var(--space-8);
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-bottom: var(--space-10);
  line-height: 1.6;
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-interactive);
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}

.btn--primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px oklch(from var(--color-accent) l c h / 0.3);
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn--small {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* ── Status badge ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-accent-highlight);
  color: var(--color-accent);
}

.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Section spacing ───────────────────────────────────────── */
.section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.section--surface { background: var(--color-surface); }

.section__header {
  margin-bottom: var(--space-16);
}

.section__eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.section__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-4);
}

.section__lead {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 56ch;
}

/* ── Feature grid ──────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.feature-card {
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  transition: border-color var(--transition-interactive), transform var(--transition-interactive);
}

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

.feature-card__icon {
  width: 40px; height: 40px;
  margin-bottom: var(--space-5);
  color: var(--color-accent);
}

.feature-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.feature-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ── Roadmap timeline ──────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-divider);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-8);
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  border: 3px solid var(--color-bg);
  outline: 2px solid var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-bg);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
  margin-bottom: var(--space-2);
  letter-spacing: 0.02em;
}

.timeline__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.timeline__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ── Specs cards (horizontal) ──────────────────────────────── */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.spec-card {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
}

.spec-card__value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.spec-card__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ── Text blocks ───────────────────────────────────────────── */
.prose p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-5);
}

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

.prose h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-5);
  margin: var(--space-8) 0;
  font-style: italic;
  color: var(--color-text);
}

.prose blockquote cite {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-text-muted);
}

.prose ul {
  margin: var(--space-5) 0 var(--space-5) var(--space-6);
  list-style: none;
}

.prose ul li {
  position: relative;
  padding-left: var(--space-4);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--color-accent);
  transform: rotate(45deg);
}

/* ── Compatibility tables ──────────────────────────────────── */
.comp-table {
  margin-top: var(--space-8);
  overflow-x: auto;
}

.comp-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

.comp-table th,
.comp-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-divider);
}

.comp-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-surface-offset);
}

.comp-table tr:nth-child(even) td {
  background: oklch(from var(--color-surface) l c h / 0.5);
}

.comp-table td:first-child {
  font-weight: 500;
  color: var(--color-text);
}

.comp-table .check { color: var(--color-success); }
.comp-table .xmark { color: var(--color-error); }
.comp-table .warn { color: var(--color-accent); }

/* ── Link list ─────────────────────────────────────────────── */
.link-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.link-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-divider);
  transition: color var(--transition-interactive);
}

.link-list__item:hover {
  color: var(--color-accent);
}

.link-list__item svg {
  flex-shrink: 0;
  width: 18px; height: 18px;
  color: var(--color-text-faint);
}

.link-list__item:hover svg {
  color: var(--color-accent);
}

/* ── Verdict box ───────────────────────────────────────────── */
.verdict {
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  margin-top: var(--space-12);
}

.verdict__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.verdict__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.verdict__body p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.verdict__body p:last-child { margin-bottom: 0; }
[data-theme='light'] .hero__bg-grid {
  background-image:
    linear-gradient(oklch(from var(--color-accent) l c h / 0.06) 1px, transparent 1px),
    linear-gradient(90deg, oklch(from var(--color-accent) l c h / 0.06) 1px, transparent 1px);
}

[data-theme='light'] .hero__bg-glow {
  background: radial-gradient(ellipse, oklch(from var(--color-accent) l c h / 0.12), transparent 70%);
}

[data-theme='light'] ::selection {
  background: oklch(from var(--color-accent) l c h / 0.18);
}

[data-theme='light'] .comp-table th {
  background: var(--color-surface-offset);
}

[data-theme='light'] .comp-table tr:nth-child(even) td {
  background: oklch(from var(--color-surface) l c h / 0.6);
}

[data-theme='light'] .prose code {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

[data-theme='light'] .footer {
  background: var(--color-surface-offset);
}

[data-theme='light'] .link-list__item:hover svg {
  color: var(--color-accent);
}

[data-theme='light'] .spec-card {
  background: var(--color-surface-offset);
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  padding-block: var(--space-12);
  border-top: 1px solid var(--color-divider);
  background: var(--color-surface);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__links {
  display: flex;
  gap: var(--space-6);
}

.footer__links a {
  color: var(--color-text-faint);
  text-decoration: none;
}

.footer__links a:hover { color: var(--color-accent); }

/* ── Divider line ──────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--color-divider);
  margin-block: var(--space-12);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav__link--hide-mobile { display: none; }
  .hero__cta-row { flex-direction: column; }
  .features-grid { grid-template-columns: 1fr; }
  .specs-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { padding-left: 1.5rem; }
}

@media (max-width: 480px) {
  .specs-grid { grid-template-columns: 1fr; }
}
