:root {
  --ink: #102333;
  --muted: #546878;
  --navy: #084b8f;
  --blue: #0d62a8;
  --aqua: #8fd7e7;
  --leaf: #3f7d69;
  --gold: #edb84e;
  --coral: #cf6958;
  --paper: #f7fbfd;
  --white: #ffffff;
  --line: #d8e7ee;
  --shadow: 0 20px 55px rgba(16, 35, 51, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  background:
    linear-gradient(180deg, rgba(143, 215, 231, 0.18), rgba(255, 255, 255, 0) 38rem),
    var(--paper);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 3rem);
  background: rgba(247, 251, 253, 0.9);
  border-bottom: 1px solid rgba(216, 231, 238, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 3rem;
  height: 2.6rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-link {
  flex: 0 0 auto;
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

main {
  overflow: hidden;
}

.intro-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(17rem, 0.78fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  width: min(1120px, calc(100% - 2rem));
  min-height: calc(100svh - 4.6rem);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.intro-copy {
  max-width: 42rem;
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--leaf);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 11ch;
  margin-bottom: 1.1rem;
  color: var(--navy);
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro-copy > p:not(.kicker) {
  max-width: 38rem;
  margin-bottom: 1.6rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.intro-actions,
.form-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.78rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button-primary {
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 10px 22px rgba(8, 75, 143, 0.2);
}

.button-secondary {
  color: var(--navy);
  background: var(--white);
  border-color: var(--line);
}

.button-plain {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.brand-panel {
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-panel img {
  width: min(25rem, 100%);
  object-fit: contain;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(6.5rem, 1fr));
  gap: 0.7rem;
  width: 100%;
}

.signal-grid span {
  display: grid;
  min-height: 3rem;
  place-items: center;
  padding: 0.7rem;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  background: #e9f6f9;
  border: 1px solid var(--line);
}

.signal-grid span:nth-child(2) {
  background: #eaf4ef;
}

.signal-grid span:nth-child(3) {
  background: #fff5dc;
}

.signal-grid span:nth-child(4) {
  background: #fbecea;
}

.questionnaire-shell,
.results-shell,
.guide-section {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.section-heading {
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

.section-heading h2,
.result-copy h2 {
  margin-bottom: 0.7rem;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 0.34fr);
  gap: 1rem;
}

.progress-panel {
  grid-column: 1 / -1;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  color: var(--muted);
}

.progress-copy strong {
  color: var(--leaf);
}

.progress-track {
  height: 0.7rem;
  overflow: hidden;
  background: #e6eef3;
  border-radius: 999px;
}

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

.quiz-panel,
.note-panel,
.results-shell,
.guide-grid article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(16, 35, 51, 0.08);
}

.quiz-panel {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.question-block {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.question-block legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-weight: 900;
}

#questionArea {
  color: var(--leaf);
}

#questionText {
  min-height: 5.6rem;
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.options {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.option-button {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  min-height: 4rem;
  padding: 0.8rem;
  color: var(--ink);
  text-align: left;
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.option-button[aria-checked="true"] {
  border-color: var(--navy);
  background: #edf7fb;
  box-shadow: inset 0 0 0 1px var(--navy);
}

.option-marker {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.option-button[aria-checked="true"] .option-marker {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.option-text {
  min-width: 0;
}

.option-text strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--ink);
}

.option-text span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.note-panel {
  align-self: start;
  padding: 1rem;
}

.note-panel strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--coral);
}

.note-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.results-shell {
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: center;
  margin-top: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
}

.results-shell:not([hidden]) {
  display: grid;
}

.result-score {
  display: grid;
  width: min(14rem, 58vw);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--white) 0 57%, transparent 58%),
    conic-gradient(var(--leaf) var(--score-angle, 0deg), #e6eef3 0);
}

.result-score span {
  color: var(--navy);
  font-size: 4rem;
  font-weight: 950;
  line-height: 1;
}

.result-score small {
  margin-top: -4.5rem;
  color: var(--muted);
  font-weight: 900;
}

.result-copy p:not(.kicker) {
  color: var(--muted);
  font-size: 1.05rem;
}

.pattern-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 1.2rem;
}

.pattern-list span {
  padding: 0.5rem 0.65rem;
  color: var(--ink);
  font-weight: 900;
  background: #eaf4ef;
  border: 1px solid #cfe7dc;
  border-radius: 999px;
}

.copy-status {
  min-height: 1.5rem;
  margin: 0.9rem 0 0;
  color: var(--leaf);
  font-weight: 800;
}

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

.guide-grid article {
  padding: 1rem;
}

.guide-grid strong {
  color: var(--coral);
}

.guide-grid h3 {
  margin: 0.25rem 0 0.35rem;
  color: var(--navy);
}

.guide-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 2rem);
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto clamp(2rem, 5vw, 4rem);
  padding: clamp(1.1rem, 3vw, 1.5rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact-section h2 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: 0;
}

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

.contact-links a {
  display: grid;
  min-height: 5.3rem;
  align-content: center;
  gap: 0.18rem;
  padding: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(16, 35, 51, 0.06);
}

.contact-links span {
  color: var(--leaf);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-links strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 1rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

:focus-visible {
  outline: 3px solid rgba(237, 184, 78, 0.95);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .intro-shell,
  .quiz-layout,
  .results-shell,
  .guide-grid,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .intro-shell {
    min-height: auto;
  }

  .brand-panel {
    order: -1;
  }

  .brand-panel img {
    width: min(19rem, 100%);
  }

  .note-panel {
    order: 3;
  }

  .contact-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
  }

  .brand span {
    white-space: normal;
    line-height: 1.15;
  }

  .header-link {
    display: none;
  }

  .intro-actions,
  .form-actions,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .progress-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  #questionText {
    min-height: 7rem;
  }

  .option-button {
    grid-template-columns: 1.9rem minmax(0, 1fr);
  }

  .option-marker {
    width: 1.9rem;
    height: 1.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
