:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #172e27;
  background: #edf2ec;
  --paper: #fbfcf8;
  --dark: #122e26;
  --ink: #172e27;
  --muted: #4a6258;
  --line: #cfdbd0;
  --accent: #d7f586;
  --green: #256347;
  --radius: 1.35rem;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, ul, ol { margin: 0; }
body { min-width: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
a { color: inherit; }
:focus-visible { outline: 3px solid #ac5400; outline-offset: 4px; }
h1[tabindex], h2[tabindex] { scroll-margin-block: 1.5rem; }
h1, h2 { line-height: 1.12; }
p { line-height: 1.55; }
.skip { position: absolute; transform: translateY(-150%); background: var(--paper); padding: .75rem; z-index: 5; }
.skip:focus { transform: none; }

.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner, .main { max-width: 80rem; margin-inline: auto; padding-inline: clamp(1rem, 5vw, 4rem); }
.top-inner { display: flex; align-items: center; gap: 1.4rem; min-height: 4.7rem; }
.wordmark { display: inline-flex; gap: .62rem; align-items: center; font-size: 1.28rem; font-weight: 820; letter-spacing: -.045em; text-decoration: none; }
.logo { width: 1.75rem; aspect-ratio: 1; border-radius: 50%; border: 1px solid #29513e; background: var(--accent); position: relative; }
.logo::before, .logo::after { content: ''; position: absolute; border: 1px solid #29513e; border-radius: 50%; inset: .3rem .49rem; transform: rotate(44deg); }
.logo::after { transform: rotate(-44deg); }
.top-label { color: var(--muted); font-size: .84rem; }
.link-button { margin-left: auto; border: 0; padding: .75rem .15rem; background: none; color: var(--green); font-weight: 720; }
.link-button:hover { text-decoration: underline; text-underline-offset: .25em; }
.main { padding-block: clamp(1.1rem, 5vw, 3.75rem); }
.welcome { display: grid; gap: 1.25rem; }
.hero, .result-summary {
  background: var(--dark);
  color: var(--paper);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 4.6rem);
}
.hero { position: relative; overflow: hidden; isolation: isolate; min-height: 30rem; }
.hero-content { position: relative; z-index: 1; max-width: 36rem; }
.eyebrow { color: var(--green); font-size: .76rem; letter-spacing: .105em; text-transform: uppercase; font-weight: 780; }
.hero .eyebrow, .result-summary .eyebrow { color: var(--accent); }
.hero h1 { font-family: Georgia, serif; font-weight: 500; font-size: clamp(3rem, 7vw, 6.1rem); line-height: .99; letter-spacing: -.065em; margin: .9rem 0 1rem; }
.hero h1 span { color: var(--accent); }
.intro { max-width: 29rem; color: #d9e8dc; margin-bottom: 2rem; }
#start-form label { display: block; color: #e6f0e3; font-weight: 670; font-size: .86rem; margin-bottom: .5rem; }
.form-row { display: flex; gap: .7rem; max-width: 32rem; }
input[name="name"] { width: 100%; min-width: 0; background: #f7faf3; color: var(--ink); border: 1px solid #a9b9a6; border-radius: .55rem; padding: .75rem .85rem; }
.primary, .secondary { min-height: 2.8rem; border-radius: .55rem; padding: .65rem .95rem; font-weight: 750; }
.primary { background: var(--accent); color: #152a21; border: 1px solid #52733f; white-space: nowrap; }
.primary:hover:not(:disabled) { background: #e5ffa2; }
.primary span { margin-left: .3rem; }
.secondary { background: var(--paper); border: 1px solid #829a8b; color: var(--ink); }
.secondary:hover:not(:disabled) { background: #e6f1e7; }

.illustration {
  position: absolute; z-index: -1; top: 50%; right: 1%; width: 49%; aspect-ratio: 1.13; transform: translateY(-50%);
  background: radial-gradient(ellipse at center, #45765088, transparent 69%);
}
.orbit { position: absolute; border: 1px solid #a8dba84d; border-radius: 50%; inset: 9% 6%; transform: rotate(-25deg); }
.orbit-inner { inset: 17% 15%; border-style: dashed; }
.organelle {
  position: absolute; inset: 29% 12% 28%; overflow: hidden;
  border: .35rem solid #b4df91; border-radius: 52% 46% 44% 47% / 59% 52% 54% 45%;
  transform: rotate(-28deg);
  background: radial-gradient(ellipse at 34% 24%, #a3d980, #4d9968 59%, #31654e);
  box-shadow: inset 0 0 0 .3rem #275b43, inset 0 0 0 .52rem #87c78b, 0 0 3rem #9fd77945;
}
.fold { position: absolute; width: 13%; height: 66%; border: clamp(.22rem, .75vw, .65rem) solid #245842; background: #77b47a; }
.fold-one { top: -12%; left: 17%; border-radius: 0 0 65% 48%; transform: rotate(-21deg); }
.fold-two { bottom: -18%; left: 30%; border-radius: 48% 65% 0 0; transform: rotate(-17deg); }
.fold-three { top: -16%; left: 45%; border-radius: 0 0 58% 60%; transform: rotate(-16deg); }
.fold-four { bottom: -15%; left: 57%; border-radius: 65% 60% 0 0; transform: rotate(-13deg); }
.fold-five { top: -17%; left: 72%; border-radius: 0 0 58% 60%; transform: rotate(-11deg); }
.particle { position: absolute; width: .5rem; aspect-ratio: 1; border-radius: 50%; background: var(--accent); box-shadow: 0 0 1rem #d7f586ad; }
.particle-one { top: 20%; right: 22%; }
.particle-two { bottom: 24%; right: 22%; width: .32rem; }
.particle-three { top: 38%; left: 12%; width: .3rem; }
.figure-label { position: absolute; right: 13%; bottom: 12%; color: #d4e8d0; font: .71rem ui-monospace, monospace; letter-spacing: .065em; }
.figure-label::before { content: ''; display: inline-block; width: 2rem; height: 1px; background: #97c399; vertical-align: middle; margin-right: .45rem; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.topics { padding: clamp(1.25rem, 3vw, 2.1rem); }
.topics h2, .result-list h2 { font-size: 1.28rem; margin-bottom: 1rem; }
.topics ul { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.topics li { display: flex; flex-direction: column; gap: .45rem; justify-content: space-between; border-radius: .7rem; background: #edf4e9; padding: 1rem; font-size: .91rem; font-weight: 730; overflow-wrap: anywhere; }
.topic-count { color: var(--muted); font-size: .8rem; font-weight: 560; }

.question-layout { display: grid; grid-template-columns: minmax(13rem, 1fr) minmax(0, 3fr); gap: 1.25rem; align-items: start; }
.progress-panel, .question-panel, .result-list { padding: clamp(1.15rem, 3vw, 2.6rem); }
.counter { margin-top: .55rem; font-size: 1.24rem; font-weight: 790; }
progress { display: block; width: 100%; height: .55rem; margin: .65rem 0; border-radius: .5rem; overflow: hidden; background: #e0eade; color: var(--green); accent-color: var(--green); }
progress::-webkit-progress-bar { background: #e0eade; }
progress::-webkit-progress-value { background: var(--green); }
progress::-moz-progress-bar { background: var(--green); }
.score { color: var(--muted); font-size: .86rem; }
.progress-panel ol { border-top: 1px solid var(--line); list-style: none; margin-top: 1.2rem; padding: .6rem 0 0; }
.progress-panel li { color: var(--muted); padding: .45rem 0 .45rem .7rem; border-left: 3px solid transparent; font-size: .82rem; overflow-wrap: anywhere; }
.progress-panel [aria-current] { color: var(--ink); border-color: var(--green); font-weight: 780; }
.question-panel h1 { font-family: Georgia, serif; font-size: clamp(1.65rem, 4vw, 2.55rem); font-weight: 500; letter-spacing: -.028em; margin: .7rem 0 1.25rem; overflow-wrap: anywhere; }
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: .65rem; color: var(--muted); padding: 0; }
.options { display: grid; gap: .55rem; }
.option { position: relative; display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: .65rem; border: 1px solid var(--line); border-radius: .65rem; padding: .75rem; cursor: pointer; overflow-wrap: anywhere; line-height: 1.4; }
.option:has(input:checked) { border-color: var(--green); background: #eef6e9; }
.option:has(input:enabled):hover { border-color: var(--green); }
.option:has(input:disabled) { cursor: default; }
.option input { margin: 0; width: 1.1rem; height: 1.1rem; accent-color: var(--green); }
.option-letter { display: inline-grid; place-items: center; width: 1.65rem; aspect-ratio: 1; background: #e8f1e4; border-radius: 50%; color: #315743; font-size: .78rem; font-weight: 750; }
.option.correct { background: #e7f4e3; border-color: #5f936e; }
.option.incorrect { background: #fcf0ed; border-color: #ab7065; }
.option-status { grid-column: 3; font-size: .78rem; color: #305d40; font-weight: 740; }
.incorrect .option-status { color: #833c30; }
.actions { display: flex; justify-content: flex-end; margin-top: 1.05rem; }
.feedback { padding: 1.1rem; margin-top: 1.1rem; border-left: 3px solid #6a9a72; border-radius: .45rem; background: #edf4e9; overflow-wrap: anywhere; }
.feedback h2 { font-size: 1.18rem; margin-bottom: .45rem; }
.solution-label { color: var(--muted); font-size: .78rem; font-weight: 750; margin-bottom: .16rem; }
.notice { padding: .75rem 1rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--paper); margin-bottom: 1rem; }
.notice[role="alert"] { border-color: #a86254; color: #782e24; background: #fff3ef; }

.result-layout { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }
.result-summary { padding: clamp(1.5rem, 4vw, 3rem); overflow-wrap: anywhere; }
.result-summary h1 { margin-top: .6rem; font: 500 clamp(2.1rem, 4vw, 3.4rem)/1.05 Georgia, serif; letter-spacing: -.04em; }
.result-score { margin: 1.3rem 0 .3rem; color: #e6f0e3; }
.result-score strong { color: var(--accent); font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1; }
.result-summary .primary { margin-top: 1.4rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem .45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); }
td:nth-child(2) { overflow-wrap: anywhere; }
th:last-child, td:last-child { text-align: right; white-space: nowrap; }
.current-result { background: #e7f4e3; font-weight: 760; }
dialog { width: min(38rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); padding: clamp(1rem, 3vw, 2rem); }
dialog::backdrop { background: #10261db3; }
.dialog-head { display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.dialog-head h2 { font-size: 1.35rem; }

@media (max-width: 67rem) {
  .illustration { right: -4%; }
}
@media (max-width: 54rem) {
  .hero-content { max-width: 100%; }
  .illustration { position: relative; top: auto; right: auto; width: min(100%, 27rem); margin: 1rem auto -.75rem; transform: none; }
  .hero { min-height: 0; }
  .topics ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 45rem) {
  .question-layout, .result-layout { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .progress-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; padding-block: .8rem; column-gap: .5rem; }
  .progress-panel .eyebrow { grid-column: 1; }
  .counter { grid-column: 1; margin: .2rem 0 0; }
  .score { grid-row: 2; grid-column: 2; }
  progress { grid-column: 1 / -1; margin-bottom: .2rem; }
  .progress-panel ol { display: none; }
}
@media (max-width: 29rem) {
  .top-label { display: none; }
  .top-inner { min-height: 3.8rem; }
  .form-row { flex-direction: column; }
  .topics ul { grid-template-columns: 1fr; }
  .option { gap: .45rem; }
  .option-letter { width: 1.35rem; }
}
