:root {
  --bg: #f6f4f1;
  --bg-soft: rgba(255, 255, 255, 0.9);
  --line: rgba(185, 185, 185, 0.18);
  --text: #23170f;
  --muted: #54483f;
  --brand: #ff8a2d;
  --brand-light: #ffab69;
  --brand-dark: #d96e1e;
  --focus: #0f5fff;
  --petal-shadow: rgba(140, 140, 140, 0.16);
  --panel: rgba(255, 255, 255, 0.84);
  --shadow: 0 22px 45px rgba(85, 76, 67, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Rubik", "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 171, 105, 0.12), transparent 22%),
    radial-gradient(circle at 82% 80%, rgba(255, 171, 105, 0.12), transparent 18%),
    linear-gradient(180deg, #faf8f5, var(--bg));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.92;
  background:
    repeating-radial-gradient(circle at 16% 22%, transparent 0 34px, var(--line) 34px 36px, transparent 36px 70px),
    repeating-radial-gradient(circle at 84% 68%, transparent 0 34px, var(--line) 34px 36px, transparent 36px 70px),
    repeating-radial-gradient(circle at 46% 48%, transparent 0 52px, rgba(205, 205, 205, 0.12) 52px 54px, transparent 54px 100px);
  mix-blend-mode: multiply;
}

html:has(dialog[open]),
body:has(dialog[open]) {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(85, 76, 67, 0.16);
}

.skip-link:focus {
  top: 14px;
}

.page-shell {
  width: min(1600px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

.entry-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.entry-shell {
  width: min(1380px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 42px;
  align-items: center;
}

.entry-copy {
  max-width: 520px;
}

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

.entry-scan-callout {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 16px 30px rgba(85, 76, 67, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.86);
}

.entry-scan-label {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-scan-text {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.45;
}

.entry-scan-button {
  border-color: transparent;
  background: linear-gradient(180deg, rgba(255, 171, 105, 0.18), rgba(217, 110, 30, 0.16));
  color: var(--brand-dark);
  box-shadow: 0 12px 22px rgba(217, 110, 30, 0.12);
}

.entry-button {
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  box-shadow: 0 16px 28px rgba(217, 110, 30, 0.22);
  cursor: pointer;
}

.entry-visual {
  position: relative;
  min-height: 620px;
  display: grid;
  place-items: center;
}

.entry-flower-frame {
  position: relative;
  width: min(860px, 100%);
  aspect-ratio: 800.9 / 763.3;
  filter: drop-shadow(0 26px 45px rgba(85, 76, 67, 0.12));
}

.entry-flower,
.entry-eight {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.entry-eight {
  inset: auto;
  left: 50%;
  top: 50%;
  width: min(24%, 190px);
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.94;
}

.experience-open .entry-screen {
  display: none;
}

.hero {
  display: block;
  margin-bottom: 24px;
  padding-inline: 28px;
}

.hero-copy {
  max-width: 720px;
}

.brand {
  margin-bottom: 8px;
}

.brand-logo {
  display: block;
  width: 96px;
  height: auto;
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--brand-dark);
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 0.95;
  font-weight: 700;
  max-width: 13ch;
}

.intro {
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.45;
}

.hero-actions {
  margin-top: 16px;
}

.section-intro h2 {
  margin-bottom: 10px;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.1;
}

.layout {
  display: grid;
  gap: 24px;
}

.flower-section {
  display: grid;
  gap: 16px;
}

.section-intro {
  max-width: 720px;
  padding-inline: 28px;
}

.section-intro p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.flower-stage {
  position: relative;
  min-height: auto;
  padding: 28px;
}

.flower {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-content: start;
}

.flower-base,
.flower-eight {
  position: absolute;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.flower-base {
  left: 50%;
  top: 50%;
  width: min(1120px, 92%);
  transform: translate(-50%, -50%);
  opacity: 0.14;
}

.flower-eight {
  left: 50%;
  top: 50%;
  width: min(220px, 22%);
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0.16;
}

.petal {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  color: var(--text);
  z-index: 3;
  background: transparent;
}

.petal-content {
  position: relative;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 18px;
  min-height: 100%;
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 14px 28px rgba(85, 76, 67, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
}

.petal-title {
  border: 0;
  background: none;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.12;
  cursor: pointer;
  text-align: left;
  margin: 0;
  max-width: 100%;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px 12px;
  width: 100%;
  max-width: 100%;
}

.tag {
  border: 0;
  background: rgba(255, 138, 45, 0.1);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
}

.ghost-button,
.entry-button,
.petal-title,
.tag,
.source-list a,
.scan-rating-option {
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    opacity 140ms ease;
}

.tag:hover,
.petal-title:hover,
.ghost-button:hover,
.entry-button:hover,
.source-list a:hover,
.scan-rating-option:hover {
  transform: translateY(-1px);
}

.ghost-button:focus-visible,
.entry-button:focus-visible,
.petal-title:focus-visible,
.tag:focus-visible,
.source-list a:focus-visible,
.scan-rating-option:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.petal-title:hover,
.petal-title:focus-visible {
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.3);
}

.tag.is-active {
  background: #6b3412;
  color: #fffaf5;
  text-shadow: none;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 227, 0.12);
}

.theory-text {
  color: var(--muted);
  line-height: 1.52;
}

.theory-text p {
  margin: 0 0 10px;
}

.theory-text p:last-child {
  margin-bottom: 0;
}

.citation {
  color: rgba(109, 97, 89, 0.76);
  font-size: 0.88em;
  white-space: nowrap;
}

.source-block {
  margin-top: 14px;
}

.source-list {
  padding-left: 18px;
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.84rem;
}

.source-list a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  transition: color 140ms ease, transform 140ms ease, opacity 140ms ease;
}

.source-list a::after {
  content: "";
  width: 0.78rem;
  height: 0.78rem;
  opacity: 0.48;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d6159' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3h7v7'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M21 14v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h6'/%3E%3C/svg%3E");
}

.source-list a:hover,
.source-list a:focus-visible {
  color: #3d2c21;
}

.source-list a:hover::after,
.source-list a:focus-visible::after {
  opacity: 0.82;
}

.ghost-button {
  border: 1px solid rgba(217, 110, 30, 0.18);
  background: rgba(255, 138, 45, 0.09);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 11px 15px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.theory-dialog {
  position: relative;
  margin: auto;
  width: min(720px, calc(100vw - 32px));
  max-height: min(88vh, calc(100vh - 32px));
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.theory-dialog::backdrop {
  background: rgba(60, 49, 41, 0.2);
}

.term-dialog {
  width: min(420px, calc(100vw - 32px));
  max-height: none;
  padding: 18px 18px 16px;
  border-radius: 22px;
  overflow: visible;
  box-shadow: 0 18px 40px rgba(85, 76, 67, 0.18);
}

.term-dialog::before {
  display: none;
}

.term-dialog::backdrop {
  background: rgba(60, 49, 41, 0.1);
}

.term-dialog .dialog-header {
  position: static;
  top: auto;
  margin-bottom: 10px;
  padding-bottom: 0;
  background: transparent;
}

.term-dialog h2 {
  font-size: 1.35rem;
  line-height: 1.1;
  margin-bottom: 0;
}

.term-dialog #termDialogDescription {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.term-dialog .dialog-actions {
  margin-top: 14px;
}

.term-dialog .ghost-button {
  padding: 9px 13px;
}

.theory-dialog::before,
.scan-dialog::before {
  content: "";
  position: absolute;
  right: -36px;
  top: -28px;
  width: 220px;
  height: 220px;
  background: url("./bloem.svg") no-repeat center/contain;
  opacity: 0.06;
  pointer-events: none;
  filter: saturate(0.9);
}

.theory-dialog > *,
.scan-dialog > * {
  position: relative;
  z-index: 1;
}

.scan-dialog {
  position: relative;
  margin: auto;
  width: min(980px, calc(100vw - 32px));
  max-height: min(92vh, calc(100vh - 24px));
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.scan-dialog-wide {
  width: min(1240px, calc(100vw - 32px));
}

.scan-dialog::backdrop {
  background: rgba(60, 49, 41, 0.24);
}

.scan-shell {
  padding: 22px;
}

.scan-progress {
  margin-bottom: 18px;
}

.scan-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  align-items: baseline;
}

#scanStepLabel {
  font-size: 0.9rem;
  color: var(--muted);
}

#scanStepTitle {
  font-size: clamp(1.22rem, 2vw, 1.6rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.scan-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(217, 110, 30, 0.08);
  overflow: hidden;
}

.scan-progress-fill {
  height: 100%;
  width: 12.5%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  transition: width 220ms ease;
}

.scan-scale {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 18px;
}

.scan-questions {
  display: grid;
  gap: 14px;
}

.scan-question {
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(246, 244, 241, 0.9);
  border: 1px solid rgba(185, 185, 185, 0.16);
}

.scan-question-title {
  margin: 0 0 12px;
  font-weight: 600;
  line-height: 1.45;
}

.scan-question legend {
  padding: 0;
}

.scan-rating {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scan-rating-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(185, 185, 185, 0.22);
  cursor: pointer;
}

.scan-rating-option input {
  margin: 0;
  accent-color: var(--brand-dark);
}

.scan-rating-option:has(input:checked) {
  background: rgba(255, 138, 45, 0.18);
  border-color: rgba(217, 110, 30, 0.35);
  box-shadow: 0 8px 14px rgba(217, 110, 30, 0.08);
}

.scan-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.scan-actions button[hidden] {
  display: none;
}

.scan-actions .ghost-button {
  min-width: 150px;
}

.scan-actions .ghost-button:last-child,
.scan-actions #scanNext {
  margin-left: auto;
}

.scan-actions #scanPrev {
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  border-color: rgba(185, 185, 185, 0.28);
}

.scan-actions #scanNext,
.scan-actions #scanResults {
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(217, 110, 30, 0.2);
}

.scan-actions #scanNext:disabled,
.scan-actions #scanResults:disabled {
  background: rgba(217, 110, 30, 0.18);
  color: rgba(255, 255, 255, 0.75);
  box-shadow: none;
  cursor: not-allowed;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 340px);
  gap: 28px;
  align-items: start;
}

.results-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.results-contact-button {
  text-decoration: none;
}

.results-chart-card,
.results-level-card,
.results-score-card {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  box-shadow:
    0 14px 28px rgba(85, 76, 67, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.84);
}

.results-chart-card {
  padding: 18px 22px 24px;
}

.results-chart-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.results-chart-header h3,
.results-level-card h3,
.results-score-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.results-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.results-radar-shell {
  width: min(100%, 700px);
  margin: 0 auto;
}

.results-radar {
  display: block;
  width: 100%;
  height: auto;
}

.results-sidebar {
  display: grid;
  gap: 16px;
}

.results-level-card,
.results-score-card {
  padding: 18px 18px 16px;
}

.results-level-copy {
  margin-top: 14px;
  color: var(--text);
}

.results-level-copy p {
  margin: 0 0 14px;
  line-height: 1.45;
}

.results-level-copy p:last-child {
  margin-bottom: 0;
}

.results-legend {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.results-legend-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(246, 244, 241, 0.92);
}

.results-legend-title {
  font-weight: 600;
}

.results-legend-score {
  min-width: 48px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 138, 45, 0.12);
  color: var(--brand-dark);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.radar-bg {
  fill: rgba(207, 207, 207, 0.26);
}

.radar-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 2;
}

.radar-axis {
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 3;
}

.radar-level-label {
  fill: rgba(109, 97, 89, 0.9);
  font-size: 15px;
  font-weight: 600;
}

.radar-label {
  fill: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.radar-polygon {
  fill: rgba(255, 138, 45, 0.28);
  stroke: #ff7e1f;
  stroke-width: 3;
}

.radar-point {
  fill: #ff7e1f;
  stroke: rgba(255, 255, 255, 0.68);
  stroke-width: 2;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
  position: static;
  top: auto;
  padding-bottom: 0;
  background: transparent;
  z-index: 2;
}

.dialog-actions {
  margin-top: 16px;
}

@media (max-width: 1200px) {
  .flower-stage {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .entry-shell {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .entry-visual {
    min-height: auto;
  }

  .entry-flower-frame {
    width: min(680px, 100%);
  }

  .hero,
  .section-intro {
    padding-inline: 18px;
  }

  .flower-stage {
    padding: 18px 14px 18px;
    min-height: auto;
  }

  .flower {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
  }

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

  .flower-base,
  .flower-eight {
    display: none;
  }

  .petal {
    width: 100%;
  }

}

@media (max-width: 640px) {
  .entry-screen {
    padding: 20px 14px 24px;
  }

  .entry-shell {
    gap: 22px;
  }

  .entry-button {
    width: 100%;
  }

  .entry-actions .ghost-button {
    width: 100%;
  }

  .entry-flower-frame {
    width: min(100%, 520px);
  }

  .hero,
  .section-intro {
    padding-inline: 14px;
  }

  .page-shell {
    width: min(100vw - 24px, 100%);
    padding-top: 10px;
  }

  .theory-dialog,
  .scan-dialog,
  .scan-dialog-wide {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 18px;
  }

  .theory-dialog {
    padding: 18px 16px;
  }

  .scan-shell {
    padding: 18px 16px;
  }

  .results-chart-card,
  .results-level-card,
  .results-score-card {
    border-radius: 18px;
  }

  .results-legend-item {
    border-radius: 18px;
    padding: 10px 12px;
  }

  .dialog-header,
  .scan-progress-meta,
  .scan-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .scan-actions .ghost-button,
  .scan-actions #scanNext,
  .scan-actions #scanResults,
  .scan-actions #scanPrev {
    width: 100%;
    margin-left: 0;
  }
}

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