/* ==========================================================================
   WearAI Hub — Main Stylesheet
   Modern, minimalist, mobile-first. Light + dark mode via CSS variables.
   Core Web Vitals optimized: minimal CSS, no render-blocking imports.
   ========================================================================== */

/* ---------- CSS Reset (minimal) ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, picture, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ---------- Design Tokens ---------- */
:root {
  /* Light theme (default) */
  --bg: #ffffff;
  --bg-elevated: #f7f7f9;
  --bg-card: #ffffff;
  --bg-subtle: #f1f3f5;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --star: #fbbf24;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Layout */
  --container: 1200px;
  --container-narrow: 760px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-elevated: #131829;
  --bg-card: #161c2e;
  --bg-subtle: #1c2333;
  --text: #e8edf6;
  --text-muted: #a8b3c7;
  --text-soft: #7c8aa3;
  --border: #232a3d;
  --border-strong: #2e3850;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: #1e2440;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* ---------- Base Typography ---------- */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  transition: background-color var(--transition), color var(--transition);
}
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin-top: var(--space-7); margin-bottom: var(--space-4); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.625rem); margin-top: var(--space-6); margin-bottom: var(--space-3); }
h4 { font-size: 1.125rem; margin-top: var(--space-5); margin-bottom: var(--space-2); }
p { margin-bottom: var(--space-4); }
strong { font-weight: 700; color: var(--text); }
em { font-style: italic; }
a.content-link, .prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color var(--transition);
}
a.content-link:hover, .prose a:hover { color: var(--accent-hover); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.section { padding: var(--space-8) 0; }
.section-sm { padding: var(--space-6) 0; }
.text-center { text-align: center; }
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  max-width: var(--container);
  margin: 0 auto;
  gap: var(--space-4);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--text);
  white-space: nowrap;
}
.brand-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: 0.95rem;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: var(--bg-subtle);
  transition: all var(--transition);
}
.icon-btn:hover { color: var(--text); background: var(--accent-soft); }
.icon-btn svg { width: 18px; height: 18px; }

/* Mobile nav toggle */
.nav-toggle { display: none; }
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    padding: var(--space-4);
    gap: var(--space-3);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  white-space: nowrap;
  text-align: center;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-amazon {
  background: #ff9900;
  color: #0f172a;
  font-weight: 700;
  padding: 0.8rem 1.6rem;
}
.btn-amazon:hover {
  background: #e88b00;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-product {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.card-product .product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.card-product .product-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.card-product .product-summary {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}
.card-product .product-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}
.card-product .product-footer {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
}

/* Star ratings */
.stars { color: var(--star); letter-spacing: 1px; font-size: 0.95rem; }
.stars-num { color: var(--text-soft); font-size: 0.85rem; margin-left: var(--space-1); }

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-9) 0 var(--space-8);
  text-align: center;
  background:
    radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    var(--bg);
}
.hero h1 {
  margin-bottom: var(--space-4);
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-6);
}
.hero-cta {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Badges & tags ---------- */
.tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag-muted {
  background: var(--bg-subtle);
  color: var(--text-soft);
}

/* ---------- Article / Prose ---------- */
.article-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: var(--space-3);
}
.prose { font-size: 1.06rem; line-height: 1.75; color: var(--text); }
.prose p { margin-bottom: var(--space-4); }
.prose h2 { margin-top: var(--space-7); }
.prose h3 { margin-top: var(--space-6); }
.prose h4 { margin-top: var(--space-5); }
.prose ul, .prose ol { margin: 0 0 var(--space-4) var(--space-5); }
.prose ul li { list-style: disc; margin-bottom: var(--space-2); }
.prose ol li { list-style: decimal; margin-bottom: var(--space-2); }
.prose blockquote {
  border-left: 4px solid var(--accent);
  padding: var(--space-3) var(--space-5);
  margin: var(--space-5) 0;
  background: var(--bg-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}
.prose code {
  background: var(--bg-subtle);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.prose img { border-radius: var(--radius); margin: var(--space-5) 0; }

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  font-size: 0.95rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.comparison-table th,
.comparison-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.comparison-table thead {
  background: var(--bg-subtle);
}
.comparison-table th {
  font-weight: 700;
  color: var(--text);
}
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table tbody tr:hover { background: var(--accent-soft); }
.comparison-table .col-feature { font-weight: 600; width: 25%; }

/* Callout boxes */
.callout {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  margin: var(--space-5) 0;
  border-left: 4px solid;
  background: var(--bg-subtle);
}
.callout-title { font-weight: 700; margin-bottom: var(--space-2); }
.callout-info { border-color: var(--accent); }
.callout-info .callout-title { color: var(--accent); }
.callout-warning { border-color: var(--warning); }
.callout-warning .callout-title { color: var(--warning); }
.callout-success { border-color: var(--success); }
.callout-success .callout-title { color: var(--success); }

/* Disclosure banner */
.disclosure {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}
.disclosure strong { color: var(--text); }

/* Pros/Cons grid */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-5) 0;
}
@media (max-width: 600px) {
  .pros-cons { grid-template-columns: 1fr; }
}
.pros-cons > div {
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.pros-cons h4 { margin-top: 0; }
.pros-cons ul { margin-left: var(--space-5); margin-top: var(--space-2); }
.pros-cons li { list-style: disc; margin-bottom: var(--space-2); color: var(--text-muted); }
.pros h4 { color: var(--success); }
.cons h4 { color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: var(--space-7) 0 var(--space-5);
  margin-top: var(--space-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-5); }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand { font-weight: 800; font-size: 1.1rem; margin-bottom: var(--space-2); color: var(--text); }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; max-width: 320px; }
.footer-col h5 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin-bottom: var(--space-3);
}
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-col a { color: var(--text-muted); font-size: 0.92rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.85rem;
  color: var(--text-soft);
}
.footer-bottom a { color: var(--text-soft); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- FAQ section ---------- */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
  overflow: hidden;
  background: var(--bg-card);
}
.faq-question {
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 1rem;
  color: var(--text);
}
.faq-question:hover { background: var(--bg-subtle); }
.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  padding: 0 var(--space-5) var(--space-4);
  color: var(--text-muted);
  display: none;
  font-size: 0.97rem;
  line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* ---------- CTA Section ---------- */
.cta-section {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  text-align: center;
  color: #fff;
  margin: var(--space-7) 0;
}
.cta-section h2 { color: #fff; margin-top: 0; }
.cta-section p { color: color-mix(in srgb, #fff 90%, transparent); font-size: 1.1rem; }
.cta-section .btn {
  background: #fff;
  color: var(--accent);
  margin-top: var(--space-3);
}
.cta-section .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-soft);
  padding: var(--space-3) 0;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--text-soft); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .current { color: var(--text-muted); font-weight: 500; }

/* ---------- Table of Contents ---------- */
.toc {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
}
.toc-title {
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin-bottom: var(--space-3);
}
.toc ol {
  margin-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.toc ol li { list-style: decimal; }
.toc a { color: var(--text-muted); font-size: 0.95rem; }
.toc a:hover { color: var(--accent); }

/* ---------- Featured list ---------- */
.featured-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.featured-list .featured-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all var(--transition);
}
.featured-list .featured-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.featured-rank {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
}

/* ---------- Utility ---------- */
.muted { color: var(--text-muted); }
.text-sm { font-size: 0.9rem; }
.text-xs { font-size: 0.8rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print */
@media print {
  .site-header, .site-footer, .nav-toggle, .icon-btn, .btn { display: none !important; }
  body { font-size: 12pt; color: #000; background: #fff; }
}
