:root {
  --bg: #1a1d24;
  --panel: #20242c;
  --strip: #1e222a;
  --border: #2c3341;
  --border-strong: #363e4f;
  --hover: #282d38;
  --active: #2e3543;
  --text: #e8ecf3;
  --text-2: #c9d1de;
  --muted: #909cb5;
  --muted-2: #6b778c;
  --accent: #9db0c9;
  --coral: #d97757;
  --coral-deep: #c2643f;
  --green: #4ade80;
  --yellow: #f0c04a;
  --cyan: #67d1ff;

  --sans: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --mono: 'Source Code Pro', Menlo, Consolas, monospace;

  --sidebar: 250px;
  --right: 260px;
  --line: 28px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  height: 100%;
}

body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: var(--line);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono {
  font-family: var(--mono);
}

/* The window */

.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--right);
  grid-template-rows: 44px minmax(0, 1fr) 30px;
  grid-template-areas:
    'title title title'
    'side  center right'
    'status status status';
}

.titlebar {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  -webkit-app-region: drag;
}

.lights i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 7px;
  background: #3a4353;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 16px;
  color: var(--text);
}

.brand img {
  border-radius: 7px;
}

.lockup {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: 28px 28px;
  column-gap: 14px;
  align-items: center;
  margin: 0 0 var(--line);
}

.lockup img {
  grid-row: 1 / 3;
  border-radius: 13px;
}

.lockup-name {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 28px;
  align-self: end;
}

.lockup-tag {
  color: var(--muted);
  font-size: 15px;
  line-height: 28px;
  align-self: start;
}

.omni {
  margin-inline: auto;
  width: min(520px, 46%);
  height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}

.titlebar-cta {
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
}

.titlebar-cta:hover {
  background: var(--hover);
}

/* Sidebar */

.sidebar {
  grid-area: side;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 10px 8px 16px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.3;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-head .count {
  font-weight: 500;
  color: var(--muted-2);
  text-transform: none;
  letter-spacing: 0;
}

.group {
  padding: 12px 8px 4px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  font-weight: 600;
  color: var(--text-2);
}

.project.on {
  background: var(--active);
  color: var(--text);
}

.chev {
  width: 10px;
  color: var(--muted-2);
  font-size: 10px;
}

.branch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 24px;
  color: var(--muted);
  font-size: 13px;
}

.rows {
  display: block;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 24px;
  border-radius: 5px;
  color: var(--text-2);
  text-decoration: none;
}

.row.agent {
  align-items: flex-start;
  padding-block: 6px;
}

.row.muted {
  color: var(--muted);
}

a.row:hover {
  background: var(--hover);
}

a.row.on {
  background: var(--active);
  color: var(--text);
}

.row .two {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.row .two small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.glyph {
  flex: none;
  width: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

.badge {
  flex: none;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

.tab .badge,
.term-head .badge {
  margin-top: 0;
}

.badge.c {
  background: var(--coral);
}

.dot {
  margin-left: auto;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  align-self: center;
}

.dot.busy {
  background: var(--yellow);
  box-shadow: 0 0 0 0 rgba(240, 192, 74, 0.6);
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  to {
    box-shadow: 0 0 0 7px rgba(240, 192, 74, 0);
  }
}

.aside-note {
  margin: 22px 8px 0;
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.4;
}

/* Centre */

.center {
  grid-area: center;
  display: grid;
  grid-template-rows: 38px 34px minmax(0, 1fr);
  min-width: 0;
}

.tabs {
  display: flex;
  background: var(--strip);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-2);
  background: var(--hover);
}

.tab.on {
  color: var(--text);
  background: var(--bg);
  box-shadow: inset 0 2px 0 var(--accent);
}

.tab-icon,
.row-icon {
  flex: none;
  border-radius: 4px;
}

.tab-plus {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
}

.pathbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.lint.ok {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--green);
  color: var(--green);
  font-size: 10px;
  line-height: 1;
}

.editor {
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-padding-top: 8px;
}

/* Documents rendered as files with a gutter */

.doc {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  padding: 20px 0 48px;
  border-bottom: 1px solid var(--border);
}

.doc:last-child {
  border-bottom: 0;
  min-height: 100%;
}

.gutter {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: var(--line);
  color: var(--muted-2);
  text-align: right;
  padding-right: 18px;
  white-space: pre;
  user-select: none;
  border-right: 1px solid transparent;
}

.body {
  max-width: 68ch;
  padding-right: 32px;
}

.body h1 {
  margin: 0 0 var(--line);
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 56px;
  letter-spacing: -0.022em;
  font-weight: 600;
  text-wrap: balance;
}

.body h2 {
  margin: 0 0 var(--line);
  font-size: 27px;
  line-height: 28px;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.body h3 {
  margin: 0;
  font-size: 18px;
  line-height: var(--line);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.body p {
  margin: 0 0 var(--line);
  color: var(--text-2);
}

.lede {
  font-size: 19px;
  color: var(--text) !important;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 8px;
  background: var(--coral);
  color: #fff;
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.2;
  text-decoration: none;
  transition: background 120ms;
}

.button:hover {
  background: var(--coral-deep);
}

.button small {
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0.85;
}

.quiet {
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--muted);
  max-width: 34ch;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.86em;
}

kbd {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.opinions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.opinions li {
  padding: 13px 0 14px 0;
  border-top: 1px solid var(--border);
}

.opinions p {
  font-size: 16px;
  max-width: 60ch;
}

/* Screens */

.shot {
  margin: 0 0 var(--line);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
}

.shot figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.shot figcaption strong {
  color: var(--text);
  font-weight: 600;
}

.facts {
  margin: 0 0 var(--line);
  padding: 0 0 0 18px;
  color: var(--text-2);
}

.signoff {
  color: var(--muted) !important;
}

.legal {
  color: var(--muted-2) !important;
  font-size: 13.5px;
  line-height: 1.45;
  max-width: 62ch;
}

/* Right panel */

.rightpanel {
  grid-area: right;
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 10px 8px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.35;
}

.changes,
.tree {
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
}

.changes li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 4px 8px;
  color: var(--text-2);
}

.st {
  flex: none;
  width: 14px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  line-height: inherit;
}

.st.a {
  color: var(--green);
}

.st.m {
  color: var(--yellow);
}

.files-head {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.tree li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12.5px;
}

.tree li.file {
  padding-left: 22px;
}

/* Terminal block inside the README */

.term {
  margin: 0 0 var(--line);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #15181e;
}

.term-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}

.term-branch {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.term-body {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: #d6dde8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 190px;
}

.term .p {
  color: var(--green);
}

.term .m {
  color: var(--muted);
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  background: var(--text);
  vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Status bar */

.statusbar {
  grid-area: status;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 14px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.status-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.status-right a {
  text-decoration: none;
}

.status-right a:hover {
  color: var(--text);
}

.wdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

/* Narrow screens: the chrome folds, the document stays */

@media (max-width: 1100px) {
  .app {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    grid-template-areas:
      'title title'
      'side center'
      'status status';
  }

  .rightpanel {
    display: none;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 44px minmax(0, 1fr) 30px;
    grid-template-areas:
      'title'
      'center'
      'status';
  }

  .sidebar,
  .omni,
  .lights {
    display: none;
  }

  .body h1 {
    line-height: 36px;
  }

  .lockup {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .lockup img {
    width: 44px;
    height: 44px;
  }

  .doc {
    grid-template-columns: 40px minmax(0, 1fr);
    padding-top: 12px;
  }

  .gutter {
    padding-right: 10px;
  }

  .body {
    padding-right: 16px;
  }

  .opinions li::before {
    left: -40px;
    width: 28px;
  }

  .status-center,
  .term-branch {
    display: none;
  }

  .statusbar {
    grid-template-columns: 1fr auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dot.busy,
  .cursor {
    animation: none;
  }

  .editor {
    scroll-behavior: auto;
  }
}
