:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --accent: #0d9488;
  --accent-light: rgba(13, 148, 136, 0.08);
  --accent-hover: #0f766e;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  /* Search Engine colors */
  --google: #4285f4;
  --bing: #00809d;
  --yahoo-japan: #ff0033;
  --ai-search: #8b5cf6;
  --general: #64748b;
  /* Impact colors */
  --impact-high: #ef4444;
  --impact-medium: #f59e0b;
  --impact-low: #22c55e;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Helvetica Neue', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
}

/* -- Navigation -- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s;
}
nav a:hover {
  color: var(--accent);
  background: var(--accent-light);
}
nav a.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 700;
}

/* -- Hero -- */
.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 40%, #ecfdf5 100%);
  position: relative;
  overflow: hidden;
  padding: 4rem 2rem;
}
.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.08) 0%, transparent 70%);
  top: -100px; right: -100px;
  animation: float 8s ease-in-out infinite;
}
.hero::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  bottom: -50px; left: -50px;
  animation: float 6s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--muted);
  max-width: 600px;
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
}

/* -- Search Bar -- */
.search-bar {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  margin-bottom: 3rem;
}
.search-bar input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}
.search-bar input::placeholder { color: #94a3b8; }
.search-bar .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
}

/* -- Search Overlay -- */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  justify-content: center;
  padding-top: 10vh;
}
.search-overlay.active { display: flex; }
.search-modal {
  background: var(--card);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.search-modal-input {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.search-modal-input input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  color: var(--text);
}
.search-modal-input input:focus {
  border-color: var(--accent);
}
.search-results {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
}
.search-results-group h3 {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 12px 0 8px;
}
.search-results-group:first-child h3 { margin-top: 0; }
.search-result-item {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}
.search-result-item:hover { background: var(--accent-light); }
.search-result-item .title { font-weight: 600; font-size: 0.95rem; }
.search-result-item .snippet { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.search-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
  font-size: 0.95rem;
}

/* -- Engine Cards (Hero) -- */
.engine-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  position: relative;
  z-index: 1;
  max-width: 800px;
  width: 100%;
}
.engine-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s;
  box-shadow: var(--shadow);
}
.engine-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.engine-card .icon { font-size: 2rem; }
.engine-card .label { font-size: 0.9rem; font-weight: 600; }

/* -- Sections -- */
section {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 2rem;
}
.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  margin-bottom: 0.5rem;
}
.section-title span { color: var(--accent); }
.section-subtitle {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* -- Page Header -- */
.page-header {
  padding: 6rem 2rem 3rem;
  text-align: center;
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 40%, #ecfdf5 100%);
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.06) 0%, transparent 70%);
  top: -150px; right: -100px;
}
.page-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 900;
  position: relative;
  z-index: 1;
}
.page-header h1 span { color: var(--accent); }
.page-header p {
  color: var(--muted);
  margin-top: 0.5rem;
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
}

/* -- Filter Pills -- */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}
.pill {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.pill:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.pill.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
/* Search engine color dots on filter pills */
.pill[data-filter]::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.pill[data-filter="all"]::before { display: none; }
.pill[data-filter="google"]::before { background: var(--google); }
.pill[data-filter="bing"]::before { background: var(--bing); }
.pill[data-filter="yahoo-japan"]::before { background: var(--yahoo-japan); }
.pill[data-filter="ai-search"]::before { background: var(--ai-search); }
.pill[data-filter="general"]::before { background: var(--general); }

/* Category filter pills (second row) */
.category-filters {
  margin-top: -1rem;
  margin-bottom: 1.5rem;
}
.pill.pill-sm {
  padding: 5px 14px;
  font-size: 0.8rem;
  border-width: 1.5px;
}
.pill.pill-sm::before { display: none; }

/* -- Search Engine Badge -- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-google { background: rgba(66,133,244,0.1); color: var(--google); }
.badge-bing { background: rgba(0,128,157,0.1); color: var(--bing); }
.badge-yahoo-japan { background: rgba(255,0,51,0.1); color: var(--yahoo-japan); }
.badge-ai-search { background: rgba(139,92,246,0.1); color: var(--ai-search); }
.badge-general { background: rgba(100,116,139,0.1); color: var(--general); }

/* -- Impact Badge -- */
.impact {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
}
.impact-high { background: rgba(239,68,68,0.1); color: var(--impact-high); }
.impact-medium { background: rgba(245,158,11,0.1); color: var(--impact-medium); }
.impact-low { background: rgba(34,197,94,0.1); color: var(--impact-low); }

/* -- Difficulty Badge -- */
.difficulty {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
}
.difficulty-beginner { background: rgba(34,197,94,0.1); color: #16a34a; }
.difficulty-intermediate { background: rgba(245,158,11,0.1); color: #d97706; }
.difficulty-advanced { background: rgba(239,68,68,0.1); color: #dc2626; }

/* -- Cards Grid -- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 1.8rem;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card p { color: var(--muted); font-size: 0.9rem; }
.tags { margin-top: 0.8rem; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* -- Knowledge Category Groups -- */
.knowledge-category {
  margin-bottom: 2rem;
}
.category-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
}
.category-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.category-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.category-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.15rem 0 0;
}
.category-count {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  flex-shrink: 0;
}

/* -- Accordion -- */
.accordion { display: grid; gap: 0.8rem; }
.accordion-item {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.accordion-item:hover { box-shadow: var(--shadow-lg); }
.accordion-header {
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
  transition: background 0.2s;
  user-select: none;
}
.accordion-header:hover { background: var(--accent-light); }
.accordion-header .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.accordion-header .arrow {
  transition: transform 0.3s;
  font-size: 0.8rem;
  color: var(--muted);
}
.accordion-item.open .arrow { transform: rotate(180deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  padding: 0 1.5rem;
}
.accordion-item.open .accordion-body {
  max-height: 2000px;
  padding: 0 1.5rem 1.5rem;
}
.accordion-body p { color: var(--muted); font-size: 0.95rem; line-height: 1.8; }
.accordion-body h4 { margin: 1rem 0 0.3rem; font-size: 0.95rem; }

/* -- Timeline -- */
.timeline {
  position: relative;
  padding-left: 40px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), var(--general), #94a3b8);
  border-radius: 3px;
}
.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  background: var(--card);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.timeline-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 1.7rem;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg);
}
.timeline-item .date {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.timeline-item h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.timeline-item p { color: var(--muted); font-size: 0.9rem; }
.timeline-item .source {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.timeline-item .source:hover { text-decoration: underline; }

/* -- Case Card -- */
.case-card {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.case-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.case-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.case-card .client-type {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.case-detail { display: none; margin-top: 1rem; }
.case-card.open .case-detail { display: block; }
.case-section {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 10px;
}
.case-section h4 {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
  font-weight: 700;
}
.case-section p { color: var(--muted); font-size: 0.9rem; }
.case-toggle {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.5rem;
  display: inline-block;
}

/* -- Latest Section (index) -- */
.latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.latest-card {
  background: var(--card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.latest-card:hover { transform: translateY(-3px); }
.latest-card .date { font-size: 0.75rem; color: var(--muted); }
.latest-card h3 { font-size: 0.95rem; margin: 0.3rem 0; }
.latest-card p { font-size: 0.85rem; color: var(--muted); }

/* -- Filter Group -- */
.filter-group {
  margin-bottom: 1rem;
}
.filter-group .filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.filter-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* -- Card / Timeline Links -- */
a.card-link, a.timeline-link, a.case-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.card-link:hover, a.timeline-link:hover, a.case-link:hover {
  text-decoration: none;
}
.case-link .case-preview {
  color: var(--muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -- Detail Page -- */
.detail-card {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 16px;
  padding: 2.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.detail-card h1 {
  font-size: 1.6rem;
  margin: 0.8rem 0 1.2rem;
  line-height: 1.4;
}
.detail-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.detail-body {
  color: var(--text);
  font-size: 1rem;
  line-height: 2;
  margin-bottom: 1.5rem;
}
.detail-body ol, .detail-body ul {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}
.detail-body li {
  margin-bottom: 0.4rem;
}
.detail-body p {
  margin: 0.5rem 0;
}
.detail-card .case-sections {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
#detailBack a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

/* -- Resource Page -- */
.resource-section { margin-bottom: 2.5rem; }
.resource-section h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.resource-section h2 .count {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
.resource-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.resource-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--accent);
}
.resource-card .card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.resource-card .card-header .type-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: transparent !important;
}
.resource-card .card-header .name {
  font-weight: 600;
  font-size: 0.95rem;
}
.resource-card .card-header .name a {
  color: var(--text);
  text-decoration: none;
}
.resource-card .card-header .name a:hover { text-decoration: underline; }
.resource-card .lang-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--border);
  color: var(--muted);
  vertical-align: middle;
  margin-left: 4px;
}
.resource-card .note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.resource-card .type-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}
.resource-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* -- Quiz -- */
.quiz-settings {
  max-width: 500px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.quiz-setting-row { margin-bottom: 1.2rem; }
.quiz-setting-row label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.9rem; }
.quiz-start-btn {
  display: block; width: 100%; padding: 0.9rem; margin-top: 1rem;
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s;
}
.quiz-start-btn:hover { opacity: 0.85; }
.quiz-container { max-width: 640px; margin: 0 auto; }
.quiz-progress { height: 6px; background: var(--border); border-radius: 3px; margin-bottom: 0.8rem; overflow: hidden; }
.quiz-progress-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }
.quiz-score { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 1.2rem; }
.quiz-question-card {
  background: var(--card); border-radius: 16px; padding: 2rem;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.quiz-question { margin-bottom: 1.5rem; }
.quiz-question p { font-size: 1.05rem; line-height: 1.7; margin-top: 0.8rem; }
.quiz-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.quiz-badge-knowledge { background: #ccfbf1; color: #0f766e; }
.quiz-options { display: grid; gap: 0.7rem; }
.quiz-option {
  display: block; width: 100%; text-align: left; padding: 1rem 1.2rem;
  background: var(--bg); border: 2px solid var(--border); border-radius: 10px;
  font-size: 0.92rem; line-height: 1.6; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-light); }
.quiz-option:disabled { cursor: default; opacity: 0.85; }
.quiz-option.quiz-correct { border-color: #16a34a; background: #f0fdf4; }
.quiz-option.quiz-wrong { border-color: #dc2626; background: #fef2f2; }
.quiz-feedback { text-align: center; margin-top: 1rem; font-size: 1rem; font-weight: 700; }
.quiz-correct-text { color: #16a34a; }
.quiz-wrong-text { color: #dc2626; }
.quiz-explanation {
  margin-top: 0.8rem; padding: 1rem; background: #fef2f2; border-radius: 8px;
  font-size: 0.9rem; line-height: 1.7; color: var(--text); font-weight: 400; text-align: left;
}
.quiz-ref-link { display: inline-block; margin-top: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.quiz-ref-link:hover { opacity: 0.7; }
.quiz-next-btn {
  display: block; width: 100%; margin-top: 1rem; padding: 0.7rem;
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.quiz-next-btn:hover { opacity: 0.85; }
.quiz-result { max-width: 500px; margin: 0 auto; }
.quiz-result-card {
  background: var(--card); border-radius: 16px; padding: 2.5rem;
  border: 1px solid var(--border); box-shadow: var(--shadow); text-align: center;
}
.quiz-result-grade {
  display: inline-flex; align-items: center; justify-content: center;
  width: 80px; height: 80px; border-radius: 50%; font-size: 2.5rem; font-weight: 900; margin-bottom: 1rem;
}
.grade-s { background: #ccfbf1; color: #0f766e; }
.grade-a { background: #dbeafe; color: #1d4ed8; }
.grade-b { background: #e0f2fe; color: #0369a1; }
.grade-c { background: #f1f5f9; color: #64748b; }
.quiz-result-score { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
.quiz-result-msg { color: var(--muted); margin-bottom: 1.5rem; }
.quiz-result-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.quiz-link-btn {
  display: inline-block; padding: 0.7rem 1.2rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; font-size: 0.9rem;
  font-weight: 600; color: var(--text); text-decoration: none; transition: background 0.2s;
}
.quiz-link-btn:hover { background: var(--accent-light); }

/* -- Footer -- */
footer {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* -- Scroll Animation -- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* -- Responsive -- */
@media (max-width: 768px) {
  section { padding: 3rem 1.5rem; }
  .engine-cards { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .timeline { padding-left: 30px; }
  .timeline-item::before { left: -23px; width: 10px; height: 10px; }
  .timeline::before { left: 11px; }
  .resource-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  section { padding: 2rem 1rem; }
  nav { padding: 0.6rem 1rem; }
  .engine-cards { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .engine-card { padding: 1rem 0.8rem; }
  .hero { padding: 3rem 1.5rem; min-height: 60vh; }
  .filter-pills { gap: 6px; }
  .pill { padding: 6px 12px; font-size: 0.8rem; }
}
