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

:root {
  --ink: #0f1c2e;
  --muted: #4b5970;
  --surface: #ffffff;
  --line: #ced8e6;
  --warm: #f6eee2;
  --warm-2: #f9f4ec;
  --shadow: 0 18px 45px rgba(15, 28, 46, 0.14);
  --page-bg:
    radial-gradient(circle at 8% 12%, #ffc966 0%, transparent 26%),
    radial-gradient(circle at 92% 8%, #9dd0ff 0%, transparent 22%),
    linear-gradient(160deg, #f8f0e8 0%, #f1f5fb 55%, #fdfbf8 100%);
}

html,
body {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
}

body.settings-open {
  overflow: hidden;
}

html {
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  width: 0;
  display: none;
}

.home {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 2.3rem 0 3.3rem;
}

.hero {
  text-align: center;
  margin-bottom: 1.3rem;
}

@media (max-width: 980px) {
  .intro {
    max-width: 66ch;
  }

  .top-tabs {
    margin-top: clamp(0.9rem, 0.5rem + 1.4vh, 1.5rem);
  }
}

.eyebrow {
  font-size: 1.15rem;
  margin-bottom: clamp(0.9rem, 2.6vw, 2rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #284161;
  margin-top: 15px;
  height: 120px;
}

.hero h1 {
  font-size: 4.2rem;
  line-height: 1.12;
  font-weight: 600;
  color: #284161;
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
  height: 200px;
}

.intro {
  margin: 1.1rem auto 0;
  width: min(950px, 90%);
  max-width: 62ch;
  font-family: "Spectral", serif;
  font-size: 1.5rem;
  line-height: clamp(1.4, 1.35 + 0.2vw, 1.55);
  font-weight: 600;
  color: #284161;;
  height: 135px;
}

.scroll-down-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  color: #2f4565;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

.scroll-arrow {
  width: 40px;
  height: 40px;
}

@media (max-width: 680px) {
  .scroll-down-cta {
    margin-top: 2.5rem;
    font-size: 1rem;
  }
  .scroll-arrow {
    width: 32px;
    height: 32px;
  }
}

.top-tabs {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin: 120px 0 0.6rem;
  flex-wrap: wrap;
  position: relative;
}

.top-tab-dropdown {
  position: relative;
}

.top-tab {
  border: 1px solid var(--line);
  background: #ffffff;
  color: #2d4467;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.top-tab.active {
  background: #274870;
  color: #ffffff;
  border-color: #274870;
}

.settings-tab {
  border-style: dashed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0.5rem;
}

.settings-gear {
  width: 1.2rem;
  height: 1.2rem;
  transform-origin: 50% 50%;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.settings-tab.is-open .settings-gear {
  transform: rotate(180deg);
}

.party-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 28, 46, 0.16);
  padding: 0.35rem;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.top-tab-dropdown.is-open .party-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(2px);
}

.party-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #2a4568;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.party-link:hover,
.party-link:focus-visible {
  background: #f3f7fd;
  border-color: var(--line);
  outline: none;
}

.party-link.active {
  background: #274870;
  color: #ffffff;
  border-color: #274870;
}

.hidden {
  display: none;
}

.tab-view {
  margin-top: 1rem;
}

.tab-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, var(--warm) 100%);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
  padding: 1rem;
}

.tab-card h3 {
  font-size: 1.15rem;
  color: #203f63;
}

.tab-subtitle {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: #4a607f;
}

.source-list.large {
  margin-top: 0.8rem;
}

.group-grid {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.member-initials {
  height: 2rem;
  width: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #ffffff;
  background: #2f4f75;
}

.member-name {
  font-weight: 700;
  color: #2f4568;
}

.carousel-section {
  margin-top: 1.5rem;
}

.controls-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
}

.arrow-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  height: 3.2rem;
  width: 3.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 8px 18px rgba(15, 28, 46, 0.08);
}

.arrow-btn:hover {
  transform: translateY(-1px);
}

.counter {
  text-align: center;
  color: #2f4565;
  font-size: 0.9rem;
  font-weight: 600;
}

.carousel-stage {
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--warm-2) 100%);
  box-shadow: var(--shadow);
  position: relative;
  padding: 0.6rem 1.2rem;
  height: 440px;
  overflow: hidden;
  cursor: grab;
  outline: none;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.carousel-stage.is-dragging {
  cursor: grabbing;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1600px;
  will-change: transform;
}

.party-card {
  position: absolute;
  top: 48%;
  left: 50%;
  width: min(335px, 80vw);
  min-height: 280px;
  transform-style: preserve-3d;
  border-radius: 18px;
  padding: 1.2rem;
  padding-top: 1.2rem;
  border: 1px solid color-mix(in srgb, var(--party, #003189) 30%, #ffffff);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 360ms ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.party-card .stripe {
  height: 6px;
  border-radius: 8px;
  background: var(--party, #003189);
  margin-bottom: 1rem;
  width: 100%;
}

.party-card .orientation {
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--party, #003189) 35%, #ffffff);
  color: color-mix(in srgb, var(--party, #003189) 75%, #000000);
  background: color-mix(in srgb, var(--party, #003189) 12%, #ffffff);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.8rem;
}

.party-card h2 {
  margin-top: 1rem;
  font-size: 1.5rem;
  line-height: 1.15;
}

.party-card .slogan {
  margin-top: 1.8rem;
  font-family: "Spectral", serif;
  color: var(--muted);
  font-size: 1.1rem;
}

.party-card .leader {
  margin-top: 2rem;
  font-size: 1.05rem;
  color: #2f4565;
}

.party-card.is-center {
  transform: translate(-50%, -50%) scale(1) rotateY(0deg);
  opacity: 1;
  z-index: 4;
}

.party-card.is-left {
  transform: translate(calc(-50% - 270px), -48%) scale(0.89) rotateY(24deg);
  opacity: 0.72;
  z-index: 3;
}

.party-card.is-right {
  transform: translate(calc(-50% + 270px), -48%) scale(0.89) rotateY(-24deg);
  opacity: 0.72;
  z-index: 3;
}

.party-card.is-far-left {
  transform: translate(calc(-50% - 560px), -45%) scale(0.76);
  opacity: 0;
  z-index: 2;
}

.party-card.is-far-right {
  transform: translate(calc(-50% + 560px), -45%) scale(0.76);
  opacity: 0;
  z-index: 2;
}

.click-hint {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  color: #5b6c86;
  font-size: 0.75rem;
  pointer-events: none;
}

.details-panel {
  margin-top: 1rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, var(--warm) 100%);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  scroll-margin-top: 0.8rem;
  touch-action: pan-y;
}

.details-panel.teleport-highlight {
  animation: panel-teleport-arrival 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panel-teleport-arrival {
  0% {
    transform: translateY(22px) scale(0.985);
    box-shadow: 0 0 0 rgba(39, 72, 112, 0);
  }

  45% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 12px rgba(39, 72, 112, 0.16);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .details-panel.teleport-highlight {
    animation: none;
  }
}

.detail-header {
  border-left: 5px solid var(--party, #003189);
  padding-left: 0.8rem;
  margin-bottom: 0.85rem;
}

.detail-header h3 {
  font-size: 1.18rem;
  line-height: 1.2;
}

.detail-header .meta {
  margin-top: 0.25rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: #40536f;
  font-size: 0.85rem;
  font-weight: 600;
}

.detail-header .meta span {
  background: #f2f6fc;
  border: 1px solid var(--line);
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
}

.detail-header .slogan {
  margin-top: 0.45rem;
  font-family: "Spectral", serif;
  color: #304561;
}

.details-accordion {
  display: grid;
  gap: 0.55rem;
}

.detail-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.detail-item summary {
  list-style: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #2a476a;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.detail-item summary::after {
  content: "+";
  font-size: 1rem;
  color: #5c6f89;
}

.detail-item[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
}

.detail-item[open] summary::after {
  content: "-";
}

.detail-item.is-closing summary {
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
}

.detail-item.is-closing summary::after {
  content: "-";
}

.detail-body {
  padding: 0.75rem;
}

.detail-item.is-animating .detail-body {
  will-change: height, opacity;
}

.detail-item.is-animating summary {
  pointer-events: none;
}

.general-list {
  display: grid;
  gap: 0.46rem;
}

.general-row {
  display: grid;
  grid-template-columns: minmax(130px, 220px) 1fr;
  gap: 0.7rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}

.general-row .key {
  font-size: 0.81rem;
  color: #51617a;
  font-weight: 700;
}

.general-row .value {
  font-size: 0.93rem;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.chip-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem;
}

.chip-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5d6d86;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.ideas-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.idea-item {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 10px;
  padding: 0.62rem;
}

.idea-item h5 {
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}

.idea-item p,
.long-text,
.source-list li,
.example-card p,
.chip-card p {
  font-size: 0.92rem;
  line-height: 1.45;
  color: #263b58;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.result-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.62rem;
}

.result-label {
  font-size: 0.78rem;
  color: #586c87;
  margin-bottom: 0.2rem;
}

.result-value {
  font-size: 1rem;
  font-weight: 700;
}

.example-card {
  border: 1px solid var(--line);
  border-left: 5px solid #324f74;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.7rem;
}

.example-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #304966;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.source-list {
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.source-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0.52rem 0.6rem;
}

.empty-note {
  color: #566884;
  font-style: italic;
  font-size: 0.9rem;
}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(9, 18, 31, 0.38);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.settings-panel.hidden {
  display: none;
}

.settings-card {
  width: min(640px, 95vw);
  max-height: min(86vh, 560px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--warm) 100%);
  box-shadow: 0 24px 48px rgba(15, 28, 46, 0.24);
  padding: 0.95rem;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.settings-header h3 {
  font-size: 1.05rem;
  color: #203f63;
}

.settings-close {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  color: #2d4467;
  font-weight: 700;
  cursor: pointer;
}

.settings-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.65rem;
}

.setting-item {
  display: grid;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 0.7rem;
  color: #2a4568;
  font-size: 0.93rem;
  font-weight: 600;
}

.setting-item-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
}

.setting-item input[type="checkbox"] {
  appearance: none;
  width: 1.05rem;
  min-width: 1.05rem;
  height: 1.05rem;
  min-height: 1.05rem;
  border-radius: 6px;
  border: 1px solid #8ca4c1;
  background: #ffffff;
  display: inline-grid;
  place-content: center;
  margin-right: 0;
  margin-top: 0.08rem;
  flex: none;
  cursor: pointer;
}

.setting-item input[type="checkbox"]::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 3px;
  background: #2b4d76;
  transform: scale(0);
  transition: transform 120ms ease;
}

.setting-item input[type="checkbox"]:checked {
  border-color: #2b4d76;
  background: #eef4fc;
}

.setting-item input[type="checkbox"]:checked::after {
  transform: scale(1);
}

.setting-item > span {
  line-height: 1.35;
}

.setting-item-checkbox > span {
  cursor: pointer;
}

.radio-group {
  border: 1px solid var(--line);
}

.radio-group legend {
  padding: 0 0.3rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2a4568;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbfe;
  padding: 0.55rem 0.62rem;
  cursor: pointer;
}

.radio-option + .radio-option {
  margin-top: 0.2rem;
}

.radio-option input[type="radio"] {
  appearance: none;
  width: 1.08rem;
  height: 1.08rem;
  border-radius: 999px;
  border: 1px solid #8ca4c1;
  background: #ffffff;
  display: inline-grid;
  place-content: center;
  flex: none;
  cursor: pointer;
}

.radio-option input[type="radio"]::after {
  content: "";
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 999px;
  background: #2b4d76;
  transform: scale(0);
  transition: transform 120ms ease;
}

.radio-option input[type="radio"]:checked {
  border-color: #2b4d76;
  background: #eef4fc;
}

.radio-option input[type="radio"]:checked::after {
  transform: scale(1);
}

.radio-option span {
  line-height: 1.33;
  cursor: pointer;
}

@media (max-width: 900px) {
  .carousel-stage {
    height: 420px;
  }

  .party-card.is-left {
    transform: translate(calc(-50% - 200px), -49%) scale(0.84) rotateY(19deg);
  }

  .party-card.is-right {
    transform: translate(calc(-50% + 200px), -49%) scale(0.84) rotateY(-19deg);
  }

  .party-card.is-far-left,
  .party-card.is-far-right {
    opacity: 0;
  }

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

  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ideas-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .home {
    width: 94vw;
    padding-top: 1.5rem;
  }

  .eyebrow {
    font-size: 0.84rem;
    letter-spacing: 0.08em;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
    line-height: 1.15;
    max-width: 14ch;
  }

  .intro {
    width: min(96%, 620px);
    font-size: 1rem;
    line-height: 1.55;
  }

  .carousel-stage {
    height: 390px;
    padding: 0.4rem 0.8rem;
  }

  .party-card {
    width: min(315px, 86vw);
    min-height: 250px;
  }

  .party-card.is-left,
  .party-card.is-right {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.78);
  }

  .general-row {
    grid-template-columns: 1fr;
  }

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

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

  .click-hint {
    font-size: 0.69rem;
  }

  .top-tab-dropdown {
    position: static;
  }

  .party-dropdown {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 0.35rem);
    max-width: calc(100vw - 1.2rem);
  }

  .top-tab-dropdown.is-open .party-dropdown {
    transform: translateX(-50%) translateY(2px);
  }

  .settings-panel {
    padding: 0.6rem;
    align-items: end;
  }

  .settings-card {
    width: min(680px, 100%);
    max-height: 88vh;
    border-radius: 14px;
    padding: 0.75rem;
  }

  .settings-header h3 {
    font-size: 1rem;
  }
}

