/* ===== Base Variables (fallback if no theme loaded) ===== */
:root {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #71717a;
  --link: #2563eb;
  --link-visited: #7c3aed;
  --accent: #be123c;
  --font-body: system-ui, -apple-system, sans-serif;
  --font-heading: inherit;
  --radius: 10px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration: underline; }

/* ===== Site Header & Nav ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  padding: 1rem 0;
  white-space: nowrap;
  margin-right: auto;
  font-family: var(--font-heading);
}

.logo:visited { color: var(--text); }
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}

.site-nav a:visited { color: var(--muted); }

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  font-size: 1.25rem;
  line-height: 1;
}

/* ===== Theme Picker ===== */
.theme-picker {
  position: relative;
}

.theme-picker-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.theme-picker-btn:hover { color: var(--text); }

.theme-picker-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem;
  min-width: 175px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 200;
  flex-direction: column;
}

.theme-picker-menu.open { display: flex; }

.theme-picker-menu button {
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  text-align: left;
  cursor: pointer;
  border-radius: 5px;
  font-size: 0.85rem;
  color: var(--text);
  font-family: var(--font-body);
  transition: background 0.15s;
}

.theme-picker-menu button:hover { background: var(--bg); }

.theme-picker-menu button.active {
  color: var(--accent);
  font-weight: 600;
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 5rem 2rem 2.5rem;
}

.hero-line,
.hero-badge { display: none; }

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

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

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.hero-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 500px;
  margin: 1rem auto 0;
  line-height: 1.6;
}

/* ===== Main Content ===== */
.site-main {
  max-width: 1200px;
  width: 100%;
  margin: 2.5rem auto;
  padding: 0 2rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

/* ===== Cards ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.card h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
}

.card-wide { grid-column: 1 / -1; }

.section-number,
.card-icon { display: none; }

.card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card-wide ul {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

.card li::before {
  content: "\203A";
  color: var(--accent);
  margin-right: 0.5rem;
  font-weight: 700;
}

/* ===== Content Pages ===== */
.content-page {
  max-width: 800px;
  width: 100%;
  margin: 2.5rem auto;
  padding: 0 2rem;
}

.content-page h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
}

.content-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content-page p { margin-bottom: 1rem; }

.content-page ul,
.content-page ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-page li { margin-bottom: 0.3rem; }

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  transition: border-color 0.3s;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ===== Utilities ===== */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-small { font-size: 0.875rem; }
.mt-1 { margin-top: 0.5rem; }

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .site-header { flex-wrap: wrap; }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    order: 10;
    padding: 0.5rem 0;
    gap: 0;
  }

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

  .site-nav a {
    padding: 0.6rem 0.75rem;
    width: 100%;
  }

  .hero { padding: 3.5rem 1.5rem 2rem; }
}
