:root {
  color: #f4faff;
  background: #07111c;
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --blue: #2684ff;
  --blue-deep: #1455b8;
  --blue-panel: #14263a;
  --panel: #0d1927;
  --line: #26384b;
  --text: #f4faff;
  --text-soft: #dce8f7;
  --muted: #8fa5c2;
  --muted-dark: #607895;
  --success: #5de08b;
  --warning: #e6b43c;
  --danger: #e06b6b;
  --esp-tools-button-color: var(--blue-deep);
  --esp-tools-button-text-color: var(--text);
  --esp-tools-button-border-radius: 0.25rem;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: #07111c;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 4%, rgba(38, 132, 255, 0.12), transparent 28rem),
    radial-gradient(circle at 5% 58%, rgba(20, 85, 184, 0.08), transparent 34rem),
    #07111c;
}

.scope-grid {
  position: fixed;
  z-index: -1;
  top: 0;
  right: 0;
  width: min(52vw, 48rem);
  height: 32rem;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(38, 56, 75, 0.42) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 56, 75, 0.42) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: linear-gradient(to bottom left, black, transparent 82%);
}

.site-header,
main,
footer {
  width: min(calc(100% - 2.5rem), 68rem);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 6rem;
  border-bottom: 1px solid rgba(38, 56, 75, 0.8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand img {
  width: 2.15rem;
  height: auto;
}

.github-link,
.report-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 120ms ease, color 120ms ease;
}

.github-link:hover,
.report-link:hover {
  border-color: var(--blue);
  color: var(--text);
}

main {
  padding: 4rem 0;
}

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

h1,
h2,
h3 {
  color: var(--text);
  letter-spacing: -0.035em;
}

h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.6rem, 4vw, 2.45rem);
}

h2 {
  margin-bottom: 0.85rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.2rem;
}

.section-label {
  margin: 0 0 0.55rem;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.device-notice,
.installer,
.details {
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: rgba(13, 25, 39, 0.96);
  box-shadow: 0 1.8rem 4rem rgba(0, 0, 0, 0.18);
}

.device-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: clamp(1.35rem, 4vw, 2rem);
  border-color: rgba(230, 180, 60, 0.55);
  background: linear-gradient(90deg, rgba(230, 180, 60, 0.08), rgba(13, 25, 39, 0.96) 45%);
}

.notice-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--warning);
  color: var(--warning);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}

.device-notice .section-label {
  color: var(--warning);
}

.device-notice p:last-child {
  max-width: 50rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.installer {
  position: relative;
  padding: clamp(1.4rem, 4.5vw, 2.8rem);
  border-top: 2px solid var(--blue);
}

.installer::before {
  position: absolute;
  top: -2px;
  left: -1px;
  width: 5rem;
  height: 2px;
  background: #75b5ff;
  box-shadow: 0 0 1rem rgba(38, 132, 255, 0.7);
  content: "";
}

.installer-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.78fr);
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: end;
  padding-bottom: 2.3rem;
  border-bottom: 1px solid var(--line);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(93, 224, 139, 0.25);
  border-radius: 0.25rem;
  background: rgba(93, 224, 139, 0.06);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 750;
}

.status-dot {
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0.6rem rgba(93, 224, 139, 0.75);
}

.intro-copy {
  max-width: 39rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.development-warning {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(224, 107, 107, 0.42);
  border-radius: 0.25rem;
  background: rgba(224, 107, 107, 0.07);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.development-warning > span {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--danger);
  color: var(--danger);
  font-weight: 800;
}

.development-warning p {
  margin-bottom: 0;
}

.development-warning strong {
  display: block;
  color: var(--text-soft);
}

.guide-heading {
  padding: 2.4rem 0 1.3rem;
}

.guide-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  background: var(--line);
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  min-height: 9.4rem;
  padding: 1.25rem;
  background: var(--panel);
}

.step-number {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 800;
}

.steps strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.steps p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.58;
}

.button-sequence {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.button-sequence > span {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
}

.button-sequence kbd {
  display: grid;
  min-width: 3.6rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid var(--blue);
  border-bottom-width: 3px;
  border-radius: 0.2rem;
  background: var(--blue-panel);
  color: var(--text);
  font: 800 0.67rem ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.05em;
}

.button-sequence small {
  color: var(--muted-dark);
  font-size: 0.56rem;
  white-space: nowrap;
}

.button-sequence b {
  color: var(--blue);
  font-size: 0.7rem;
}

.connect-area {
  margin-top: 1.5rem;
  padding: 1.3rem;
  border: 1px solid rgba(38, 132, 255, 0.42);
  border-radius: 0.25rem;
  background: rgba(20, 85, 184, 0.09);
}

.version-selection {
  display: grid;
  grid-template-columns: minmax(9rem, 0.35fr) minmax(12rem, 0.65fr);
  gap: 0.45rem 1rem;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(38, 132, 255, 0.25);
}

.version-selection label {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.version-selection select {
  width: 100%;
  min-height: 2.7rem;
  padding: 0 2.3rem 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
}

.version-selection select:disabled {
  color: var(--text-soft);
  opacity: 1;
}

.version-selection p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.connect-area > p:last-of-type {
  margin-bottom: 0.75rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.install-button {
  display: flex;
  width: 100%;
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  border: 1px solid var(--blue);
  border-radius: 0.25rem;
  background: var(--blue-deep);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;
  transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.install-button:hover {
  background: var(--blue);
  box-shadow: 0 0.8rem 2rem rgba(38, 132, 255, 0.2);
  transform: translateY(-1px);
}

.compatibility {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.install-button:focus-visible,
.version-selection select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--warning);
  outline-offset: 4px;
}

.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.35rem;
  margin-top: 1rem;
  padding: clamp(1.35rem, 3.5vw, 2rem);
}

.help-mark {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.details h2 {
  margin-bottom: 0.7rem;
  font-size: 1.3rem;
}

.details p:last-child {
  max-width: 55rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 0 2.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted-dark);
  font-size: 0.72rem;
}

.report-link {
  color: var(--blue);
}

@media (max-width: 50rem) {
  main {
    padding-top: 2.5rem;
  }

  .installer-intro {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .steps li {
    min-height: 0;
  }

  .version-selection {
    grid-template-columns: 1fr;
  }

  .version-selection p {
    grid-column: 1;
  }
}

@media (max-width: 38rem) {
  .site-header,
  main,
  footer {
    width: min(calc(100% - 1.5rem), 68rem);
  }

  .site-header {
    min-height: 5rem;
  }

  .device-notice {
    grid-template-columns: 1fr;
  }

  .button-sequence {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
  }

  .button-sequence kbd {
    min-width: 3.2rem;
  }

  .details {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .install-button,
  .github-link,
  .report-link {
    transition: none;
  }
}
