/* =========================================================
   SCOTT'S GEAR — Retro-Tech Nostalgia Design System
   ========================================================= */

@import url('https://api.fontshare.com/v2/css?f[]=space-grotesk@500,600,700&f[]=jetbrains-mono@400,500,600&display=swap');

:root {
  /* ===== Light theme (default) — "vintage tech manual" ===== */
  --bg: #f4f1e8;
  --surface: #ffffff;
  --surface-alt: #ebe7d9;
  --surface-raised: #ffffff;
  --border: #d8d2bd;
  --border-bright: #b8b096;

  --text: #1a1a2e;
  --text-muted: #5c5c6e;
  --text-faint: #8a8a96;

  --accent: #007a66;        /* deep teal-green */
  --accent-dim: #d9f2ec;
  --accent-glow: rgba(0, 122, 102, 0.18);
  --accent-contrast: #ffffff;

  --accent-2: #b81f63;      /* deep magenta/rose */
  --accent-2-glow: rgba(184, 31, 99, 0.18);

  --amber: #92600a;         /* darkened amber for AA contrast on cream */

  --error: #c0392b;
  --success: #1f7a4d;

  --scanline-opacity: 0.02;
  --vignette-opacity: 0.08;
  --grid-opacity: 0.05;

  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'JetBrains Mono', 'Courier New', monospace;

  --radius: 4px;
  --container-max: 1200px;
  --measure: 68ch;
}

/* ===== Dark theme (opt-in via toggle) — "CRT terminal" ===== */
[data-theme="dark"] {
  --bg: #0d0d14;
  --surface: #15151f;
  --surface-alt: #1c1c2a;
  --surface-raised: #21212f;
  --border: #33334a;
  --border-bright: #4a4a68;

  --text: #e8e8f0;
  --text-muted: #9494ab;
  --text-faint: #5f5f75;

  --accent: #00ffc8;        /* terminal cyan-mint */
  --accent-dim: #0a8f74;
  --accent-glow: rgba(0, 255, 200, 0.35);
  --accent-contrast: #0d0d14;

  --accent-2: #ff2e88;      /* hot magenta */
  --accent-2-glow: rgba(255, 46, 136, 0.35);

  --amber: #ffd60a;         /* LED amber for tags/decades */

  --error: #ff5c5c;
  --success: #4ee6a0;

  --scanline-opacity: 0.025;
  --vignette-opacity: 0.55;
  --grid-opacity: 0.035;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
}
body, .site-header, .card, .site-footer, .catalog-search input, .filter-pill, .form-row input, .form-row textarea {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.25em; }
button { font-family: inherit; cursor: pointer; }

/* ---------- CRT scanline + vignette overlay ----------
   Subtle in light mode (barely-there texture), stronger in dark mode
   (full CRT terminal feel). Intensity driven by --scanline-opacity /
   --vignette-opacity / --grid-opacity, set per theme above. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, var(--scanline-opacity)) 0px,
    rgba(0, 0, 0, var(--scanline-opacity)) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}
[data-theme="dark"] body::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, var(--scanline-opacity)) 0px,
    rgba(255, 255, 255, var(--scanline-opacity)) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,var(--vignette-opacity)) 130%);
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Faint circuit-grid background on the page body */
.site {
  background-image:
    linear-gradient(rgba(0, 122, 102, var(--grid-opacity)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 122, 102, var(--grid-opacity)) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}
[data-theme="dark"] .site {
  background-image:
    linear-gradient(rgba(0, 255, 200, var(--grid-opacity)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 200, var(--grid-opacity)) 1px, transparent 1px);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1.2em; max-width: var(--measure); }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }

.glow-text {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow), 0 0 20px var(--accent-glow);
}
.glow-text--pink {
  color: var(--accent-2);
  text-shadow: 0 0 8px var(--accent-2-glow), 0 0 20px var(--accent-2-glow);
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 64px 0; }
.section--tight { padding: 32px 0; }

/* ---------- Site Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(13, 13, 20, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: var(--container-max);
  margin: 0 auto;
  gap: 24px;
}
.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.site-logo:hover { text-decoration: none; }
.site-logo__bracket { color: var(--accent); }
.site-logo__mark {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.primary-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 28px;
  flex-wrap: wrap;
}
.primary-nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.primary-nav a:hover,
.primary-nav a.active {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-bright);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
}

/* ---------- Theme toggle (light/dark) ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle__icon { font-size: 0.95rem; line-height: 1; }
.theme-toggle .label-dark { display: none; }
[data-theme="dark"] .theme-toggle .label-light { display: none; }
[data-theme="dark"] .theme-toggle .label-dark { display: inline; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 4px; padding: 16px 0; }
  .site-header__inner { flex-wrap: wrap; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  color: var(--accent-contrast);
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px var(--accent-glow);
  text-decoration: none;
  color: var(--accent-contrast);
}
.btn--outline {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}
.btn--outline:hover { background: var(--accent-glow); }
.btn--pink {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: var(--accent-contrast);
  box-shadow: 0 0 16px var(--accent-2-glow);
}
.btn--pink:hover { box-shadow: 0 0 24px var(--accent-2-glow); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px var(--accent-dim);
}
.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 18px; }
.card__eyebrow {
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  margin-bottom: 8px;
  display: block;
}
.card__title {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--accent); text-decoration: none; }
.card__excerpt { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0; }
.card__meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Tags / Badges ---------- */
.badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
}
.badge--decade {
  border-color: var(--amber);
  color: var(--amber);
}
.badge--accent {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.grid--blog { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 72px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.hero__eyebrow {
  font-family: var(--font-display);
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  margin-bottom: 16px;
}
.hero h1 { margin-bottom: 18px; }
.hero p.hero__sub {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 28px;
  font-size: 1.05rem;
}
.hero__cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Catalog / Filters ---------- */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.catalog-search {
  flex: 1 1 260px;
  position: relative;
}
.catalog-search input[type="search"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  border-radius: var(--radius);
}
.catalog-search input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.catalog-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-pill {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  background: transparent;
}
.filter-pill.is-active,
.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.catalog-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}

/* ---------- Gadget single page ---------- */
.gadget-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 48px 0;
  align-items: start;
}
@media (max-width: 800px) {
  .gadget-hero { grid-template-columns: 1fr; }
}
.gadget-hero__media {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.gadget-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.gadget-hero__badges { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table td { padding: 10px 0; }
.spec-table td:first-child {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  width: 40%;
}
.spec-table td:last-child { color: var(--text); }

/* ---------- Blog single / content ---------- */
.entry-content {
  max-width: var(--measure);
}
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5em 0;
}
.entry-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.5em 1.2em;
  color: var(--text-muted);
  font-style: normal;
  background: var(--surface);
}
.entry-content pre, .entry-content code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.entry-content code { padding: 2px 6px; font-size: 0.85em; }
.entry-content pre { padding: 16px; overflow-x: auto; }
.entry-header { padding: 56px 0 24px; text-align: center; border-bottom: 1px solid var(--border); }
.entry-header .badge--decade { margin-bottom: 14px; }
.entry-meta {
  color: var(--text-faint);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

/* ---------- Page header (generic) ---------- */
.page-header {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { margin-bottom: 10px; }

/* ---------- Contact form ---------- */
.contact-form { max-width: 620px; }
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.form-row input,
.form-row textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: var(--radius);
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ---------- Social page ---------- */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.social-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.social-card:hover { border-color: var(--accent); transform: translateY(-3px); text-decoration: none; }
.social-card__icon { font-size: 2rem; margin-bottom: 12px; }
.social-card__name { font-family: var(--font-display); font-weight: 700; color: var(--text); margin-bottom: 4px; }
.social-card__handle { color: var(--text-muted); font-size: 0.85rem; }

/* ---------- YouTube video grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.video-card__embed {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-card__embed iframe { width: 100%; height: 100%; border: 0; }
.video-card__title { margin: 12px 0 4px; font-size: 1rem; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 48px 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.85rem;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .current { border-color: var(--accent); color: var(--accent); }

/* ---------- Sidebar / widgets ---------- */
.widget { margin-bottom: 36px; }
.widget-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { margin-bottom: 10px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 64px;
  background: var(--surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-grid h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
  margin-bottom: 14px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--text-muted); }
.footer-grid a:hover { color: var(--accent); }
.site-footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-faint);
  font-size: 0.8rem;
}

/* ---------- Layout with sidebar ---------- */
.content-layout {
  display: grid;
  grid-template-columns: 2.4fr 1fr;
  gap: 48px;
}
@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; }
}

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 12px 20px;
  z-index: 10000;
}
.skip-link:focus { left: 12px; top: 12px; }
