:root {
  --bg: #f2f0eb;
  --surface: #faf9f7;
  --surface2: #ebe8e1;
  --border: #d4cfc3;
  --accent: #2f5d4f;
  --accent-soft: #e8f0ec;
  --accent2: #a65d21;
  --accent3: #3d5a80;
  --muted: #6f6a62;
  --text: #1c1b18;
  --text-dim: #45423c;
  --gold: #8a6d1f;
  --red: #9b2c2c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::-webkit-scrollbar {
  height: 3px;
  width: 3px;
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}


body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  font-size: 16px;
}

/* HEADER */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 60px 0 50px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(47, 93, 79, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 40px;
}
.eyebrow {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 20px;
}
h1 {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
h1 span { color: var(--accent); }
.hero-sub {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 600px;
  font-weight: 400;
  line-height: 1.55;
}
.meta-bar {
  display: flex;
  gap: 30px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.meta-pill {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  background: var(--accent-soft);
  border: 1px solid rgba(47, 93, 79, 0.25);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 2px;
  letter-spacing: 1px;
}

/* LAYOUT */
.container { max-width: 960px; margin: 0 auto; padding: 0 40px; }

/* SECTION HEADERS */
.section {
  padding: 60px 0 20px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.section-label {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}
h2 {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 30px;
  letter-spacing: -0.02em;
}
h3 {
  font-family: inherit;
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}

/* RANKED LIST */
.rank-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.niche-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 28px 32px;
  position: relative;
  transition: border-color 0.2s;
}
.niche-card:hover { border-color: #b8b2a4; border-left-color: var(--accent); }
.niche-card.top3 { border-left-color: var(--gold); background: rgba(138, 109, 31, 0.06); }
.niche-card.avoid { border-left-color: var(--red); background: rgba(155, 44, 44, 0.05); }
.niche-card.hidden { border-left-color: var(--accent3); background: rgba(61, 90, 128, 0.05); }

.rank-num {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 52px;
  font-weight: 700;
  color: rgba(47, 93, 79, 0.12);
  position: absolute;
  top: 16px; right: 24px;
  line-height: 1;
  user-select: none;
}
.top3 .rank-num { color: rgba(138, 109, 31, 0.18); }

.niche-title {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.tag {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.tag-rev { background: rgba(61, 90, 128, 0.1); color: var(--accent3); border: 1px solid rgba(61, 90, 128, 0.22); }
.tag-cost { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(47, 93, 79, 0.25); }
.tag-score { background: rgba(138, 109, 31, 0.1); color: var(--gold); border: 1px solid rgba(138, 109, 31, 0.25); }
.tag-diff { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); }
.tag-speed { background: rgba(166, 93, 33, 0.1); color: var(--accent2); border: 1px solid rgba(166, 93, 33, 0.25); }
.tag-comp { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); }

.niche-body { font-size: 15px; color: var(--text-dim); line-height: 1.7; }
.niche-body p { margin-bottom: 12px; }
.niche-body strong { color: var(--text); font-weight: 500; }

/* SUB-SECTIONS inside cards */
.sub-label {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 20px 0 8px;
}
.top3 .sub-label { color: var(--gold); }
.avoid .sub-label { color: var(--red); }
.hidden .sub-label { color: var(--accent3); }

/* PRODUCT IDEAS LIST */
.ideas-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ideas-list li {
  font-size: 14px;
  color: var(--text-dim);
  padding: 10px 14px;
  background: var(--surface);
  border-left: 2px solid var(--border);
  line-height: 1.5;
}
.ideas-list li strong { color: var(--text); display: block; font-size: 13px; margin-bottom: 2px; }
.ideas-link-row {
  margin-top: 16px;
}
.ideas-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(47, 93, 79, 0.24);
  padding: 10px 14px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ideas-link-btn:hover {
  background: rgba(232, 240, 236, 0.75);
  color: var(--text);
  border-color: rgba(47, 93, 79, 0.36);
}
.ideas-link-btn::after {
  content: '→';
  font-size: 12px;
}

/* DEEP DIVE SECTION */
.deep-dive {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 40px;
  margin-bottom: 24px;
  position: relative;
}
.deep-dive::before {
  content: 'DEEP DIVE';
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--gold);
  position: absolute;
  top: 16px; right: 20px;
}
.deep-dive h3 {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 22px;
  margin-bottom: 16px;
}

/* DIVIDER */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* TABLE */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 24px 0;
}
.summary-table th {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.summary-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(212, 207, 195, 0.85);
  color: var(--text-dim);
  vertical-align: top;
}
.summary-table tr:hover td { background: rgba(47, 93, 79, 0.04); }
.rank-cell {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 20px;
  font-weight: 700;
  color: rgba(28, 27, 24, 0.2);
  width: 40px;
}
.name-cell { color: var(--text); font-weight: 400; }

/* FOOTER */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
  text-align: center;
}
footer p { font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
footer p + p { margin-top: 0.5rem; }

.green { color: #1a6b3d; }
.yellow { color: var(--gold); }
.red-text { color: var(--red); }
.cyan { color: #2c5282; }
.accent-text { color: var(--accent); }

html { scroll-behavior: smooth; }

/* Niche detail pages */
.masthead {
  border-bottom: 1px solid var(--border);
  padding: 14px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.masthead-brand,
.masthead-count {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.masthead-count { color: var(--gold); }
.masthead-navigator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.masthead-navigator-label {
  color: inherit;
  white-space: nowrap;
}
.masthead-nav-arrow {
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(138, 109, 31, 0.35);
  background: rgba(138, 109, 31, 0.08);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.masthead-nav-arrow:hover {
  background: rgba(138, 109, 31, 0.16);
  border-color: rgba(138, 109, 31, 0.55);
  color: var(--text);
}
.masthead-nav-arrow.is-disabled {
  opacity: 0.35;
  cursor: default;
}

.category-nav {
  position: sticky;
  top: 45px;
  z-index: 90;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-nav-inner {
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.cat-link {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 13px 14px 11px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  display: inline-block;
  white-space: nowrap;
}
.cat-link:hover { color: var(--text); border-bottom-color: var(--gold); }
.cat-link.is-active { color: var(--text); border-bottom-color: var(--gold); }

.idea-section-head {
  padding: 48px 0 28px;
}
.idea-section-head .section-range {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.idea-section-head .section-range-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.idea-section-head .section-range-num {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.idea-section-head .idea-section-category {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.idea-section-head h2 .idea-count-pill {
  display: inline-block;
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 600;
  background: rgba(138, 109, 31, 0.1);
  color: var(--gold);
  border: 1px solid rgba(138, 109, 31, 0.25);
  padding: 3px 10px;
  border-radius: 2px;
  margin-left: 10px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

.ideas-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.idea-card {
  padding: 30px 0 32px;
  border-bottom: 1px solid rgba(212, 207, 195, 0.7);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0 24px;
  position: relative;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.idea-card:hover {
  background: rgba(250, 249, 247, 0.95);
  margin: 0 -14px;
  padding: 30px 14px 32px;
  border-bottom-color: rgba(184, 178, 164, 0.9);
  box-shadow: inset 3px 0 0 rgba(47, 93, 79, 0.16);
}
.idea-num {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 15px;
  color: rgba(69, 66, 60, 0.92);
  font-style: italic;
  padding-top: 4px;
  text-align: right;
}
.idea-content {
  max-width: 780px;
}
.idea-detail-block {
  margin-bottom: 14px;
}
.idea-detail-label {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
}
.idea-title {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.idea-what {
  font-size: 16px;
  color: #35322d;
  line-height: 1.78;
  margin-bottom: 14px;
  font-style: normal;
}
.idea-meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 8px;
  margin-bottom: 14px;
  align-items: start;
}
.idea-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.idea-tag {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.2px;
  padding: 5px 10px;
  border-radius: 2px;
  font-weight: 600;
  line-height: 1.4;
}
.tag-icp {
  background: rgba(61, 90, 128, 0.08);
  color: var(--accent3);
  border: 1px solid rgba(61, 90, 128, 0.18);
}
.tag-pain {
  background: rgba(155, 44, 44, 0.07);
  color: var(--red);
  border: 1px solid rgba(155, 44, 44, 0.18);
}
.tag-mono {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(47, 93, 79, 0.22);
}
.idea-pain {
  font-size: 15px;
  color: #38352f;
  line-height: 1.72;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(235, 232, 225, 0.72) 0%, rgba(235, 232, 225, 0.95) 100%);
  border-left: 3px solid rgba(47, 93, 79, 0.22);
  margin-bottom: 4px;
  font-style: normal;
}

.top5-section {
  padding: 56px 0 72px;
  border-top: 3px double var(--border);
  margin-top: 32px;
}
.top5-header {
  text-align: center;
  margin-bottom: 40px;
}
.top5-label {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.top5-title {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.top5-title em { font-style: italic; color: var(--gold); }
.top5-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.top5-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
}
.top5-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at top right, rgba(138, 109, 31, 0.12), transparent 70%);
  pointer-events: none;
}
.top5-rank {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 56px;
  font-weight: 700;
  color: rgba(138, 109, 31, 0.14);
  position: absolute;
  top: 8px;
  right: 22px;
  line-height: 1;
  user-select: none;
}
.top5-medal {
  font-family: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top5-medal::before { content: '★'; font-size: 11px; }
.top5-name {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 23px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  max-width: 82%;
}
.top5-why {
  font-size: 15px;
  color: #35322d;
  line-height: 1.78;
}
.top5-why strong { color: var(--text); font-weight: 500; }

.page-message-wrap {
  padding-top: 60px;
  padding-bottom: 60px;
}
.page-message {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: 28px 32px;
}
.page-message p {
  color: var(--text-dim);
}

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 600px) {
  .container, .hero-inner { padding: 0 20px; }
  .niche-card, .deep-dive { padding: 20px; }
  .rank-num { font-size: 36px; }
  h1 { font-size: 30px; }
  .masthead {
    padding: 12px 20px;
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
  }
  .masthead-navigator {
    width: 100%;
    justify-content: space-between;
  }
  .masthead-navigator-label {
    flex: 1;
    min-width: 0;
    text-align: center;
    white-space: normal;
  }
  .category-nav { padding: 0 20px; }
  .idea-card { grid-template-columns: 40px 1fr; gap: 0 12px; }
  .idea-card:hover { margin: 0 -8px; padding: 30px 8px 32px; }
  .idea-meta-row { grid-template-columns: 1fr; }
  .cat-link,
  .idea-detail-label,
  .top5-label,
  .idea-section-head .idea-section-category { font-size: 9px; }
  .idea-title { font-size: 19px; }
  .idea-what, .idea-pain, .top5-why { font-size: 15px; }
  .top5-name { font-size: 21px; }
  .top5-card { padding: 22px 20px; }
  .top5-name { max-width: 100%; }
}
