:root {
  --terracotta: #c86842;
  --terracotta-dark: #9f4c32;
  --sea: #147d89;
  --sea-dark: #0e5e68;
  --deep: #17353d;
  --deep-soft: #31545a;
  --cream: #f8f1e5;
  --paper: #fffaf2;
  --sand: #e7d6b9;
  --olive: #69744d;
  --sun: #e7b957;
  --line: rgba(23, 53, 61, .16);
  --shadow: 0 18px 42px rgba(23, 53, 61, .14);
  color: var(--deep);
  background: var(--cream);
  font-family: ui-rounded, "Hiragino Maru Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--cream);
}

button,
input,
select {
  font: inherit;
}

button,
label,
a,
input[type="checkbox"],
input[type="radio"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  min-height: 44px;
}

a {
  color: var(--sea-dark);
}

a:hover {
  color: var(--terracotta-dark);
}

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: .75rem;
  z-index: 10;
  padding: .75rem 1rem;
  border-radius: 8px;
  background: var(--deep);
  color: var(--paper);
  transform: translateY(-160%);
}

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

.site-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(248, 241, 229, .97) 0%, rgba(248, 241, 229, .9) 54%, rgba(222, 232, 218, .91) 100%),
    url("/assets/generated/mediterranean-garden.webp") center / cover fixed;
}

.site-shell::before,
.site-shell::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.site-shell::before {
  top: 6.5rem;
  right: -4rem;
  width: 20rem;
  height: 20rem;
  border: 2rem solid rgba(20, 125, 137, .09);
  border-radius: 48% 52% 58% 42%;
  transform: rotate(18deg);
}

.site-shell::after {
  bottom: -5rem;
  left: -4rem;
  width: 22rem;
  height: 12rem;
  background: repeating-linear-gradient(135deg, rgba(200, 104, 66, .08) 0 1.2rem, transparent 1.2rem 2.4rem);
  transform: rotate(-9deg);
}

.site-header,
.main-content,
.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 94px;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  min-height: 44px;
  color: var(--deep);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 58% 42% 48% 52%;
  background: var(--terracotta);
  color: var(--paper);
  font-size: 1.3rem;
  transform: rotate(-8deg);
}

.brand-kicker,
.eyebrow,
.section-kicker,
.step-label {
  display: block;
  color: var(--sea-dark);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.45;
  text-transform: uppercase;
}

.brand-title {
  display: block;
  font-size: 1.03rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.header-note {
  margin: 0;
  color: var(--deep-soft);
  font-size: .9rem;
}

.main-content {
  padding: 3.5rem 0 5rem;
}

.hero-intro,
.setup-intro {
  max-width: 760px;
}

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--deep);
  letter-spacing: -.035em;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: .98;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.12;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.3;
}

.hero-copy,
.setup-copy {
  max-width: 640px;
  margin: 1.2rem 0 0;
  color: var(--deep-soft);
  font-size: 1.08rem;
  line-height: 1.85;
}

.example-plaque {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .7rem;
  width: fit-content;
  max-width: 100%;
  margin: 1.8rem 0 0;
  padding: .72rem 1rem;
  border: 1px solid rgba(23, 53, 61, .18);
  border-radius: 7px 18px 7px 14px;
  background: linear-gradient(160deg, #c7965e, #b97845);
  box-shadow: 5px 6px 0 rgba(105, 116, 77, .2);
  color: #fff8e9;
  transform: rotate(-1.2deg);
}

.example-plaque span {
  color: #f7d88e;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.example-plaque strong {
  font-family: Georgia, serif;
  font-size: 1.03rem;
  letter-spacing: .02em;
}

.example-plaque b {
  color: #f7d88e;
}

.noscript-note {
  margin-top: 1.5rem;
  color: var(--terracotta-dark);
  font-size: .85rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 2.3rem;
  border-top: 1px solid var(--line);
  color: var(--deep-soft);
  font-size: .78rem;
  line-height: 1.7;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  min-height: auto;
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: start;
}

.setup-intro {
  position: sticky;
  top: 1.5rem;
}

.garden-index {
  display: grid;
  gap: .65rem;
  margin: 2.4rem 0 0;
  padding: 0;
  list-style: none;
}

.garden-index li {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--deep-soft);
  font-size: .9rem;
}

.garden-index li::before {
  display: grid;
  flex: 0 0 1.65rem;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border: 1px solid rgba(20, 125, 137, .36);
  border-radius: 50%;
  color: var(--sea-dark);
  content: counter(garden-step);
  counter-increment: garden-step;
  font-size: .75rem;
  font-weight: 800;
}

.garden-index {
  counter-reset: garden-step;
}

.setup-form {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.2rem, 3vw, 2.1rem);
  border: 1px solid rgba(23, 53, 61, .16);
  border-radius: 19px 7px 23px 9px;
  background: rgba(255, 250, 242, .76);
  box-shadow: var(--shadow);
}

.form-section {
  padding: 0 0 1.2rem;
  border-bottom: 1px solid var(--line);
}

.form-section:last-of-type {
  padding-bottom: 0;
  border-bottom: 0;
}

.form-section > legend,
.form-section > .section-title {
  display: block;
  margin-bottom: .8rem;
  font-size: .98rem;
  font-weight: 850;
}

.section-hint {
  margin: -.35rem 0 .85rem;
  color: var(--deep-soft);
  font-size: .83rem;
  line-height: 1.65;
}

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

.choice-grid.people {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-label {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: .55rem;
  padding: .55rem .62rem;
  border: 1px solid rgba(23, 53, 61, .18);
  border-radius: 8px 13px 7px 11px;
  background: rgba(255, 255, 255, .55);
  color: var(--deep);
  cursor: pointer;
  font-size: .88rem;
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.choice-label:hover {
  border-color: var(--sea);
  background: #fffdf8;
  transform: translateY(-1px);
}

.choice-label input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--sea);
}

.choice-label input:checked + span {
  color: var(--sea-dark);
  font-weight: 800;
}

.group-switches {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: .8rem;
}

.mini-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px 15px 8px 13px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.mini-button {
  padding: .5rem .8rem;
  border-color: rgba(20, 125, 137, .35);
  background: rgba(20, 125, 137, .08);
  color: var(--sea-dark);
  font-size: .78rem;
}

.mini-button:hover,
.button:hover {
  transform: translateY(-2px);
}

.number-field {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.number-field input {
  width: 6.5rem;
  min-height: 48px;
  padding: .5rem .7rem;
  border: 1px solid rgba(23, 53, 61, .25);
  border-radius: 8px 15px 8px 12px;
  background: var(--paper);
  color: var(--deep);
  font-size: 1rem;
  text-align: center;
}

.number-suffix {
  color: var(--deep-soft);
  font-size: .9rem;
}

.radio-row {
  display: grid;
  gap: .6rem;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  min-height: 44px;
  padding: .65rem .75rem;
  border: 1px solid rgba(23, 53, 61, .15);
  border-radius: 9px 17px 9px 13px;
  background: rgba(255, 255, 255, .45);
  cursor: pointer;
  font-size: .88rem;
  line-height: 1.55;
}

.radio-option input {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: .12rem;
  accent-color: var(--terracotta);
}

.radio-option strong {
  display: block;
}

.radio-option small {
  display: block;
  color: var(--deep-soft);
  font-size: .76rem;
}

.form-error,
.storage-notice {
  margin: 0;
  padding: .75rem .85rem;
  border-left: 4px solid var(--terracotta);
  border-radius: 5px 11px 7px 4px;
  background: rgba(200, 104, 66, .11);
  color: var(--terracotta-dark);
  font-size: .84rem;
  line-height: 1.6;
}

.storage-notice {
  border-left-color: var(--sun);
  background: rgba(231, 185, 87, .14);
  color: #73561d;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.button {
  padding: .7rem 1.05rem;
  box-shadow: 0 5px 0 rgba(23, 53, 61, .16);
}

.button:active {
  box-shadow: 0 2px 0 rgba(23, 53, 61, .16);
  transform: translateY(2px);
}

.button-primary {
  background: var(--terracotta);
  color: #fffaf2;
}

.button-primary:hover {
  background: var(--terracotta-dark);
  color: #fffaf2;
}

.button-secondary {
  border-color: rgba(20, 125, 137, .35);
  background: rgba(20, 125, 137, .09);
  color: var(--sea-dark);
}

.button-quiet {
  border-color: rgba(23, 53, 61, .2);
  background: rgba(255, 250, 242, .55);
  color: var(--deep-soft);
}

.saved-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1.6rem 0 0;
  padding: .85rem 1rem;
  border: 1px dashed rgba(105, 116, 77, .52);
  border-radius: 17px 7px 13px 9px;
  background: rgba(105, 116, 77, .1);
}

.saved-strip p {
  margin: 0;
  color: var(--deep-soft);
  font-size: .84rem;
}

.drill-page,
.result-page {
  width: min(940px, 100%);
  margin-inline: auto;
}

.trail-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.trail-title {
  margin-top: .4rem;
  font-size: clamp(1.65rem, 4vw, 3rem);
}

.progress-wrap {
  min-width: 11rem;
  text-align: right;
}

.progress-text {
  display: block;
  color: var(--deep-soft);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  width: 100%;
  height: 8px;
  margin-top: .45rem;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(20, 125, 137, .15);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sea), var(--sun));
  transition: width .25s ease;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr);
  gap: 1.1rem;
  align-items: stretch;
}

.quiz-signpost {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 390px;
  padding: 1.4rem 1.25rem;
  border-radius: 28px 8px 18px 5px;
  background: var(--sea);
  box-shadow: inset -12px 0 0 rgba(255, 255, 255, .08), 10px 10px 0 rgba(200, 104, 66, .2);
  color: #f8f1e5;
  transform: rotate(-1.1deg);
}

.quiz-signpost .section-kicker {
  color: #bce1dd;
}

.signpost-verb {
  margin-top: 1rem;
  color: #fffaf2;
  font-family: Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.signpost-meaning {
  margin: .65rem 0 0;
  color: #e0f1ed;
  font-size: .94rem;
  line-height: 1.55;
}

.signpost-path {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #f7d88e;
  font-size: .82rem;
  line-height: 1.5;
}

.signpost-path::before {
  width: .7rem;
  height: .7rem;
  border-radius: 50% 40% 50% 40%;
  background: var(--sun);
  content: "";
  transform: rotate(20deg);
}

.quiz-stage {
  position: relative;
  padding: clamp(1.2rem, 4vw, 2.25rem);
  border: 1px solid rgba(23, 53, 61, .17);
  border-radius: 8px 24px 8px 18px;
  background: rgba(255, 250, 242, .86);
  box-shadow: var(--shadow);
}

.question-prompt {
  margin: .45rem 0 1.6rem;
  font-family: Georgia, serif;
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.question-hint {
  margin: 0 0 1.2rem;
  color: var(--deep-soft);
  font-size: .9rem;
  line-height: 1.65;
}

.answer-form {
  display: grid;
  gap: .7rem;
}

.answer-form label {
  font-size: .86rem;
  font-weight: 800;
}

.answer-input {
  width: 100%;
  min-height: 54px;
  padding: .75rem .9rem;
  border: 2px solid rgba(20, 125, 137, .35);
  border-radius: 7px 17px 7px 13px;
  background: #fffdf8;
  color: var(--deep);
  font-size: 16px;
}

.answer-input:focus {
  border-color: var(--sea);
  box-shadow: 0 0 0 4px rgba(20, 125, 137, .12);
  outline: 0;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: .8rem;
  padding: .25rem .6rem;
  border-radius: 99px;
  background: rgba(105, 116, 77, .14);
  color: var(--olive);
  font-size: .74rem;
  font-weight: 800;
}

.feedback {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px 18px 8px 14px;
  background: rgba(255, 255, 255, .62);
}

.feedback.is-correct {
  border-color: rgba(20, 125, 137, .38);
  background: rgba(20, 125, 137, .09);
}

.feedback.is-wrong {
  border-color: rgba(200, 104, 66, .42);
  background: rgba(200, 104, 66, .09);
}

.feedback-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  font-size: 1.05rem;
}

.feedback-answer {
  margin: .65rem 0 0;
  font-size: 1rem;
  line-height: 1.7;
}

.feedback-answer strong {
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.feedback-note {
  margin: .55rem 0 0;
  color: var(--deep-soft);
  font-size: .84rem;
  line-height: 1.7;
}

.result-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.4rem;
}

.score-badge {
  display: grid;
  min-width: 8.2rem;
  padding: .75rem 1rem;
  border-radius: 8px 20px 8px 17px;
  background: var(--terracotta);
  color: #fffaf2;
  text-align: center;
  transform: rotate(2deg);
}

.score-badge strong {
  font-size: 1.85rem;
  line-height: 1;
}

.score-badge span {
  margin-top: .3rem;
  font-size: .75rem;
}

.result-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: 1.4rem;
}

.result-stat {
  padding: .85rem .95rem;
  border-top: 3px solid var(--sea);
  background: rgba(255, 250, 242, .75);
}

.result-stat:nth-child(2) {
  border-top-color: var(--sun);
}

.result-stat:nth-child(3) {
  border-top-color: var(--terracotta);
}

.result-stat span {
  display: block;
  color: var(--deep-soft);
  font-size: .75rem;
}

.result-stat strong {
  display: block;
  margin-top: .25rem;
  font-size: 1.35rem;
}

.result-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: 1.1rem;
  align-items: start;
}

.result-list,
.info-section {
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(23, 53, 61, .15);
  border-radius: 17px 7px 14px 8px;
  background: rgba(255, 250, 242, .76);
}

.result-list h3,
.info-section h3 {
  margin-bottom: .8rem;
}

.mistake-list {
  display: grid;
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mistake-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .65rem;
  align-items: center;
  padding: .65rem .7rem;
  border-left: 4px solid var(--terracotta);
  background: rgba(200, 104, 66, .08);
}

.mistake-item strong {
  font-family: Georgia, serif;
  font-size: .98rem;
}

.mistake-item span {
  color: var(--deep-soft);
  font-size: .8rem;
}

.mistake-count {
  padding: .25rem .45rem;
  border-radius: 99px;
  background: rgba(200, 104, 66, .17);
  color: var(--terracotta-dark) !important;
  font-size: .7rem !important;
  font-weight: 800;
  white-space: nowrap;
}

.empty-note {
  margin: 0;
  color: var(--deep-soft);
  font-size: .86rem;
  line-height: 1.65;
}

.info-section {
  display: grid;
  gap: 1rem;
}

.info-section p,
.info-section li {
  color: var(--deep-soft);
  font-size: .82rem;
  line-height: 1.7;
}

.info-section p {
  margin: 0;
}

.info-section ul {
  margin: 0;
  padding-left: 1.15rem;
}

.result-actions {
  margin-top: 1.2rem;
}

.print-only {
  display: none;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
  background: var(--cream);
}

.error-panel {
  width: min(550px, 100%);
  padding: 2rem;
  border-radius: 9px 24px 9px 17px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}

.error-panel p:not(.eyebrow) {
  margin: 1rem 0 1.5rem;
  color: var(--deep-soft);
}

@media (max-width: 800px) {
  .setup-layout,
  .quiz-layout,
  .result-columns {
    grid-template-columns: 1fr;
  }

  .setup-intro {
    position: static;
  }

  .quiz-signpost {
    min-height: auto;
    transform: none;
  }

  .signpost-path {
    margin-top: 1.3rem;
  }
}

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

  .site-header {
    justify-content: center;
    padding: 1.1rem 0;
  }

  .header-note {
    display: none;
  }

  .main-content {
    padding-top: 2.25rem;
  }

  .choice-grid,
  .choice-grid.people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trail-header,
  .result-heading {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .progress-wrap {
    width: 100%;
    text-align: left;
  }

  .result-map {
    grid-template-columns: 1fr;
  }

  .score-badge {
    transform: none;
  }

  .button-row .button {
    flex: 1 1 12rem;
  }
}

@media (max-width: 360px) {
  .site-header,
  .main-content,
  .site-footer {
    width: min(100% - 1.1rem, 1120px);
  }

  .setup-form,
  .quiz-stage,
  .result-list,
  .info-section {
    padding-inline: .85rem;
  }

  .choice-grid,
  .choice-grid.people {
    grid-template-columns: 1fr;
  }

  .example-plaque {
    gap: .45rem;
    padding-inline: .7rem;
  }
}

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

@media print {
  :root {
    background: white;
  }

  body,
  .site-shell {
    background: white !important;
  }

  .site-header,
  .site-footer,
  .result-actions,
  .print-hide {
    display: none !important;
  }

  .main-content {
    width: 100%;
    padding: 0;
  }

  .result-page {
    width: 100%;
  }

  .result-list,
  .info-section,
  .result-stat {
    box-shadow: none;
    break-inside: avoid;
  }

  .print-only {
    display: block;
    margin: 0 0 1rem;
    font-size: .8rem;
  }
}
