:root {
  color-scheme: light;
  --ink: #26351f;
  --ink-soft: #58634e;
  --olive: #53633a;
  --olive-deep: #34431f;
  --cream: #fffaf1;
  --paper: rgba(255, 252, 245, .84);
  --sage: #dce6cf;
  --lilac: #e7dcf0;
  --blush: #f2d9d5;
  --apricot: #f3cba9;
  --gold: #dbb75d;
  --line: rgba(61, 73, 43, .22);
  --shadow: 0 24px 70px rgba(61, 65, 42, .12);
  font-family: "Mulish", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  background: #f7f0e5;
  -webkit-font-smoothing: antialiased;
}

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

button,
input { font: inherit; }

a { color: inherit; }

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus { transform: translateY(0); }

.app-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 250, 240, .12), rgba(255, 250, 240, .28)),
    url("assets/pastel-watercolour-quiz-bg-v2.png") center / cover no-repeat;
}

.app-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.42), transparent 42%),
    linear-gradient(rgba(255,255,255,.03), rgba(255,255,255,.03));
}

.app-header {
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: max(12px, env(safe-area-inset-top)) clamp(18px, 4vw, 64px) 10px;
  border-bottom: 1px solid rgba(71, 78, 51, .13);
  background: rgba(255, 251, 243, .46);
  backdrop-filter: blur(12px) saturate(.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(58, 71, 37, .42);
  border-radius: 48% 52% 46% 54% / 52% 45% 55% 48%;
  background: rgba(255, 252, 244, .58);
  font: 600 17px/1 "Cormorant Garamond", serif;
  letter-spacing: .04em;
}

.brand-name {
  font: 600 clamp(20px, 2vw, 25px)/.9 "Cormorant Garamond", serif;
}

.brand-name small {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font: 600 8px/1 "Mulish", sans-serif;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.app-header nav {
  display: flex;
  align-items: center;
  gap: clamp(5px, 1.2vw, 14px);
}

.app-header nav button,
.app-header nav a {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.app-header .book-link {
  padding: 10px 16px;
  border: 1px solid rgba(64, 77, 40, .22);
  border-radius: 999px;
  background: rgba(255, 251, 241, .68);
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  animation: wash-in .42s ease both;
}

@keyframes wash-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.welcome-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(230px, .62fr);
  align-items: center;
  gap: clamp(30px, 7vw, 120px);
  width: min(1180px, calc(100% - 10vw));
  margin: auto;
  padding: clamp(20px, 3vw, 42px) 0;
}

.welcome-copy { max-width: 770px; }

.eyebrow {
  margin: 0 0 13px;
  color: #66704f;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .21em;
  text-transform: uppercase;
}

.welcome-copy h1 {
  max-width: 790px;
  margin: 0;
  font: 600 clamp(46px, 5.6vw, 82px)/.88 "Cormorant Garamond", serif;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.lede {
  max-width: 690px;
  margin: 24px 0 11px;
  color: #4e5947;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.58;
}

.disclaimer {
  margin: 0 0 23px;
  color: #5e6557;
  font-size: 12px;
  line-height: 1.55;
}

.primary-button,
.next-button {
  min-height: 50px;
  min-width: 174px;
  padding: 0 34px;
  border: 0;
  background: transparent url("assets/button-sage-v1.png") center / 100% 100% no-repeat;
  color: #29361f;
  filter: drop-shadow(0 10px 14px rgba(54, 68, 30, .11));
  cursor: pointer;
  font-weight: 700;
}

.primary-button span,
.next-button span { margin-left: 17px; }

.time-note {
  display: inline-block;
  margin: 0 0 0 15px;
  color: #6b7165;
  font-size: 11px;
}

.time-note a { font-weight: 700; }

.specific-quiz .welcome-screen {
  grid-template-columns: minmax(0, 1.58fr) minmax(230px, .58fr);
}

.specific-quiz .welcome-copy h1 {
  font-size: clamp(42px, 4.8vw, 70px);
  line-height: .92;
}

.specific-quiz .lede { max-width: 740px; }

.welcome-note {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(340px, 100%);
  aspect-ratio: 1.5 / 1;
  padding: clamp(44px, 4vw, 58px) clamp(38px, 3.4vw, 51px) clamp(48px, 4.4vw, 63px);
  border: 0;
  background: transparent url("assets/watercolour-reassurance-note-v2.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 22px 34px rgba(77, 72, 49, .1));
  transform: rotate(1.4deg);
}

.welcome-note p {
  margin: 0;
  font: italic 500 clamp(24px, 2.4vw, 34px)/1.04 "Cormorant Garamond", serif;
  text-align: center;
}

.question-screen {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(1000px, calc(100% - 8vw));
  margin: auto;
  padding: clamp(16px, 2.6vw, 34px) 0 clamp(14px, 2vw, 24px);
}

.question-wrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  min-height: 0;
}

.progress-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 0;
}

.progress-area p {
  margin: 0;
  color: #69705f;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.progress-dots {
  display: flex;
  align-items: center;
  gap: 9px;
}

.progress-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(69, 79, 52, .22);
  transition: width .25s ease, background .25s ease;
}

.progress-dots i.done { background: #a9b892; }

.progress-dots i.current {
  width: 27px;
  border-radius: 999px;
  background: var(--olive);
}

.question-wrap form {
  position: relative;
  display: grid;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.question-layout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.question-wrap h2 {
  display: flex;
  align-items: center;
  width: min(920px, 100%);
  margin: 0;
  padding: clamp(16px, 3vh, 34px) 0;
  font: 600 clamp(36px, 4.5vw, 62px)/.98 "Cormorant Garamond", serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.answers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 22px);
}

.answers label { position: relative; cursor: pointer; }

.answers input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.answers span {
  display: grid;
  min-height: clamp(62px, 9vh, 84px);
  place-items: center;
  padding: 12px 15px;
  border: 0;
  color: #435039;
  background: transparent url("assets/button-sage-v1.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 9px 14px rgba(77, 72, 49, .08));
  font: 600 clamp(15px, 1.5vw, 18px)/1.1 "Mulish", sans-serif;
  text-align: center;
  transition: border .2s ease, background .2s ease, transform .2s ease;
}

.answers label:nth-child(2) span {
  background-image: url("assets/button-lilac-v1.png");
}

.answers label:nth-child(3) span {
  background-image: url("assets/button-blush-v1.png");
}

.answers input:checked + span {
  color: #202b18;
  filter: saturate(1.18) contrast(1.05) drop-shadow(0 13px 15px rgba(61, 71, 41, .16));
  transform: translateY(-4px) scale(1.025);
}

.answers input:focus-visible + span {
  outline: 3px solid rgba(92, 109, 61, .34);
  outline-offset: 4px;
}

.answer-error {
  position: absolute;
  right: 0;
  bottom: -19px;
  margin: 0;
  color: #845345;
  font-size: 12px;
}

.question-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 15px;
}

.quiet-button {
  padding: 10px 2px;
  border: 0;
  background: transparent;
  color: #5c6552;
  cursor: pointer;
  font-weight: 600;
}

.next-button { display: none; }

.result-screen {
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 38px);
}

.result-card {
  width: min(930px, 100%);
  max-height: 100%;
  padding: clamp(24px, 3.4vw, 46px) clamp(24px, 4.3vw, 58px);
  overflow: auto;
  border: 1px solid rgba(70, 78, 52, .17);
  border-radius: 30px 48px 28px 44px / 37px 31px 46px 34px;
  background: rgba(255, 252, 245, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(13px) saturate(.85);
  scrollbar-width: thin;
}

.result-card h2 {
  max-width: 780px;
  margin: 0 0 13px;
  font: 600 clamp(35px, 4.3vw, 58px)/.96 "Cormorant Garamond", serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.result-copy {
  max-width: 800px;
  margin: 0;
  color: #4d5846;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.55;
}

.medical-note,
.gentle-step {
  margin: 17px 0 0;
  padding-left: 17px;
  border-left: 3px solid #ddb36a;
  color: #4f5747;
  font-size: 13px;
  line-height: 1.48;
}

.medical-note p { margin: 3px 0 0; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 21px;
}

.result-actions a,
.result-actions button,
.dialog-book {
  min-width: 138px;
  padding: 13px 22px;
  border: 0;
  background: transparent url("assets/button-lilac-v1.png") center / 100% 100% no-repeat;
  color: #334126;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.result-actions a {
  background-image: url("assets/button-sage-v1.png");
  color: #26341f;
}

.result-actions button:last-child { background-image: url("assets/button-blush-v1.png"); }

.dialog-book { background-image: url("assets/button-sage-v1.png"); }

.privacy-note {
  margin: 15px 0 0;
  color: #757b6e;
  font-size: 10px;
}

.app-footer {
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 38px;
  padding: 8px clamp(18px, 4vw, 64px) max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(71, 78, 51, .13);
  background: rgba(255, 251, 243, .62);
  color: #5b6253;
  backdrop-filter: blur(12px);
}

.app-footer p { margin: 0; font-size: 10px; line-height: 1.2; }
.app-footer a { font-weight: 700; }

.info-dialog {
  width: min(680px, calc(100% - 30px));
  max-height: min(82dvh, 720px);
  padding: clamp(26px, 4vw, 50px);
  overflow: auto;
  border: 1px solid rgba(70, 78, 52, .2);
  border-radius: 34px 51px 35px 44px / 44px 33px 48px 38px;
  background: rgba(255, 251, 242, .97);
  color: var(--ink);
  box-shadow: 0 35px 120px rgba(40, 45, 30, .27);
}

.info-dialog::backdrop {
  background: rgba(43, 48, 33, .28);
  backdrop-filter: blur(7px);
}

.info-dialog h2 {
  margin: 0 0 15px;
  font: 600 clamp(32px, 4vw, 48px)/1 "Cormorant Garamond", serif;
}

.info-dialog h3 {
  margin: 0 0 4px;
  font: 600 22px/1 "Cormorant Garamond", serif;
}

.info-dialog p { color: #55604d; font-size: 13px; line-height: 1.58; }

.search-questions {
  margin: 24px 0;
  padding: 20px 22px;
  border: 1px solid rgba(82, 94, 61, .16);
  border-radius: 26px 31px 24px 34px / 31px 24px 33px 27px;
  background: rgba(232, 227, 241, .38);
}

.search-questions ul { display: grid; gap: 8px; margin: 12px 0 14px; padding-left: 20px; }
.search-questions li { color: #35422c; font-size: 13px; line-height: 1.4; }
.search-questions p { margin-bottom: 0; }

.dialog-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(62, 75, 40, .2);
  border-radius: 50%;
  background: rgba(255, 255, 255, .62);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.dialog-links { display: grid; gap: 7px; }
.dialog-links a { color: #475b2e; font-size: 12px; font-weight: 700; }
.reviewed { margin-bottom: 0; font-size: 10px !important; }
.support-option { padding: 13px 0; border-top: 1px solid var(--line); }
.support-option p { margin: 5px 0 8px; }
.crisis-note { margin-top: 10px; padding: 15px; background: rgba(242, 217, 213, .55); }
.crisis-note p { margin: 5px 0 0; }
.noscript { position: fixed; inset: auto 12px 12px; z-index: 99; padding: 12px; background: #fff; }

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(90, 108, 56, .38);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .app-header {
    min-height: 61px;
    padding-inline: 16px;
  }

  .brand-mark { width: 33px; height: 33px; }
  .brand-name { font-size: 19px; }
  .brand-name small { display: none; }
  .app-header nav { gap: 3px; }
  .app-header nav button { padding-inline: 6px; font-size: 11px; }
  .app-header .book-link { padding: 8px 10px; font-size: 11px; }

  .welcome-screen {
    grid-template-columns: 1fr;
    align-content: center;
    width: calc(100% - 38px);
    padding: 14px 0;
  }

  .welcome-copy h1 { font-size: clamp(40px, 12vw, 61px); }
  .lede { margin-top: 17px; font-size: 14px; line-height: 1.45; }
  .disclaimer { margin-bottom: 17px; font-size: 11px; }
  .welcome-note { display: none; }
  .primary-button { min-height: 46px; }

  .question-screen {
    width: calc(100% - 36px);
    padding-top: 15px;
  }

  .progress-area { margin-bottom: 18px; }
  .progress-dots { gap: 5px; }
  .progress-dots i { width: 5px; height: 5px; }
  .progress-dots i.current { width: 18px; }
  .question-wrap h2 { padding-block: 14px; font-size: clamp(31px, 9.3vw, 43px); }
  .answers { gap: 7px; }
  .answers span { min-height: 58px; padding: 8px 5px; font-size: 13px; }
  .next-button { min-width: 120px; min-height: 45px; }
  .question-footer { padding-top: 8px; }

  .result-screen { padding: 13px 16px; }
  .result-card { padding: 22px 20px; border-radius: 24px; }
  .result-card h2 { font-size: clamp(31px, 9vw, 43px); }
  .result-copy { font-size: 13px; line-height: 1.45; }
  .medical-note, .gentle-step { margin-top: 12px; font-size: 11px; }
  .result-actions { margin-top: 15px; }
  .result-actions a, .result-actions button { padding: 9px 12px; font-size: 10px; }

  .app-footer { padding-inline: 16px; }
  .app-footer p { font-size: 8.5px; }
  .app-footer p:last-child { display: none; }
}

@media (max-height: 700px) {
  .app-header { min-height: 58px; padding-top: 9px; padding-bottom: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .welcome-screen { padding-block: 10px; }
  .welcome-copy h1 { font-size: clamp(40px, 5.2vw, 66px); }
  .lede { margin-top: 15px; line-height: 1.4; }
  .disclaimer { margin-bottom: 14px; }
  .primary-button { min-height: 44px; }
  .question-screen { padding-top: 12px; padding-bottom: 10px; }
  .progress-area { margin-bottom: 0; }
  .question-wrap h2 { padding-block: 10px; font-size: clamp(31px, 4vw, 50px); }
  .answers span { min-height: 54px; }
  .result-card { padding-top: 22px; padding-bottom: 22px; }
  .result-card h2 { font-size: clamp(32px, 3.8vw, 48px); }
  .result-copy { line-height: 1.4; }
  .medical-note, .gentle-step { margin-top: 11px; }
  .result-actions { margin-top: 13px; }
  .app-footer { min-height: 30px; padding-top: 5px; padding-bottom: max(5px, env(safe-area-inset-bottom)); }
}

@media (max-height: 560px) {
  .brand-name small,
  .time-note,
  .welcome-note,
  .app-footer p:last-child { display: none; }
  .welcome-screen { grid-template-columns: 1fr; width: min(900px, calc(100% - 50px)); }
  .welcome-copy h1 { font-size: clamp(35px, 4.7vw, 52px); }
  .lede { margin: 10px 0 6px; font-size: 12px; }
  .disclaimer { margin-bottom: 9px; font-size: 10px; }
  .question-wrap h2 { padding-block: 7px; font-size: clamp(29px, 3.6vw, 43px); }
  .answers span { min-height: 46px; }
  .progress-area { margin-bottom: 8px; }
  .question-footer { padding-top: 3px; }
  .result-card { padding: 16px 22px; }
  .result-card h2 { margin-bottom: 8px; font-size: clamp(29px, 3.4vw, 40px); }
  .result-copy { font-size: 12px; }
  .medical-note, .gentle-step { margin-top: 8px; padding-left: 11px; font-size: 10px; }
  .result-actions { margin-top: 9px; }
  .privacy-note { margin-top: 8px; }
}

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