:root {
  color-scheme: light;
  --bg: #f8f1e8;
  --panel: #fffaf3;
  --ink: #171313;
  --muted: #756154;
  --line: #e3c6aa;
  --brand: #a66f45;
  --brand-dark: #5b3323;
  --gold: #d6a14c;
  --copper: #b1784f;
  --green: #526d58;
  --blue: #3f6071;
  --shadow: 0 24px 64px rgba(33, 23, 18, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(214, 161, 76, 0.28), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(166, 111, 69, 0.2), transparent 34rem),
    linear-gradient(135deg, #fff8ef 0%, #efe0cf 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 28px 18px 48px;
}

.hero,
.card,
.result-panel {
  background: rgba(255, 250, 243, 0.92);
  border: 1px solid rgba(227, 198, 170, 0.94);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 30px;
  padding: 32px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "DISC";
  position: absolute;
  right: -12px;
  bottom: -38px;
  color: rgba(91, 51, 35, 0.06);
  font-size: clamp(96px, 18vw, 210px);
  font-weight: 900;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.hero-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo img {
  display: block;
  width: min(220px, 35vw);
  min-width: 120px;
  height: auto;
  filter: drop-shadow(0 12px 20px rgba(33, 23, 18, 0.12));
}

.hero-text h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  letter-spacing: -0.06em;
}

.hero-controls {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 16px;
  align-items: end;
  position: relative;
  z-index: 1;
}

.hero-controls .actions {
  margin-top: 0;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 680px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 8vw, 5.9rem);
  letter-spacing: -0.06em;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.45rem);
  letter-spacing: -0.04em;
}

h3 {
  font-size: 1.15rem;
}

.lead {
  max-width: 670px;
  color: var(--muted);
  font-size: 1.07rem;
  line-height: 1.65;
}

.hero-side {
  align-self: end;
  position: relative;
  z-index: 1;
}

.name-field {
  display: grid;
  gap: 8px;
}

.name-field label,
.rank-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.name-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 15px 16px;
  color: var(--ink);
  outline: none;
}

.name-field input:focus,
.rank-button:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(166, 111, 69, 0.16);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  padding: 13px 19px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--brand-dark), var(--copper) 58%, var(--gold));
  color: #fffaf2;
  box-shadow: 0 12px 28px rgba(91, 51, 35, 0.24);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3f2318, var(--brand) 58%, #c78c35);
}

.btn-secondary {
  background: rgba(166, 111, 69, 0.13);
  color: var(--brand-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}

.progress-panel,
.card {
  padding: 22px;
}

.progress-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  background: linear-gradient(160deg, rgba(23, 19, 19, 0.96), rgba(60, 37, 27, 0.95));
  border-radius: 26px;
  color: #fffaf2;
}

.progress-ring {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: conic-gradient(var(--gold) var(--progress, 0%), rgba(255, 250, 242, 0.16) 0);
}

.progress-ring span {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: #171313;
  font-size: 1rem;
  font-weight: 900;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 7px;
}

.mini-dot {
  border-radius: 10px;
  background: rgba(255, 250, 242, 0.14);
  color: rgba(255, 250, 242, 0.68);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 7px 0;
  text-align: center;
}

.mini-dot.done {
  background: linear-gradient(135deg, var(--gold), var(--copper));
  color: #231f20;
}

.question-card {
  min-height: 580px;
}

.question-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--ink);
  color: #fffaf2;
  font-weight: 900;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffdf9;
  padding: 16px;
}

.option strong {
  color: var(--brand-dark);
}

.rank-control {
  display: grid;
  gap: 8px;
}

.rank-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.rank-button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 900;
  padding: 10px 0;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.rank-button:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
}

.rank-button.selected {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-dark), var(--copper) 58%, var(--gold));
  color: #fffaf2;
}

.hint,
.error {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.error {
  color: #9e2f24;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 20px;
  margin-top: 20px;
}

.result-panel {
  padding: 26px;
}

.score-list {
  display: grid;
  gap: 15px;
  margin-top: 22px;
}

.score-row {
  display: grid;
  gap: 8px;
}

.score-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.bar {
  overflow: hidden;
  height: 16px;
  border-radius: 999px;
  background: rgba(35, 31, 32, 0.08);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--brand));
}

.profile-hero {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.profile-hero .type {
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-hero .phrase {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  letter-spacing: -0.05em;
}

.profile-section {
  margin-top: 18px;
}

.profile-section h3 {
  margin-bottom: 9px;
  color: var(--brand-dark);
}

.profile-section ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.meta-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
  padding: 12px;
}

.meta-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-card strong {
  display: block;
  margin-top: 5px;
}

@media (max-width: 820px) {
  .hero-top,
  .hero-controls,
  .layout,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 26px;
  }

  .hero-logo img {
    width: min(190px, 55vw);
  }

  .progress-panel {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .mini-grid {
    width: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

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

  .profile-meta {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .hero,
  .progress-panel,
  .question-card,
  .actions .btn-secondary,
  .actions .btn-ghost {
    display: none;
  }

  .result-grid {
    display: block;
  }

  .result-panel {
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 16px;
  }
}
