:root {
  color-scheme: dark;
  --bg: #111916;
  --panel: #192520;
  --surface: #131e19;
  --line: #3a4b40;
  --text: #f0f5ef;
  --muted: #b2c0b5;
  --accent: #c2f78c;
  --ink: #15210f;
  --warn: #ffce95;
  --esp-tools-button-color: var(--accent);
  --esp-tools-button-text-color: var(--ink);
  --esp-tools-button-border-radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, sans-serif;
}

main {
  max-width: 1100px;
  margin-inline: auto;
  padding: 0 clamp(16px, 4vw, 40px) 24px;
}

a {
  color: var(--accent);
  text-underline-offset: .22em;
}
a:hover { color: var(--text); }

.site-header, .header-actions, .brand, .actions, footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.site-header {
  justify-content: space-between;
  gap: 12px;
  padding-block: 18px;
}

.brand {
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.02em;
  text-decoration: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
}

.header-actions { gap: 14px; }
.header-actions a, footer a { color: var(--muted); font-size: 14px; }
.header-actions a:hover, footer a:hover { color: var(--text); }

select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.language-picker select { font-size: 14px; }

.hero {
  margin-bottom: 20px;
  padding: clamp(24px, 4.5vw, 50px);
  border: 1px solid var(--line);
  border-radius: 21px;
  background: radial-gradient(ellipse at 100% 0%, #354a31, transparent 57%), var(--surface);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; line-height: 1.12; }
h1 {
  max-width: 19ch;
  font-size: clamp(35px, 6vw, 60px);
  letter-spacing: -.055em;
  text-wrap: balance;
}
h2 { font-size: clamp(22px, 2.6vw, 27px); letter-spacing: -.035em; }

.lead {
  max-width: 56ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 17px);
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: clamp(17px, 3vw, 27px);
  background: var(--panel);
}

.install-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.install-heading h2 { min-width: 0; overflow-wrap: anywhere; }

#firmware-version {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 9px;
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.muted, .hint { color: var(--muted); }
.panel p { margin: 12px 0 0; }
.panel .muted { font-size: 15px; }
.hint { font-size: 13px; }
.hint:empty { display: none; }
.error { color: var(--warn); }

.board-field { margin-top: 20px; }
.board-field label { display: block; margin-bottom: 6px; font-weight: 650; }
.board-field select { width: 100%; }
.board-field .hint { margin-top: 6px; }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-block: 18px 14px;
  font-size: 14px;
  cursor: pointer;
}
.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.actions { gap: 8px; }
button, .secondary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

button:disabled { opacity: .5; cursor: not-allowed; }
button:hover:enabled { filter: brightness(1.1); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}
.secondary:hover { border-color: var(--muted); color: var(--text); }
esp-web-install-button { max-width: 100%; color: var(--warn); font-size: 14px; }

.downloads, .panel .privacy {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.usb-panel .actions { margin-top: 16px; }

.usb-result {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 11px 11px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.usb-result p, .usb-result ul { font-size: 14px; }
.usb-result ul { padding-left: 18px; }
.usb-result p:empty, .device-link:has(a[hidden]) { display: none; }

.plain-key {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-family: ui-monospace, monospace;
  overflow-wrap: anywhere;
  cursor: copy;
}
.plain-key:disabled { opacity: 1; cursor: default; }

footer { gap: 8px 18px; padding-top: 20px; }
.trademark-notice { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 13px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .setup-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .site-header { justify-content: flex-start; }
  .install-heading { gap: 8px; }
  #firmware-version { padding-inline: 7px; font-size: 11px; }
}
