:root {
  --bg: #ffffff;
  --bg-elevated: #f3f4f6;
  --bg-muted: #e5e7eb;
  --fg: #020617;
  --fg-muted: #4b5563;
  --border-subtle: rgba(148, 163, 184, 0.5);
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --accent-strong: #0d9488;
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] {
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-muted: #0b1120;
  --fg: #e5e7eb;
  --fg-muted: #9ca3af;
  --border-subtle: rgba(55, 65, 81, 0.9);
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.15);
  --accent-strong: #16a34a;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.7);
}

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

body.layout {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent),
              radial-gradient(circle at bottom, rgba(34, 197, 94, 0.08), transparent),
              var(--bg);
  color: var(--fg);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.75rem;
  background: rgba(15, 23, 42, 0.98);
  color: #f9fafb;
  border-bottom: 1px solid rgba(148, 163, 184, 0.5);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .site-header {
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: conic-gradient(
    from 200deg,
    #22c55e,
    #3b82f6,
    #6366f1,
    #ec4899,
    #22c55e
  );
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35);
}

.logo-text {
  font-weight: 650;
  letter-spacing: 0.03em;
  font-size: 0.95rem;
}

.primary-nav a {
  margin-right: 1rem;
  font-size: 0.86rem;
  text-decoration: none;
  color: inherit;
  padding: 0.35rem 0.4rem;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.primary-nav a:hover {
  background-color: rgba(148, 163, 184, 0.25);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 200px;
  max-width: 240px;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 0.8rem;
}

html[data-theme="light"] .search-box input {
  background: #ffffff;
  color: #0f172a;
}

.search-box input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

.icon-button {
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.92);
  color: #e5e7eb;
  border-radius: 999px;
  width: 38px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

html[data-theme="light"] .icon-button {
  background: #ffffff;
  color: #0f172a;
}

.icon-sun,
.icon-moon {
  font-size: 0.9rem;
}

/* Layout shell */

.main-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
}

.hero {
  padding: 1rem 0 2.5rem;
}

.hero-content {
  max-width: 640px;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.hero-title {
  margin-top: 0.5rem;
  font-size: clamp(2.1rem, 3.3vw, 2.7rem);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin-top: 0.65rem;
  font-size: 0.98rem;
  color: var(--fg-muted);
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  gap: 0.75rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-size: 0.86rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #f9fafb;
  box-shadow: var(--shadow-soft);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.7);
  color: var(--fg);
}

/* Home grid */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 1.75rem;
}

.home-column {
  min-width: 0;
}

.sidebar {
  padding-left: 0.5rem;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.9rem;
}

/* Cards */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.card {
  background: rgba(15, 23, 42, 0.86);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.8);
}

html[data-theme="light"] .card {
  background: #ffffff;
  border-color: rgba(209, 213, 219, 0.9);
  box-shadow: 0 10px 26px rgba(148, 163, 184, 0.3);
}

.card.article-card {
  position: relative;
  overflow: hidden;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-title {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
}

.card-excerpt {
  margin: 0.1rem 0 0.4rem;
  font-size: 0.86rem;
  color: var(--fg-muted);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
}

.badge {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.65rem;
}

.meta-source {
  color: var(--fg-muted);
}

/* Video cards */

.video-card {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.video-thumb {
  width: 60px;
  height: 40px;
  border-radius: 0.5rem;
  background: radial-gradient(circle at top left, #22c55e, #0f172a);
}

.video-body {
  flex: 1;
}

/* Page headers */

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.page-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

/* Content layouts */

.content-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
  gap: 1.75rem;
}

.content-main {
  min-width: 0;
}

.content-main.narrow {
  max-width: 640px;
}

.content-sidebar {
  min-width: 0;
}

.sidebar-section {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(31, 41, 55, 0.9);
}

html[data-theme="light"] .sidebar-section {
  background: #ffffff;
  border-color: rgba(209, 213, 219, 0.95);
}

.sidebar-title {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.86rem;
}

.sidebar-list li {
  margin-bottom: 0.25rem;
}

.sidebar-list a {
  color: var(--fg);
  text-decoration: none;
}

/* Search hint */

.search-hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

/* Contact form */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.5rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--fg);
  font-size: 0.86rem;
}

html[data-theme="light"] .contact-form input,
html[data-theme="light"] .contact-form textarea {
  background: #ffffff;
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding: 1.5rem 1.5rem 2rem;
  margin-top: 1rem;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-copy {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.footer-right a {
  margin-left: 0.9rem;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--fg-muted);
}

/* Responsive */

@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-with-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .primary-nav {
    display: none;
  }

  .search-box input {
    width: 150px;
  }

  .footer-inner {
    flex-direction: column;
  }
}
