/* ============================================================
   TechSifted Design System
   Shared tokens + base components for all pages
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Color */
  --ink: #0a0f1c;
  --ink-2: #1f2937;
  --ink-3: #374151;
  --ink-4: #4b5563;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e5e7eb;
  --line-2: #f3f4f6;
  --bg: #ffffff;
  --bg-2: #f9fafb;
  --bg-3: #f3f4f6;

  --brand: #1d4ed8;
  --brand-2: #1e40af;
  --brand-light: #60a5fa;

  --good: #059669;
  --good-light: #34d399;
  --good-bg: rgba(52,211,153,0.1);
  --bad: #dc2626;
  --bad-bg: rgba(220,38,38,0.1);
  --warn: #d97706;
  --warn-bg: rgba(217,119,6,0.1);

  /* Type */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  /* Layout */
  --container: 1280px;
  --container-narrow: 760px;
  --gutter: 56px;
  --gutter-mobile: 16px;

  /* Radius */
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
}
.eyebrow-muted {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.h1 {
  font-size: 68px;
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0;
  text-wrap: balance;
}
.h1 em { color: var(--brand); font-style: italic; font-weight: 800; }
.h2 {
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0;
  text-wrap: balance;
}
.h3 {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
}
.h4 {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 700;
  margin: 0;
}
.dek {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0;
}
.section-rule {
  width: 40px; height: 3px; background: var(--brand); margin: 12px 0 28px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 20px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  background: none;
  color: var(--ink);
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-ghost { border-color: #d1d5db; color: var(--ink); }
.btn-cta {
  background: var(--brand); color: #fff;
  padding: 16px 24px; font-size: 15px; font-weight: 700;
  letter-spacing: 0.01em;
}

/* ---------- Score badge ---------- */
.score {
  font-family: var(--font-mono);
  font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  letter-spacing: -0.01em;
}
.score-good { background: var(--good-bg); color: var(--good); }
.score-warn { background: var(--warn-bg); color: var(--warn); }
.score-bad  { background: var(--bad-bg);  color: var(--bad); }
.score-lg { font-size: 48px; padding: 12px 16px; letter-spacing: -0.03em; }

/* ---------- Verdict chip ---------- */
.verdict {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: var(--r-sm);
}
.verdict-worth { background: var(--good); color: #fff; }
.verdict-skip  { background: var(--bad); color: #fff; }
.verdict-maybe { background: var(--warn); color: #fff; }

/* ---------- Image placeholder ---------- */
.img-ph {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1e3a8a, #312e81);
  border-radius: var(--r-sm);
}
.img-ph::after {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 10px, transparent 10px 20px);
}
.img-ph.t-b { background: linear-gradient(135deg, #1e293b, #475569); }
.img-ph.t-c { background: linear-gradient(135deg, #0c4a6e, #1e3a8a); }
.img-ph.t-d { background: linear-gradient(135deg, #44403c, #1c1917); }
.img-ph.t-e { background: linear-gradient(135deg, #581c87, #1e1b4b); }
.img-ph.t-f { background: linear-gradient(135deg, #064e3b, #134e4a); }
.img-ph.t-g { background: linear-gradient(135deg, #831843, #1e1b4b); }
.img-ph.t-h { background: linear-gradient(135deg, #0c4a6e, #134e4a); }
.img-ph.t-i { background: linear-gradient(135deg, #7c2d12, #1c1917); }

/* ---------- Site chrome ---------- */
.top-strip {
  background: var(--ink); color: var(--muted-2);
  padding: 8px var(--gutter);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; row-gap: 4px;
  white-space: nowrap;
}
.top-strip > span { white-space: nowrap; }
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 50;
}
.site-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 22px; font-weight: 800; letter-spacing: -0.025em;
}
.site-logo .slash {
  width: 14px; height: 14px; background: var(--brand);
  transform: skewX(-20deg);
}
.nav-links { display: flex; gap: 32px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-search {
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: var(--r); padding: 8px 12px;
  font-size: 13px; color: var(--muted);
  width: 220px; display: flex; align-items: center; gap: 8px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: var(--muted-2);
  padding: 64px var(--gutter) 32px;
}
.site-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  max-width: var(--container); margin: 0 auto;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--ink-2);
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #fff; font-weight: 700; margin: 0 0 14px;
}
.footer-col a { display: block; padding: 5px 0; font-size: 13px; color: var(--muted-2); }
.footer-col a:hover { color: #fff; }
.site-footer-bottom {
  max-width: var(--container); margin: 24px auto 0;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Containers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Mobile (≤ 720px) ---------- */
@media (max-width: 720px) {
  .h1 { font-size: 36px; line-height: 1; }
  .h2 { font-size: 26px; }
  .h3 { font-size: 20px; }
  .h4 { font-size: 17px; }
  .dek { font-size: 15px; }
  .top-strip { padding: 6px var(--gutter-mobile); font-size: 10px; }
  .site-nav { padding: 14px var(--gutter-mobile); flex-wrap: wrap; row-gap: 10px; }
  /* Was: .nav-links, .nav-search { display: none; } -- that left phones with no
     navigation at all (v2 has no hamburger, and main.js is not loaded). Show the
     sections as a scrollable row instead. No JS, no open/close state. */
  .nav-search { display: none; }
  .nav-links {
    order: 3; width: 100%;
    gap: 20px; font-size: 13px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; scrollbar-width: none;
    border-top: 1px solid var(--line); padding-top: 10px;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
  .container, .container-narrow { padding: 0 var(--gutter-mobile); }
  .site-footer { padding: 40px var(--gutter-mobile) 24px; }
  .site-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; padding-bottom: 32px; }
  .site-footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ---------- View toggle (desktop / mobile) ---------- */
.view-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
  display: flex; gap: 4px;
  background: var(--ink); border-radius: 999px; padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.view-toggle button {
  border: none; background: transparent; color: var(--muted-2);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 999px;
}
.view-toggle button.active { background: var(--brand); color: #fff; }

.viewport-frame {
  margin: 0 auto;
  transition: max-width 0.2s ease;
}
.viewport-frame.mobile {
  max-width: 414px;
  border: 1px solid var(--line);
  margin-top: 24px; margin-bottom: 24px;
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.viewport-frame.mobile .site-nav { position: static; }
.viewport-frame.mobile .nav-links,
.viewport-frame.mobile .nav-search { display: none; }
