:root {
  color-scheme: light;
  --bg: #ffffff;
  --card: #ffffff;
  --surface: #eefaff;
  --ink: #17212b;
  --heading: #101820;
  --muted: #526575;
  --faint: #8a9aa4;
  --go: #00add8;
  --go-dark: #007d9c;
  --accent-text: #007d9c;
  --line: #c9e9f2;
  --good: #1a8c5a;
  --bad: #c2185b;
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --shadow: 0 22px 54px rgba(0, 91, 116, 0.12);
  --card-shadow: 0 10px 26px rgba(0, 91, 116, 0.06);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1016;
  --card: #121b24;
  --surface: #0f1720;
  --ink: #c7d3dc;
  --heading: #eaf2f7;
  --muted: #8ea0ac;
  --faint: #5b6c78;
  --go: #12c2ef;
  --go-dark: #0b4d5f;
  --accent-text: #4fd3f4;
  --line: #223543;
  --good: #3ecb8b;
  --bad: #ff77a0;
  --topbar-bg: rgba(11, 16, 22, 0.82);
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.5);
  --card-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 40px;
  background:
    linear-gradient(180deg, rgba(0, 173, 216, 0.24), rgba(0, 173, 216, 0.08) 430px, transparent 760px),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
}

.shell-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 40px));
  height: 52px;
  margin: 0 auto;
}

.brand {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
}

.brand-prompt {
  color: var(--accent-text);
}

.cursor {
  color: var(--go);
  animation: blink 1.1s steps(1) infinite;
}

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

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--mono);
  font-size: 0.86rem;
}

.topnav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
}

.topnav a::before {
  content: "/";
  margin-right: 2px;
  color: var(--faint);
}

.topnav a:hover {
  color: var(--accent-text);
}

/* ---------- theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--accent-text);
  font-size: 0.92rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.theme-toggle:hover {
  border-color: var(--go);
  color: var(--go);
}

.theme-toggle .icon-light {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-dark {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-light {
  display: inline;
}

/* ---------- layout ---------- */
main {
  position: relative;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 40px;
}

/* ---------- hero ---------- */
.hero {
  padding: 8px 0 26px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 0 22px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 173, 216, 0.34);
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-text);
  font-size: 0.86rem;
  font-weight: 700;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--go);
  box-shadow: 0 0 0 4px rgba(0, 173, 216, 0.15);
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 0.92;
  color: var(--heading);
}

.lead {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.24rem);
  line-height: 1.62;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--go);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(0, 173, 216, 0.24);
  transition: transform 0.12s ease, background 0.12s ease;
}

.button:hover {
  transform: translateY(-1px);
  background: var(--go-dark);
}

:root[data-theme="dark"] .button {
  color: #05141b;
}

:root[data-theme="dark"] .button:hover {
  color: #eaf8fd;
}

/* stack chips */
.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}

.stack li {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-text);
  background: var(--card);
  border: 1px solid rgba(0, 173, 216, 0.28);
  border-radius: 6px;
  padding: 4px 9px;
}

.stack li::before {
  content: "#";
  margin-right: 1px;
  color: var(--faint);
}

/* ---------- board of cards ---------- */
.board {
  margin-top: 30px;
  display: grid;
  gap: 16px;
}

.grid3 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 173, 216, 0.55);
  box-shadow: var(--shadow);
}

/* editor-style tab strip */
.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.card-top .tab {
  position: relative;
  padding-left: 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent-text);
}

.card-top .tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--go);
}

.card-top .badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--go);
  border-radius: 999px;
  padding: 3px 9px;
}

:root[data-theme="dark"] .card-top .badge {
  color: #05141b;
}

.card-body {
  flex: 1;
  padding: clamp(18px, 3vw, 26px);
}

.card-body h2 {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  line-height: 1.18;
  color: var(--heading);
}

.card-body h3 {
  margin: 0 0 10px;
  font-size: 1.14rem;
  line-height: 1.25;
  color: var(--heading);
}

.card-body p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.66;
}

.card-body p:last-child {
  margin-bottom: 0;
}

.card-body strong {
  color: var(--accent-text);
}

/* feature card gets a touch more presence */
.feature .card-body p {
  max-width: 74ch;
}

/* mono chips inside cards */
.chips {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--good);
  background: rgba(26, 140, 90, 0.08);
  border: 1px solid rgba(26, 140, 90, 0.28);
  border-radius: 6px;
  padding: 4px 8px;
}

:root[data-theme="dark"] .chips li {
  background: rgba(62, 203, 139, 0.1);
  border-color: rgba(62, 203, 139, 0.32);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent-text);
  background: rgba(0, 173, 216, 0.1);
  border: 1px solid rgba(0, 173, 216, 0.22);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ---------- cost ledger ---------- */
.ledger {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.ledger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font-family: var(--mono);
}

.ledger-row.bad {
  border-color: rgba(194, 24, 91, 0.4);
}

.ledger-row.good {
  border-color: rgba(26, 140, 90, 0.45);
}

.ledger-label {
  font-size: 0.9rem;
  color: var(--ink);
}

.ledger-value {
  font-size: 0.9rem;
  font-weight: 700;
}

.ledger-row.bad .ledger-value {
  color: var(--bad);
}

.ledger-row.good .ledger-value {
  color: var(--good);
}

/* ---------- code snippet ---------- */
.snippet {
  overflow: auto;
  margin: 14px 0 0;
  padding: 16px 18px;
  border: 1px solid #152b38;
  border-radius: 8px;
  background: #050b10;
}

.snippet code {
  display: block;
  color: #d8f6ff;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- status bar ---------- */
.statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0;
  height: 26px;
  padding: 0 14px;
  background: var(--go-dark);
  color: #eaf8fd;
  font-family: var(--mono);
  font-size: 0.74rem;
}

.statusbar .seg {
  padding: 0 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0.92;
}

.statusbar .seg.branch {
  background: rgba(0, 0, 0, 0.14);
  font-weight: 700;
}

.statusbar .git {
  margin-right: 4px;
}

.statusbar .seg.right {
  margin-left: auto;
  border-right: none;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .grid3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  main,
  .topbar-inner {
    width: min(100% - 22px, 680px);
  }

  main {
    padding-top: 28px;
  }

  .ledger-row {
    justify-content: flex-start;
  }

  .topnav {
    gap: 16px;
  }
}