:root {
  color-scheme: light;
  --ink: #142022;
  --muted: #607071;
  --paper: #f3f2eb;
  --surface: #fffef9;
  --line: #d7d8ce;
  --accent: #f05a31;
  --accent-dark: #c83b18;
  --navy: #102e35;
  --teal: #177a74;
  --warning: #a56300;
  --danger: #b52d33;
  --shadow: 0 18px 55px rgb(20 32 34 / 9%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.55;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
a { color: var(--teal); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-dark); }
button, input, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
summary:focus-visible, main:focus-visible {
  outline: 3px solid #167aee;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: white;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  min-height: 4.5rem;
  padding: 0.75rem clamp(1rem, 4vw, 4.5rem);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  color: white;
  background: var(--navy);
  border-bottom: 1px solid rgb(255 255 255 / 14%);
}
.site-header a { color: inherit; text-decoration: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 45%);
  color: #ffd6c7;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  transform: rotate(-4deg);
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.7rem);
  margin-right: auto;
}
.site-header nav a, .header-link { color: #cfdbda; font-size: 0.91rem; }
.site-header nav a:hover, .header-link:hover { color: white; }
.header-link { margin-left: auto; }
.account { display: flex; align-items: center; gap: 0.8rem; }
.account form { margin: 0; }
.account-name {
  max-width: 13rem;
  overflow: hidden;
  color: #cfdbda;
  font-size: 0.82rem;
  text-overflow: ellipsis;
}

main { min-height: calc(100vh - 10rem); }
footer {
  padding: 2rem clamp(1rem, 4vw, 4.5rem);
  display: flex;
  gap: 1.5rem;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}
footer span:first-child { color: var(--ink); font-weight: 750; }
footer a:first-of-type { margin-left: auto; }

.hero {
  min-height: calc(100vh - 4.5rem);
  padding: clamp(4rem, 9vw, 8rem) clamp(1.25rem, 7vw, 8rem);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(25rem, 0.95fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
  color: white;
  background:
    radial-gradient(circle at 83% 12%, rgb(240 90 49 / 24%), transparent 27rem),
    linear-gradient(135deg, #102e35 0%, #0c252b 62%, #17383b 100%);
  overflow: hidden;
}
.hero h1 {
  max-width: 12ch;
  margin: 0.2rem 0 1.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 6.3vw, 6.8rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.055em;
}
.lede {
  max-width: 42rem;
  color: #c5d5d4;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
}
.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero-actions {
  margin-top: 2.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.hero-actions form { margin: 0; }

.button {
  min-height: 2.8rem;
  padding: 0.7rem 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none;
}
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { color: white; background: var(--accent-dark); }
.button.secondary { color: var(--ink); border-color: var(--line); background: var(--surface); }
.hero .button.secondary {
  color: white;
  border-color: rgb(255 255 255 / 35%);
  background: transparent;
}
.button.ghost {
  min-height: 2.3rem;
  color: white;
  border-color: rgb(255 255 255 / 25%);
  background: transparent;
}
.button.danger { color: white; background: var(--danger); }
.button.small { min-height: 2.25rem; padding: 0.45rem 0.7rem; font-size: 0.82rem; }

.code-window {
  position: relative;
  width: min(100%, 43rem);
  color: #dbe8e6;
  background: #071c21;
  border: 1px solid rgb(255 255 255 / 16%);
  box-shadow: 0 35px 90px rgb(0 0 0 / 35%);
  transform: rotate(1deg);
}
.code-window::before {
  content: "";
  position: absolute;
  inset: 0.9rem -0.9rem -0.9rem 0.9rem;
  z-index: -1;
  border: 1px solid rgb(240 90 49 / 55%);
}
.window-bar {
  height: 2.8rem;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  color: #819998;
  font: 0.75rem ui-monospace, monospace;
}
.window-bar i { width: 0.58rem; aspect-ratio: 1; border-radius: 50%; background: #345158; }
.window-bar i:first-child { background: var(--accent); }
.window-bar span { margin-left: auto; }
.code-window pre {
  margin: 0;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  overflow: auto;
  font: clamp(0.78rem, 1.3vw, 1rem) / 1.85 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.code-window .kw { color: #ff9477; }
.code-window .fn { color: #7edbd1; }

.feature-grid {
  padding: clamp(5rem, 10vw, 9rem) clamp(1.25rem, 7vw, 8rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}
.section-heading, .feature-grid article {
  padding: clamp(2rem, 4vw, 4rem);
  background: var(--surface);
}
.section-heading { grid-column: 1 / -1; }
.section-heading h2, .getting-started h2 {
  max-width: 18ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 4.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}
.feature-grid article h3 { margin: 2.8rem 0 0.5rem; font-size: 1.2rem; }
.feature-grid article p { color: var(--muted); }
.feature-number { color: var(--accent); font: 0.8rem ui-monospace, monospace; }
.getting-started {
  padding: clamp(4rem, 9vw, 8rem) clamp(1.25rem, 7vw, 8rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem 6rem;
  align-items: end;
  background: #e4e9df;
}
.getting-started > p { max-width: 40rem; color: var(--muted); font-size: 1.12rem; }
.arrow-link { grid-column: 2; font-weight: 750; }

.page-shell {
  width: min(100% - 2rem, 88rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 6rem) 0;
}
.page-shell.narrow { max-width: 52rem; }
.page-heading {
  margin-bottom: 2.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}
.page-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.page-heading p:not(.eyebrow) { max-width: 48rem; color: var(--muted); }
.muted { color: var(--muted); }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { overflow-wrap: anywhere; font-size: 0.85em; }

.next-action {
  margin-bottom: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3.3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: white;
  background: var(--navy);
  box-shadow: var(--shadow);
}
.next-action h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.5rem); }
.next-action p:not(.eyebrow) { max-width: 48rem; margin-bottom: 0; color: #c8d6d5; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.panel {
  padding: clamp(1.3rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgb(20 32 34 / 4%);
}
.panel.wide { grid-column: 1 / -1; }
.panel-heading {
  margin-bottom: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.panel-heading h2, .panel > h2 { margin: 0; font-size: 1.1rem; }
.compact-list, .logs { margin: 0; padding: 0; list-style: none; }
.compact-list li {
  padding: 0.8rem 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  border-top: 1px solid var(--line);
}
.status-dot {
  display: inline-block;
  width: 0.65rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent);
}
.status-ok { color: #14736a; }
.status-warn { color: var(--warning); }
.status-error { color: var(--danger); }
.status-active { color: #1a62a7; }
.pill {
  width: fit-content;
  padding: 0.23rem 0.52rem;
  display: inline-flex;
  border: 1px solid currentColor;
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}
.process-summary { display: grid; gap: 0.7rem; }
.process-summary p { margin: 0; color: var(--muted); }
.artifact-list > div {
  padding: 0.9rem 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--line);
}
.artifact-list small, table small { display: block; color: var(--muted); }
.file-icon { color: var(--accent); }
.quota-mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.quota-mini-grid > div { display: grid; gap: 0.4rem; }
.quota-mini-grid span, .quota-mini-grid small { color: var(--muted); font-weight: 400; }

progress {
  width: 100%;
  height: 0.45rem;
  appearance: none;
  border: 0;
  background: #dfe3da;
}
progress::-webkit-progress-bar { background: #dfe3da; }
progress::-webkit-progress-value { background: var(--teal); }
progress::-moz-progress-bar { background: var(--teal); }
.empty-state { color: var(--muted); }
.empty-state.large {
  padding: 5rem 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed #afb8ae;
}
.empty-state.large h2 { color: var(--ink); }
.card-list, .task-list { display: grid; gap: 1rem; }
.node-card, .agent-card, .task-card {
  padding: clamp(1.2rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
}
.card-main, .agent-card header, .task-card header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.card-main h2, .agent-card h2, .task-card h3 { margin: 0; }
.agent-card header, .task-card header { justify-content: space-between; }
dl { margin: 0; }
dl > div {
  padding: 0.55rem 0;
  display: grid;
  grid-template-columns: minmax(8rem, 0.32fr) 1fr;
  gap: 1rem;
  border-top: 1px solid var(--line);
}
dt { color: var(--muted); font-size: 0.82rem; }
dd { margin: 0; }
details { margin-top: 1rem; }
summary { width: fit-content; cursor: pointer; font-weight: 700; }
.danger-zone { padding-top: 1rem; border-top: 1px solid #e8c5c5; }
.danger-zone summary, .error-text { color: var(--danger); }
.confirm {
  margin: 0.8rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.confirm input { margin-top: 0.25rem; }
.notice {
  margin: 1rem 0;
  padding: 1rem 1.2rem;
  background: #e7efed;
  border-left: 4px solid var(--teal);
}
.notice.warning { background: #fff1d8; border-color: var(--warning); }
.notice.compact { padding: 0.55rem 0.8rem; font-size: 0.8rem; }
.flash-notice { margin: 1rem auto 0; max-width: 72rem; }
.error-summary { background: #fee7e4; border-color: var(--danger); }
.copy-block {
  margin: 2rem 0;
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  color: #dbe8e6;
  background: var(--navy);
}
.copy-block pre { margin: 0; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.copy-inline {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.process-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(19rem, 0.6fr);
  gap: 1.5rem;
  align-items: start;
}
.process-facts { margin-bottom: 1.5rem; }
.sticky { position: sticky; top: 1rem; }
.task-actions {
  margin-top: 1.4rem;
  padding-top: 1rem;
  display: grid;
  gap: 0.8rem;
  border-top: 1px solid var(--line);
}
.task-actions form { padding: 0.8rem; background: var(--paper); }
.live-label {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.live-label::before {
  content: "";
  width: 0.45rem;
  aspect-ratio: 1;
  margin-right: 0.4rem;
  display: inline-block;
  border-radius: 50%;
  background: currentColor;
}
.log-view {
  max-height: 35rem;
  overflow: auto;
  color: #dbe8e6;
  background: #0c252b;
}
.logs li { padding: 0.8rem 1rem; border-bottom: 1px solid rgb(255 255 255 / 8%); }
.logs pre {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.78rem/1.5 ui-monospace, monospace;
}
.log-meta, .truncated { color: #829c9b; font: 0.67rem ui-monospace, monospace; }
.log-stderr pre { color: #ffb0a2; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
td code { display: block; margin-top: 0.35rem; }
.quota-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.quota-card {
  padding: 1.5rem;
  display: grid;
  gap: 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
}
.quota-card > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.quota-card h2 { margin: 0; font-size: 1rem; }
.quota-card span, .quota-card small { color: var(--muted); font-weight: 400; }
.quota-card > strong { font-size: 1.5rem; }
.quota-card.limit-reached { border-color: var(--danger); }
.quota-card.limit-reached progress::-webkit-progress-value { background: var(--danger); }

.stack-form { margin-top: 1.2rem; display: grid; gap: 1rem; }
.enrollment-form { min-width: min(100%, 19rem); margin-top: 0; }
.stack-form > label:not(.confirm) {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}
input[type="text"], input:not([type]), textarea {
  width: 100%;
  padding: 0.7rem;
  color: var(--ink);
  background: white;
  border: 1px solid #aeb7ad;
}
textarea { resize: vertical; font-family: ui-monospace, monospace; }

.error-page {
  min-height: 65vh;
  padding: clamp(4rem, 10vw, 9rem) 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.error-page h1 {
  max-width: 18ch;
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 500;
  line-height: 1;
}
.error-page > p:not(.eyebrow, .request-id) {
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.1rem;
}
.error-page .button { margin-top: 0.6rem; }
.request-id { margin-top: 2rem; color: var(--muted); font: 0.72rem ui-monospace, monospace; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
  .code-window { width: 100%; }
  .feature-grid { grid-template-columns: 1fr; }
  .section-heading { grid-column: 1; }
  .process-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .quota-mini-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .site-header { flex-wrap: wrap; }
  .site-header nav {
    width: 100%;
    order: 3;
    overflow-x: auto;
    padding-bottom: 0.3rem;
  }
  .account-name { display: none; }
  footer { flex-wrap: wrap; }
  footer span:nth-child(2) { width: 100%; }
  footer a:first-of-type { margin-left: 0; }
  .summary-grid, .getting-started, .quota-grid { grid-template-columns: 1fr; }
  .panel.wide, .arrow-link { grid-column: 1; }
  .next-action, .page-heading { align-items: stretch; flex-direction: column; }
  .artifact-list > div { grid-template-columns: auto 1fr; }
  .artifact-list > div > :nth-child(n + 3) { grid-column: 2; }
  .copy-block { grid-template-columns: 1fr; }
  dl > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.code-caption {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}
