:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #09090b;
  --surface-raised: #101014;
  --text: #f7f7f8;
  --muted: #a9a9b2;
  --subtle: #777780;
  --line: #25252b;
  --line-strong: #3a3a42;
  --accent: #ff3195;
  --accent-hover: #ff5aab;
  --accent-soft: #2b0719;
  --success: #60e3aa;
  --max: 1180px;
  --reading: 74ch;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #000000; scroll-behavior: smooth; scrollbar-color: var(--line-strong) #000000; }
body {
  margin: 0;
  min-height: 100vh;
  background: #000000;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #ffffff; }
a { color: inherit; text-underline-offset: 0.2em; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -6rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #000000;
  font-weight: 750;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: #000000; }
.header-inner, .container { width: min(calc(100% - 3rem), var(--max)); margin-inline: auto; }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: 1rem; min-width: 0; color: #ffffff; text-decoration: none; }
.brand-logo { display: block; width: 112px; height: auto; max-height: 38px; object-fit: contain; object-position: left center; }
.brand-label {
  padding-left: 1rem;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a { position: relative; padding: 0.6rem 0.8rem; color: var(--muted); font-size: 0.92rem; font-weight: 650; text-decoration: none; }
.nav a::after { content: ""; position: absolute; right: 0.8rem; bottom: 0.25rem; left: 0.8rem; height: 1px; background: transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: #ffffff; }
.nav a[aria-current="page"]::after { background: var(--accent); }

main { padding: 0 0 6rem; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.55fr);
  align-items: end;
  gap: clamp(3rem, 8vw, 7rem);
  min-height: min(680px, calc(100vh - 76px));
  padding: clamp(5rem, 11vw, 9rem) 0 clamp(4rem, 8vw, 7rem);
  border-bottom: 1px solid var(--line);
}
.hero > div:first-child { max-width: 780px; }

h1, h2, h3 { color: #ffffff; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
h1 { max-width: 13ch; margin: 0; font-size: clamp(3rem, 7.3vw, 5.75rem); font-weight: 760; }
h2 { margin: 4.75rem 0 1.1rem; font-size: clamp(1.75rem, 3.5vw, 2.75rem); font-weight: 730; }
h3 { margin: 0 0 0.65rem; font-size: 1.08rem; font-weight: 720; }
.lead { max-width: 66ch; margin: 1.7rem 0 0; color: #c2c2ca; font-size: clamp(1.05rem, 1.7vw, 1.22rem); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 0.55rem 1.25rem; margin-top: 1.35rem; color: var(--subtle); font-size: 0.8rem; }
.doc-meta span, .doc-meta time { display: inline-flex; align-items: center; }
.doc-meta span:not(:first-child)::before, .doc-meta time::before { content: ""; width: 3px; height: 3px; margin-right: 1.25rem; border-radius: 50%; background: var(--line-strong); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.65rem;
  background: transparent;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 180ms ease-out, background-color 180ms ease-out, color 180ms ease-out;
}
.button.primary { border-color: var(--accent); background: var(--accent); color: #000000; }
.button:hover { border-color: #ffffff; background: #ffffff; color: #000000; }
.button.primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: #000000; }

.status-card, .webmcp-tool { align-self: end; padding: 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); background: #000000; }
.status-card::before, .webmcp-tool::before {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.status-card::before { content: "System / interface status"; }
.webmcp-tool::before { content: "Browser agent / public resource"; }
.status-row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.status-row:last-child { border-bottom: 0; }
.status-label { color: var(--subtle); }
.status-value { color: #dddde2; font-weight: 680; overflow-wrap: anywhere; text-align: right; }
.online { color: var(--success); }

.section { padding: 4.75rem 0; border-bottom: 1px solid var(--line); }
.section.grid > * { min-width: 0; }
.section-intro { max-width: var(--reading); margin: 0 0 2rem; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); align-content: start; column-gap: 0.8rem; padding: 1.6rem 1.4rem 1.75rem 0; border-bottom: 1px solid var(--line); }
.grid:not(.two) .card:not(:nth-child(3n + 1)), .grid.two .card:nth-child(even) { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.card h3, .card > p, .card a.more { grid-column: 1 / -1; }
.card .kicker { grid-column: 1; align-self: baseline; margin: 0.18rem 0 0; color: var(--accent); font-size: 0.7rem; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; }
.card .kicker + h3 { grid-column: 2; }
.card p { margin: 0; color: var(--muted); }
.card a.more { display: inline-flex; justify-self: start; margin-top: 1.1rem; color: #ff94c7; font-weight: 700; }
.card a.more:hover { color: #ffffff; }

.prose { max-width: var(--reading); padding-top: 0.25rem; }
.prose section { scroll-margin-top: 7rem; }
.prose p, .prose li { color: #c7c7ce; }
.prose p { margin-block: 0.9rem; }
.prose li + li { margin-top: 0.48rem; }
.prose a { color: #ff94c7; }
.prose a:hover { color: #ffffff; }
.prose code:not(pre code) { padding: 0.13em 0.35em; border: 1px solid var(--line); border-radius: 0.25rem; background: var(--surface); color: #ffd3e7; font-size: 0.88em; overflow-wrap: anywhere; }
pre { overflow-x: auto; margin: 1.4rem 0 2rem; padding: 1.25rem 1.4rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--surface); color: #e9e9ed; font-size: 0.85rem; line-height: 1.62; tab-size: 2; }
.table-wrap { max-width: 100%; overflow-x: auto; margin: 1.4rem 0 2rem; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
table { width: 100%; min-width: 540px; border-collapse: collapse; }
caption { padding: 0 0 0.8rem; color: var(--subtle); font-size: 0.82rem; text-align: left; caption-side: top; }
th, td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
th:first-child, td:first-child { width: 10rem; white-space: nowrap; }
th { background: var(--surface); color: #ffffff; font-size: 0.8rem; letter-spacing: 0.04em; }
td { color: #c7c7ce; }
tr:last-child td { border-bottom: 0; }

.http-outcomes { margin: 1.4rem 0 2rem; border-top: 1px solid var(--line-strong); }
.http-outcomes > div { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.http-outcomes dt, .http-outcomes dd { margin: 0; }
.http-outcomes dd { color: #c7c7ce; }

.callout { margin-top: 3rem; padding: 1.25rem 1.35rem; border: 1px solid #5a1536; border-radius: 0.75rem; background: var(--accent-soft); color: #e9c8d8; }
.callout strong { color: #ffffff; }
.webmcp-tool { padding-bottom: 1.15rem; }
.webmcp-tool label { display: block; margin: 1rem 0 0.55rem; color: #ffffff; font-weight: 720; }
.webmcp-tool select, .webmcp-tool button { width: 100%; min-height: 48px; border-radius: 0.55rem; font: inherit; }
.webmcp-tool select { padding: 0.7rem 0.8rem; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.webmcp-tool button { margin-top: 0.7rem; border: 1px solid var(--accent); background: var(--accent); color: #000000; font-weight: 760; cursor: pointer; transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out; }
.webmcp-tool button:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: #000000; }
.webmcp-output { min-height: 1.5rem; margin: 0.8rem 0 0; color: var(--muted); font-size: 0.9rem; }
:tool-form-active { outline: 3px solid rgba(255, 49, 149, 0.75); outline-offset: 5px; }
:tool-submit-active { box-shadow: 0 6px 24px rgba(255, 49, 149, 0.28); }

.site-footer { border-top: 1px solid var(--line); padding: 2.4rem 0 3.5rem; background: #000000; color: var(--subtle); }
.footer-inner { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: #ffffff; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; align-items: start; gap: 3.5rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid:not(.two) .card { padding-inline: 0; border-left: 0; }
  .grid:not(.two) .card:nth-child(even) { padding-left: 1.4rem; border-left: 1px solid var(--line); }
  .grid:not(.two) .card:nth-child(odd) { padding-right: 1.4rem; }
}

@media (max-width: 680px) {
  .header-inner, .container { width: min(calc(100% - 2rem), var(--max)); }
  .header-inner { min-height: auto; align-items: flex-start; flex-direction: column; gap: 0.75rem; padding: 0.9rem 0 0.65rem; }
  .brand-logo { width: 96px; max-height: 32px; }
  .brand-label { font-size: 0.7rem; }
  .nav { width: 100%; overflow-x: auto; padding-bottom: 0.2rem; }
  .nav a { padding: 0.5rem 0.65rem; white-space: nowrap; }
  .nav a:first-child { padding-left: 0; }
  .nav a:first-child::after { left: 0; }
  main { padding-bottom: 4rem; }
  .hero { padding: 4.5rem 0 3.5rem; }
  h1 { font-size: clamp(2.65rem, 14vw, 4.2rem); }
  h2 { margin-top: 3.75rem; }
  .actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .grid .card, .grid.two .card, .grid:not(.two) .card:nth-child(even), .grid:not(.two) .card:nth-child(odd) { padding-inline: 0; border-left: 0; }
  .status-row { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); }
  .footer-inner { flex-direction: column; }
  .doc-meta { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
  .doc-meta span:not(:first-child)::before, .doc-meta time::before { display: none; }
  .http-outcomes > div { grid-template-columns: 4rem minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
