@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root {
  --paper: #f3efe6;
  --paper-deep: #e5ded0;
  --ink: #1b1917;
  --muted: #665f56;
  --faint: #9a9185;
  --line: #d6cdbd;
  --terminal: #11110f;
  --terminal-2: #1b1a17;
  --terminal-3: #24221e;
  --chalk: #f5efe1;
  --chalk-dim: #b8afa1;
  --amber: #d9863d;
  --green: #77c48f;
  --blue: #78a6d8;
  --red: #d66a5c;
  --shadow: 0 28px 80px rgba(31, 26, 20, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  background:
    linear-gradient(90deg, rgba(27, 25, 23, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(27, 25, 23, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

a {
  color: inherit;
}

.site-header {
  width: min(1160px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--paper);
  background: var(--ink);
  font-size: 14px;
}

.site-nav {
  gap: 6px;
}

.site-nav a {
  padding: 9px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}

.site-nav a:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

main {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 72px);
  padding: 58px 0 44px;
  display: grid;
  align-content: start;
  gap: 34px;
}

.hero-copy {
  display: grid;
  justify-items: center;
  text-align: center;
}

.kicker {
  margin: 0 0 14px;
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 84px;
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 38px;
  line-height: 1.14;
  letter-spacing: 0;
}

h3 {
  font-size: 20px;
  letter-spacing: 0;
}

.hero-text {
  width: min(760px, 100%);
  margin-top: 20px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.button.primary {
  color: var(--paper);
  background: var(--ink);
}

.button.secondary {
  color: var(--ink);
  background: transparent;
}

.tui-stage {
  perspective: 1200px;
}

.terminal-window {
  overflow: hidden;
  border-radius: 8px;
  background: var(--terminal);
  border: 1px solid #2d2a25;
  box-shadow: var(--shadow);
  transform: rotateX(2deg);
}

.terminal-titlebar {
  min-height: 42px;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  color: var(--chalk-dim);
  background: #191814;
  border-bottom: 1px solid #302d27;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.window-controls {
  display: flex;
  gap: 8px;
}

.window-controls span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--red);
}

.window-controls span:nth-child(2) {
  background: #d9b65f;
}

.window-controls span:nth-child(3) {
  background: var(--green);
}

.window-title {
  color: var(--chalk);
}

.window-status {
  color: var(--green);
}

.tui {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 560px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--chalk);
}

.tui-nav {
  padding: 20px 16px;
  border-right: 1px solid #302d27;
  background: #151411;
}

.tui-logo {
  margin-bottom: 18px;
  color: var(--blue);
  font-weight: 600;
}

.nav-row {
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--chalk-dim);
  text-decoration: none;
  font-size: 14px;
}

.nav-row.active {
  color: var(--green);
  background: #22251f;
}

.tui-help {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid #302d27;
  color: #7f786d;
  font-size: 12px;
  line-height: 1.8;
}

.tui-main {
  padding: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--terminal);
  background-size: 100% 30px;
}

.tui-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 0 2px 14px;
  color: var(--chalk-dim);
  font-size: 13px;
}

.tui-topline span:first-child {
  color: var(--blue);
  font-weight: 600;
}

.chat-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
}

.session-list,
.chat-panel {
  border: 1px solid #343129;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.session-list {
  padding: 10px;
}

.session {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 6px;
  color: var(--chalk-dim);
}

.session + .session {
  margin-top: 8px;
}

.session.active {
  background: #22251f;
  color: var(--chalk);
}

.session span {
  color: #837b70;
  font-size: 11px;
}

.session strong {
  font-size: 13px;
}

.chat-panel {
  min-height: 440px;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.bubble {
  width: min(620px, 100%);
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
}

.bubble.user {
  margin-left: auto;
  color: #1a1713;
  background: var(--paper-deep);
}

.bubble.assistant {
  color: var(--chalk);
  background: #1d1c18;
  border: 1px solid #38342d;
}

.bubble code,
.command-panel code {
  font-family: "IBM Plex Mono", monospace;
}

.bubble code {
  color: var(--green);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.status-grid div {
  padding: 12px;
  border: 1px solid #343129;
  border-radius: 8px;
  background: #171612;
}

.status-grid span,
.status-grid strong {
  display: block;
}

.status-grid span {
  color: #91897c;
  font-size: 11px;
}

.status-grid strong {
  margin-top: 6px;
  color: var(--green);
  font-size: 13px;
}

.prompt-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid #343129;
  border-radius: 8px;
  color: var(--chalk-dim);
  background: #11110f;
}

.prompt-line span {
  color: var(--amber);
  font-weight: 600;
}

.strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  margin: 12px 0 64px;
  border: 1px solid var(--line);
  background: var(--line);
}

.strip span {
  min-height: 56px;
  display: grid;
  place-items: center;
  background: rgba(243, 239, 230, 0.92);
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.feature-section,
.quickstart {
  border-top: 1px solid var(--line);
  padding: 58px 0;
}

.section-heading {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 28px;
}

.section-heading .kicker {
  align-self: start;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.feature {
  min-height: 240px;
  padding: 22px;
  background: rgba(243, 239, 230, 0.94);
}

.feature-index {
  display: block;
  margin-bottom: 42px;
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
}

.feature p {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.75;
}

.quickstart {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 48px;
}

.command-panel {
  border: 1px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ink);
}

.command-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid #3a352f;
  color: var(--chalk);
}

.command-row:last-child {
  border-bottom: 0;
}

.command-row span {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--faint);
  border-right: 1px solid #3a352f;
  font-family: "IBM Plex Mono", monospace;
}

.command-row code {
  padding: 0 18px;
  color: var(--green);
  font-size: 14px;
  white-space: nowrap;
  overflow-x: auto;
}

.site-footer {
  width: min(1160px, calc(100% - 40px));
  min-height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  h1 {
    font-size: 64px;
  }

  h2 {
    font-size: 32px;
  }

  .tui {
    grid-template-columns: 170px 1fr;
  }

  .chat-layout,
  .section-heading,
  .quickstart {
    grid-template-columns: 1fr;
  }

  .session-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .session + .session {
    margin-top: 0;
  }

  .strip,
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 24px, 1160px);
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }

  .hero {
    padding-top: 42px;
  }

  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 28px;
  }

  .hero-text {
    font-size: 16px;
  }

  .terminal-window {
    transform: none;
  }

  .terminal-titlebar {
    grid-template-columns: 72px 1fr;
  }

  .window-status {
    display: none;
  }

  .tui {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .tui-nav {
    border-right: 0;
    border-bottom: 1px solid #302d27;
  }

  .tui-help {
    display: none;
  }

  .tui-main {
    padding: 12px;
  }

  .tui-topline,
  .status-grid,
  .session-list {
    grid-template-columns: 1fr;
  }

  .tui-topline {
    display: grid;
  }

  .hero-actions,
  .site-nav {
    width: 100%;
  }

  .button,
  .site-nav a {
    flex: 1;
  }

  .chat-panel {
    min-height: 360px;
  }
}
