/* The Recovery Fuel Lab — muted brown with mauve and dusk-blue tones */
:root {
    --paper: #F5F0F1;      /* mauve-tinged linen */
    --surface: #FFFCFC;
    --ink: #3A2D29;        /* deep cocoa text */
    --bark: #6B5449;       /* muted brown, primary */
    --bark-soft: #8E766A;
    --mauve: #9C7384;      /* accent */
    --mauve-wash: #EFE3E8;
    --dusk: #58718C;       /* slate blue */
    --dusk-wash: #E1E8EF;
    --line: #DDD0D2;
    --petal: #D8B4C2;     /* soft mauve tulip */
    --sage: #9DAA92;      /* muted leaf green */
    --radius-sm: 6px;
    --radius-lg: 14px;
    --serif: "Young Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --sans: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1.0625rem/1.6 var(--sans);
}
.wrap { width: min(100% - 2.5rem, 46rem); margin-inline: auto; }
.is-embed .wrap { width: min(100% - 2rem, 46rem); }

h1, h2, .priority__level, .score__num, .figure__num, .brand__name {
    font-family: var(--serif);
    font-weight: 400;
    color: var(--bark);
    line-height: 1.2;
}
h1 { font-size: clamp(1.85rem, 4.5vw, 2.6rem); margin: 1.75rem 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; margin: 0 0 .75rem; }
p { margin: 0 0 .9rem; }
a { color: var(--dusk); text-underline-offset: .18em; }
a:hover { color: var(--bark); }
.lede { font-size: 1.15rem; color: var(--bark); max-width: 38em; }
.muted { color: var(--bark-soft); }
.small { font-size: .9rem; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: .5rem; left: .5rem; z-index: 10; background: var(--surface); padding: .5rem 1rem; }
:focus-visible { outline: 3px solid var(--dusk); outline-offset: 2px; border-radius: 3px; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-head__inner { display: flex; align-items: center; justify-content: space-between; padding: .85rem 0; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--bark); text-decoration: none; }
.brand__mark { color: var(--bark); display: flex; }
.brand__name { display: block; font-size: 1.15rem; }
.brand__tag { display: block; font-size: .85rem; color: var(--mauve); letter-spacing: .02em; }
.site-head__link { font-weight: 600; font-size: .95rem; }

/* Progress steps (a real sequence, so numbered) */
.steps ol { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin: 1.25rem 0 0; padding: 0; }
.steps li { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; color: var(--bark-soft); }
.steps li::before { content: ""; height: 4px; border-radius: 2px; background: var(--line); }
.steps li.is-done::before { background: var(--mauve); }
.steps li.is-current::before { background: var(--bark); }
.steps li.is-current { color: var(--bark); font-weight: 600; }
.steps__n { font-weight: 700; margin-right: .3rem; }
@media (max-width: 34rem) { .steps__label { display: none; } .steps li.is-current .steps__label { display: inline; } .steps li { white-space: nowrap; } }

/* Buttons */
.btn {
    display: inline-block; border: 0; cursor: pointer;
    background: var(--bark); color: #fff;
    font: 600 1rem/1 var(--sans);
    padding: .95rem 1.4rem; border-radius: var(--radius-sm);
    text-decoration: none;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--bark); box-shadow: inset 0 0 0 1.5px var(--bark); }
.btn--ghost:hover { background: var(--mauve-wash); color: var(--bark); }
.next { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2.25rem 0 1rem; }

/* Home */
.hero { padding: 1rem 0 1.5rem; }
.hero h1 { max-width: 16em; }
.hero__window { margin: 1.75rem 0 2rem; }
.block { margin: 2.5rem 0; }
.block--quiet { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.path { padding-left: 1.3rem; }
.path li { margin-bottom: .8rem; padding-left: .3rem; }
.path li::marker { font-family: var(--serif); color: var(--mauve); }

/* Signature: the recovery window timeline */
.window__track {
    position: relative; height: 3.25rem; border-radius: var(--radius-sm);
    background: repeating-linear-gradient(90deg, var(--dusk-wash) 0 calc(100%/12 - 1px), #fff 0 calc(100%/12));
    border: 1px solid var(--line); overflow: hidden;
}
.window__rapid {
    position: absolute; inset: 0 auto 0 0;
    background: var(--mauve); color: #fff;
    display: flex; align-items: center; padding-left: .8rem;
    font-weight: 600; font-size: .9rem; white-space: nowrap;
}
.window--live .window__rapid { animation: fill 1.1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fill { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.window__next { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--bark); }
.window__marks { display: flex; justify-content: space-between; font-size: .85rem; color: var(--bark-soft); margin-top: .4rem; }
.hero__window .window__marks { position: relative; }
.hero__window .window__marks span:nth-child(2) { position: absolute; left: 50%; transform: translateX(-50%); }
.hero__window .window__track::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 4px; background: var(--bark); }

/* Priority banner */
.priority { margin: 1.75rem 0 2rem; padding: 1.5rem 1.5rem 1rem; border-radius: var(--radius-lg); background: var(--surface); border-left: 8px solid var(--dusk); }
.priority--high { border-left-color: var(--mauve); }
.priority--lower { border-left-color: var(--bark-soft); }
.priority__label { margin: 0; font-weight: 600; color: var(--bark-soft); }
.priority__level { font-size: 2.6rem; margin: 0 0 .5rem; }
.priority--high .priority__level { color: var(--mauve); }

/* The three recovery cards: different accents so they read as a set of distinct jobs */
.r-card { background: var(--surface); border-radius: var(--radius-lg); padding: 1.5rem; margin: 1.25rem 0; border-top: 5px solid var(--bark); }
.r-card--repair { border-top-color: var(--mauve); }
.r-card--rehydrate { border-top-color: var(--dusk); }
.figure { margin: .25rem 0 1rem; }
.figure__num { font-size: 2.1rem; margin: 0; }
.figure__num span { font-family: var(--sans); font-size: 1rem; color: var(--bark-soft); }
.figure p:last-child { color: var(--bark-soft); font-size: .95rem; margin-bottom: 0; }
.why { font-size: .98rem; }
.tip { background: var(--mauve-wash); padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .98rem; }
.note { background: var(--dusk-wash); padding: 1rem 1.2rem; border-radius: var(--radius-sm); margin: 1.25rem 0; }
.note h2 { font-size: 1.15rem; }

.table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .95rem; }
.table caption { text-align: left; font-weight: 600; color: var(--bark); padding-bottom: .4rem; }
.table th { text-align: left; font-weight: 600; color: var(--bark); border-bottom: 2px solid var(--line); padding: .45rem .5rem .45rem 0; }
.table td { border-bottom: 1px solid var(--line); padding: .5rem .5rem .5rem 0; vertical-align: top; }
.block .table { background: var(--surface); }
@media (max-width: 34rem) { .table { font-size: .88rem; } }

/* Forms */
.form { margin-top: 1.5rem; }
.field { margin: 0 0 1.5rem; border: 0; padding: 0; min-width: 0; }
.field legend, .field > label:not(.choice), .foods legend { display: block; font-weight: 600; margin-bottom: .55rem; color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 34rem) { .field-row { grid-template-columns: 1fr; } }
input[type=number], select {
    font: inherit; color: var(--ink); background: var(--surface);
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    padding: .7rem .8rem; width: 100%; max-width: 12rem;
}
input[type=number]:focus, select:focus { border-color: var(--dusk); }
input[aria-invalid=true] { border-color: var(--mauve); background: var(--mauve-wash); }
.input-unit { display: flex; align-items: center; gap: .6rem; }
.input-unit input { max-width: 7rem; }
.input-unit span { color: var(--bark-soft); }
.field__hint { font-size: .88rem; color: var(--bark-soft); margin: .4rem 0 0; }
.field__error { color: #7E4A5E; font-weight: 600; font-size: .92rem; margin: .4rem 0 0; }
.alert { background: var(--mauve-wash); border-left: 5px solid var(--mauve); padding: .8rem 1rem; border-radius: var(--radius-sm); margin: 1rem 0; }
.alert p { margin: 0; }

.choice {
    display: flex; gap: .7rem; align-items: flex-start;
    background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    padding: .75rem .9rem; margin-bottom: .45rem; cursor: pointer;
}
.choice:hover { border-color: var(--bark-soft); }
.choice:has(input:checked) { border-color: var(--bark); background: #FBF6F7; }
.choice input { margin-top: .3rem; accent-color: var(--bark); }
.choice--check { margin: 0 0 1.75rem; max-width: max-content; }

.unit-toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1rem; }
.unit-toggle label { cursor: pointer; }
.unit-toggle input { position: absolute; opacity: 0; }
.unit-toggle span { display: block; padding: .45rem 1.1rem; font-weight: 600; color: var(--bark-soft); background: var(--surface); }
.unit-toggle input:checked + span { background: var(--bark); color: #fff; }
.unit-toggle input:focus-visible + span { outline: 3px solid var(--dusk); outline-offset: -3px; }

.optional { background: var(--surface); border-radius: var(--radius-sm); padding: .8rem 1rem; border: 1px dashed var(--line); }
.optional summary { cursor: pointer; font-weight: 600; color: var(--dusk); }
.optional[open] summary { margin-bottom: 1rem; }

/* Meal builder */
.targets { background: var(--surface); border-radius: var(--radius-sm); padding: .9rem 1.1rem; border-left: 5px solid var(--bark); }
.foods { border: 0; padding: 0; margin: 1.75rem 0; }
.foods legend { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; color: var(--bark); }
.foods__grid { display: grid; gap: .5rem; }
.food { display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.food.is-picked { border-color: var(--mauve); background: #FCF7F9; }
.food__name { font-weight: 600; margin: 0; }
.food__name span { font-weight: 400; color: var(--bark-soft); font-size: .92rem; }
.food__facts { font-size: .88rem; color: var(--dusk); margin: .1rem 0; }
.food__note { font-size: .88rem; color: var(--bark-soft); margin: 0; }
.food__qty select { width: 4.5rem; }
.window { margin-bottom: 1.25rem; }
.sticky-submit { position: sticky; bottom: 0; padding: .9rem 0; background: linear-gradient(to top, var(--paper) 70%, transparent); }

.result { background: var(--surface); border-radius: var(--radius-lg); padding: 1.5rem; margin: 1.5rem 0; }
.checks { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
@media (max-width: 34rem) { .checks { grid-template-columns: 1fr 1fr; } }
.check { border-radius: var(--radius-sm); padding: .8rem; display: grid; gap: .15rem; background: var(--paper); border: 1.5px solid var(--line); }
.check__mark { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.check__label { font-weight: 600; }
.check__num { font-size: .85rem; color: var(--bark-soft); }
.check--met { background: var(--dusk-wash); border-color: var(--dusk); }
.check--met .check__mark { color: var(--dusk); }
.check--partial { background: var(--mauve-wash); border-color: var(--mauve); }
.check--partial .check__mark { color: var(--mauve); }
.check--missing .check__mark { color: var(--bark); }
.feedback p { font-size: .98rem; }

/* Challenge and quiz */
.q { border: 0; padding: 1.25rem; margin: 0 0 1.25rem; background: var(--surface); border-radius: var(--radius-lg); border-left: 5px solid var(--line); min-width: 0; }
.q legend { float: left; width: 100%; font-weight: 600; margin-bottom: .35rem; padding: 0; }
.q legend + * { clear: left; }
.q__n { font-family: var(--serif); font-weight: 400; color: var(--mauve); margin-right: .35rem; }
.q__tag { font-size: .85rem; color: var(--bark-soft); margin: 0 0 .8rem; }
.q--right { border-left-color: var(--dusk); }
.q--wrong { border-left-color: var(--mauve); }
.choice.is-answer { border-color: var(--dusk); background: var(--dusk-wash); }
.q__explain { margin-top: .8rem; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--paper); font-size: .98rem; }
.q__explain p { margin: 0; }

.score { text-align: center; background: var(--surface); border-radius: var(--radius-lg); padding: 1.75rem 1.5rem 1rem; margin: 1.5rem 0; }
.score__num { font-size: 4rem; margin: 0; line-height: 1; }
.score__label { font-weight: 600; color: var(--mauve); }

.refs { padding-left: 1.2rem; }
.refs li { margin-bottom: 1rem; padding-left: .3rem; overflow-wrap: anywhere; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0 2.5rem; font-size: .88rem; color: var(--bark-soft); }
.site-foot p { max-width: 42em; }

@media (prefers-reduced-motion: reduce) {
    .window--live .window__rapid { animation: none; }
}
