/* ============================================
   HOME PAGE
   ============================================ */
.hero {
  padding: 140px 0 40px;
  text-align: center;
  position: relative;
}
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--border-strong);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 auto;
  max-width: 16ch;
  color: var(--fg-default);
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  display: inline-block;
}
.hero-title em::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -4px;
  height: 3px;
  background: var(--accent);
  opacity: 0.3;
  border-radius: 2px;
}
.hero-lede {
  max-width: 58ch;
  margin: 40px auto 0;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.75;
  color: var(--fg-muted);
}
.hero-lede p { margin: 0 0 1em; }
.hero-lede p:last-child { margin: 0; }
.hero-dates {
  margin: 48px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-muted);
  flex-wrap: wrap;
}
.hero-dates .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.hero-dates .line {
  width: 80px; height: 1px;
  background: var(--border-strong);
}
.hero-scroll-hint {
  margin-top: 64px;
  color: var(--fg-subtle);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .kpi-grid { grid-template-columns: 1fr; } }

/* Entry grid */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) { .entry-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .entry-grid { grid-template-columns: 1fr; } }

.epilogue {
  margin-top: 140px;
  padding: 80px 20px;
  text-align: center;
  border-top: 1px solid var(--border-default);
}
.epilogue-quote {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--fg-default);
  max-width: 28ch;
  margin: 0 auto 24px;
}
.epilogue-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all var(--dur-fast) var(--ease-out);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
}
.epilogue-link:hover { border-bottom-color: var(--accent); gap: 12px; }

/* ============================================
   STORIES PAGE
   ============================================ */
.stories-layout {
  display: grid;
  grid-template-columns: 60px 1fr 240px;
  gap: 48px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 60px 32px 0;
}
@media (max-width: 1100px) {
  .stories-layout { grid-template-columns: 1fr; padding: 40px 20px 0; gap: 0; }
  .stories-progress, .stories-toc { display: none !important; }
}

.stories-progress {
  position: sticky;
  top: 100px;
  align-self: start;
  height: calc(100vh - 140px);
  width: 4px;
  background: var(--border-default);
  border-radius: 2px;
  overflow: hidden;
  margin-left: 16px;
}
.stories-progress-bar {
  background: var(--accent);
  width: 100%;
  transition: height 100ms linear;
}

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

.stories-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 24px 0;
  font-size: 13px;
}
.toc-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-subtle);
  margin-bottom: 16px;
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color var(--dur-fast);
  font-weight: 500;
  background: none; border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
}
.toc-item:hover { color: var(--fg-default); }
.toc-item.active { color: var(--fg-default); }
.toc-bullet {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--fg-subtle);
  background: transparent;
  transition: all var(--dur-fast);
  flex-shrink: 0;
}
.toc-item.active .toc-bullet { background: var(--accent); border-color: var(--accent); }
.toc-item:hover .toc-bullet { border-color: var(--fg-default); }

.stories-hero {
  padding: 40px 0 80px;
  max-width: 720px;
}
.stories-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 32px;
}
.stories-hero h1 em { font-style: normal; color: var(--accent); }
.stories-hero .narrative { margin-left: 0; max-width: 64ch; font-size: 17px; }

.story-section {
  max-width: 720px;
  padding: 80px 0;
  position: relative;
  --category-aura: transparent;
  --category-strong: var(--accent);
}
.story-section[data-category-theme="welcome"]   { --category-aura: #EAFBF6; --category-strong: #2EB89B; }
.story-section[data-category-theme="love"]      { --category-aura: #FFE3DF; --category-strong: #FF7369; }
.story-section[data-category-theme="success"]   { --category-aura: #FFF3D1; --category-strong: #F5A623; }
.story-section[data-category-theme="crack"]     { --category-aura: #FFE3DF; --category-strong: #D9453A; }
.story-section[data-category-theme="grief"]     { --category-aura: #ECE8F2; --category-strong: #A67DB8; }
.story-section[data-category-theme="echo"]      { --category-aura: #E5E3DC; --category-strong: #57544C; }
.story-section[data-category-theme="overseas"]  { --category-aura: #FFF3D1; --category-strong: #F5A623; }
.story-section[data-category-theme="tears"]     { --category-aura: #E8F0FA; --category-strong: #4A8CC4; }

[data-theme="dark"] .story-section[data-category-theme="welcome"]  { --category-aura: rgba(79,222,192,0.08); }
[data-theme="dark"] .story-section[data-category-theme="love"]     { --category-aura: rgba(255,115,105,0.10); }
[data-theme="dark"] .story-section[data-category-theme="success"]  { --category-aura: rgba(245,166,35,0.10); }
[data-theme="dark"] .story-section[data-category-theme="crack"]    { --category-aura: rgba(217,69,58,0.10); }
[data-theme="dark"] .story-section[data-category-theme="grief"]    { --category-aura: rgba(166,125,184,0.10); }
[data-theme="dark"] .story-section[data-category-theme="echo"]     { --category-aura: rgba(229,227,220,0.05); }
[data-theme="dark"] .story-section[data-category-theme="overseas"] { --category-aura: rgba(245,166,35,0.10); }
[data-theme="dark"] .story-section[data-category-theme="tears"]    { --category-aura: rgba(74,140,196,0.10); }

.story-chapter-mark {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.story-chapter-mark::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

.story-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 24px;
  padding-left: 18px;
  border-left: 4px solid var(--category-strong);
}

.callout {
  background: var(--category-aura);
  border-left: 3px solid var(--category-strong);
  padding: 18px 22px;
  border-radius: 0 12px 12px 0;
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-default);
  display: flex;
  gap: 12px;
}
.callout-icon { font-size: 20px; flex-shrink: 0; line-height: 1.3; }
[data-theme="dark"] .callout { color: var(--fg-default); }

.review-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
  text-align: left;
  font-family: inherit;
  color: inherit;
  width: 100%;
  display: block;
}
.review-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.review-stars { color: var(--accent-amber-500); letter-spacing: 1px; font-size: 14px; }
.review-title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.35;
}
.review-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-default);
  border-left: 2px solid var(--brand-mint-300);
  padding-left: 14px;
  white-space: pre-line;
}
.review-body-en {
  border-left-color: var(--border-strong);
}
.review-reply {
  margin-top: 18px;
  background: var(--bg-surface-alt);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-muted);
}
.review-reply-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-default);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-translation {
  margin-top: 14px;
  background: var(--bg-surface-alt);
  border-left: 3px solid var(--accent-amber-500);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-default);
}
.review-translation-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.story-show-more {
  margin-top: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  transition: all var(--dur-fast) var(--ease-out);
}
.story-show-more:hover {
  background: var(--bg-surface-alt);
  color: var(--fg-default);
  border-color: var(--fg-subtle);
}

.stories-epilogue {
  max-width: 720px;
  padding: 120px 0 80px;
  text-align: center;
}
.stories-epilogue h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0 0 40px;
  color: var(--fg-default);
}
.stories-epilogue .narrative { font-style: italic; color: var(--fg-muted); font-size: 18px; }

/* ============================================
   REVIEWS DASHBOARD
   ============================================ */
.reviews-hero {
  padding: 80px 0 40px;
}
.reviews-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 16px;
}
.reviews-hero-sub { color: var(--fg-muted); font-size: 17px; margin: 0; }

.reviews-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  margin-top: 48px;
}
@media (max-width: 1024px) {
  .reviews-layout { grid-template-columns: 1fr; }
}

.filter-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-default);
}
.filter-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.filter-reset {
  background: none; border: none;
  color: var(--fg-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--dur-fast);
}
.filter-reset:hover { color: var(--accent); background: var(--bg-surface-alt); }

.filter-section { margin-bottom: 24px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section-title {
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.checkbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--fg-default);
  transition: color var(--dur-fast);
}
.checkbox-item:hover { color: var(--accent); }
.checkbox-box {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  display: grid;
  place-items: center;
  margin-right: 10px;
  flex-shrink: 0;
  background: var(--bg-surface);
  transition: all var(--dur-fast);
}
.checkbox-box.checked { background: var(--accent); border-color: var(--accent); }
.checkbox-box.checked::after {
  content: "✓";
  color: white;
  font-size: 10px;
  font-weight: 700;
}
.checkbox-count { color: var(--fg-muted); font-family: var(--font-mono); font-size: 12px; }

.rating-toggle { display: flex; gap: 4px; flex-wrap: wrap; }
.rating-pill {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--fg-default);
  transition: all var(--dur-fast);
}
.rating-pill:hover { border-color: var(--border-strong); }
.rating-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--fg-default);
  font-family: inherit;
  font-size: 13px;
  transition: border-color var(--dur-fast);
}
.filter-input:focus { outline: none; border-color: var(--accent); }

.chart-grid {
  display: grid;
  gap: 20px;
}
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: opacity var(--dur-base) var(--ease-out);
}
.chart-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 12px;
}
.chart-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.chart-sub { font-size: 12px; color: var(--fg-muted); margin: 0 0 16px; }

.charts-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 768px) { .charts-row { grid-template-columns: 1fr; } }

/* Simple SVG charts */
.chart-svg { width: 100%; height: auto; display: block; }

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.donut-row {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.donut-dot { width: 10px; height: 10px; border-radius: 3px; }

.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 60px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.bar-track {
  background: var(--bg-surface-alt);
  border-radius: 4px;
  height: 20px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width var(--dur-slow) var(--ease-out);
}
.bar-count { text-align: right; color: var(--fg-muted); font-family: var(--font-mono); font-size: 12px; }
.bar-label { display: flex; align-items: center; gap: 6px; }

.heatmap-row { display: flex; gap: 4px; margin-bottom: 4px; }
.heatmap-label { width: 80px; font-size: 12px; color: var(--fg-muted); }
.heatmap-cell {
  flex: 1;
  aspect-ratio: 1;
  min-height: 28px;
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  transition: transform var(--dur-fast);
}
.heatmap-cell:hover { transform: scale(1.1); z-index: 2; outline: 2px solid var(--accent); outline-offset: 1px; }
.heatmap-header {
  display: flex;
  gap: 4px;
  padding-left: 80px;
  margin-bottom: 8px;
}
.heatmap-header-cell {
  flex: 1;
  font-size: 10px;
  color: var(--fg-subtle);
  text-align: center;
  font-family: var(--font-mono);
}

/* Review list */
.review-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}
.review-list-count { font-size: 14px; color: var(--fg-muted); }
.review-list-count strong { color: var(--fg-default); font-weight: 700; font-family: var(--font-mono); }

.review-list-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 16px;
  align-items: center;
  text-align: left;
  font-family: inherit;
  color: inherit;
  width: 100%;
}
.review-list-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.review-list-stars { color: var(--accent-amber-500); font-size: 12px; letter-spacing: 1px; min-width: 66px; }
.review-list-flag { font-size: 18px; }
.review-list-body {
  min-width: 0;
  overflow: hidden;
}
.review-list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-default);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.review-list-snippet {
  font-size: 13px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-list-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {
  .review-list-item { grid-template-columns: auto 1fr; gap: 10px; }
  .review-list-meta { display: none; }
  .review-list-flag { display: none; }
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--fg-muted);
}
.empty-state-icon { font-size: 36px; margin-bottom: 16px; }
.empty-state-title { font-size: 17px; font-weight: 600; color: var(--fg-default); margin-bottom: 8px; }
.empty-state-sub { font-size: 14px; }

/* callout box for API limit etc */
.callout-box {
  background: var(--accent-amber-100);
  border: 1px solid var(--accent-amber-300);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  font-size: 14px;
  color: var(--accent-amber-700);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
[data-theme="dark"] .callout-box {
  background: rgba(245,166,35,0.1);
  border-color: rgba(245,166,35,0.3);
  color: var(--accent-amber-300);
}
