/* ============================================================
   Quantum Computing Study Series — Shared Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@400;600;700;800&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  /* Backgrounds — kept dark but with more separation between layers */
  --bg:          #0a0d18;
  --bg-card:     #111827;
  --bg-elevated: #1a2235;
  --bg-image:    #1c2340;   /* Used behind dark SVG images */

  /* Borders — brighter so they're visible */
  --border:      #2a3f6a;
  --border-glow: #3d6fd4;

  /* Text — significantly brighter for readability */
  --text-primary:   #f0f4ff;       /* Near-white, very legible */
  --text-secondary: #c4cfe8;       /* Was #8a9ac0 — now much brighter */
  --text-muted:     #7a8fb5;       /* Was #4a5878 — raised considerably */

  /* Accent colours — slightly brightened */
  --accent:       #5b9bf8;         /* Brighter blue */
  --accent-light: #93bcff;
  --accent-glow:  rgba(91,155,248,0.2);

  --highlight:    #00e8bb;         /* Brighter teal */
  --highlight-dim: rgba(0,232,187,0.14);

  --warn:         #ffc04a;         /* Brighter amber */

  --font-display: 'Syne', sans-serif;
  --font-mono:    'Space Mono', monospace;
  --font-body:    'IBM Plex Sans', sans-serif;

  --radius: 6px;
  --radius-lg: 12px;
  --shadow-glow: 0 0 40px rgba(91,155,248,0.15);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.8;
  font-size: 17px;           /* Base size up from 16px */
  overflow-x: hidden;
}

/* Subtle grid texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(50,80,140,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50,80,140,0.1) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(10,13,24,0.97);
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  height: 62px;
}

.site-logo {
  font-family: var(--font-mono);
  font-size: 0.82rem;          /* Up from 0.75rem */
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}
.site-logo span { color: var(--text-muted); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 5;
  padding: 72px 32px 56px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;          /* Up from 0.68rem */
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-label::before { content: '// '; opacity: 0.6; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 22px;
}
.hero h1 em { font-style: normal; color: var(--accent-light); }

.hero-sub {
  font-size: 1.12rem;          /* Up from 1.05rem */
  color: var(--text-secondary);
  max-width: 660px;
  line-height: 1.8;
}

/* ── Page layout ──────────────────────────────────────────── */
.page-body {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 80px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .page-body { grid-template-columns: 1fr; }
  .hero { padding: 48px 24px 36px; }
  .page-body { padding: 0 24px 60px; }
  .header-inner { padding: 0 24px; }
}

/* ── Section labels ───────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;          /* Up from 0.62rem */
  color: var(--accent-light);  /* Brighter than just --accent */
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Typography ───────────────────────────────────────────── */
h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;           /* Up from 1.05rem */
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

p {
  color: var(--text-secondary); /* Now #c4cfe8 — much more readable */
  margin-bottom: 18px;
  font-weight: 400;              /* Up from 300 — thin weight on dark bg is hard to read */
  font-size: 1rem;
}
p:last-child { margin-bottom: 0; }

strong { color: var(--text-primary); font-weight: 600; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover { border-color: var(--border-glow); box-shadow: var(--shadow-glow); }

/* ── Concept grid ─────────────────────────────────────────── */
.concept-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 600px) { .concept-grid { grid-template-columns: 1fr; } }

.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.3s, transform 0.2s;
}
.concept-card:hover { border-color: var(--highlight); transform: translateY(-2px); }

.concept-icon { font-size: 1.8rem; margin-bottom: 12px; display: block; }

.concept-card h3 {
  font-size: 1rem;             /* Up from 0.9rem */
  margin-bottom: 8px;
  color: var(--highlight);
}
.concept-card p {
  font-size: 0.94rem;          /* Up from 0.84rem */
  color: var(--text-secondary);
}

/* ── Visual figures ───────────────────────────────────────── */
.visual-figure {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
}

/* White/light backing so dark SVGs and diagrams are visible */
.visual-figure .img-wrap {
  background: #e8eef8;         /* Light background for diagram images */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 220px;
}

.visual-figure img {
  width: 100%;
  display: block;
  max-height: 360px;
  object-fit: contain;         /* contain instead of cover so diagrams aren't cropped */
  object-position: center;
}

.visual-caption {
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;          /* Up from 0.68rem */
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  line-height: 1.6;
}

.visual-caption span { color: var(--text-secondary); } /* Caption text brighter */
.visual-caption a { color: var(--accent-light); text-decoration: none; white-space: nowrap; }
.visual-caption a:hover { text-decoration: underline; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.sidebar-card h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;          /* Up from 0.68rem */
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Link lists ───────────────────────────────────────────── */
.link-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.link-list li a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;           /* Up from 0.84rem */
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.link-list li a:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}

.link-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--accent-glow);
  border: 1px solid rgba(91,155,248,0.3);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: var(--accent-light);
  font-family: var(--font-mono);
  margin-top: 1px;
}
.link-type-video .link-icon { background: rgba(255,192,74,0.15); border-color: rgba(255,192,74,0.35); color: var(--warn); }
.link-type-tool  .link-icon { background: var(--highlight-dim); border-color: rgba(0,232,187,0.3); color: var(--highlight); }
.link-type-paper .link-icon { background: rgba(200,150,255,0.12); border-color: rgba(200,150,255,0.3); color: #d0a8ff; }

/* ── Further study list ───────────────────────────────────── */
.study-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.study-list li a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.88rem;          /* Up from 0.82rem */
  text-decoration: none;
  padding: 7px 10px 7px 20px;
  border-radius: 4px;
  position: relative;
  transition: color 0.2s, background 0.2s;
}
.study-list li a::before {
  content: '→';
  position: absolute;
  left: 5px;
  color: var(--accent-light);
  font-size: 0.8rem;
}
.study-list li a:hover { color: var(--text-primary); background: var(--accent-glow); }

/* ── Tables ───────────────────────────────────────────────── */
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; } /* Up from 0.85rem */

.compare-table th {
  font-family: var(--font-mono);
  font-size: 0.72rem;          /* Up from 0.65rem */
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  text-align: left;
}

.compare-table td {
  padding: 12px 16px;          /* More breathing room */
  border: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
  font-weight: 400;            /* Up from 300 */
  line-height: 1.6;
}
.compare-table tr:hover td { background: var(--bg-elevated); }

/* ── Callout ──────────────────────────────────────────────── */
.callout {
  border-left: 3px solid var(--highlight);
  background: var(--highlight-dim);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 28px;
  font-size: 0.98rem;          /* Up from 0.9rem */
  color: var(--text-secondary);
  line-height: 1.7;
}
.callout strong { color: var(--highlight); font-weight: 600; }

/* ── Tag chips ────────────────────────────────────────────── */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;           /* Up from 0.62rem */
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.tag.t-key  { border-color: rgba(91,155,248,0.5); color: var(--accent-light); background: var(--accent-glow); }
.tag.t-algo { border-color: rgba(0,232,187,0.4); color: var(--highlight); background: var(--highlight-dim); }
.tag.t-warn { border-color: rgba(255,192,74,0.4); color: var(--warn); background: rgba(255,192,74,0.1); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 5;
  border-top: 1px solid var(--border);
  padding: 24px 32px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;          /* Up from 0.65rem */
  color: var(--text-muted);
  letter-spacing: 0.08em;
}
.site-footer a { color: var(--accent-light); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero      { animation: fadeUp 0.55s ease both; }
.page-body { animation: fadeUp 0.55s 0.15s ease both; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 3px; }
