@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #050806;
  --panel: #0b100c;
  --panel-2: #0f1511;
  --ink: #f2f8f3;
  --muted: #8d9a91;
  --line: #263128;
  --lime: #b7ff35;
  --lime-soft: rgba(183, 255, 53, 0.12);
  --cyan: #70f7df;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --esp-tools-button-color: var(--lime);
  --esp-tools-button-text-color: #071006;
  --esp-tools-button-border-radius: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.site-header {
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--mono); font-weight: 500; text-decoration: none; letter-spacing: .08em; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; color: #061004; background: var(--lime); font-weight: 700; }
.brand-cursor { animation: blink 1s steps(1) infinite; }
nav { display: flex; gap: 32px; }
nav a, .github-link { color: var(--muted); font: 12px var(--mono); text-decoration: none; text-transform: uppercase; letter-spacing: .08em; transition: color .2s; }
nav a:hover, .github-link:hover { color: var(--lime); }
.header-actions { display: flex; align-items: center; gap: 20px; }
.language-toggle { padding: 9px 12px; border: 1px solid var(--line); background: transparent; color: var(--lime); font: 12px var(--mono); cursor: pointer; white-space: nowrap; }
.language-toggle span { color: var(--muted); }
.language-toggle:hover, .language-toggle:focus-visible { border-color: var(--lime); }
.source-download { margin: -6px 30px 16px; text-align: center; font-size: 12px; }
.source-download a { color: var(--muted); text-underline-offset: 4px; }
.source-download a:hover { color: var(--lime); }
.install-safety { margin: 0 30px 22px; color: var(--muted); font-size: 12px; }

.hero { min-height: 730px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 56px; padding-block: 84px 70px; }
.eyebrow { margin: 0 0 22px; color: var(--muted); font: 11px var(--mono); letter-spacing: .16em; }
.eyebrow span { display: inline-block; width: 22px; height: 1px; margin: 0 10px 3px 0; background: var(--lime); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 27px; font-size: clamp(54px, 6.2vw, 94px); line-height: .96; letter-spacing: -.06em; font-weight: 600; }
h1 em { color: var(--lime); font-style: normal; }
.hero-lead { max-width: 640px; color: #b7c1b9; font-size: 18px; }
.hero-actions { display: flex; gap: 12px; margin: 36px 0 50px; }
.button { min-height: 53px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 32px; border: 1px solid var(--line); text-decoration: none; text-transform: uppercase; font: 12px var(--mono); letter-spacing: .08em; transition: .2s ease; }
.button-primary { color: #061004; border-color: var(--lime); background: var(--lime); }
.button-primary:hover { background: var(--cyan); border-color: var(--cyan); transform: translateY(-2px); }
.button-ghost:hover { color: var(--lime); border-color: var(--lime); }
.spec-strip { list-style: none; padding: 18px 0 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.spec-strip li { display: flex; flex-direction: column; }
.spec-strip strong { font: 12px var(--mono); color: var(--ink); }
.spec-strip span { color: var(--muted); font-size: 12px; }

.watch-stage { height: 520px; display: grid; place-items: center; position: relative; background: radial-gradient(circle, rgba(183,255,53,.12), transparent 54%); }
.orbit { position: absolute; border: 1px solid #263728; border-radius: 50%; }
.orbit-one { width: 440px; height: 440px; animation: orbitPulse 4s ease-in-out infinite; }
.orbit-two { width: 330px; height: 330px; border-style: dashed; animation: spin 28s linear infinite; }
.watch { width: 360px; height: 276px; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; transform: rotate(-3deg); filter: drop-shadow(0 35px 35px rgba(0,0,0,.65)); }
.watch-body { width: 360px; height: 204px; border: 12px solid #161b17; border-radius: 18px; position: relative; overflow: hidden; color: var(--lime); background: #010301; box-shadow: inset 0 0 0 2px #344037, 0 0 0 1px #020302; font-family: var(--mono); }
.screen-grid { position: absolute; inset: 0; opacity: .1; background-image: linear-gradient(var(--lime) 1px, transparent 1px), linear-gradient(90deg, var(--lime) 1px, transparent 1px); background-size: 8px 8px; }
.screen-top, .screen-bottom { position: absolute; left: 18px; right: 18px; display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .08em; }
.screen-top { top: 14px; }
.screen-bottom { bottom: 12px; }
.time { position: absolute; inset: 34px 12px 27px; display: flex; align-items: center; justify-content: center; font: 500 68px/1 var(--mono); letter-spacing: -.1em; text-shadow: 0 0 13px rgba(183,255,53,.25); }
.time b { margin: 0 4px; animation: blink 1s steps(1) infinite; }
.battery { width: 22px; height: 10px; padding: 2px; border: 1px solid var(--lime); position: relative; }
.battery::after { content: ''; position: absolute; right: -4px; top: 2px; width: 2px; height: 4px; background: var(--lime); }
.battery i { display: block; width: 70%; height: 100%; background: var(--lime); }
.scanline { position: absolute; left: 0; right: 0; height: 2px; background: rgba(255,255,255,.4); box-shadow: 0 0 15px var(--lime); animation: scan 3.5s linear infinite; }
.strap { position: absolute; left: 60px; right: 60px; height: 40px; border: 10px solid #131814; display: flex; justify-content: center; gap: 20px; }
.strap-top { top: 0; border-bottom: 0; border-radius: 11px 11px 0 0; }
.strap-bottom { bottom: 0; border-top: 0; border-radius: 0 0 11px 11px; }
.strap i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #566159; }
.stage-caption { position: absolute; bottom: -3px; color: var(--muted); font: 10px var(--mono); letter-spacing: .15em; }
.stage-caption span { color: var(--lime); }

.install-section { padding: 118px 0; border-block: 1px solid var(--line); background: #080c09; }
.install-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: 85px; align-items: start; }
h2 { font-size: clamp(42px, 5vw, 70px); line-height: 1.02; letter-spacing: -.055em; }
.section-intro > p:not(.eyebrow) { color: var(--muted); max-width: 470px; }
.browser-note { display: flex; align-items: center; gap: 11px; margin-top: 32px; padding: 16px; border: 1px solid var(--line); color: #aeb9b1; font: 12px var(--mono); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #f6c35b; box-shadow: 0 0 10px #f6c35b; }
.browser-note.supported .status-dot { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.browser-note.unsupported-browser .status-dot { background: #ff6a5d; box-shadow: 0 0 10px #ff6a5d; }
.installer-card { border: 1px solid #344038; background: var(--panel); box-shadow: 18px 18px 0 #050705; }
.card-head { padding: 27px 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.card-head p, .file-type { margin-bottom: 6px; color: var(--lime); font: 10px var(--mono); letter-spacing: .14em; }
.card-head h3 { margin: 0; font-size: 24px; }
.verified { color: var(--lime); border: 1px solid rgba(183,255,53,.35); padding: 7px 9px; font: 9px var(--mono); letter-spacing: .1em; }
.firmware-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.firmware-meta div { padding: 18px 26px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.firmware-meta div:last-child { border-right: 0; }
.firmware-meta span { color: var(--muted); font: 10px var(--mono); }
.firmware-meta strong { font: 12px var(--mono); }
.steps { margin: 0; padding: 25px 30px 12px; list-style: none; }
.steps li { display: grid; grid-template-columns: 45px 1fr; padding: 14px 0; border-bottom: 1px solid #1c251e; }
.steps li > span { color: var(--lime); font: 11px var(--mono); }
.steps p { margin: 0; color: var(--muted); font-size: 13px; }
.steps strong { display: block; color: var(--ink); font-size: 15px; }
esp-web-install-button { display: block; padding: 20px 30px; }
.flash-button { width: 100%; min-height: 60px; padding: 0 20px; display: flex; align-items: center; gap: 16px; border: 0; color: #071006; background: var(--lime); cursor: pointer; font: 600 13px var(--mono); letter-spacing: .08em; transition: .2s ease; }
.flash-button:hover { background: var(--cyan); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(112,247,223,.12); }
.flash-icon { font-size: 26px; }
.arrow { margin-left: auto; }
.unsupported { padding: 15px; color: #ffbaaf; border: 1px solid #71372f; background: #1a0d0b; font: 12px var(--mono); }
details { margin: 0 30px 26px; color: var(--muted); font-size: 12px; }
summary { cursor: pointer; color: #cad2cc; font-family: var(--mono); }
details p { margin: 10px 0 0; }

.source-section { padding-block: 120px; }
.section-heading { display: grid; grid-template-columns: 1fr .7fr; gap: 120px; align-items: end; margin-bottom: 54px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { color: var(--muted); }
.download-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px; }
.download-card { min-height: 385px; padding: 31px; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--panel); transition: .25s ease; }
.download-card:hover { border-color: #556359; transform: translateY(-4px); }
.source-card { background: var(--lime); color: #071006; border-color: var(--lime); }
.source-card .file-type, .source-card p { color: #31491a; }
.file-icon { width: 54px; height: 54px; margin-bottom: 35px; display: grid; place-items: center; border: 1px solid currentColor; font: 13px var(--mono); }
.download-card h3 { font-size: 27px; }
.download-card > p:not(.file-type) { color: var(--muted); font-size: 14px; }
.file-row { margin-top: auto; padding: 15px 0; display: flex; justify-content: space-between; border-top: 1px solid rgba(130,150,135,.3); color: currentColor; font: 10px var(--mono); }
.download-button, .copy-button { min-height: 49px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; color: var(--lime); border: 1px solid var(--lime); background: transparent; text-decoration: none; font: 11px var(--mono); letter-spacing: .06em; cursor: pointer; }
.source-card .download-button { color: var(--lime); background: #071006; border-color: #071006; }
.download-button:hover, .copy-button:hover { color: #071006; background: var(--lime); }
.source-card .download-button:hover { color: #071006; background: var(--cyan); }
.checksum-card code { margin: auto 0 18px; padding: 14px; overflow-wrap: anywhere; color: var(--cyan); border: 1px dashed #365049; background: #070b08; font: 11px var(--mono); }
.copy-button { width: 100%; justify-content: center; }

.wiring-section { padding-block: 105px; border-block: 1px solid var(--line); background: var(--panel-2); }
.wiring-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 110px; }
.wiring-copy { max-width: 440px; color: var(--muted); }
.pin-table { border-top: 1px solid #3a493d; }
.pin-row { min-height: 58px; display: grid; grid-template-columns: .7fr .8fr 1.4fr; align-items: center; border-bottom: 1px solid var(--line); font: 12px var(--mono); }
.pin-row span:last-child { color: var(--muted); }
.pin-row strong { color: var(--lime); }
.pin-header { min-height: 40px; color: #68766b; font-size: 9px; letter-spacing: .1em; }

.credits { padding-block: 125px; text-align: center; }
.credits > p:first-child { color: var(--lime); font: 11px var(--mono); letter-spacing: .17em; }
.credits h2 { margin-bottom: 20px; }
.credits > p:last-child { max-width: 650px; margin-inline: auto; color: var(--muted); }
.credits a { color: var(--ink); }

footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 112px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: 10px var(--mono); letter-spacing: .08em; }
.footer-inner > a:last-child { text-decoration: none; }
.footer-inner > a:last-child:hover { color: var(--lime); }

@keyframes blink { 50% { opacity: 0; } }
@keyframes scan { from { top: -5px; } to { top: 100%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orbitPulse { 50% { transform: scale(1.04); opacity: .6; } }

@media (max-width: 980px) {
  .hero, .install-grid, .wiring-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 70px; }
  .watch-stage { order: -1; height: 460px; }
  .install-grid, .wiring-grid { gap: 55px; }
  .download-grid { grid-template-columns: 1fr 1fr; }
  .source-card { grid-column: 1 / -1; }
  .section-heading { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 680px) {
  .wrap { width: min(100% - 30px, 1180px); }
  .site-header { height: 64px; padding-inline: 15px; }
  nav { display: none; }
  .github-link { font-size: 10px; }
  .header-actions { gap: 10px; }
  .language-toggle { padding: 8px; font-size: 10px; }
  .source-download, .install-safety { margin-inline: 22px; }
  .hero { min-height: auto; gap: 20px; padding-block: 35px 65px; }
  .watch-stage { height: 350px; transform: scale(.82); margin-inline: -40px; }
  h1 { font-size: 51px; }
  h2 { font-size: 42px; }
  .hero-actions { flex-direction: column; }
  .spec-strip { grid-template-columns: 1fr 1fr; gap: 18px; }
  .install-section, .source-section { padding-block: 75px; }
  .card-head { padding: 22px; align-items: flex-start; }
  .verified { display: none; }
  .firmware-meta { grid-template-columns: 1fr; }
  .firmware-meta div { border-right: 0; border-bottom: 1px solid var(--line); }
  .steps, esp-web-install-button { padding-inline: 22px; }
  details { margin-inline: 22px; }
  .download-grid { grid-template-columns: 1fr; }
  .source-card { grid-column: auto; }
  .pin-row { grid-template-columns: .6fr .9fr 1.5fr; font-size: 10px; }
  .footer-inner { padding-block: 24px; flex-direction: column; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
