:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #5a6863;
  --paper: #f6f3ea;
  --panel: rgba(255, 252, 242, 0.9);
  --line: rgba(23, 33, 31, 0.16);
  --accent: #d8533b;
  --accent-2: #1c8a83;
  --shadow: 0 18px 60px rgba(18, 28, 26, 0.2);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.atlas {
  position: relative;
  min-height: clamp(620px, 88vh, 980px);
  overflow: hidden;
  background: #9cc9c0;
}

#atlasCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: clamp(22px, 4vw, 46px);
  pointer-events: none;
}

.topbar h1 {
  margin: 4px 0 0;
  max-width: 760px;
  font-size: clamp(56px, 13vw, 168px);
  line-height: 0.82;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(23, 33, 31, 0.22);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 252, 242, 0.74);
  box-shadow: 0 10px 34px rgba(23, 33, 31, 0.14);
  cursor: pointer;
}

.icon-button span {
  display: block;
  font-size: 1.6rem;
  transform: translateY(-1px);
}

.panel {
  position: absolute;
  right: clamp(16px, 4vw, 46px);
  bottom: clamp(16px, 4vw, 42px);
  z-index: 2;
  width: min(390px, calc(100% - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel h2,
.manifest h2 {
  margin: 4px 0 0;
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.stats div,
.trait {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.stats div {
  padding: 12px;
}

.stats span {
  display: block;
  font-size: 1.55rem;
  font-weight: 850;
}

.stats small {
  color: var(--muted);
}

.control {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 16px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 33, 31, 0.06);
}

.segmented button,
.primary {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.segmented button {
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.segmented button.active {
  color: var(--ink);
  background: rgba(255, 252, 242, 0.9);
  box-shadow: 0 7px 20px rgba(23, 33, 31, 0.12);
}

.primary {
  width: 100%;
  color: #fffaf0;
  background: var(--ink);
  font-weight: 850;
}

.manifest {
  display: grid;
  grid-template-columns: minmax(220px, 0.88fr) minmax(280px, 1.12fr);
  gap: clamp(22px, 5vw, 70px);
  padding: clamp(28px, 6vw, 74px);
  background: #f7f2e5;
}

.manifest p:not(.eyebrow) {
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  line-height: 1.65;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.trait {
  min-height: 150px;
  padding: 16px;
}

.trait b {
  display: block;
  margin-bottom: 22px;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trait span {
  display: block;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  line-height: 1.35;
}

@media (max-width: 760px) {
  .atlas {
    min-height: 760px;
  }

  .topbar {
    padding-bottom: 120px;
  }

  .topbar h1 {
    font-size: clamp(54px, 22vw, 112px);
  }

  .panel {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }

  .manifest,
  .cards {
    grid-template-columns: 1fr;
  }
}
