:root {
  color-scheme: dark;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  background: #081522;
  color: #eff5fb;
  --muted: #a3b5c6;
  --line: #284052;
  --accent: #81f0d1;
  --panel: #0e2130;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 4px; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #ffd378; outline-offset: 5px; }
.site-width { width: min(1136px, calc(100% - 56px)); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner, nav, .brand { display: flex; align-items: center; }
.header-inner { justify-content: space-between; min-height: 74px; gap: 20px; }
.brand { color: inherit; font-weight: 720; gap: 12px; text-decoration: none; }
nav { gap: clamp(14px, 4vw, 30px); }
nav a { text-decoration: none; color: var(--muted); font-size: .92rem; }
nav a:hover { color: var(--accent); }

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-template-rows: repeat(3, 4px);
  gap: 3px;
  padding: 7px;
  border-radius: 7px;
  border: 1px solid #366c64;
  background: #123631;
}
.brand-mark i { background: var(--accent); border-radius: 50%; }
.brand-mark i:nth-child(2) { grid-column: 3; }
.brand-mark i:nth-child(3) { grid-column: 2; }
.brand-mark i:nth-child(4) { grid-row: 3; }
.brand-mark i:nth-child(5) { grid-column: 3; grid-row: 3; }

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 484px);
  gap: clamp(40px, 7vw, 100px);
  align-items: start;
  padding-block: 54px 72px;
}
.intro { padding-top: clamp(16px, 7vw, 72px); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-size: .875rem;
  letter-spacing: .085em;
  text-transform: uppercase;
  font-weight: 650;
  margin: 0 0 22px;
}
.eyebrow span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
h1, h2, p, dl, dd { margin: 0; }
h1 {
  font-size: clamp(3rem, 6.3vw, 5.75rem);
  font-weight: 730;
  line-height: .98;
  letter-spacing: -.065em;
}
h1 em { display: block; color: var(--accent); font-style: normal; }
.lede { margin-top: 28px; max-width: 37ch; color: var(--muted); font-size: 1.19rem; line-height: 1.64; }
.headline-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 385px;
  margin-top: 36px;
  padding-block: 23px;
  border-block: 1px solid var(--line);
}
.headline-metrics div { display: flex; flex-direction: column; gap: 8px; }
.headline-metrics div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.headline-metrics dd { font-size: clamp(1.45rem, 3.2vw, 2.12rem); font-weight: 630; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.headline-metrics dt, .privacy { color: var(--muted); font-size: .92rem; }
.privacy { margin-top: 20px; }

.workspace {
  padding: clamp(16px, 3vw, 22px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 24px 60px #0004;
}
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
h2 { font-size: 1.32rem; letter-spacing: -.025em; }
.source-label { font-size: .875rem; color: var(--muted); text-align: right; }
.preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #3e5669;
  background: #142432;
}
.preview img, .preview canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.preview-grid {
  position: absolute;
  inset: 14px;
  border: 1px solid #fff5;
  border-radius: 5px;
  pointer-events: none;
}
.legend { display: flex; gap: 8px 17px; flex-wrap: wrap; padding-top: 13px; color: var(--muted); font-size: .875rem; }
.legend span { display: inline-flex; gap: 7px; align-items: center; }
.legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--point); }
.eyes { --point: #81f0d1; }
.nose { --point: #ffd378; }
.mouth { --point: #ff9bb9; }

.controls { display: flex; gap: 9px; margin-top: 18px; }
button {
  min-height: 45px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #06201b;
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #b0ffe9; }
button:disabled { opacity: .65; cursor: default; }
.controls button { flex: 1; }
.secondary { background: transparent; border-color: #486173; color: #eff5fb; }
.secondary:hover:not(:disabled) { background: #20394c; }
.text-button { min-height: 32px; padding: 0; background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.text-button:hover:not(:disabled) { background: transparent; color: #b0ffe9; }
.status-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-top: 12px; }
#status { color: var(--muted); font-size: .875rem; line-height: 1.5; }
#status[data-error] { color: #ffbbc6; }

details { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
summary { cursor: pointer; color: var(--accent); font-weight: 630; }
.coordinates-content p { color: var(--muted); margin: 12px 0; line-height: 1.5; }
.coordinates-content button { margin-top: 14px; }

.results {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 35px;
  border-top: 1px solid var(--line);
  padding-block: 33px 42px;
}
.results p { color: var(--muted); line-height: 1.55; margin: 13px 0; max-width: 44ch; }
.results-table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--muted); font-size: .875rem; font-weight: 650; }
.best td, .best th { color: var(--accent); }
footer { padding: 18px 0 38px; color: var(--muted); border-top: 1px solid var(--line); font-size: .875rem; }

@media (max-width: 850px) {
  .demo-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 30px; }
  .intro { padding-top: 7px; }
  .workspace { width: min(100%, 520px); }
  .results { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 450px) {
  .site-width { width: calc(100% - 32px); }
  .header-inner { min-height: 64px; gap: 8px; }
  .brand { gap: 8px; font-size: .92rem; }
  nav { gap: 14px; }
  .eyebrow { letter-spacing: .04em; }
  .workspace { padding: 13px; }
  .workspace-heading h2 { font-size: 1.14rem; }
}
