:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #52525b;
  --border: #e4e4e7;
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-soft: #fffbeb;
  --tag-bg: #fef3c7;
  --tag-text: #92400e;
  --hero-bg: linear-gradient(135deg, #f4f4f5 0%, #ffffff 55%, #fef3c7 100%);
  --dot-color: rgba(24, 24, 27, 0.11);
  --glow-color: rgba(217, 119, 6, 0.08);
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 18px 34px rgba(15, 23, 42, 0.11), 0 6px 12px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] {
  --bg: #111114;
  --surface: #1b1b20;
  --text: #fafafa;
  --muted: #a1a1aa;
  --border: #2e2e36;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-soft: #2e220d;
  --tag-bg: #2b2110;
  --tag-text: #fcd34d;
  --hero-bg: linear-gradient(135deg, #1b1b20 0%, #111114 60%, #291d0c 100%);
  --dot-color: rgba(161, 161, 170, 0.13);
  --glow-color: rgba(245, 158, 11, 0.09);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 18px 36px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, var(--glow-color), transparent 60%),
    radial-gradient(var(--dot-color) 1.15px, transparent 1.15px);
  background-size: 100% 100%, 22px 22px;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.top-accent {
  height: 4px;
  background: linear-gradient(90deg, #1e293b 0%, #dc2626 50%, #f59e0b 100%);
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

.brand-logo {
  width: 56px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hero {
  background: var(--hero-bg);
  border-bottom: 1px solid var(--border);
  padding: 2.75rem 0 2.5rem;
}

.hero-inner {
  max-width: 740px;
  margin: 0 auto;
  text-align: center;
}

.hero-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  margin-bottom: 0.9rem;
}

.hero h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-subtitle {
  margin: 0.75rem auto 1.35rem;
  max-width: 560px;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.highlight-chip {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

main {
  flex: 1;
  padding: 2rem 0 3.5rem;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.82rem 1rem 0.82rem 2.65rem;
  font-size: 0.96rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.38rem 0.95rem;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.tag-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(37, 99, 235, 0.45);
}

.video-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #090d16;
  overflow: hidden;
}

.video-box iframe,
.video-thumb-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-thumb-btn {
  padding: 0;
  background: #090d16;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.video-thumb-btn:hover img {
  opacity: 1;
  transform: scale(1.03);
}

.play-badge {
  position: absolute;
  width: 58px;
  height: 40px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, transform 0.15s ease;
}

.video-thumb-btn:hover .play-badge {
  background: #dc2626;
  transform: scale(1.06);
}

.card-body {
  padding: 1.2rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  flex: 1;
  justify-content: space-between;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.card-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
}

.card h2 {
  margin: 0.6rem 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.015em;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 0.95rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  flex: 1;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 0;
}

.info-strip {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-item strong {
  font-size: 0.94rem;
}

.info-item span {
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.35rem 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.6rem;
  box-shadow: var(--shadow-hover);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-subtitle {
  margin: 0.4rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.modal-form .search-input {
  padding-left: 1rem;
}

.modal-submit {
  width: 100%;
  border: 0;
  cursor: pointer;
  padding: 0.72rem 1rem;
}

.modal-status {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}
