/* The installer's page, in the same Line map as the rest (site.css has the tokens).
   Each step is a stop on the rail; a choice is a stop on a short line of its own; the file is a figure that hangs from a rule. */
html:not(.js) [data-needs-js] { display: none; }

/* The top. */
.intro { padding-block: 56px 0; }
.intro > p { max-width: 46em; }
.intro > * { animation: rise var(--enter) var(--ease) both; }
.intro > :nth-child(2) { animation-delay: var(--step); }
.intro > :nth-child(3) { animation-delay: calc(var(--step) * 2); }
.intro > :nth-child(4) { animation-delay: calc(var(--step) * 3); }
.word i { font-style: normal; }
.intro h1 { font-size: clamp(34px, 5.6vw, 76px); margin-block: 18px 24px; }
.intro h1 .under { display: block; width: fit-content; max-width: 100%; padding-bottom: 0.06em; text-wrap: wrap; }
.intro .fine { margin-top: 16px; }
.intro .need { color: var(--warn); }

/* The steps on the left, the file on the right and in view as you go. */
.install { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); column-gap: 64px; align-items: start; }
.install .part { --gap: 72px; }
.install .head { margin-bottom: 20px; }
.install h2 { font-size: var(--head); margin-block: 10px 10px; }
.install .head > p:last-child { font-size: var(--note); }
@media (max-width: 960px) {
  .install { grid-template-columns: minmax(0, 1fr); }
}

/* A step's stop: accent once reached (site.css), solid where you are, a broken red ring where an answer is wrong. */
main .part.here::before { background: var(--accent); border-color: var(--accent); }
main .part.bad::before { background: var(--bg); border-color: var(--bad); border-style: dashed; }
main .part.bad::after { border-color: var(--bad); }
.install .file::before, .install .file::after { display: none; }

/* Fields: a sunken strip on a 1px ink line; its line turns blue, and thickens as it grows from the left. */
.field { margin-top: 26px; min-width: 0; border: 0; padding: 0; }
.field .field { margin-top: 16px; }
.lab { display: block; padding: 0; margin-bottom: 8px; font-weight: 700; font-size: var(--note); }
.lab .dim { font-weight: 400; font-size: var(--small); }
input[type="text"] {
  display: block; width: 100%; max-width: 36em; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--text); border-radius: 0;
  background-color: var(--sunken); background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 3px;
  color: var(--text); font: 400 14px/1.4 var(--mono); transition: background-size var(--arrive) var(--ease);
}
input[type="text"]::placeholder { color: var(--dim); opacity: 1; }
input[type="text"]:focus-visible { outline: none; background-size: 100% 3px; }
input[aria-invalid="true"] { border-bottom-color: var(--bad); background-image: linear-gradient(var(--bad), var(--bad)); }
.hint, .err { margin-top: 8px; max-width: 60ch; font-size: var(--small); color: var(--dim); }
.err { color: var(--bad); font-weight: 700; animation: arrive var(--arrive) var(--ease) both; }
.warn { margin-top: 4px; padding-left: 14px; border-left: var(--stroke) solid var(--bad); color: var(--bad); font-weight: 700; font-size: var(--note); }

/* Choices are stops on a line: the one chosen is the blue stop. What it needs hangs from a line of its own. */
.choices { margin-left: 8px; border-left: var(--stroke) solid var(--text); }
.choice, .switch { position: relative; cursor: pointer; }
.choice { display: block; padding: 6px 0 8px 30px; }
.choice input, .switch input { position: absolute; left: -10px; top: 8px; width: 18px; height: 18px; margin: 0; opacity: 0; cursor: pointer; }
.stop { position: absolute; left: calc(var(--stroke) / -2 - 9px); top: 9px; width: 18px; height: 18px; border: var(--stroke) solid var(--text); border-radius: 50%; background: var(--bg); transition: background var(--enter), border-color var(--quick), transform var(--quick); }
.choice:hover .stop { border-color: var(--accent); }
.choice input:checked + .stop { border-color: var(--accent); background: radial-gradient(var(--accent) 38%, var(--bg) 42%); animation: pop var(--pop) var(--ease); }
.choice input:focus-visible + .stop, .switch input:focus-visible + .line i { outline: var(--stroke) solid var(--accent); outline-offset: 2px; }
.say { display: block; font-weight: 700; font-size: var(--note); line-height: 1.4; overflow-wrap: anywhere; }
.say small { display: block; margin-top: 2px; color: var(--dim); font-weight: 400; font-size: var(--small); max-width: 56ch; }
.say small a { color: var(--accent-text); }
.choice input:checked ~ .say { font-weight: 800; }
.choice input:checked ~ .say small { font-weight: 400; }
.branch { display: grid; grid-template-rows: 0fr; margin-left: 30px; transition: grid-template-rows var(--enter) var(--ease); }
.branch.open { grid-template-rows: 1fr; }
.branch > div { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s linear var(--enter); }
.branch.open > div { visibility: visible; transition-delay: 0s; }
.branch .field { margin: 6px 0 12px 0; padding-left: 16px; border-left: 1px solid var(--text); }
.branch .field:first-child { margin-top: 6px; }
.words { margin-top: 12px; font-size: var(--small); color: var(--dim); }
.words summary { cursor: pointer; font-weight: 700; color: var(--accent-text); list-style: none; display: flex; align-items: center; gap: 8px; }
.words summary::-webkit-details-marker { display: none; }
.words summary::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--accent-text); border-radius: 50%; transition: background var(--quick); }
.words[open] summary::before { background: var(--accent-text); }
.words p { margin-top: 8px; max-width: 56ch; }

/* A switch is a line with a stop that slides along it, and the line runs blue behind it. */
.switch { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0 16px; align-items: start; }
.switch input { left: 0; top: 1px; width: 52px; height: 24px; }
.line { position: relative; display: block; height: 24px; margin-top: 1px;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 50% / 0 var(--stroke), linear-gradient(var(--text), var(--text)) no-repeat 0 50% / 100% var(--stroke);
  transition: background-size var(--enter) var(--ease); }
.line i { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border: var(--stroke) solid var(--text); border-radius: 50%; background: var(--bg); transition: transform var(--enter) var(--ease), border-color var(--quick), background var(--enter); }
.switch:hover .line i { border-color: var(--accent); }
.switch input:checked + .line { background-size: 100% var(--stroke), 100% var(--stroke); }
.switch input:checked + .line i { transform: translateX(28px); border-color: var(--accent); background: radial-gradient(var(--accent) 38%, var(--bg) 42%); }

/* The file: a figure that hangs from a rule, and stays in view beside the steps. */
.file { position: sticky; top: 84px; margin-top: 72px; padding-top: 0; min-width: 0; }
.file .panel { padding-top: 12px; }
.file figcaption { align-items: center; margin-bottom: 14px; }
.file figcaption b { font: 700 var(--small) var(--mono); }
.file .lamp { flex: none; }
.lamp.bad { border-color: var(--bad); border-style: dashed; background: var(--bg); }
pre { white-space: pre; tab-size: 2; }
#yaml { min-height: 4.4em; }
#yaml .l { display: block; margin-inline: -20px; padding-inline: 20px; }
#yaml .l.new { animation: flash 1.2s var(--ease); }
#yaml .k { color: var(--accent-text); font-weight: 700; }
.status { margin-top: 14px; min-height: 3.1em; font-size: var(--note); color: var(--dim); }
.status.bad { color: var(--bad); font-weight: 700; }
.file .acts { margin-block: 16px 0; gap: 10px; }
.file .button { padding: 8px 16px; }
.file .button::after { content: none; }
.file .get::after { content: "\2193"; margin-left: 10px; }
.file .get:hover::after { transform: translateY(3px); }
.button:disabled, .button:disabled:hover { background: none; color: var(--dim); border: var(--stroke) dashed var(--hair); cursor: not-allowed; }
.button:disabled::after { transform: none; }
@media (max-width: 960px) {
  .file { position: static; margin-top: 56px; }
}

/* The stick first, then the steps, then writing it and the key; netboot is a branch off the rail beside the stick. */
#stick .head, #recovery .head { margin-bottom: 20px; }
#stick .head > p:last-child, #writing .head > p:last-child, #recovery .head > p:last-child { max-width: 56ch; font-size: var(--note); }
#stick h2, #writing h2, #recovery h2 { font-size: var(--head); margin-block: 10px 10px; }
#writing .head { margin-bottom: 20px; }
#writing .keep { margin-bottom: 32px; max-width: 56ch; }
#writing .path { margin-top: 12px; }
#writing .path li { padding-bottom: 20px; }
#writing .path li:last-child { padding-bottom: 0; }
#writing .path li::before { top: 4px; }
#writing .panel pre { margin-top: 4px; }
#recovery .fine { max-width: 56ch; }
.hint.key { margin-top: 14px; padding-left: 14px; border-left: var(--stroke) solid var(--warn); color: var(--text); }
.cmd { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 16px; padding: 14px 16px; }
.cmd.live { animation: flash 1.2s var(--ease); }
#installUrl { max-width: none; }
.example { margin-top: 48px; }
.net { position: relative; margin-top: 8px; max-width: 46em; }
.net::before { content: ""; position: absolute; left: calc(7.5px - var(--rail)); top: 14px; width: calc(var(--rail) - 7.5px + 12px); height: var(--stroke); background: var(--text); }
.net::after { content: ""; position: absolute; left: calc(7.5px - var(--rail) - 6px + var(--stroke) / 2); top: calc(14px - 6px + var(--stroke) / 2); width: 12px; height: 12px; border: var(--stroke) solid var(--text); border-radius: 50%; background: var(--bg); }
.net h3 { margin-left: 24px; margin-bottom: 6px; }
.net p { margin-left: 24px; color: var(--dim); font-size: var(--note); }
#recovery .acts, #writing .acts { margin-top: 28px; }

.toast { position: fixed; z-index: 5; right: var(--gutter); bottom: var(--gutter); max-width: calc(100vw - 2 * var(--gutter)); padding: 10px 16px; background: var(--text); color: var(--bg); font-weight: 700; font-size: var(--note); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity var(--arrive) var(--ease), transform var(--arrive) var(--ease); }
.toast.on { opacity: 1; transform: none; }

@keyframes flash { from { background-color: color-mix(in srgb, var(--accent) 24%, transparent); } }

@media (max-width: 720px) {
  .intro { padding-top: 32px; }
  .install .part { --gap: 56px; }
  input[type="text"] { font-size: 16px; } /* under 16px, iOS zooms the page when a field is focused */
  .file .button { padding: 7px 12px; font-size: var(--small); }
}
@media (prefers-reduced-motion: reduce) {
  .branch, .branch > div { transition: none !important; }
}
