/* CampusStack Design System - Lightweight, Zero-CLS, Responsive */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --accent: #0ea5e9;
  --success: #10b981;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --max-w: 1140px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 28px -4px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img, svg {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Reading Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 1000;
  transition: width 0.1s linear;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--primary);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.icon-btn:hover {
  border-color: var(--primary);
}

.menu-toggle {
  display: none;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--text-muted);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 4.5rem 0 3.25rem;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, 95vw);
  height: 340px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--primary) 18%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 45%, transparent 72%);
  filter: blur(28px);
  pointer-events: none;
  z-index: -1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.95rem;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.35rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin: 0 auto 1.1rem;
  max-width: 820px;
  background: linear-gradient(135deg, var(--text) 35%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 2rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.78rem 1.45rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 30%, transparent);
}

.btn-primary:hover {
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 42%, transparent);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
}

/* Stats Strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 3.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: var(--shadow-md);
}

.stat-card strong {
  display: block;
  font-size: 1.55rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-card span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Section Headings */
.section {
  padding: 2.5rem 0;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-header h2 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
}

.card:hover::before {
  opacity: 1;
}

.card[hidden] {
  display: none;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
}

.tag-free {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.card h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.card p {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin: 0 0 1.1rem;
}

.card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Featured Banner */
.featured-box {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.featured-box h2 {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.55rem;
}

.featured-checklist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-size: 0.9rem;
}

.featured-checklist ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

/* FAQ Accordion */
.faq-list {
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 1.1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-a {
  padding: 0 1.25rem 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  display: none;
}

.faq-item.open .faq-a {
  display: block;
}

/* Prompt Builder Tool */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.form-control:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.prompt-output {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  white-space: pre-wrap;
  min-height: 220px;
  color: var(--text);
}

/* Article Layout */
.article-wrap {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2.25rem;
  padding: 2rem 0 4rem;
  align-items: start;
}

.toc-box {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.toc-box h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.toc-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.article-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.article-body h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.article-body h2 {
  font-size: 1.45rem;
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 84px;
}

.article-body h3 {
  font-size: 1.15rem;
  margin: 1.35rem 0 0.5rem;
}

.callout {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
}

th {
  background: var(--surface-alt);
  font-weight: 700;
}

/* Footer (4-Column Pro Layout) */
.site-footer {
  border-top: 1px solid var(--border);
  background: #0b1120;
  color: #94a3b8;
  padding: 3.5rem 0 2rem;
  margin-top: 4rem;
  font-size: 0.9rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.25rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #1e293b;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: #f8fafc;
  margin-bottom: 0.85rem;
}

.footer-brand:hover {
  text-decoration: none;
}

.footer-desc {
  margin: 0;
  line-height: 1.65;
  color: #94a3b8;
  max-width: 320px;
}

.footer-col h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f8fafc;
  margin: 0 0 1rem;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.footer-col a {
  color: #94a3b8;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: #60a5fa;
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  font-size: 0.82rem;
  color: #64748b;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* Team Cards (About Us) */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0 2rem;
}

.team-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
}

.team-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
}

.team-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.team-role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.6rem;
}

.team-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .footer-top {
    grid-template-columns: 1fr;
  }
}

/* Scroll Reveal Motion */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Blog Search & Filter Bar */
.blog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.search-input {
  flex: 1 1 260px;
  max-width: 380px;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 1rem;
}

/* Google SERP Previewer */
.meta-count {
  float: right;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta-count.good { color: var(--success); }
.meta-count.warn { color: #f59e0b; }

.serp-card {
  background: #ffffff;
  color: #202124;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-family: Arial, sans-serif;
}

.serp-site-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.serp-favicon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.serp-site-name {
  font-size: 0.85rem;
  color: #202124;
  line-height: 1.2;
}

.serp-url {
  font-size: 0.75rem;
  color: #4d5156;
  word-break: break-all;
}

.serp-title {
  font-size: 1.2rem;
  line-height: 1.3;
  color: #1a0dab;
  margin: 0.25rem 0 0.35rem;
}

.serp-desc {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #4d5156;
}

.serp-checks {
  margin-top: 1rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 860px) {
  .featured-box,
  .tool-grid,
  .article-wrap {
    grid-template-columns: 1fr;
  }

  .toc-box {
    position: static;
  }
}

@media (max-width: 720px) {
  .menu-toggle {
    display: grid;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 0.9rem;
    align-items: flex-start;
  }

  .nav-links.open {
    display: flex;
  }

  .article-body {
    padding: 1.35rem;
  }
}
