/* PopVend: a neutral canvas and bold primary-color parts. */
:root {
  --canvas: #fafafa;
  --surface: #ffffff;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --red: #f24822;
  --blue: #3787ff;
  --blue-dark: #1d4ed8;
  --green: #14c77b;
  --yellow: #ffd43b;
  --blue-soft: #edf3ff;
  --green-soft: #eefaf4;
  --yellow-soft: #fff7d1;
  --neutral: #f1f2f4;
  --dot: #c4c7cc;
  --toggle-track: #e4e6ea;
  --control-border: #858a94;
  --warning-border: #8a711f;
  --error: #b42318;
  --machine-side: #2155c9;
  --machine-top: #6da7ff;
  --light-on: #8bf0bc;
  --shadow-soft: #20212420;
  --border-soft: #20212433;
  --surface-glass: #ffffffb3;
  --dialog-shadow: #20212440;
  --backdrop: #2021249c;
  --shadow: 4px 5px 0 var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 16px/1.6 'Trebuchet MS', Arial, sans-serif; }
a { color: inherit; text-underline-offset: 4px; }
button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 5px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.1; }
h1 { font-size: clamp(52px, 6.3vw, 86px); letter-spacing: -5px; font-weight: 900; }
h2 { font-size: clamp(32px, 3.7vw, 48px); letter-spacing: -2px; }
h3 { font-size: 23px; letter-spacing: -.8px; }
h1 em, h2 em { font-style: normal; color: var(--blue-dark); }
p + p { margin-top: 14px; }
.wrap { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.eyebrow, .step-label { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 11px; font-weight: 600; line-height: 1.6; letter-spacing: 1.2px; text-transform: uppercase; }
.eyebrow { margin-bottom: 20px; }
.status-dot { display: inline-block; width: 8px; height: 8px; background: var(--green); border: 1px solid var(--ink); border-radius: 50%; margin-right: 7px; }
.icon { display: block; width: 44px; height: 44px; flex: none; }
.nav { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; font-size: 33px; font-weight: 900; letter-spacing: -1.8px; text-decoration: none; line-height: 1; }
.wordmark img { margin-right: 12px; transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.wordmark:hover img { transform: rotate(-10deg); }
.wordmark-dot { color: var(--red); }
.nav nav { display: flex; align-items: center; gap: 30px; }
.nav nav > a:not(.button) { font-size: 14px; text-decoration: none; font-weight: bold; }
.nav nav > a:not(.button):hover, .text-link:hover { color: var(--blue-dark); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 52px; padding: 12px 22px; background: var(--ink); color: var(--surface); border: 2px solid var(--ink); border-radius: 10px; font-size: 14px; font-weight: bold; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--blue); }
.button:active:not(:disabled) { transform: translate(0); box-shadow: none; }
.button span { font-size: 20px; line-height: 1; }
.button.small { min-height: 43px; padding: 8px 16px; font-size: 13px; background: var(--yellow); color: var(--ink); }
.button.secondary { background: var(--surface); color: var(--ink); }
.full { width: 100%; }
.text-link { font-size: 14px; font-weight: bold; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 25px; margin-top: 28px; }
.hero, .machine-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; padding-block: 65px 70px; }
.hero-copy { padding-block: 10px; }
.lead { max-width: 430px; margin-top: 25px; font-size: 18px; color: var(--muted); line-height: 1.65; }
.maker-note { display: flex; align-items: center; gap: 10px; margin-top: 27px; max-width: 360px; font-size: 12px; color: var(--muted); }
.maker-note > span { color: var(--blue-dark); font-size: 32px; line-height: 1; }
.product-display { min-width: 0; position: relative; border: 1.5px solid var(--ink); border-radius: 20px; background-color: var(--neutral); background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 18px 18px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.product-label { display: flex; align-items: center; gap: 4px; margin: 20px 22px 0; font: 10px/1.4 ui-monospace, Consolas, monospace; letter-spacing: 1px; }
.product-label > span:last-child { margin-left: auto; }
.product-label .status-dot { background: var(--red); }
.machine-art { position: relative; min-height: 405px; }
.vending-illustration { display: block; width: 89%; height: 410px; margin: 0 auto; overflow: visible; }
.art-note { position: absolute; top: 14px; left: 20px; z-index: 1; font-family: Georgia, serif; font-size: 16px; font-style: italic; transform: rotate(-9deg); }
.art-note span { display: block; font-size: 30px; text-align: center; line-height: 1; }
.art-spark { position: absolute; font-size: 44px; line-height: 1; }
.spark-one { top: 50px; right: 17px; color: var(--blue-dark); transform: rotate(10deg); }
.spark-two { bottom: 49px; left: 20px; color: var(--blue-dark); font-size: 32px; }
.build-sticker { position: absolute; bottom: 25px; right: -13px; padding: 14px 16px; border: 1.5px solid var(--ink); border-radius: 5px; background: var(--yellow); box-shadow: 3px 3px 0 var(--shadow-soft); font: 10px/1.5 ui-monospace, Consolas, monospace; transform: rotate(-9deg); }
.product-caption { display: flex; justify-content: space-between; gap: 14px; padding: 15px 20px; border-top: 1px solid var(--border-soft); border-radius: 0 0 20px 20px; background: var(--surface-glass); font-size: 10px; }
.machine-photo { display: block; width: 100%; height: 410px; padding: 25px; object-fit: contain; }
.dispensed-card { animation: dispense 2.4s ease-in-out 2; }
.product-display:hover .dispensed-card { animation: dispense-hover 1.3s ease both; }
.machine-light { animation: light-on 1.5s ease-in-out 3; }
.project-strip { border-block: 1px solid var(--line); }
.project-strip > div { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-block: 19px; }
.project-strip span { display: flex; align-items: center; gap: 12px; font: 12px/1.5 ui-monospace, Consolas, monospace; }
.project-strip b { width: 12px; height: 12px; border-radius: 4px; }
.red-dot { background: var(--red); }
.blue-dot { background: var(--blue); }
.green-dot { background: var(--green); }
.project-strip .strip-spark { font-size: 28px; color: var(--blue-dark); line-height: 1; }
.section { padding-block: 78px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 32px; }
.section-heading .eyebrow { margin-bottom: 13px; }
.section-heading > p { max-width: 285px; color: var(--muted); font-size: 15px; }
.flow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.flow-card { padding: 27px; border: 1px solid var(--ink); border-radius: 15px; transition: transform .3s, box-shadow .3s; }
.flow-card:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: 3px 5px 0 var(--ink); }
.scan-card { background: var(--surface); }
.pay-card { background: var(--surface); }
.vend-card { background: var(--surface); }
.flow-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 33px; }
.icon-tile { display: grid; place-items: center; width: 68px; height: 68px; border: 1.5px solid var(--ink); border-radius: 17px; transform: rotate(-6deg); background: var(--red); transition: transform .4s; }
.pay-card .icon-tile { background: var(--yellow); transform: rotate(6deg); }
.vend-card .icon-tile { background: var(--green); }
.flow-card:hover .icon-tile { transform: rotate(5deg); }
.flow-card p { margin-top: 12px; font-size: 14px; line-height: 1.65; }
.scan-line { animation: scan 2s ease-in-out 2; }
.flow-card:hover .scan-line { animation: scan-hover 1.4s ease-in-out; }
.flow-card:hover .icon-card { animation: dispense-hover 1s ease; }
.flow-card:hover .icon-check { animation: wiggle .6s ease; transform-origin: center; }
.connection-note { display: flex; align-items: center; gap: 12px; margin-top: 23px; color: var(--muted); font-size: 12px; }
.connection-note .icon { width: 24px; height: 24px; }
.build-banner { display: flex; align-items: center; gap: 28px; padding: 36px; background: var(--yellow); border: 1.5px solid var(--ink); border-radius: 16px; margin-bottom: 65px; box-shadow: var(--shadow); }
.banner-icon { font-size: 86px; line-height: 1; }
.build-banner .eyebrow { margin-bottom: 10px; }
.build-banner h2 { font-size: 30px; letter-spacing: -1px; }
.build-banner p:last-child { margin-top: 12px; font-size: 14px; }
.build-banner .button { margin-left: auto; flex: none; }
.build-banner:hover .banner-icon { animation: wiggle .7s ease; }
.footer { border-top: 1px solid var(--line); padding-block: 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer .wordmark { font-size: 26px; }
.footer p, .footer > a:last-child { font-size: 12px; color: var(--muted); }
.breadcrumb { display: inline-block; margin-bottom: 25px; font-size: 12px; color: var(--muted); }
.machine-hero { padding-top: 40px; }
.machine-hero h1 { font-size: clamp(48px, 5.6vw, 72px); letter-spacing: -3.6px; }
.specs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.specs span { border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; font: 11px/1.5 ui-monospace, Consolas, monospace; background: var(--surface); }
.build-section { padding-block: 70px; }
.build-section + .build-section { border-top: 1px solid var(--line); }
.build { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.build h2 { margin-bottom: 18px; }
.build p { color: var(--muted); max-width: 460px; font-size: 15px; }
.video-card { display: flex; align-items: center; gap: 22px; border: 1.5px solid var(--ink); border-radius: 15px; padding: 28px; background: var(--surface); }
.video-card h3 { margin-bottom: 10px; }
.video-card p, .video-card a { font-size: 13px; }
.video-card .icon-tile { flex: none; background: var(--red); }
.video-card:hover .icon-tile { animation: wiggle .6s ease; }
#build, .setup-section { background-color: var(--neutral); background-image: radial-gradient(var(--dot) .7px, transparent .7px); background-size: 12px 12px; }
#build { border-top: 1px solid var(--line); }
.setup-section { border-block: 1px solid var(--line); padding-block: 70px; }
.setup-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 85px; align-items: start; }
.setup-layout aside { position: sticky; top: 30px; }
.setup-layout aside h2 { font-size: 58px; letter-spacing: -2.7px; margin-bottom: 23px; }
.setup-layout aside > p { max-width: 320px; color: var(--muted); }
.setup-layout aside .eyebrow { color: var(--ink); }
.setup-aside-icon { display: grid; place-items: center; width: 70px; height: 70px; border: 1.5px solid var(--ink); border-radius: 18px; margin-bottom: 25px; background: var(--green); transform: rotate(-7deg); }
.build-step-icon { background: var(--red); }
.build-section:nth-child(even) .build-step-icon { background: var(--yellow); transform: rotate(7deg); }
.prep { padding-left: 22px; margin-block: 28px; }
.prep li { padding-left: 7px; margin-bottom: 17px; font-size: 14px; }
.prep li::marker { font-family: ui-monospace, Consolas, monospace; color: var(--blue-dark); font-weight: bold; }
.privacy { border-top: 1px solid var(--line); padding-top: 18px; font-size: 12px; color: var(--muted); }
fieldset { border: 0; padding: 0; min-width: 0; }
.setup-panel { background: var(--surface); border: 1.5px solid var(--ink); border-radius: 16px; padding: 30px; box-shadow: 3px 4px 0 var(--shadow-soft); }
/* Native radios keep method switching usable without JavaScript. */
.firmware-methods { margin: 0; min-width: 0; position: relative; }
.firmware-methods > legend { padding: 0; margin-bottom: 13px; font-size: 13px; font-weight: bold; }
.method-radio { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.method-toggle { display: grid; grid-template-columns: 1fr 1fr; position: relative; isolation: isolate; padding: 6px; border: 1.5px solid var(--ink); background: var(--toggle-track); border-radius: 14px; margin-bottom: 22px; }
.method-slider { position: absolute; z-index: -1; inset: 6px auto 6px 6px; width: calc((100% - 12px)/2); border-radius: 9px; background: var(--ink); transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.method-toggle label { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 8px; border-radius: 9px; cursor: pointer; font-size: 15px; font-weight: bold; line-height: 1.3; transition: color .2s; }
.method-toggle small { display: block; font-size: 10px; font-weight: normal; margin-top: 5px; }
.method-toggle .experimental-label { font-weight: bold; }
.method-icon { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: 23px; }
#method-usb:checked ~ .method-toggle .method-slider { transform: translateX(100%); }
#method-arduino:checked ~ .method-toggle label[for=method-arduino], #method-usb:checked ~ .method-toggle label[for=method-usb] { color: var(--surface); }
#method-arduino:checked ~ .method-toggle label[for=method-arduino] .method-icon, #method-usb:checked ~ .method-toggle label[for=method-usb] .method-icon { animation: wiggle .6s ease both; }
#method-arduino:focus-visible ~ .method-toggle label[for=method-arduino], #method-usb:focus-visible ~ .method-toggle label[for=method-usb] { outline: 3px solid var(--blue-dark); outline-offset: 5px; }
#method-arduino:not(:checked) ~ #arduino-method, #method-usb:not(:checked) ~ #usb-method { display: none; }
.method-panel { animation: arrive .4s ease-out both; min-width: 0; }
.method-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.method-heading .eyebrow { font-size: 10px; margin: 0; }
.method-emblem { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border: 1px solid var(--ink); border-radius: 15px; background: var(--green); font: bold 22px ui-monospace, Consolas, monospace; transform: rotate(-7deg); }
.arduino-card > h3 { font-size: 29px; margin-bottom: 13px; }
.arduino-card > p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.arduino-steps { list-style: none; counter-reset: arduino; padding: 0; margin: 28px 0 0; }
.arduino-steps > li { counter-increment: arduino; position: relative; border-top: 1px solid var(--line); padding: 22px 0 0 38px; margin-top: 22px; }
.arduino-steps > li::before { content: counter(arduino); position: absolute; left: 0; top: 22px; width: 26px; height: 26px; border: 1px solid var(--ink); border-radius: 8px; background: var(--yellow); display: grid; place-items: center; font: bold 12px ui-monospace, Consolas, monospace; transform: rotate(-5deg); }
.arduino-steps > li:nth-child(2)::before { background: var(--green); transform: rotate(5deg); }
.arduino-steps > li:nth-child(3)::before { background: var(--blue); }
.arduino-steps h4 { font-size: 17px; line-height: 1.4; margin-bottom: 12px; }
.arduino-steps p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.arduino-steps strong { color: var(--ink); }
.library-list { list-style: none; padding: 5px 13px; margin: 16px 0; background: var(--canvas); border: 1px solid var(--line); border-radius: 9px; }
.library-list li { padding: 8px 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; font-size: 13px; }
.library-list li + li { border-top: 1px solid var(--line); }
.library-list span { font-size: 12px; color: var(--muted); }
.serial-prompts { padding: 5px 15px; margin-block: 16px; border-left: 3px solid var(--blue-dark); background: var(--blue-soft); border-radius: 0 8px 8px 0; }
.serial-prompts > div { padding-block: 8px; }
.serial-prompts dt { font-size: 13px; font-weight: bold; margin-bottom: 4px; }
.serial-prompts dd { margin: 0; font-size: 13px; color: var(--muted); }
.arduino-steps .arduino-tip { font-size: 12px; background: var(--canvas); padding: 13px; border-radius: 8px; margin: 16px 0 0; }
.experimental-notice { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border: 1px solid var(--warning-border); border-radius: 12px; background: var(--yellow-soft); }
.experimental-notice > span { font-size: 32px; line-height: 1; }
.experimental-notice p { font-size: 13px; }
.experimental-notice strong { display: block; margin-bottom: 3px; }
.usb-prep { font-size: 13px; color: var(--muted); margin: 16px 4px 20px; }
.start-card { text-align: center; padding: 35px 30px; }
.start-card h3 { font-size: 30px; margin-bottom: 15px; }
.start-card > p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.setup-symbol { display: grid; place-items: center; width: 88px; height: 88px; margin: 0 auto 25px; border-radius: 24px; border: 1px solid var(--ink); background: var(--blue); font-size: 62px; line-height: 1; transform: rotate(-8deg); }
.start-card:hover .setup-symbol { animation: wiggle .7s ease; }
.start-journey { display: flex; justify-content: center; gap: 12px; margin-block: 25px; }
.start-journey span { border: 1px solid var(--line); border-radius: 20px; padding: 6px 13px; font-size: 12px; }
.field-hint { display: block; font-size: 12px !important; color: var(--muted); line-height: 1.5; margin: 10px 0 0 !important; }
/* USB installer and serial monitor. */
.setup-open { overflow: hidden; }
.setup-dialog { border: 2px solid var(--ink); border-radius: 20px; background: var(--canvas); color: var(--ink); width: min(660px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 28px 34px; box-shadow: 8px 9px 0 var(--dialog-shadow); overflow-y: auto; overscroll-behavior: contain; }
.setup-dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(5px); }
.setup-dialog[open], .wizard-step:not([hidden]), #conversation-content { animation: arrive .3s ease-out; }
.wizard-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.wizard-head .wordmark { font-size: 28px; }
.dialog-close { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--ink); border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: 27px; line-height: 1; }
.wizard-tabs { display: flex; gap: 22px; padding: 0; margin: 0 0 26px; list-style: none; font-size: 14px; font-weight: bold; }
.wizard-tabs li { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.wizard-tabs li span { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.wizard-tabs li[aria-current=step] { color: var(--ink); }
.wizard-tabs li[aria-current=step] span { background: var(--green); border-color: var(--ink); }
.setup-dialog h2 { font-size: 35px; letter-spacing: -1.5px; margin-bottom: 12px; }
#dialog-intro { color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.wizard-step > label, .wizard-step fieldset > label:not(.hide-reply) { display: block; font-size: 14px; font-weight: bold; margin-bottom: 10px; }
input:not([type=checkbox]), select { display: block; width: 100%; min-width: 0; min-height: 50px; padding: 12px; border: 1px solid var(--control-border); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 16px; }
input::placeholder { color: var(--muted); }
input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--blue-dark); }
.wizard-step .check { display: flex; align-items: flex-start; gap: 10px; margin-block: 25px; font-weight: normal; font-size: 14px; }
.text-button { border: 0; background: transparent; color: var(--blue-dark); font-size: 13px; font-weight: bold; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
.wizard-alternative { display: block; margin: 16px auto 0; font-size: 14px; }
.wizard-footnote { color: var(--muted); font-size: 12px; margin-top: 18px; }
.wizard-error { color: var(--error); font-size: 14px; }
.wizard-error:empty, .serial-status:empty { display: none; }
.upload-emblem { display: grid; place-items: center; width: 88px; height: 88px; margin: 12px auto 25px; border: 1px solid var(--ink); border-radius: 25px; background: var(--yellow); font-size: 60px; }
.progress-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-bottom: 20px; }
.progress-heading { display: flex; justify-content: space-between; gap: 20px; font-size: 14px; }
progress { width: 100%; height: 12px; accent-color: var(--blue-dark); margin-top: 16px; }
.progress-box p { color: var(--muted); font-size: 14px; margin-top: 10px; }
details { border-bottom: 1px solid var(--line); padding-block: 20px; }
summary { cursor: pointer; font-size: 15px; font-weight: bold; }
details p { color: var(--muted); font-size: 14px; margin-top: 14px; }
.upload-details { margin-top: 20px; }
.activity { padding-left: 20px; font-size: 12px; max-height: 230px; overflow: auto; overflow-wrap: anywhere; }
.activity li { margin-block: 8px; }
.reconnect-card { text-align: center; padding-top: 8px; }
.reconnect-card h3 { font-size: 24px; margin: 16px 0 10px; }
.reconnect-card > p { max-width: 390px; margin: 0 auto 20px; }
.reconnect-card .upload-emblem { margin: 0 auto; background: var(--green); }
.reconnect-card .field-hint { margin: 14px auto 0 !important; }
.talk-intro { margin-bottom: 18px; }
.serial-card { border: 1px solid var(--control-border); background: var(--green-soft); border-radius: 12px; overflow: hidden; }
.serial-output { font: 14px/1.7 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-height: 235px; min-height: 100px; overflow: auto; margin: 0; padding: 16px 18px; tab-size: 2; }
.serial-empty { color: var(--muted); font-size: 14px; padding: 18px 18px 0; }
.serial-status { color: var(--muted); font-size: 13px; margin: 12px 0 20px; }
#serial-form { margin-top: 18px; }
.reply-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.hide-reply { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.hide-reply input { margin: 0; }
.wizard-bottom { margin-top: 25px; }
.troubleshooting { max-width: 840px; }
.troubleshooting h2 { margin-bottom: 25px; }
.error-page { min-height: 60vh; }
.error-page h1 { margin-bottom: 30px; }
.skip { position: absolute; top: -100px; left: 15px; z-index: 10; background: var(--surface); padding: 10px; }
.skip:focus { top: 10px; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0) scale(1); } 35% { transform: rotate(-14deg) scale(1.1); } 65% { transform: rotate(10deg) scale(1.05); } }
@keyframes dispense { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(12px); } }
@keyframes dispense-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
@keyframes light-on { 50% { fill: var(--light-on); } }
@keyframes scan { 0%, 100% { transform: translateY(-7px); } 50% { transform: translateY(7px); } }
@keyframes scan-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(9px); } }
@media (max-width: 1050px) {
  .wrap { width: calc(100% - 48px); }
  .hero, .machine-hero { gap: 35px; }
  h1 { letter-spacing: -3.5px; }
  .setup-layout { gap: 40px; grid-template-columns: .75fr 1.25fr; }
  .flow-card { padding: 22px; }
  .flow-top { gap: 8px; }
  .step-label { font-size: 10px; }
  .build-banner { gap: 22px; padding: 30px; }
  .banner-icon { font-size: 60px; }
  .build-banner h2 { font-size: 26px; }
  .product-caption { font-size: 9px; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .nav { min-height: 85px; gap: 15px; }
  .wordmark { font-size: 28px; }
  .wordmark img { width: 32px; height: 32px; margin-right: 8px; }
  .nav nav { gap: 16px; }
  .nav nav > a:not(.button) { font-size: 12px; }
  .nav nav .button { display: none; }
  .hero, .machine-hero { grid-template-columns: 1fr; padding-block: 38px 48px; gap: 38px; }
  h1 { font-size: clamp(52px, 10vw, 76px); letter-spacing: -3.5px; }
  .lead { font-size: 17px; max-width: 460px; margin-top: 22px; }
  .hero-copy { padding: 0; }
  .maker-note { max-width: none; }
  .product-display { width: calc(100% - 12px); max-width: 510px; margin-inline: auto; }
  .product-caption { font-size: 10px; }
  .project-strip > div { flex-wrap: wrap; gap: 12px 20px; justify-content: center; padding-block: 18px; }
  .project-strip span { font-size: 10px; gap: 7px; }
  .project-strip .strip-spark { display: none; }
  .section { padding-block: 50px; }
  .section-heading { align-items: start; flex-direction: column; gap: 16px; }
  .section-heading > p { max-width: 360px; }
  .flow-grid { grid-template-columns: 1fr; gap: 16px; }
  .flow-card { padding: 25px; }
  .flow-top { margin-bottom: 22px; }
  .flow-card h3 { font-size: 24px; }
  .build-banner { flex-wrap: wrap; gap: 20px; margin-bottom: 48px; padding: 26px; }
  .banner-icon { font-size: 45px; }
  .build-banner > div { flex: 1; min-width: 190px; }
  .build-banner .button { margin-left: 0; }
  .footer { flex-wrap: wrap; gap: 20px 30px; }
  .footer p { flex-basis: 100%; order: 1; }
  .footer > a:last-child { margin-left: auto; }
  .machine-hero h1 { font-size: clamp(46px, 9vw, 68px); letter-spacing: -2.8px; }
  .build, .setup-layout { grid-template-columns: 1fr; gap: 30px; }
  .build-section { padding-block: 45px; }
  .setup-section { padding-block: 45px; }
  .setup-layout aside { position: static; }
  .setup-layout aside h2 { font-size: 44px; }
  .setup-layout aside > p { max-width: none; }
  .setup-aside-icon { width: 58px; height: 58px; margin-bottom: 22px; }
  .prep { margin-block: 22px; }
  .setup-panel { padding: 25px; }
  .setup-dialog { padding: 24px 20px; max-height: calc(100dvh - 24px); }
  .setup-dialog h2 { font-size: 29px; }
  .serial-output { padding: 12px; font-size: 13px; }
  .reply-row { gap: 8px; }
  .reply-row .button { padding: 12px 16px; }
}
@media (max-width: 400px) {
  .nav nav { gap: 12px; }
  .nav .wordmark { font-size: 25px; }
  .nav .wordmark img { width: 28px; height: 28px; }
  .vending-illustration { height: 330px; }
  .machine-art { min-height: 335px; }
  .art-note { font-size: 13px; top: 8px; left: 12px; }
  .build-sticker { padding: 10px; font-size: 8px; right: -8px; }
  .spark-one { font-size: 31px; right: 10px; }
  .product-caption { font-size: 8px; padding: 13px; }
  .method-toggle label { gap: 7px; font-size: 13px; }
  .method-icon { font-size: 18px; }
  .setup-panel { padding: 20px; }
  .arduino-steps > li { padding-left: 34px; }
  .actions { gap: 20px; }
  .video-card { padding: 20px; gap: 17px; }
  .video-card .icon-tile { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Machine photo gallery and fullscreen viewer. */
.machine-gallery { padding-block: 12px 54px; }
.gallery-heading { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.gallery-heading h2 { font-size: 30px; letter-spacing: -1px; }
.gallery-heading p { color: var(--muted); font-size: 14px; }
.gallery-thumbnails { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 260px)); gap: 18px; }
.gallery-thumbnail { display: block; position: relative; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--neutral); }
.gallery-thumbnail:hover { box-shadow: 3px 4px 0 var(--ink); }
.gallery-thumbnail img { display: block; width: 100%; height: 200px; padding: 12px; object-fit: contain; }
.gallery-expand { position: absolute; bottom: 10px; right: 10px; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--ink); border-radius: 8px; background: var(--yellow); font-size: 22px; line-height: 1; }
html.gallery-open { overflow: hidden; }
.gallery-viewer { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #111318; color: #fff; overflow: hidden; overscroll-behavior: contain; }
.gallery-viewer::backdrop { background: #111318; }
.gallery-viewer[open] { display: grid; place-items: center; }
.gallery-full-image { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 16px; width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 76px 80px 24px; }
.gallery-full-image img { display: block; place-self: center; width: 100%; height: 100%; max-width: 1100px; max-height: 800px; min-width: 0; min-height: 0; object-fit: scale-down; }
.gallery-full-image figcaption { text-align: center; font-size: 14px; overflow-wrap: anywhere; max-height: 20dvh; overflow: auto; }
.gallery-control { position: absolute; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #ffffff66; border-radius: 50%; background: #292d36; color: #fff; font-size: 27px; line-height: 1; }
.gallery-control:hover { background: #454b58; }
.gallery-viewer :focus-visible { outline-color: var(--yellow); }
.gallery-close { top: 16px; right: 16px; }
.gallery-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.gallery-next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .gallery-thumbnails { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gallery-thumbnail img { height: 160px; padding: 8px; }
  .gallery-full-image { padding: 76px 12px 92px; }
  .gallery-prev, .gallery-next { top: auto; bottom: 20px; transform: none; }
}

/* Shared machine catalog and hero carousel. */
.machine-carousel { min-width: 0; display: grid; }
.machine-slide { grid-area: 1 / 1; min-width: 0; }
.carousel-controls { grid-area: 2 / 1; }
.machine-preview { display: block; text-decoration: none; }
.slide-link { display: block; margin-top: 22px; font-weight: bold; text-align: center; }
.carousel-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }
.carousel-controls button { min-height: 44px; min-width: 44px; border: 1px solid var(--ink); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 8px 12px; font-size: 13px; }
.machine-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 42px; margin-top: 48px; }
.machine-card { min-width: 0; max-width: 550px; }
.machine-card .product-display { transform: none; }
.machine-card h2 { margin: 26px 0 12px; font-size: 30px; letter-spacing: -1px; }
.machine-card p { color: var(--muted); }
.machine-preview:hover .slide-link, .machine-preview:hover h2 { color: var(--blue-dark); }
