/* SPDX-License-Identifier: Apache-2.0 */
/* Apache-2.0 — X6 market site stylesheet.
   Deliberately small and editorial: system fonts, one accent color, generous spacing, no
   external requests. Generated pages only ever link this one local file. */

:root {
  color-scheme: light;
  --paper: #fcfcfa;
  --surface: #f4f3ef;
  --ink: #191a1c;
  --muted: #64676e;
  --line: #e3e1db;
  --accent: #9a3d1a;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--paper));
  --radius: 10px;
  --measure: 46rem;
  --wrap: 76rem;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #121315;
    --surface: #1a1c1f;
    --ink: #f1f0ec;
    --muted: #a3a6ad;
    --line: #2c2f34;
    --accent: #e59a72;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, var(--paper));
  }
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -0.011em; }

h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); margin: 0.4rem 0 1rem; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin: 3.4rem 0 0.9rem; }
h3 { font-size: 1.06rem; margin: 2.2rem 0 0.5rem; }
h4 { font-size: 0.95rem; margin: 1.6rem 0 0.4rem; }

p { margin: 0 0 1rem; }
p.lead { font-size: 1.16rem; color: var(--muted); max-width: var(--measure); }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

code, pre, kbd { font-family: var(--mono); font-size: 0.875em; }
code { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0.06em 0.34em; }
pre code { background: none; border: 0; padding: 0; font-size: 0.86rem; }

pre.code {
  margin: 0 0 1.1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
}

table { width: 100%; border-collapse: collapse; margin: 0 0 1.2rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); font-weight: 600; }
td { font-size: 0.94rem; }
.table-wrap { overflow-x: auto; }

ul { margin: 0 0 1.1rem; padding-left: 1.15rem; }
li { margin: 0.2rem 0; }

/* Agent surfaces strip: interface-only chrome, excluded from HTML/Markdown parity. */
.topline {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
  padding: 0.4rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
}
.topline a { color: var(--muted); text-decoration: none; }
.topline a:hover { color: var(--accent); }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 0.75rem; top: 0.75rem; z-index: 3; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.45rem 0.7rem; }

.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--mono); font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.site-header nav { display: flex; gap: 1.1rem; font-size: 0.86rem; color: var(--muted); }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { color: var(--accent); }

main { padding-bottom: 4rem; }

/* Landing hero and toolbar. */
.hero { padding: 3.2rem 0 1rem; max-width: var(--measure); }
.hero .kicker { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin: 1.6rem 0 0; }
.button { display: inline-block; background: var(--accent); color: var(--paper); border-radius: 999px; padding: 0.5rem 1.05rem; font-size: 0.9rem; text-decoration: none; }
.button:hover { color: var(--paper); filter: brightness(1.06); }
.quiet { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); text-decoration: none; }
.quiet:hover { color: var(--accent); }

.toolbar {
  display: grid; gap: 0.8rem;
  margin: 1.4rem 0 1.8rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toolbar label { display: grid; gap: 0.6rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.toolbar input {
  width: 100%; padding: 0.55rem 0.7rem;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--paper); color: var(--ink);
  font: 0.95rem var(--sans);
}
.toolbar input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips button {
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  padding: 0.28rem 0.75rem; font: 0.82rem var(--mono); cursor: pointer;
}
.chips button:hover { border-color: var(--accent); color: var(--accent); }
.chips button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.results { margin: 0; font-size: 0.84rem; color: var(--muted); font-family: var(--mono); }

/* Component grid. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 1.15rem; margin-top: 1rem; }
.card {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper);
  transition: border-color 120ms ease;
}
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0; font-family: var(--mono); font-size: 1rem; }
.card h3 a { text-decoration: none; }
.card p { margin: 0; }
.card .card-desc { font-size: 0.92rem; }
.card .card-meta { font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }
.card pre.code { margin: 0.2rem 0 0; font-size: 0.78rem; padding: 0.55rem 0.7rem; }
.card pre.code code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Component pages. */
.page-head { padding: 2.6rem 0 0.6rem; }
.page-head p { max-width: var(--measure); }
.crumbs { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin: 0 0 0.4rem; }
.meta-table { max-width: var(--measure); }
.meta-table td:first-child { width: 12rem; color: var(--muted); }
.prose { max-width: var(--measure); }

.preview { margin: 0 0 1.2rem; padding: 1rem 1.1rem; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.preview .ds-component, .preview .ds-prose, .preview .ds-callout, .preview .ds-code { margin: 0; }
.preview .ds-fallback-note { margin: 0; color: var(--muted); font-size: 0.9rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.4rem;
}
.site-footer p { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; font-size: 0.82rem; color: var(--muted); }

@media (max-width: 42rem) {
  .wrap { width: min(100% - 1.6rem, var(--wrap)); }
  .site-header, .site-footer p { width: min(100% - 1.6rem, var(--wrap)); }
  .hero { padding-top: 2.2rem; }
  h2 { margin-top: 2.6rem; }
  .card { padding: 1rem; }
}
