/* AgenTack UI. One stylesheet for every page: inlined on the sites server, served as
   /ui.css on the API server. No external fonts, images or imports: depth comes from
   gradients here and from inline SVG in the markup. */

/* Design tokens: light, warm ivory paper. Text pairs meet WCAG AA (4.5:1); borders and
   focus rings 3:1. The hero and terminal tokens are dark in both modes. */
:root {
  color-scheme: light dark;
  --bg: #fbf6ec;
  --surface: #fffdf9;
  --text: #1d1930;
  --muted: #5c5568;
  --border: #e8dfcf;
  --border-strong: #8a7f6d;
  --link: #0b6a70;
  --accent: #c2410c;
  --accent-hover: #a3360a;
  --on-accent: #ffffff;
  --danger: #b42318;
  --on-danger: #ffffff;
  --success: #18703c;
  --code-bg: #f4ede0;
  --focus: #5b3fd0;
  --badge-bg: #efe9ff;
  --badge-text: #4a2fb5;
  --get-bg: #e0f3ef;
  --get-text: #0a5d5a;
  --post-bg: #fde7da;
  --post-text: #9a3412;
  --put-bg: #ece8fd;
  --put-text: #4b33b8;
  --delete-bg: #fde4e2;
  --delete-text: #a3161a;
  --info-bg: #eaf4f2;
  --info-border: #b9dcd6;
  --danger-bg: #fdeceb;
  --danger-border: #f2b8b2;
  --hero-base: #0d0b1e;
  --hero-ink: #fbf6ec;
  --hero-muted: #ebe5f4;
  --term-bg: #0b0a16;
  --term-text: #ece7f6;
  --term-muted: #a59fbd;
  --term-ok: #6fe3b4;
  --term-prompt: #ff9a6b;
  --term-caret: #ffb38a;
  --art-glow: #fde7da;
  --wash-a: rgba(194, 65, 12, 0.07);
  --wash-b: rgba(11, 106, 112, 0.07);
  --shadow-sm: 0 1px 2px rgba(41, 28, 10, 0.06), 0 6px 16px -8px rgba(41, 28, 10, 0.12);
  --shadow-md: 0 2px 6px rgba(41, 28, 10, 0.06), 0 22px 44px -20px rgba(41, 28, 10, 0.3);
  --shadow-lg: 0 12px 30px -18px rgba(29, 25, 48, 0.35), 0 40px 90px -40px rgba(29, 25, 48, 0.6);
  --glow: 0 0 0 6px rgba(91, 63, 208, 0.07), 0 24px 60px -28px rgba(194, 65, 12, 0.4), 0 30px 70px -30px rgba(11, 106, 112, 0.45);
  --radius: 14px;
  --radius-lg: 26px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* Design tokens: dark, midnight ink. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e1c;
    --surface: #181629;
    --text: #f4efe6;
    --muted: #b5aec6;
    --border: #2c2942;
    --border-strong: #7d7794;
    --link: #6fd8d2;
    --accent: #ff8b5c;
    --accent-hover: #ffa47f;
    --on-accent: #1c0f0a;
    --danger: #ff8a7a;
    --on-danger: #1d0b0b;
    --success: #62d39b;
    --code-bg: #1d1b30;
    --focus: #a996ff;
    --badge-bg: #2a2350;
    --badge-text: #cfc4ff;
    --get-bg: #0f3533;
    --get-text: #8ce6dc;
    --post-bg: #3d1d10;
    --post-text: #ffb38f;
    --put-bg: #28214d;
    --put-text: #c9bcff;
    --delete-bg: #3d1517;
    --delete-text: #ff9e94;
    --info-bg: #142a2b;
    --info-border: #24504f;
    --danger-bg: #33151a;
    --danger-border: #6b2a2f;
    --art-glow: #221d42;
    --wash-a: rgba(124, 92, 255, 0.14);
    --wash-b: rgba(20, 184, 166, 0.1);
    --shadow-sm: 0 8px 20px -10px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 24px 48px -20px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
    --glow: 0 0 0 6px rgba(169, 150, 255, 0.08), 0 24px 60px -24px rgba(124, 92, 255, 0.55), 0 30px 80px -30px rgba(20, 184, 166, 0.4);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(60rem 32rem at 0% -8rem, var(--wash-a), transparent 70%) no-repeat,
    radial-gradient(54rem 30rem at 100% 0%, var(--wash-b), transparent 70%) no-repeat,
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.site-header,
main,
.site-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.site-header {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

main {
  padding-bottom: 4rem;
}

.site-footer {
  padding-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font: 600 1.25rem/1 var(--serif);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.logo {
  flex: none;
}

.logo-bg {
  fill: var(--accent);
}

.logo-fg {
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  margin: 2.5rem 0 0.85rem;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.muted,
.hint {
  color: var(--muted);
}

.hint {
  font-size: 0.9375rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font: 700 0.8125rem/1.3 var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

code,
pre {
  font-family: var(--mono);
}

code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--code-bg);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

pre {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

.icon {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Buttons. Danger is an outline until it is the "yes" of a confirmation. */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px -10px var(--accent);
}

.button:hover,
button:not(:disabled):hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button.secondary,
button.secondary {
  border-color: var(--border-strong);
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.button.secondary:hover,
button.secondary:not(:disabled):hover {
  border-color: var(--text);
  background: var(--code-bg);
}

.button.danger,
button.danger {
  border-color: var(--danger);
  background: transparent;
  color: var(--danger);
  box-shadow: none;
}

.button.danger:hover,
button.danger:not(:disabled):hover {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--on-danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.card,
.step,
.stat {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card {
  margin: 0 0 1rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

input[type="password"],
input[type="email"],
input[type="text"] {
  width: 100%;
  min-height: 3rem;
  margin-bottom: 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input[type="file"] {
  display: block;
  max-width: 100%;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font: inherit;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.25rem 0 0.5rem;
}

.check-row input[type="checkbox"] {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check-row label {
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  min-height: 2.5rem;
  margin-right: 0.75rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

details {
  margin: 0 0 0.75rem;
}

summary {
  cursor: pointer;
  color: var(--muted);
}

details ul {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

/* Hero: a deep aurora of radial gradients on two drifting layers. Its text stays AA even
   where every blob overlaps. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  padding: clamp(1.5rem, 5vw, 3.75rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, #1a1540, var(--hero-base) 55%, #08070f);
  color: var(--hero-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), var(--shadow-lg);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -40%;
  pointer-events: none;
}

.hero::before {
  background:
    radial-gradient(36% 40% at 30% 38%, rgba(20, 184, 166, 0.36), transparent 70%),
    radial-gradient(34% 38% at 70% 62%, rgba(124, 92, 255, 0.32), transparent 70%);
}

.hero::after {
  background:
    radial-gradient(30% 34% at 62% 30%, rgba(255, 122, 69, 0.26), transparent 70%),
    radial-gradient(28% 30% at 34% 70%, rgba(236, 72, 153, 0.18), transparent 70%);
}

.hero-copy {
  min-width: 0;
  max-width: 46rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 1.3rem + 4.6vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
}

.hero .eyebrow,
.hero-lead {
  color: var(--hero-muted);
}

.hero-lead {
  max-width: 34rem;
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3rem);
}

.hero a:not(.button) {
  color: var(--hero-ink);
}

.hero code {
  background: rgba(8, 6, 20, 0.45);
}

.hero :focus-visible {
  outline-color: var(--hero-ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 0;
}

.button.ghost {
  border-color: rgba(251, 246, 236, 0.5);
  background: rgba(8, 6, 20, 0.3);
  color: var(--hero-ink);
  box-shadow: none;
}

.button.ghost:hover {
  border-color: var(--hero-ink);
  background: rgba(8, 6, 20, 0.55);
}

.hero-compact {
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.hero-compact h1 {
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
}

@media (max-width: 40rem) {
  .hero {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    border-radius: 0;
  }
}

/* Terminal card. In the motion section a cover (::after) steps right across each .t-line,
   its left edge the caret. Without motion every line is simply shown. */
.term {
  min-width: 0;
  max-width: 54rem;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--term-bg);
  color: var(--term-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), 0 30px 60px -24px rgba(0, 0, 0, 0.75);
}

.term-bar {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.term-bar::before {
  content: "";
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #ff7a59;
  box-shadow: 1.15rem 0 #ffc46b, 2.3rem 0 #4fd1a5;
}

.term pre {
  margin: 0;
  padding: 1.1rem 1.2rem 0.75rem;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 0.8125rem;
  line-height: 1.75;
}

.term figcaption {
  padding: 0 1.2rem 1.1rem;
  color: var(--term-muted);
  font-size: 0.875rem;
}

.t-line,
.t-out,
.t-wait {
  position: relative;
  display: inline-block;
  vertical-align: top;
}

.t-line {
  overflow: hidden;
}

.t-cmd::before {
  content: "$ ";
  content: "$ " / "";
  color: var(--term-prompt);
}

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

.t-ok {
  color: var(--term-ok);
  font-weight: 700;
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.2em;
  vertical-align: text-bottom;
  background: var(--term-caret);
}

.section,
.duo {
  margin: 0 0 clamp(2.5rem, 6vw, 3.5rem);
}

.section {
  max-width: 56rem;
}

.section > h2:first-child,
.duo h2 {
  margin-top: 0;
}

.section > p {
  max-width: 42rem;
}

.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
}

.duo > .card,
.section.card {
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.duo > .card {
  min-width: 0;
  margin: 0;
}

/* Publish, Serve, Update. */
.how {
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 1.5rem;
  counter-increment: step;
}

.step::after {
  content: counter(step, decimal-leading-zero);
  content: counter(step, decimal-leading-zero) / "";
  position: absolute;
  top: 1.3rem;
  right: 1.4rem;
  color: var(--border-strong);
  font: italic 1.5rem/1 var(--serif);
}

.step h3,
.publish-card h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1.375rem;
}

.step p {
  margin: 0;
  color: var(--muted);
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
}

/* Endpoint table with method pills. */
.table-wrap {
  margin: 0 0 1rem;
  overflow-x: auto;
}

th,
td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.endpoints {
  width: 100%;
  font-size: 0.9375rem;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.endpoints th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.endpoints tr:last-child td {
  border-bottom: 0;
}

/* Method and path stay whole on narrow screens; .table-wrap scrolls instead. */
.endpoints td:nth-child(-n + 2),
.endpoints td:nth-child(-n + 2) code {
  white-space: nowrap;
  overflow-wrap: normal;
}

.method {
  display: inline-block;
  min-width: 4.5em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.method-get,
.step:nth-child(2) .tile-icon {
  background: var(--get-bg);
  color: var(--get-text);
}

.method-post,
.step:nth-child(1) .tile-icon,
.publish-card .tile-icon {
  background: var(--post-bg);
  color: var(--post-text);
}

.method-put,
.tile-icon {
  background: var(--put-bg);
  color: var(--put-text);
}

.method-delete {
  background: var(--delete-bg);
  color: var(--delete-text);
}

@media (max-width: 30rem) {
  .endpoints {
    font-size: 0.875rem;
  }

  .endpoints th,
  .endpoints td {
    padding: 0.6rem 0.35rem;
  }

  .endpoints td:nth-child(2) code {
    padding: 0;
    background: none;
  }

  .method {
    min-width: 0;
  }
}

/* Limits as stat tiles, extensions as chips. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.stat-value {
  display: block;
  color: var(--post-text);
  font: 600 clamp(1.75rem, 1.4rem + 1.4vw, 2.4rem)/1.05 var(--serif);
  letter-spacing: -0.02em;
}

.stat:nth-child(2) .stat-value {
  color: var(--get-text);
}

.stat:nth-child(3) .stat-value {
  color: var(--put-text);
}

.stat:nth-child(4) .stat-value {
  color: var(--text);
}

.stat-label {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.chips code {
  display: inline-block;
  padding: 0.25em 0.75em;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

/* The free trial's rules (sites home "Try it free", API page). */
.trial-rules {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.trial-rules h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.trial-rules ul:not(.chips) {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.trial-rules li {
  margin-bottom: 0.35rem;
}

.chips.chips-inline {
  display: inline-flex;
  margin: 0.25rem 0 0;
  vertical-align: middle;
}

/* Error pages: one illustration that floats, one sentence, one way home. */
.oops {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.5rem 0 2rem;
  text-align: center;
}

.oops-art {
  width: min(100%, 22rem);
  margin: 0 auto 0.5rem;
}

.oops-code {
  margin: 0 0 0.25rem;
  padding-left: 0.3em;
  color: var(--accent);
  font: italic 600 1.125rem/1 var(--serif);
  letter-spacing: 0.3em;
}

.oops h1 {
  margin-top: 0;
}

.oops p {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.oops-lead {
  font-size: 1.1875rem;
}

.oops .button {
  margin-top: 0.75rem;
}

.art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.art-glow {
  fill: var(--art-glow);
}

.art-paper,
.art-fold {
  fill: var(--surface);
  stroke: var(--text);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.art-fold {
  fill: var(--badge-bg);
}

.art-line {
  fill: none;
  stroke: var(--text);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-trail {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1 9;
}

.art-ink,
.art-shadow {
  fill: var(--text);
}

.art-warm {
  fill: var(--accent);
}

.art-cool {
  fill: var(--link);
}

.art-shadow {
  fill-opacity: 0.1;
}

/* Dashboard. */
.signin-card {
  max-width: 30rem;
  margin: 0 auto 2rem;
  padding: clamp(1.5rem, 5vw, 2.25rem);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, #14b8a6, #7c5cff 50%, #ff7a45) border-box;
  box-shadow: var(--glow);
}

.signin-card h2 {
  margin: 1rem 0 0.35rem;
}

.signin-card button {
  width: 100%;
  margin-top: 0.5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.toolbar h2 {
  flex: 1 1 12rem;
  margin: 0;
}

.publish-card {
  margin: 0 0 1.5rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--wash-a), var(--wash-b)), var(--surface);
  box-shadow: none;
}

.site-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-list > li {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
}

.site-list > .card:hover,
.site-list > .card:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.site-list h3 {
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.badge {
  display: block;
  width: fit-content;
  margin: 0.4rem 0 0.5rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.8125rem;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.site-list .actions {
  margin-top: auto;
  padding-top: 1rem;
}

.actions .button,
.actions button {
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.9375rem;
}

/* The inline "are you sure?" that replaces a row's buttons. */
.site-list .actions:has(> .meta) {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  background: var(--danger-bg);
}

.actions:has(> .meta) > .meta,
.actions > details {
  flex: 1 1 100%;
}

.actions:has(> .meta) > .meta {
  color: var(--text);
  font-weight: 600;
}

.actions:has(> .meta) button.danger {
  background: var(--danger);
  color: var(--on-danger);
}

/* "Try it free" on the sites home page. */
.trial .tile-icon {
  margin-bottom: 0.75rem;
}

.trial-widget:not(:empty) {
  margin: 0 0 0.75rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.copy-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
  font-family: var(--mono);
  font-size: 0.875rem;
}

.copy-row button {
  flex: none;
  min-height: 3rem;
}

.trial-timer {
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.trial-label {
  margin: 1rem 0 0.4rem;
  font-weight: 600;
}

.trial-result pre {
  white-space: pre;
}

.keep {
  max-width: none;
}

.keep-warning {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  background: var(--danger-bg);
}

#keep-row button {
  margin-left: 0.5rem;
}

/* Calm banners for the live regions. */
.status {
  min-height: 1.55em;
  margin: 1rem 0;
}

.error {
  color: var(--danger);
  font-weight: 600;
}

.status:not(:empty),
.error:not(:empty) {
  padding: 0.75rem 1rem;
  border: 1px solid var(--info-border);
  border-radius: 12px;
  background: var(--info-bg);
}

.error:not(:empty) {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.error:empty,
.status:empty {
  margin: 0;
  min-height: 0;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 2rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty strong {
  color: var(--text);
  font: 600 1.375rem/1.2 var(--serif);
}

.empty .art {
  width: 7rem;
}

[hidden] {
  display: none !important;
}

/* Motion. Everything that moves is declared here, so reduced motion turns it all off. */
@keyframes drift {
  from {
    transform: translate3d(-4%, -3%, 0) rotate(-6deg) scale(1);
  }
  to {
    transform: translate3d(5%, 4%, 0) rotate(8deg) scale(1.12);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes draw {
  from {
    stroke-dashoffset: 21;
  }
}

@keyframes type {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes caret-on {
  from,
  to {
    border-left-color: var(--term-caret);
  }
}

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

@keyframes float {
  50% {
    transform: translateY(-10px) rotate(-2deg);
  }
}

@keyframes breathe {
  50% {
    opacity: 0.5;
    transform: scaleX(0.8);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .hero::before,
  .hero::after {
    will-change: transform;
    animation: drift 28s ease-in-out infinite alternate;
  }

  .hero::after {
    animation: drift 37s ease-in-out infinite alternate-reverse;
  }

  .hero-copy > *,
  .term {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }

  .hero-copy > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .hero-copy > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .hero-copy > :nth-child(4),
  .term {
    animation-delay: 0.24s;
  }

  .logo-fg {
    stroke-dasharray: 20 40;
    animation: draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.15s backwards;
  }

  .t-line::after {
    content: "";
    position: absolute;
    inset: 0;
    border-left: 2px solid transparent;
    background: var(--term-bg);
    transform: translateX(101%);
    animation: type 1s steps(44) 0.7s both, caret-on 1s step-end 0.7s;
  }

  .t-cmd::after {
    left: 2ch;
  }

  .t-line:nth-child(2)::after {
    animation-duration: 1.1s;
    animation-delay: 1.85s;
    animation-timing-function: steps(50), step-end;
  }

  .t-line:nth-child(3)::after {
    animation-duration: 0.85s;
    animation-delay: 3.1s;
    animation-timing-function: steps(38), step-end;
  }

  .t-line:nth-child(4)::after {
    animation-duration: 1.5s;
    animation-delay: 4.1s;
    animation-timing-function: steps(68), step-end;
  }

  .t-out,
  .t-wait {
    animation: rise 0.45s ease-out 5.9s backwards;
  }

  .t-wait {
    animation-delay: 6.3s;
  }

  .caret {
    animation: blink 1.1s step-end 6.3s 8;
  }

  .float {
    transform-box: fill-box;
    transform-origin: center;
    animation: float 6s ease-in-out infinite;
  }

  .art-shadow {
    transform-box: fill-box;
    transform-origin: center;
    animation: breathe 6s ease-in-out infinite;
  }

  .button,
  button,
  .site-list > .card,
  .step {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
  }

  .button:active,
  button:not(:disabled):active {
    transform: translateY(1px);
  }

  .site-list > .card:hover,
  .step:hover {
    transform: translateY(-3px);
  }
}

@media (forced-colors: active) {
  .t-line::after {
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* /admin: read-only stats. Charts are inline SVG; colours come from the tokens. */
.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.admin-head h1 {
  margin: 0;
}

.admin h2 {
  margin: 2rem 0 0.75rem;
}

.admin h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.admin .stat-value {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  overflow-wrap: anywhere;
}

.admin-login {
  max-width: 28rem;
  margin: 3rem auto;
}

.admin-chart {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: auto;
}

.chart-bar {
  fill: var(--accent);
}

.chart-bar-alt {
  fill: var(--link);
}

.chart-label,
.chart-value {
  fill: var(--muted);
  font: 12px var(--font);
}

.chart-value {
  fill: var(--text);
  font-weight: 600;
}

.legend {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin: 0 0.25rem 0 0.5rem;
  border-radius: 3px;
  vertical-align: -1px;
}

.legend-main {
  background: var(--accent);
}

.legend-alt {
  background: var(--link);
}

/* API host home page: the AgenTack brand. Light only, scoped to body.ag-home so the other
   pages keep their own look. The glow is pure radial-gradients; the prompt box is shown
   disabled (the builder is not live yet). Text pairs meet WCAG AA on --ag-bg and white. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ag-home {
  color-scheme: light;
  --ag-navy: #1b2f4e;
  --ag-teal: #1fa2a6;
  --ag-teal-ink: #0d6e72;
  --ag-cyan: #7fe6ea;
  --ag-bg: #f4f8f8;
  --ag-muted: #4a5a70;
  --bg: var(--ag-bg);
  --surface: #ffffff;
  --text: var(--ag-navy);
  --muted: var(--ag-muted);
  --border: #d9e4e6;
  --border-strong: #7d8fa3;
  --link: var(--ag-teal-ink);
  --accent: var(--ag-navy);
  --accent-hover: #0f1e35;
  --on-accent: #ffffff;
  --code-bg: #e6eff0;
  --focus: var(--ag-teal-ink);
  --badge-bg: #dff4f4;
  --badge-text: var(--ag-teal-ink);
  --info-bg: #e8f5f5;
  --info-border: #b6dedf;
  --hero-ink: #ffffff;
  --hero-muted: #dbe7f0;
  --serif: var(--font);
  background: var(--ag-bg);
  color: var(--ag-navy);
  font-family: var(--font);
}

.ag-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem var(--gutter);
}

.ag-logo {
  display: inline-flex;
  margin-right: auto;
}

.ag-logo img {
  display: block;
  width: auto;
  height: 2.25rem;
}

.ag-nav {
  display: flex;
  gap: 1.25rem;
}

.ag-nav a {
  color: var(--ag-navy);
  font-weight: 500;
  text-decoration: none;
}

.ag-nav a:hover {
  text-decoration: underline;
}

.ag-cta {
  display: flex;
  gap: 0.5rem;
}

.ag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--ag-navy);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.ag-pill-outline {
  background: transparent;
  color: var(--ag-navy);
}

.ag-pill-outline:hover {
  background: #ffffff;
}

.ag-pill-navy {
  background: var(--ag-navy);
  color: #ffffff;
}

.ag-pill-navy:hover {
  background: #0f1e35;
}

.ag-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 calc(-1 * var(--gutter)) clamp(2.5rem, 6vw, 4rem);
  padding: clamp(3rem, 9vw, 6.5rem) var(--gutter) clamp(3rem, 8vw, 5rem);
  overflow-x: clip;
  text-align: center;
}

.ag-glow {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(50% 40% at 50% 82%, rgba(27, 47, 78, 0.4), transparent 70%),
    radial-gradient(38% 42% at 28% 72%, rgba(31, 162, 166, 0.55), transparent 70%),
    radial-gradient(40% 44% at 74% 70%, rgba(127, 230, 234, 0.75), transparent 70%),
    radial-gradient(65% 40% at 50% 55%, rgba(127, 230, 234, 0.3), transparent 75%);
  filter: blur(28px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 80%, transparent);
}

.ag-hero h1 {
  max-width: 20ch;
  margin: 0 0 1rem;
  color: var(--ag-navy);
  font-size: clamp(2.1rem, 1.2rem + 4.4vw, 4.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.ag-sub {
  max-width: 36rem;
  margin: 0 0 2.25rem;
  color: var(--ag-muted);
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3rem);
}

.ag-box {
  position: relative;
  width: 100%;
  max-width: 46rem;
  padding: 1rem 1rem 0.75rem;
  border: 1px solid #e1eaec;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(27, 47, 78, 0.06), 0 24px 60px -24px rgba(27, 47, 78, 0.35);
  text-align: left;
  cursor: not-allowed;
}

.ag-soon {
  position: absolute;
  top: -0.8rem;
  right: 1.25rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--ag-teal-ink);
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
}

.ag-box textarea {
  display: block;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.25rem 0.25rem;
  border: 0;
  background: transparent;
  color: var(--ag-navy);
  font: inherit;
  font-size: 1.0625rem;
  resize: none;
  cursor: not-allowed;
}

.ag-box textarea::placeholder {
  color: #5d6b7e;
  opacity: 1;
}

.ag-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.ag-right {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ag-box button,
.ag-box button:disabled {
  min-height: 2.25rem;
  padding: 0;
  border: 1px solid #d9e4e6;
  background: #ffffff;
  color: var(--ag-navy);
  box-shadow: none;
  opacity: 0.55;
  cursor: not-allowed;
}

.ag-box .ag-icon-btn {
  width: 2.25rem;
  border-radius: 999px;
}

.ag-box .ag-mode {
  padding: 0 0.85rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.ag-box .ag-send {
  width: 2.25rem;
  border-color: var(--ag-navy);
  border-radius: 999px;
  background: var(--ag-navy);
  color: #ffffff;
}

.ag-box .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.ag-note {
  max-width: 46rem;
  margin: 1.25rem 0 0;
  color: var(--ag-muted);
  font-size: 0.9375rem;
}

.ag-note a {
  color: var(--ag-teal-ink);
  font-weight: 600;
}

.ag-home .how,
.ag-home .section {
  scroll-margin-top: 1rem;
}

.ag-home .step,
.ag-home .section.card,
.ag-home .faq-item {
  border-color: var(--border);
  background: #ffffff;
}

.ag-home .tile-icon {
  background: #dff4f4;
  color: var(--ag-teal-ink);
}

.ag-example {
  display: grid;
  gap: 1.75rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  border-radius: 24px;
  background: linear-gradient(160deg, #22406a, var(--ag-navy) 60%, #12213a);
  color: #ffffff;
}

.ag-example h2,
.ag-example a:not(.button) {
  color: #ffffff;
}

.ag-example .hero-lead {
  color: var(--hero-muted);
}

.ag-example .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.ag-example .button {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--ag-navy);
}

.ag-example .button.ghost {
  border-color: rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #ffffff;
}

.ag-example :focus-visible {
  outline-color: var(--ag-cyan);
}

.ag-home .site-footer a {
  color: var(--ag-muted);
}

@media (max-width: 30rem) {
  .ag-header {
    justify-content: space-between;
  }

  .ag-logo {
    margin-right: 0;
  }

  .ag-nav {
    order: 3;
    width: 100%;
  }

  .ag-pill {
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
  }
}

@media (forced-colors: active) {
  .ag-glow {
    display: none;
  }
}
