:root {
  --bg: #070807;
  --bg-2: #0c0e0c;
  --elev: #111411;
  --elev-2: #171b16;
  --line: #22281f;
  --line-strong: #2e3629;
  --text: #e9f0df;
  --muted: #7d8774;
  --faint: #4d5448;
  --acid: #c8ff00;
  --acid-2: #9ed600;
  --acid-ink: #081000;
  --gold: #c9a45a;
  --danger: #ff5a5a;
  --ok: #c8ff00;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font-display: "Unbounded", "Arial Black", sans-serif;
  --font: "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 14px;
  --nav-h: 68px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); color: var(--text); }
body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(200, 255, 0, 0.07), transparent 50%),
    radial-gradient(900px 500px at -10% 110%, rgba(201, 164, 90, 0.06), transparent 45%),
    var(--bg);
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  z-index: 0;
}
a { color: var(--acid); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: inherit;
  cursor: text;
  text-decoration: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Mark */
.gb {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--acid);
  color: var(--acid-ink);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 0 24px rgba(200, 255, 0, 0.28);
  flex: 0 0 auto;
}
.gb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.gb.lg {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  box-shadow: 0 0 60px rgba(200, 255, 0, 0.35);
  margin-top: 0;
  flex-shrink: 0;
}
.gb.lg img {
  width: 100%;
  height: 100%;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(7, 8, 7, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 18px;
}
.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
#account-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}
.who-chip,
.nav-links a.who-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--acid);
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0;
}
.nav-links a.who-chip:hover { color: var(--acid); text-decoration: underline; }
.auth-page { max-width: 560px; }
.auth-card { margin-top: 24px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  font-size: 14px;
}
.nav-links a:hover, .nav-links a.is-on { color: var(--text); }

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--acid);
  color: var(--acid-ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--acid); color: var(--acid); }
.btn-danger { background: transparent; color: var(--danger); border-color: #4a2020; }

#account-slot { flex-wrap: nowrap; }
.nav-links { flex-wrap: nowrap; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea, .field select {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--acid); }
.field textarea { min-height: 88px; resize: vertical; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

/* Pages */
.page { padding: 36px 0 80px; position: relative; z-index: 1; }
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.04em; margin: 0 0 12px; }
h1 { font-size: clamp(40px, 7vw, 84px); line-height: 0.95; }
h2 { font-size: 28px; }
.lede { color: var(--muted); font-size: 18px; max-width: 42rem; }

/* Landing */
.hero { padding: 72px 0 48px; }
.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 28px;
}
.hero-top .gb.lg { margin: 0; }
.hero p.lede { margin-top: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--elev);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--faint);
}
.dot.live { background: var(--acid); box-shadow: 0 0 10px var(--acid); }
.dot.down { background: var(--danger); }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 56px;
}
.card, .panel {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { font-size: 18px; }
.card p { margin: 0; color: var(--muted); }
.steps { margin-top: 64px; }
.step-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.step-n {
  font-family: var(--font-display);
  color: var(--acid);
  font-size: 22px;
}
.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--faint);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* App toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}
.search {
  width: min(320px, 100%);
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  outline: none;
}
.search:focus { border-color: var(--acid); }

.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.repo-card {
  display: block;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  color: inherit;
  text-decoration: none;
  min-height: 148px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.repo-card:hover {
  border-color: var(--acid);
  text-decoration: none;
  transform: translateY(-2px);
}
.repo-card h3 { font-size: 20px; }
.repo-card p { margin: 0 0 16px; color: var(--muted); min-height: 3em; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pill.private { color: var(--gold); border-color: #3d3420; }

/* States */
.state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(17, 20, 17, 0.5);
}
.state h2 { font-size: 24px; color: var(--text); }
.state.error { border-color: #4a2020; }
.skel {
  height: 148px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--elev), var(--elev-2), var(--elev));
  background-size: 200% 100%;
  animation: sheen 1.2s infinite;
}
@keyframes sheen {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Repo */
.repo-head { margin-bottom: 24px; }
.crumbs { color: var(--muted); font-family: var(--font-mono); font-size: 13px; margin-bottom: 10px; }
.repo-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.clone {
  display: flex;
  gap: 8px;
  margin: 16px 0 0;
}
.clone input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.tabs {
  display: flex;
  gap: 6px;
  margin: 24px 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.tab {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}
.tab.is-on { color: var(--acid); }
.ticket-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.seg {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
}
.seg button {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.seg button.is-on { color: var(--acid-ink); background: var(--acid); }
.ticket-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.ticket-item strong { font-size: 15px; }
.ticket-item:hover, .ticket-item.is-on { border-color: var(--acid); background: var(--elev-2); }
.comment {
  border-top: 1px solid var(--line);
  padding: 14px 0 0;
  margin-top: 14px;
}
.ticket-form { margin-top: 18px; }
.ticket-list { max-height: 70vh; overflow: auto; }
.split {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}
.tree button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
}
.tree button:hover, .tree button.is-on { background: var(--elev-2); color: var(--acid); }
.file-view pre, .readme {
  margin: 0;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
}
.readme { font-family: var(--font); font-size: 15px; }
.readme h1, .readme h2, .readme h3 { margin: 1.2em 0 0.4em; }
.readme pre {
  background: var(--bg);
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
}
.readme code { font-family: var(--font-mono); font-size: 0.92em; }
.file-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 10px;
}
.file-toolbar .btn { padding: 6px 10px; font-size: 12px; }
.repo-actions { margin-top: 16px; }
.danger-zone {
  border-color: #4a2020;
  margin-top: 32px;
}

/* Modal */
.modal-root[hidden] { display: none; }
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  width: min(480px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.modal h2 { font-size: 26px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.flash {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 14px;
}

@media (max-width: 800px) {
  .grid-3, .repo-grid, .split, .ticket-bar { grid-template-columns: 1fr; display: block; }
  .ticket-bar .btn { margin-top: 10px; }
  .hero-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .hero-top .gb.lg {
    margin-top: 12px;
    margin-bottom: 28px;
  }
  .brand-sub {
    display: block;
    font-size: 8px;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  .brand { gap: 8px; }
  .brand-name { font-size: 16px; }
  .nav-inner { gap: 8px; }
  .nav-links { gap: 4px; }
  .nav-links > a { padding: 8px 6px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .nav-links a.desk { display: none; }
  .wrap, .nav-inner { width: min(1120px, calc(100% - 28px)); }
  /* Phone header: both actions are the same circle as the old Sign out. */
  .nav .btn,
  .nav-links .btn,
  #account-slot .btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    max-width: 46px;
    max-height: 46px;
    padding: 4px 3px;
    border-radius: 50%;
    white-space: normal;
    text-align: center;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    flex: 0 0 46px;
    overflow: hidden;
  }
}
