:root {
  color-scheme: dark;
  --bg: #11110f;
  --panel: #1c1b18;
  --panel-2: #25231f;
  --text: #f2eee4;
  --muted: #b9afa0;
  --line: #3d3830;
  --red: #d94b43;
  --gold: #d6a84a;
  --teal: #52b9a8;
  --violet: #9b74d6;
  --ink: #080807;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 18%, rgba(217, 75, 67, 0.18), transparent 24rem),
    linear-gradient(135deg, #11110f 0%, #171613 48%, #0b1415 100%);
  color: var(--text);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.intro,
.quiz,
.result,
.catalog,
.axes {
  min-height: calc(100vh - 64px);
  display: grid;
  align-content: center;
}

.hidden {
  display: none;
}

.brand-row,
.card-top,
.progress-meta,
.intro-actions,
.result-actions {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 12px;
  margin-bottom: 36px;
}

.mark {
  width: 30px;
  height: 30px;
  background:
    linear-gradient(45deg, transparent 42%, var(--gold) 43% 57%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--red) 43% 57%, transparent 58%),
    var(--panel-2);
  border: 1px solid var(--line);
  rotate: 45deg;
}

.brand {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 40px;
  align-items: center;
}

.kicker,
.question-tag {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.94;
  letter-spacing: 0;
}

.lead {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.intro-actions,
.result-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.menu-actions {
  display: grid;
  gap: 12px;
  margin-top: 32px;
  max-width: 560px;
}

.menu-button {
  min-height: 76px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.menu-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--gold), white 20%);
}

.menu-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.menu-button span {
  color: var(--muted);
  line-height: 1.5;
}

.primary-menu {
  background: linear-gradient(135deg, rgba(217, 75, 67, 0.92), rgba(214, 168, 74, 0.62));
  border-color: rgba(255, 255, 255, 0.24);
}

.primary-menu span {
  color: rgba(255, 255, 255, 0.86);
}

.primary,
.ghost,
.choice,
.back-button {
  min-height: 46px;
  border-radius: 8px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary {
  padding: 0 22px;
  background: var(--red);
  color: white;
  font-weight: 800;
}

.ghost {
  padding: 0 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.back-button {
  width: fit-content;
  margin-bottom: 20px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.primary:hover,
.ghost:hover,
.choice:hover,
.back-button:hover {
  transform: translateY(-1px);
}

.sample-card,
.result-card,
.question-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 27, 24, 0.86);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.sample-card {
  padding: 20px;
  min-height: 520px;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}

.sample-card::before,
.result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(214, 168, 74, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(214, 168, 74, 0.07) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
  pointer-events: none;
}

.card-top {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sample-card h2,
.result-card h2 {
  margin: 18px 0 10px;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05;
}

.sample-card p,
.result-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.sigil {
  width: min(100%, 310px);
  aspect-ratio: 1;
  margin: 24px auto;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent, var(--red)), white 16%);
  border-radius: 8px;
  background:
    conic-gradient(from 20deg, color-mix(in srgb, var(--accent, var(--red)), black 20%), transparent 24%, color-mix(in srgb, var(--accent-2, var(--gold)), black 12%), transparent 62%, color-mix(in srgb, var(--accent, var(--red)), white 4%)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 42%),
    var(--ink);
}

.sigil span {
  width: 58%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.78);
  color: white;
  font-size: clamp(58px, 12vw, 106px);
  font-weight: 900;
  border-radius: 50%;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.sigil-sample {
  --accent: var(--violet);
  --accent-2: var(--red);
}

.progress-wrap {
  max-width: 820px;
  margin: 0 auto 22px;
  width: 100%;
}

.progress-meta {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--panel-2);
}

.progress span {
  display: block;
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 220ms ease;
}

.question-panel {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px);
}

.question-panel h2 {
  margin: 0;
  font-size: clamp(26px, 4.5vw, 44px);
  line-height: 1.14;
}

.choices {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.choice {
  width: 100%;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  line-height: 1.55;
}

.choice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.choice span {
  color: var(--muted);
}

.result {
  padding: 24px 0 48px;
}

.catalog,
.axes {
  padding: 24px 0 48px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
}

.section-head p:not(.kicker) {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.type-card {
  min-height: 230px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 27, 24, 0.82);
  text-align: left;
}

.type-card:hover {
  border-color: color-mix(in srgb, var(--accent, var(--red)), white 18%);
}

.type-card .card-top {
  margin-bottom: 28px;
}

.type-card h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 23px;
  line-height: 1.16;
}

.type-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.axis-list {
  display: grid;
  gap: 14px;
}

.axis-card {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 27, 24, 0.82);
}

.axis-title h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 24px;
}

.axis-title p,
.axis-side p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.axis-side {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.axis-side strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
}

.axis-side small,
.code-item small {
  display: block;
  margin-bottom: 8px;
  color: color-mix(in srgb, var(--muted), transparent 22%);
  font-size: 12px;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 4vw, 32px);
}

.result-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px, 340px) minmax(0, 1fr);
  gap: clamp(18px, 5vw, 44px);
  align-items: center;
  margin-top: 18px;
}

.result-layout .sigil {
  margin: 0;
}

.code-panel {
  position: relative;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 8, 7, 0.28);
}

.code-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 14px;
}

.code-head h3 {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
}

.code-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.code-item {
  min-height: 134px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.code-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.code-item span {
  display: block;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.code-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.detail-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.detail-grid section {
  min-height: 168px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.detail-grid h3 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
}

.detail-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 840px) {
  .shell {
    width: min(100% - 22px, 680px);
    padding: 18px 0;
  }

  .intro,
  .quiz,
  .result,
  .catalog,
  .axes {
    min-height: auto;
    align-content: start;
    padding: 10px 0;
  }

  .intro-grid,
  .result-layout,
  .code-grid,
  .detail-grid,
  .type-grid,
  .axis-card {
    grid-template-columns: 1fr;
  }

  .code-head {
    display: block;
  }

  .code-head p {
    margin-top: 6px;
    text-align: left;
  }

  .sample-card {
    min-height: 430px;
  }

  .detail-grid section {
    min-height: auto;
  }
}
