:root {
  color-scheme: dark;
  --bg: #07090c;
  --surface: rgba(17, 21, 26, 0.82);
  --surface-strong: #11151a;
  --border: rgba(255, 255, 255, 0.12);
  --muted: #9ba4af;
  --text: #f6f7f8;
  --orange: #ff8a00;
  --orange-light: #ffb13b;
  --green: #72db8c;
  --danger: #ff5d57;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 5%, rgba(255, 138, 0, 0.1), transparent 28rem),
    radial-gradient(circle at 90% 35%, rgba(255, 138, 0, 0.07), transparent 25rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(255, 166, 45, 0.45) 0 1px, transparent 1.5px);
  background-position: 0 0, 37px 63px;
  background-size: 118px 118px, 173px 173px;
  opacity: 0.18;
  content: "";
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: rgba(255, 138, 0, 0.07);
  filter: blur(90px);
  pointer-events: none;
}

.ambient-one { top: -13rem; left: -10rem; }
.ambient-two { right: -16rem; bottom: 8rem; }

.site-header,
main,
footer {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 138, 0, 0.55);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--orange-light), #df6400);
  box-shadow: 0 0 34px rgba(255, 138, 0, 0.2);
  color: #160b00;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
  letter-spacing: 0.21em;
}

.brand small {
  margin-top: 5px;
  color: var(--orange-light);
  font-size: 0.64rem;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.version {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}

main {
  padding: 34px 0 70px;
}

.product-intro {
  display: grid;
  grid-template-columns: minmax(340px, 1.1fr) minmax(300px, 0.9fr);
  align-items: center;
  gap: clamp(36px, 7vw, 88px);
  min-height: 650px;
}

.hero-visual {
  position: relative;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 138, 0, 0.25);
  border-radius: 26px;
  background: #020304;
  box-shadow: var(--shadow), 0 0 80px rgba(255, 111, 0, 0.12);
}

.hero-visual::after {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  content: "";
  pointer-events: none;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  object-fit: cover;
}

.image-caption {
  position: absolute;
  right: 26px;
  bottom: 25px;
  left: 26px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #d8dce1;
  font-size: 0.69rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--orange-light);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 15ch;
  margin-bottom: 22px;
  font-size: clamp(2.6rem, 5.5vw, 4.8rem);
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.lead {
  max-width: 610px;
  margin-bottom: 24px;
  color: #b5bdc6;
  font-size: 1.02rem;
}

.feature-list {
  display: grid;
  gap: 9px;
  margin-top: 28px;
}

.feature-list article {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 13px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.feature-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 138, 0, 0.35);
  border-radius: 10px;
  color: var(--orange-light);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.68rem;
}

.feature-list strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.88rem;
}

.feature-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.scope-note {
  margin: 16px 0 0;
  color: #747d87;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.installer {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(340px, 1.1fr);
  gap: clamp(28px, 6vw, 70px);
  align-items: center;
  margin-top: 62px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(255, 138, 0, 0.22);
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(255, 138, 0, 0.055), transparent 45%),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.installer h2 {
  max-width: 14ch;
  margin-bottom: 14px;
}

.installer-copy > p:last-child {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.precautions {
  margin-top: 90px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(114, 219, 140, 0.2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(114, 219, 140, 0.07), transparent 24rem),
    rgba(10, 14, 17, 0.92);
}

.precautions-heading {
  display: grid;
  grid-template-columns: minmax(270px, 0.95fr) minmax(300px, 1.05fr);
  column-gap: clamp(28px, 6vw, 72px);
  align-items: end;
}

.precautions-heading .eyebrow {
  grid-column: 1 / -1;
}

.precautions-heading h2 {
  max-width: 18ch;
  margin-bottom: 0;
}

.precautions-heading > p:last-child {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.power-recommendation {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 17px;
  align-items: center;
  margin-top: 30px;
  padding: 20px;
  border: 1px solid rgba(114, 219, 140, 0.25);
  border-radius: 16px;
  background: rgba(114, 219, 140, 0.045);
}

.power-mark {
  display: grid;
  min-width: 72px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(114, 219, 140, 0.48);
  border-radius: 11px;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.power-recommendation strong {
  display: block;
  margin-bottom: 3px;
  color: #dff8e5;
}

.power-recommendation p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.precaution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.precaution-grid li {
  display: grid;
  grid-template-columns: 29px 1fr;
  gap: 11px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.02);
}

.precaution-grid li > span {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.68rem;
}

.precaution-grid strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.84rem;
}

.precaution-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.electrical-note {
  margin: 17px 0 0;
  color: #78818c;
  font-size: 0.72rem;
}

.lifecycle-note {
  padding: 14px 16px;
  border-left: 3px solid var(--orange);
  color: #dce1e6;
  background: rgba(255, 138, 0, 0.045);
  font-size: 0.95rem;
  line-height: 1.6;
}

.firmware-picker {
  margin-bottom: 18px;
}

.firmware-picker label {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.firmware-picker select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(255, 138, 0, 0.35);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.firmware-picker select:focus-visible {
  outline: 3px solid rgba(255, 177, 59, 0.4);
  outline-offset: 2px;
}

.firmware-picker p {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

/* Keep complete board references legible even when a native select truncates. */
.installer-action { min-width: 0; }
#selected-board {
  color: var(--text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
#header-target, #detail-target, .flash-button > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.compatibility {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

.compatibility.ready { color: var(--green); }
.compatibility.blocked { color: var(--danger); }
.compatibility-icon { font-size: 0.65rem; }

esp-web-install-button {
  display: block;
  width: 100%;
  --esp-tools-button-color: var(--orange);
  --esp-tools-button-text-color: #160b00;
  --esp-tools-button-border-radius: 14px;
}

esp-web-install-button[hidden] {
  display: none;
}

.flash-button {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(100deg, var(--orange), var(--orange-light));
  box-shadow: 0 14px 42px rgba(255, 122, 0, 0.23);
  color: #170b00;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.flash-button:hover {
  box-shadow: 0 18px 52px rgba(255, 122, 0, 0.34);
  transform: translateY(-2px);
}

.flash-button:focus-visible,
#copy-hash:focus-visible,
#copy-application-hash:focus-visible {
  outline: 3px solid rgba(255, 177, 59, 0.5);
  outline-offset: 3px;
}

.button-arrow { font-size: 1.45rem; }
.microcopy { margin: 12px 0 0; color: #78818c; font-size: 0.74rem; }
.unsupported { padding: 13px; border: 1px solid rgba(255, 93, 87, 0.3); border-radius: 12px; color: #ffaaa7; }

.steps,
.details {
  margin-top: 90px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

h2 {
  margin-bottom: 22px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0;
  list-style: none;
}

.step-grid li {
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(23, 28, 34, 0.9), rgba(10, 13, 17, 0.92));
}

.step-number {
  display: inline-block;
  margin-bottom: 42px;
  color: var(--orange-light);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8rem;
}

.step-grid h3 { margin-bottom: 8px; font-size: 1.05rem; }
.step-grid p { margin: 0; color: var(--muted); font-size: 0.87rem; }

.details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.selected-verification > p:last-child { max-width: 72ch; margin: 0; color: var(--muted); }

.hash-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hash-card span { color: var(--muted); font-size: 0.78rem; }
.hash-card code { overflow: hidden; color: #dce1e6; font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }

.hash-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
}

#copy-hash,
#copy-application-hash {
  padding: 9px 13px;
  border: 1px solid rgba(255, 138, 0, 0.3);
  border-radius: 10px;
  background: rgba(255, 138, 0, 0.08);
  color: var(--orange-light);
  cursor: pointer;
}

.application-hash-card { padding-top: 16px; }

.sha-catalog {
  margin-top: 24px;
  padding: clamp(28px, 5vw, 42px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sha-heading h2 { max-width: 22ch; }

.sha-explanations {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.sha-explanations article {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.sha-explanations strong { color: var(--orange-light); }
.sha-explanations p,
.sha-legacy-note { margin: 7px 0 0; color: var(--muted); font-size: 0.82rem; }
.sha-legacy-note { margin-top: 16px; }

.sha-table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.sha-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  text-align: left;
}

.sha-table th,
.sha-table td {
  padding: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.sha-table th {
  color: var(--orange-light);
  background: rgba(255, 138, 0, 0.06);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.sha-table td { color: var(--muted); font-size: 0.74rem; }
.sha-table tbody tr:last-child td { border-bottom: 0; }
.sha-table code { color: #dce1e6; font-size: 0.68rem; overflow-wrap: anywhere; }

.warning {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  padding: 22px;
  border: 1px solid rgba(255, 177, 59, 0.24);
  border-radius: 18px;
  background: rgba(255, 138, 0, 0.045);
}

.warning-mark {
  display: grid;
  flex: 0 0 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--orange);
  border-radius: 50%;
  color: var(--orange-light);
  font-weight: 900;
}

.warning strong { display: block; margin: 3px 0 5px; }
.warning p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.warning p + p { margin-top: 0.65rem; }
.warning a { color: var(--orange-light); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--border);
  color: #737c86;
  font-size: 0.76rem;
}

@media (max-width: 820px) {
  .product-intro { grid-template-columns: 1fr; min-height: auto; }
  .intro-copy { order: 1; }
  .hero-visual { order: 2; }
  .hero-visual { max-width: 560px; margin-inline: auto; }
  h1 { max-width: 15ch; }
  .installer { grid-template-columns: 1fr; }
  .precautions-heading { grid-template-columns: 1fr; }
  .precautions-heading h2 { margin-bottom: 16px; }
  .precaution-grid { grid-template-columns: 1fr; }
  .step-grid { grid-template-columns: 1fr; }
  .step-grid li { min-height: 0; }
  .step-number { margin-bottom: 24px; }
  .details { padding: 28px; }
  .hash-card { grid-column: auto; grid-template-columns: 1fr; }
  .sha-explanations { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header,
  main,
  footer { width: min(100% - 24px, 1120px); }
  .site-header { align-items: flex-start; }
  .header-meta { flex-wrap: wrap; justify-content: flex-end; max-width: 150px; }
  .header-meta .status-dot { display: none; }
  main { padding-top: 18px; }
  .product-intro { gap: 34px; }
  h1 { font-size: 2.5rem; }
  .image-caption { font-size: 0.55rem; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
