/* ==========================================================
   Demo Launcher | Abt Global
   Design tokens first, then layout. Edit colors in :root only.
   ========================================================== */

:root {
  --ink:        #0E1519;
  --ink-2:      #121B21;
  --surface:    #17222A;
  --surface-hi: #1E2C36;
  --line:       #2A3A45;
  --line-soft:  #223039;
  --text:       #E9E7E1;
  --text-dim:   #93A2AC;
  --text-faint: #647581;

  --signal:     #F0A63A;  /* launch amber: the one accent */
  --live:       #5FD08A;
  --beta:       #F0A63A;
  --internal:   #6FA8DC;
  --danger:     #E97C7C;

  --radius: 14px;
  --maxw:   1160px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Signature: a faint topographic contour wash, a nod to the
   Driftless region. Static and low presence on purpose. */
.topo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='600' viewBox='0 0 900 600'%3E%3Cg fill='none' stroke='%23F0A63A' stroke-width='1'%3E%3Cpath d='M-50 120 C150 60 300 180 480 120 C640 66 760 190 950 130'/%3E%3Cpath d='M-50 200 C150 140 300 260 480 200 C640 146 760 270 950 210'/%3E%3Cpath d='M-50 280 C150 220 300 340 480 280 C640 226 760 350 950 290'/%3E%3Cpath d='M-50 360 C150 300 300 420 480 360 C640 306 760 430 950 370'/%3E%3Cpath d='M-50 440 C150 380 300 500 480 440 C640 386 760 510 950 450'/%3E%3Cpath d='M-50 520 C150 460 300 580 480 520 C640 466 760 590 950 530'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 1100px auto;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ---------------- masthead ---------------- */

.masthead {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 28px;
}
.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--signal);
}
.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--text-faint);
}
.identity-email { color: var(--text-dim); }
.identity-out {
  color: var(--text-faint);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}
.identity-out:hover { color: var(--text); border-color: var(--text-faint); }

.title {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(34px, 5.5vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0 0 12px;
}
.title .glyph { color: var(--signal); font-weight: 700; }

.lede {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 46ch;
  margin: 0;
}

/* ---------------- controls ---------------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: var(--text-faint); }
.chip.is-active {
  color: var(--ink);
  background: var(--signal);
  border-color: var(--signal);
  font-weight: 500;
}

.search-box { position: relative; min-width: 220px; flex: 0 1 300px; }
.search-box input {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  padding: 9px 16px 9px 38px;
  outline: none;
  transition: border-color .15s;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box input:focus { border-color: var(--signal); }
.search-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--text-faint);
  pointer-events: none;
}

/* ---------------- cards ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  animation: rise .5s ease both;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line);
  background: var(--surface-hi);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.15;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  padding-top: 3px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}
.status.live .dot     { background: var(--live);     box-shadow: 0 0 0 3px rgba(95,208,138,.16); animation: pulse 2.4s ease-in-out infinite; }
.status.beta .dot     { background: var(--beta);     box-shadow: 0 0 0 3px rgba(240,166,58,.16); }
.status.internal .dot { background: var(--internal); box-shadow: 0 0 0 3px rgba(111,168,220,.16); }

.blurb {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 auto;
}
.blurb.is-placeholder { color: var(--text-faint); font-style: italic; }

.host {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.host.is-unset { color: var(--danger); }

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
}

.launch {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.launch:hover { background: var(--signal); color: var(--ink); border-color: var(--signal); }
.launch svg { width: 15px; height: 15px; }
.launch.is-disabled {
  pointer-events: none;
  opacity: .4;
  border-style: dashed;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text-dim);
  cursor: pointer;
  flex: none;
  transition: color .15s, border-color .15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-faint); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn.is-copied { color: var(--live); border-color: var(--live); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-faint);
  padding: 60px 20px;
  font-size: 15px;
}

/* ---------------- pager ---------------- */

.pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
}
.pager[hidden] { display: none; }
.pager .chip { min-width: 38px; }
.pager .chip:disabled { opacity: .35; cursor: default; }
.pager .chip:disabled:hover { color: var(--text-dim); border-color: var(--line); }

/* ---------------- footer ---------------- */

footer {
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
}
footer .warn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}
footer .warn svg { width: 14px; height: 14px; stroke: var(--signal); flex: none; }
footer .brand { font-family: "IBM Plex Mono", monospace; letter-spacing: 0.08em; }

/* ---------------- motion and a11y ---------------- */

@keyframes rise  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 560px) {
  .masthead { padding-top: 30px; }
  .controls { flex-direction: column; align-items: stretch; }
  .search-box { flex: 1 1 auto; }
}
