:root {
  --bg: #07111f;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.11);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef5ff;
  --muted: #b8c5da;
  --heading: #ffffff;
  --sg: #ff7272;
  --sg-soft: rgba(255, 114, 114, 0.14);
  --ca: #7fb3ff;
  --ca-soft: rgba(127, 179, 255, 0.14);
  --dark-pill: rgba(255, 255, 255, 0.12);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
  --radius: 24px;
  --radius-sm: 16px;
  --max: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.75;
  background:
    radial-gradient(circle at 10% 15%, rgba(127, 179, 255, 0.12), transparent 22%),
    radial-gradient(circle at 88% 20%, rgba(255, 114, 114, 0.12), transparent 18%),
    linear-gradient(180deg, #07111f 0%, #091423 100%);
  overflow-x: hidden;
}

/* ensure only headings use display font */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Playfair Display", serif;
  color: var(--heading);
  line-height: 1.15;
  margin-top: 0;
}

p,
button,
li,
div,
span,
a {
  font-family: "Inter", Arial, sans-serif;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image:
    radial-gradient(circle at 20% 20%, #fff 0.6px, transparent 0.7px),
    radial-gradient(circle at 80% 50%, #fff 0.6px, transparent 0.7px),
    radial-gradient(circle at 40% 80%, #fff 0.6px, transparent 0.7px);
  background-size: 160px 160px;
}

.glow {
  position: fixed;
  width: 360px;
  height: 360px;
  filter: blur(90px);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.22;
}

.glow-a {
  background: #5b8fff;
  top: 60px;
  left: -120px;
}

.glow-b {
  background: #ff6f8e;
  right: -120px;
  top: 200px;
}

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

/* HERO */
.hero {
  padding: 5rem 0 2.5rem;
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  gap: 2rem;
  align-items: start;
}

.eyebrow,
.section-kicker,
.mini-kicker,
.panel-label,
.metric-label,
.popover-label {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "Inter", Arial, sans-serif;
  font-weight: 700;
}

.hero h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(2.7rem, 5vw, 4.6rem);
  max-width: 900px;
}

.sg-text {
  color: var(--sg);
}

.ca-text {
  color: var(--ca);
}

.hero-subtitle {
  max-width: 760px;
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.audience-note {
  max-width: 760px;
  color: #d7e2f5;
  font-size: 0.98rem;
  margin: 0 0 1.2rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.hero-tags,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.source-chip,
.stat-pill {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: 0.2s ease;
}

.source-chip:hover,
.stat-pill:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

/* cards */
.floating-panel,
.editorial-card,
.compare-board,
.step-card,
.jurisdiction-panel,
.metric-card,
.reference-card,
.section-intro,
.matrix-card,
.dashboard-card,
.visual-card {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.floating-panel,
.editorial-card,
.compare-board,
.jurisdiction-panel,
.metric-card,
.reference-card,
.section-intro,
.matrix-card,
.dashboard-card,
.visual-card {
  padding: 1.35rem;
}

.floating-panel h2 {
  margin: 0.45rem 0 0.8rem;
  font-size: 1.45rem;
}

.score-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.score-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.score-bar {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 999px;
}

.canada-fill {
  background: linear-gradient(90deg, #5f95ff, #9fc5ff);
}

.singapore-fill {
  background: linear-gradient(90deg, #ff6d6d, #ffb0b0);
}

/* NAV */
.control-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 17, 31, 0.82);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.control-bar-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0;
  flex-wrap: wrap;
}

.view-toggle,
.tab-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.view-btn,
.tab-btn,
.lens-btn {
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 0.95rem;
}

.view-btn:hover,
.tab-btn:hover,
.lens-btn:hover,
.view-btn.active,
.tab-btn.active,
.lens-btn.active {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

/* MAIN */
.site-main {
  padding: 2rem 0 4rem;
  position: relative;
  z-index: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-intro {
  margin-bottom: 1.25rem;
}

.section-intro h2 {
  margin: 0.35rem 0 0.6rem;
  font-size: 2.15rem;
}

.section-intro p,
.editorial-card p,
.jurisdiction-panel p,
.matrix-cell,
.highlight-box,
.statute-note,
.reference-card li,
.dashboard-card p,
.metric-card p,
.audience-note {
  font-size: 1rem;
  line-height: 1.75;
}

.section-intro p,
.editorial-card p,
.jurisdiction-panel p,
.highlight-box,
.dashboard-card p,
.metric-card p {
  max-width: 68ch;
  color: var(--muted);
}

.overview-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.editorial-card.large h3 {
  font-size: 1.45rem;
  margin-top: 0.3rem;
}

.accent-red {
  background: linear-gradient(180deg, rgba(255, 114, 114, 0.14), rgba(255, 255, 255, 0.06));
}

.accent-blue {
  background: linear-gradient(180deg, rgba(127, 179, 255, 0.14), rgba(255, 255, 255, 0.06));
}

/* visual strip */
.visual-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.visual-placeholder {
  height: 170px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  color: var(--muted);
  margin-bottom: 0.85rem;
  text-align: center;
  padding: 1rem;
  font-weight: 600;
}

.visual-card h3 {
  margin-bottom: 0.55rem;
}

.visual-card p {
  margin: 0;
  color: var(--muted);
}

/* compare board */
.compare-board {
  margin-bottom: 1rem;
}

.compare-board-header p {
  color: var(--muted);
  margin-top: 0.3rem;
}

.compare-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.step-card {
  padding: 1.1rem;
}

.step-card p {
  color: var(--muted);
  margin: 0;
}

.step-number {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

/* lens */
.lens-bar {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.lens-label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

.lens-content {
  display: none;
}

.lens-content.active {
  display: block;
}

/* split compare */
.split-compare {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

.jurisdiction-panel {
  transition: transform 0.22s ease, border-color 0.22s ease;
  min-height: 100%;
}

.jurisdiction-panel:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
}

.singapore-panel {
  background: linear-gradient(180deg, rgba(255, 114, 114, 0.1), rgba(255, 255, 255, 0.05));
}

.canada-panel {
  background: linear-gradient(180deg, rgba(127, 179, 255, 0.1), rgba(255, 255, 255, 0.05));
}

.panel-head {
  margin-bottom: 0.9rem;
}

.panel-head h3 {
  margin: 0.45rem 0 0;
  font-size: 1.45rem;
}

.jurisdiction-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.35rem 0.68rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sg-pill {
  background: var(--sg-soft);
  color: #ffd6d6;
}

.ca-pill {
  background: var(--ca-soft);
  color: #d6e7ff;
}

.stat-pill.sg {
  background: var(--sg-soft);
  color: #ffe4e4;
}

.stat-pill.ca {
  background: var(--ca-soft);
  color: #dce9ff;
}

.stat-pill.dark {
  background: var(--dark-pill);
  color: #edf3ff;
}

/* highlight boxes */
.highlight-box {
  margin: 1rem 0;
  padding: 1rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
}

.highlight-box strong {
  color: var(--text);
}

/* accordions */
.accordion-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.accordion-header {
  width: 100%;
  padding: 1rem;
  background: transparent;
  color: var(--text);
  border: none;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.accordion-icon {
  font-size: 1.2rem;
  margin-left: 1rem;
}

.accordion-content {
  display: none;
  padding: 0 1rem 1rem;
  color: var(--muted);
}

.accordion-item.open .accordion-content {
  display: block;
}

.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
}

/* statutes */
.statute-block {
  margin-top: 0.8rem;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  color: #dbe6f7;
}

.statute-note {
  margin-top: 0.85rem;
  color: var(--muted);
}

/* matrix */
.matrix-card {
  margin-bottom: 1rem;
}

.matrix-header p {
  color: var(--muted);
  margin-top: 0.3rem;
}

.matrix-table {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.matrix-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 0.6rem;
}

.matrix-cell {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.matrix-head .matrix-cell {
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.matrix-cell.label {
  font-weight: 700;
  color: var(--text);
}

/* metric strip / dashboard / references */
.metric-strip,
.reference-columns,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-card.emphasis {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
}

.reference-card ul {
  padding-left: 1.2rem;
  color: var(--muted);
}

.reference-card li {
  margin-bottom: 0.55rem;
}

/* disclosure */
.ai-disclosure {
  margin-top: 2rem;
}

/* links */
a {
  color: #cfe0ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: #ffffff;
}

/* popover */
.hidden {
  display: none !important;
}

.popover {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(3, 8, 16, 0.72);
  z-index: 50;
  padding: 1rem;
}

.popover.active {
  display: grid;
}

.popover-inner {
  width: min(620px, 100%);
  background: #0e1a2f;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
  position: relative;
}

.popover-inner h3 {
  margin-top: 0.3rem;
}

.popover-inner p {
  color: var(--muted);
}

.popover-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
}

/* responsive */
@media (max-width: 1000px) {
  .hero-grid,
  .overview-layout,
  .compare-steps,
  .split-compare,
  .metric-strip,
  .reference-columns,
  .dashboard-grid,
  .visual-strip,
  .matrix-row {
    grid-template-columns: 1fr;
  }

  .control-bar-inner {
    align-items: stretch;
  }

  .hero {
    padding-top: 4.2rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 8vw, 3rem);
  }

  .section-intro h2 {
    font-size: 1.7rem;
  }

  .view-toggle,
  .tab-nav,
  .lens-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .view-btn,
  .tab-btn,
  .lens-btn {
    width: 100%;
  }

  .container {
    width: min(var(--max), calc(100% - 1.25rem));
  }

  .statute-block {
    font-size: 0.8rem;
  }
}

.visual-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 0.75rem;
}