:root {
  color-scheme: dark;
  --bg: #0a0a0c;
  --panel: #141418;
  --panel-2: #1a1a20;
  --ink: #f6f4ef;
  --muted: #a4a3ad;
  --line: #2a2a31;
  --lime: #d6ff3f;
  --purple: #a793ff;
  --blue: #62b9ff;
  --orange: #ff9a51;
  --red: #ff6b72;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 88% -2%, rgba(167, 147, 255, .22), transparent 27rem),
    radial-gradient(circle at -10% 25%, rgba(214, 255, 63, .08), transparent 22rem),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.hero, main, footer {
  width: min(100% - 28px, 680px);
  margin-inline: auto;
}

.hero {
  padding: calc(env(safe-area-inset-top) + 42px) 4px 28px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(214,255,63,.12);
}

h1 {
  margin: 18px 0 14px;
  max-width: 620px;
  font-size: clamp(43px, 13vw, 76px);
  line-height: .91;
  letter-spacing: -.065em;
  font-weight: 850;
}

h1 em { color: var(--purple); font-style: normal; }
.hero > p { margin: 0; max-width: 490px; color: var(--muted); font-size: 17px; line-height: 1.5; }

main { display: grid; gap: 32px; }

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(20,20,24,.92);
  box-shadow: 0 16px 50px rgba(0,0,0,.23);
}

.destination {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 20;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading > div { display: flex; align-items: baseline; gap: 9px; }
.section-heading--outside { margin: 0 4px 8px; }
.section-number { color: var(--lime); font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }

.status-chip, .count-chip, .platform-tag, .added-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(214,255,63,.1);
  color: var(--lime);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.count-chip { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.url-row { display: flex; gap: 8px; }

input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 13px;
  border: 1px solid #3a3a44;
  border-radius: 13px;
  outline: none;
  background: #09090b;
  color: var(--ink);
  font-size: 15px;
}

input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(167,147,255,.16); }
input.invalid { border-color: var(--red); }

.mini-button, .secondary-button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.field-help, .section-intro { color: var(--muted); font-size: 12px; line-height: 1.45; }
.field-help { margin: 9px 1px 0; }
.section-intro { margin: 0 4px 16px; }
.experiment-list { display: grid; gap: 12px; }

.experiment-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(27,27,33,.98), rgba(18,18,22,.98));
}

.experiment-card.featured { border-color: rgba(167,147,255,.42); }
.experiment-card.featured::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  top: -85px;
  right: -45px;
  border-radius: 50%;
  background: rgba(167,147,255,.11);
  pointer-events: none;
}

.card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; }
.method-id { margin-right: auto; color: #777783; font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.platform-tag { min-height: 22px; padding: 4px 8px; color: var(--blue); background: rgba(98,185,255,.09); }
.platform-tag.ios { color: var(--purple); background: rgba(167,147,255,.1); }
.platform-tag.android { color: var(--orange); background: rgba(255,154,81,.1); }
.added-tag { min-height: 22px; padding: 4px 8px; }

h3 { margin: 0 0 7px; font-size: 20px; letter-spacing: -.025em; }
.primitive { margin: 0 0 11px; }
code { color: var(--lime); font: 600 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.expectation { min-height: 42px; margin: 0 0 17px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.experiment-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #0a0a0c;
  text-align: left;
  text-decoration: none;
  font-size: 15px;
  font-weight: 820;
  cursor: pointer;
  touch-action: manipulation;
}

.experiment-button span { font-size: 20px; }
.experiment-button:active { transform: scale(.985); background: var(--lime); }

.diagnostics dl { display: grid; gap: 0; margin: 0; }
.diagnostics .diagnostic-row { padding: 12px 0; border-top: 1px solid var(--line); }
.diagnostics .diagnostic-row:first-child { border-top: 0; padding-top: 2px; }
.diagnostics dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.diagnostics dd { margin: 0; color: var(--ink); font: 500 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

.log-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.secondary-button.danger { color: var(--red); }
#event-log { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.log-entry { padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #0c0c0f; }
.log-entry header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.log-type { color: var(--lime); font: 750 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.log-time { color: #72727e; font: 500 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.log-detail { margin: 0; color: #c7c5ce; font: 500 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
.empty-log { padding: 24px 10px; color: var(--muted); text-align: center; font-size: 13px; }

footer { padding: 10px 4px calc(env(safe-area-inset-bottom) + 36px); color: #696974; text-align: center; font-size: 11px; line-height: 1.5; }

@media (min-width: 600px) {
  .experiment-list { grid-template-columns: 1fr 1fr; }
  .destination { top: 12px; }
}

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