/* ===========================
   Modern Java — styles.css
   A dark/light theme with orange/amber accent
   =========================== */

/* ---------- Font Faces ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter.woff2) format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/jetbrains-mono.woff2) format('woff2');
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
code, pre { font-family: 'JetBrains Mono', monospace; }

/* ---------- Root Variables (Dark) ---------- */
:root {
  --bg: #0b0b0f;
  --surface: #14141a;
  --surface-2: #1a1a22;
  --border: #25252f;
  --border-light: #2f2f3a;
  --text: #e4e4e7;
  --text-muted: #6b6b76;
  --accent: #fb923c;
  --accent-dim: #f97316;
  --green: #34d399;
  --blue: #60a5fa;
  --pink: #f472b6;
  --orange: #fb923c;
  --yellow: #fbbf24;
  --cyan: #22d3ee;
  --red-muted: #ef4444;
  --old-bg: #11100f;
  --modern-bg: #0f1117;
  --radius: 16px;
  --radius-sm: 10px;
  --nav-bg: rgba(11, 11, 15, .8);
  color-scheme: dark light;
}

/* ---------- Light Mode ---------- */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8f8fa;
    --surface: #ffffff;
    --surface-2: #f0f0f4;
    --border: #d8d8e0;
    --border-light: #e4e4ea;
    --text: #1a1a2e;
    --text-muted: #6b6b80;
    --accent: #f97316;
    --accent-dim: #ea580c;
    --green: #059669;
    --blue: #2563eb;
    --pink: #db2777;
    --orange: #ea580c;
    --yellow: #ca8a04;
    --cyan: #0891b2;
    --red-muted: #dc2626;
    --old-bg: #fef2f2;
    --modern-bg: #eff6ff;
    --nav-bg: rgba(248, 248, 250, .85);
  }
}

/* ---------- Base Body ---------- */
body {
  background: var(--bg);
  color: var(--text);
}

/* ---------- Nav ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cmd-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.cmd-bar:hover {
  border-color: var(--border-light);
}

.cmd-bar kbd {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.github-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all 0.2s;
  text-decoration: none;
}

.github-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-2);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 80px 24px 48px;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(251, 146, 60, .1);
  border: 1px solid rgba(251, 146, 60, .2);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--orange), var(--pink), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---------- Hero Compare ---------- */
.hero-compare {
  display: flex;
  gap: 2px;
  max-width: 820px;
  margin: 48px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.hero-compare-side {
  flex: 1;
  padding: 28px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  position: relative;
}

.hero-compare-side.old {
  background: var(--old-bg);
}

.hero-compare-side.modern {
  background: var(--modern-bg);
}

.compare-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.compare-label.old {
  color: var(--red-muted);
  background: rgba(239, 68, 68, .1);
}

.compare-label.modern {
  color: var(--green);
  background: rgba(52, 211, 153, .1);
}

/* ---------- Code Highlighting ---------- */
.kw { color: var(--pink); }
.typ { color: var(--blue); }
.str { color: var(--green); }
.fn { color: var(--orange); }
.cmt { color: var(--text-muted); font-style: italic; }
.num { color: var(--yellow); }
.ann { color: var(--cyan); }

/* ---------- Section ---------- */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(251, 146, 60, .08);
  border: 1px solid rgba(251, 146, 60, .15);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ---------- Filter Pills ---------- */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}

.filter-pill {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Tips / Card Grid ---------- */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.tip-card.filter-hidden {
  display: none;
}

.tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.tip-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  border-color: var(--border-light);
}

.tip-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 12px;
}

.tip-card-header {
  padding: 0 0 8px;
}

.tip-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.tip-card-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tip-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 14px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-2);
}

.badge.language   { color: var(--blue);    background: rgba(96, 165, 250, .1);  border-color: rgba(96, 165, 250, .2); }
.badge.collections { color: var(--pink);   background: rgba(244, 114, 182, .1); border-color: rgba(244, 114, 182, .2); }
.badge.strings    { color: var(--green);   background: rgba(52, 211, 153, .1);  border-color: rgba(52, 211, 153, .2); }
.badge.streams    { color: var(--orange);  background: rgba(251, 146, 60, .1);  border-color: rgba(251, 146, 60, .2); }
.badge.concurrency { color: var(--cyan);   background: rgba(34, 211, 238, .1);  border-color: rgba(34, 211, 238, .2); }
.badge.io         { color: var(--yellow);  background: rgba(251, 191, 36, .1);  border-color: rgba(251, 191, 36, .2); }
.badge.errors     { color: var(--red-muted); background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .2); }
.badge.datetime   { color: var(--accent);  background: rgba(251, 146, 60, .1);  border-color: rgba(251, 146, 60, .2); }
.badge.security   { color: var(--pink);    background: rgba(244, 114, 182, .1); border-color: rgba(244, 114, 182, .2); }
.badge.tooling    { color: var(--blue);    background: rgba(96, 165, 250, .1);  border-color: rgba(96, 165, 250, .2); }

.badge.beginner     { color: var(--green);  background: rgba(52, 211, 153, .1);  border-color: rgba(52, 211, 153, .2); }
.badge.intermediate { color: var(--yellow); background: rgba(251, 191, 36, .1);  border-color: rgba(251, 191, 36, .2); }
.badge.advanced     { color: var(--pink);   background: rgba(244, 114, 182, .1); border-color: rgba(244, 114, 182, .2); }

/* ---------- Card Code (old → modern hover) ---------- */
.card-code {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

.card-code pre {
  padding: 16px 20px;
  font-size: 0.78rem;
  line-height: 1.7;
  overflow-x: auto;
}

.old-layer,
.modern-layer {
  transition: opacity 0.35s;
  padding: 16px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.75;
  overflow: hidden;
}

.code-text {
  white-space: pre;
  display: block;
}

.old-layer {
  opacity: 1;
  background: var(--old-bg);
}

.modern-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: var(--modern-bg);
  overflow-y: auto;
}

.tip-card:hover .old-layer,
.tip-card.toggled .old-layer {
  opacity: 0;
}

.tip-card:hover .modern-layer,
.tip-card.toggled .modern-layer {
  opacity: 1;
}

.mini-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
}

.mini-label.old {
  color: var(--red-muted);
  background: rgba(239, 68, 68, .1);
}

.mini-label.modern {
  color: var(--green);
  background: rgba(52, 211, 153, .1);
}

.hover-hint {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.3s;
}

.tip-card:hover .hover-hint,
.tip-card.toggled .hover-hint {
  opacity: 0;
}

/* ---------- Card Footer ---------- */
.tip-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}

.browser-support {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  transition: gap 0.2s;
}

.arrow-link:hover {
  gap: 8px;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 40px 24px;
  flex-wrap: wrap;
}

.stat-card {
  text-align: center;
}

.stat-card .number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.stat-card .number.orange { color: var(--orange); }
.stat-card .number.green  { color: var(--green); }
.stat-card .number.blue   { color: var(--blue); }
.stat-card .number.pink   { color: var(--pink); }

.stat-card .label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Newsletter ---------- */
.newsletter-box {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.newsletter-box h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.newsletter-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input:focus {
  border-color: var(--accent);
}

.newsletter-form button {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.2s;
}

.newsletter-form button:hover {
  background: var(--accent-dim);
}

/* ---------- Article Page ---------- */
.article {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb .sep {
  opacity: 0.4;
}

.tip-header {
  margin-bottom: 40px;
}

.tip-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.tip-header .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tip-header code {
  font-size: 0.85em;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
}

/* ---------- Code Comparison (Detail Page) ---------- */
.compare-section {
  margin: 40px 0;
}

.compare-container {
  display: flex;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.compare-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.compare-panel.old,
.compare-panel.old-panel {
  background: var(--old-bg);
  border-right: 1px solid var(--border);
}

.compare-panel.modern,
.compare-panel.modern-panel {
  background: var(--modern-bg);
}

.compare-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 6px;
}

.compare-tag.old {
  color: var(--red-muted);
  background: rgba(239, 68, 68, .1);
}

.compare-tag.modern {
  color: var(--green);
  background: rgba(52, 211, 153, .1);
}

.compare-code {
  padding: 20px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  overflow-x: auto;
  flex: 1;
}

.compare-code pre {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
}

.compare-code .line {
  display: flex;
  padding: 0 16px;
}

.compare-code .line-number {
  width: 36px;
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.4;
  text-align: right;
  padding-right: 16px;
  user-select: none;
}

.compare-code .line-content {
  flex: 1;
  white-space: pre;
}

.hl {
  background: rgba(251, 146, 60, .06);
  border-left: 2px solid var(--accent);
}

.hl-red {
  background: rgba(239, 68, 68, .06);
  border-left: 2px solid var(--red-muted);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: transparent;
  transition: all 0.2s;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--border-light);
}

/* ---------- Demo Section ---------- */
.demo-section {
  margin: 48px 0;
}

.demo-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.demo-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.demo-toolbar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-light);
}

.demo-toolbar .dot:nth-child(1) { background: var(--red-muted); }
.demo-toolbar .dot:nth-child(2) { background: var(--yellow); }
.demo-toolbar .dot:nth-child(3) { background: var(--green); }

.demo-viewport {
  padding: 32px 24px;
  min-height: 200px;
}

/* ---------- Why Section ---------- */
.why-section {
  margin: 48px 0;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.why-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.why-card:hover {
  border-color: var(--border-light);
}

.why-card .icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.why-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.why-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Info Grid ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.info-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.info-card .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.info-card .value {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ---------- JDK Support Section ---------- */
.bs-section {
  margin: 48px 0;
}

.bs-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.bs-feature-name {
  font-size: 0.88rem;
  font-weight: 500;
}

.baseline-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
}

.baseline-badge.widely {
  color: var(--green);
  background: rgba(52, 211, 153, .1);
}

.baseline-badge.newly {
  color: var(--blue);
  background: rgba(96, 165, 250, .1);
}

.baseline-badge.limited {
  color: var(--yellow);
  background: rgba(251, 191, 36, .1);
}

/* ---------- Explanation ---------- */
.explanation {
  margin: 40px 0;
}

.explanation h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.explanation p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* ---------- Related ---------- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.related-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}

.related-card h4 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.related-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Search Overlay ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-modal {
  width: 100%;
  max-width: 580px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .4);
  overflow: hidden;
}

.search-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.search-result:hover,
.search-result.selected {
  background: var(--surface-2);
}

.search-result .title {
  font-size: 0.88rem;
  font-weight: 500;
}

.search-result .desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

footer a {
  color: var(--accent);
  transition: color 0.2s;
}

footer a:hover {
  color: var(--accent-dim);
}

/* ---------- Responsive: ≤ 700px ---------- */
@media (max-width: 700px) {
  .nav-links {
    display: none;
  }

  .nav-inner {
    padding: 0 16px;
  }

  .hero {
    padding: 56px 16px 32px;
  }

  .section {
    padding: 40px 16px;
  }

  .tips-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    gap: 20px;
  }

  .filter-pills {
    gap: 6px;
  }

  .newsletter-form {
    flex-direction: column;
  }
}

/* ---------- Responsive: ≤ 500px ---------- */
@media (max-width: 500px) {
  .hero-compare {
    flex-direction: column;
  }

  .compare-container {
    flex-direction: column;
  }

  .compare-panel {
    min-width: unset;
  }

  .hero-compare-side {
    padding: 20px 16px;
  }
}

/* Copilot callout banner */
.copilot-callout {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}
.copilot-callout-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 16px 24px;
  margin-top: 8px;
  margin-bottom: 8px;
}
.copilot-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.copilot-callout-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}
.copilot-callout-links {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.copilot-callout-links a {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.copilot-callout-links a:hover {
  opacity: 0.85;
}
@media (max-width: 640px) {
  .copilot-callout-inner {
    flex-direction: column;
    text-align: center;
  }
  .copilot-callout-links {
    flex-direction: column;
    width: 100%;
  }
  .copilot-callout-links a {
    text-align: center;
  }
}

/* Social share buttons */
.social-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  max-width: 960px;
  margin: 0 auto;
}
.share-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1;
}
.share-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.share-li { font-family: Georgia, serif; font-weight: 800; font-size: 0.85rem; }
.share-reddit { font-size: 1.1rem; }
