:root {
  color-scheme: light;
  --bg: #f6efe3;
  --bg-2: #edf3f2;
  --ink: #1e1a16;
  --muted: #5f5a52;
  --accent: #e07a3f;
  --accent-2: #27707a;
  --accent-3: #f2c16d;
  --card: #ffffff;
  --border: rgba(30, 26, 22, 0.08);
  --shadow: 0 20px 40px rgba(29, 24, 18, 0.12);
  --shadow-soft: 0 12px 24px rgba(29, 24, 18, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Noto Serif SC", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 20%, rgba(242, 193, 109, 0.35), transparent 45%),
    radial-gradient(circle at 85% 10%, rgba(39, 112, 122, 0.18), transparent 50%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 55%, #fdf8f2 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(0.5px);
  opacity: 0.5;
  animation: float 14s ease-in-out infinite;
}

body::before {
  top: -120px;
  left: -120px;
  background: radial-gradient(circle, rgba(224, 122, 63, 0.35) 0%, transparent 70%);
}

body::after {
  bottom: -140px;
  right: -140px;
  background: radial-gradient(circle, rgba(39, 112, 122, 0.25) 0%, transparent 72%);
  animation-delay: 3s;
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(14px, -18px, 0);
  }
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-title {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin: 0 0 8px;
  letter-spacing: 1px;
}

.hero-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(224, 122, 63, 0.15);
  color: #9c4a1d;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fffaf3;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.secondary {
  background: #fff7ec;
  color: #b55a2a;
  border: 1px solid rgba(181, 90, 42, 0.2);
  box-shadow: none;
}

.button.ghost {
  background: rgba(39, 112, 122, 0.12);
  color: #215158;
  border: 1px solid rgba(39, 112, 122, 0.25);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.hero-card {
  background: var(--card);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  background: rgba(39, 112, 122, 0.08);
  padding: 14px;
  border-radius: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-2);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  margin-bottom: 26px;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 320px;
}

.search input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(30, 26, 22, 0.15);
  font-size: 0.95rem;
}

.search small {
  color: var(--muted);
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 14px;
  background: rgba(30, 26, 22, 0.06);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
}

.chip strong {
  color: var(--accent-2);
}

.category {
  margin-top: 36px;
}

.category-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.category-title {
  font-family: "Noto Serif SC", serif;
  font-size: 1.8rem;
  margin: 0;
}

.category-count {
  color: var(--muted);
}

.question-list {
  display: grid;
  gap: 16px;
}

details.question {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: rise 0.6s ease both;
  animation-delay: var(--delay, 0s);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

details.question[open] {
  border-color: rgba(224, 122, 63, 0.3);
  box-shadow: var(--shadow);
}

details.question summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  font-weight: 600;
}

details.question summary::-webkit-details-marker {
  display: none;
}

.question-number {
  background: rgba(224, 122, 63, 0.15);
  color: #9c4a1d;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.question-title {
  font-size: 1rem;
}

.toggle-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.answer {
  padding: 0 20px 20px;
  display: grid;
  gap: 14px;
}

.answer-block h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--accent-2);
}

.answer-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.answer-block pre {
  margin: 0;
  padding: 14px;
  background: #1f1c1a;
  color: #f5e9d6;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow: auto;
}

.footer {
  margin-top: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-card {
    order: -1;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  details.question summary {
    grid-template-columns: auto 1fr;
  }

  .toggle-label {
    justify-self: end;
  }
}

@media (max-width: 600px) {
  .page {
    padding: 28px 18px 60px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

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