/* dataconnect demo — spec-sheet design system, dark only
   Night paper, warm ink, and one oxide accent. Mono for labels and data, sans for prose. */

@font-face { font-family: 'Plex Sans'; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Sans'; src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Plex Sans'; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Plex Sans'; src: url('/fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --paper: #131311;
  --surface: #1b1b18;
  --ink: #ece8de;
  --ink-2: #c9c4b8;
  --muted: #9a958a;
  --line: #2f2e2a;
  --line-strong: #46443e;
  --accent: #f07a45;
  --accent-ink: #1b0d05;
  --accent-soft: #3a2116;
  --ok: #62c39a;
  --bad: #ff8a80;
  --warn: #e0b84f;
  --code-bg: #24231f;

  --sans: 'Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  font-feature-settings: 'kern', 'liga';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- masthead / colophon ---- */

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; }
.wordmark { font: 500 0.95rem/1 var(--mono); text-decoration: none; letter-spacing: -0.01em; }
.wm-slash { color: var(--accent); padding: 0 0.15em; }
.wm-b { color: var(--muted); }
.nav { display: flex; gap: 1.25rem; font: 400 0.8rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.nav a { text-decoration: none; color: var(--muted); padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.nav a[aria-current='page'] { color: var(--ink); border-color: var(--accent); }

.colophon { border-top: 1px solid var(--line); margin-top: 5rem; font: 400 0.75rem/1.5 var(--mono); color: var(--muted); }
.colophon-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-top: 1.25rem; padding-bottom: 1.5rem; }
.colophon b { color: var(--ink); font-weight: 500; }

/* ---- type scale ---- */

.hero { padding-top: clamp(2.5rem, 8vw, 5.5rem); padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.eyebrow { font: 400 0.78rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 1.25rem; }
.eyebrow span { color: var(--accent); }
.hero h1 { font-size: clamp(2.1rem, 6vw, 4rem); font-weight: 600; letter-spacing: -0.03em; max-width: 18ch; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 60ch; margin-top: 1.25rem; }

.block { margin-top: clamp(3rem, 7vw, 4.5rem); }
.label {
  font: 500 0.75rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem;
}
.label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.section-intro { color: var(--ink-2); max-width: 64ch; margin: -0.25rem 0 1.75rem; }
.note { font-size: 0.875rem; color: var(--muted); margin-top: 0.9rem; max-width: 60ch; }

.banner {
  margin-top: 1.5rem; padding: 0.75rem 1rem; border: 1px solid var(--accent); background: var(--accent-soft);
  border-radius: var(--radius); font-size: 0.9rem;
}

/* ---- index ---- */

.exhibits { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.exhibit {
  display: grid; grid-template-columns: 6rem 1fr auto; gap: 1.5rem; align-items: baseline;
  padding: 1.5rem 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.exhibit:hover .ex-title { color: var(--accent); }
.ex-num { font: 500 0.85rem/1 var(--mono); color: var(--accent); }
.ex-title { display: block; font-size: clamp(1.3rem, 2.5vw, 1.75rem); font-weight: 600; letter-spacing: -0.02em; transition: color 0.15s; }
.ex-desc { display: block; color: var(--ink-2); margin-top: 0.35rem; max-width: 58ch; }
.ex-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; font: 400 0.75rem/1 var(--mono); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ok); text-transform: uppercase; letter-spacing: 0.08em; }
.status::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }

.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.split > div { min-width: 0; }

.spec, .facts { margin: 0; }
.spec > div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.spec > div:first-child { border-top: 1px solid var(--ink); }
.spec dt { font: 400 0.78rem/1.6 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.spec dd { margin: 0; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 2.25rem; border-top: 1px solid var(--ink); }
.facts > div { padding: 0.8rem 1rem 0 0; }
.facts > div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.facts dt { font: 400 0.72rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.45rem; }
.facts dd { margin: 0; font-size: 0.95rem; overflow-wrap: anywhere; }

/* ---- exhibit ---- */

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.steps li { counter-increment: step; background: var(--surface); padding: 1.1rem 1.1rem 1.25rem; font-size: 0.925rem; color: var(--ink-2); }
.steps li::before { content: '0' counter(step); display: block; font: 500 0.78rem/1 var(--mono); color: var(--accent); margin-bottom: 0.75rem; }
.steps b { color: var(--ink); font-weight: 600; display: block; margin-bottom: 0.25rem; }
.snippet {
  margin: 1rem 0 0; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); overflow-x: auto; line-height: 1.55;
}

.designs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.design {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; min-width: 0;
  scroll-margin-top: 1rem;
}
.design.is-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.design-head { display: grid; grid-template-columns: auto 1fr; gap: 1rem; }
.design-num { font: 500 0.8rem/1 var(--mono); color: var(--accent-ink); background: var(--accent); padding: 0.35rem 0.45rem; border-radius: 3px; height: fit-content; }
.design h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.design-head p { color: var(--ink-2); font-size: 0.9rem; margin-top: 0.3rem; }
.chips { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chips li { font: 400 0.7rem/1 var(--mono); padding: 0.3rem 0.45rem; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--muted); }

.share { display: flex; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.share-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem !important; padding: 0.45rem 0.6rem !important; }

.btn {
  font: 500 0.78rem/1 var(--mono); padding: 0.5rem 0.7rem; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn.is-done { border-color: var(--ok); color: var(--ok); }

.payload { margin-top: 1rem; border-top: 1px solid var(--line); }
.payload summary {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.75rem 0 0; cursor: pointer;
  font: 400 0.75rem/1.4 var(--mono); color: var(--muted); list-style: none;
}
.payload summary::-webkit-details-marker { display: none; }
.payload summary > span:first-child::before { content: '+ '; color: var(--accent); }
.payload[open] summary > span:first-child::before { content: '− '; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }
.payload pre { margin: 0.75rem 0 0; max-height: 26rem; overflow: auto; padding: 0.9rem; background: var(--code-bg); border-radius: var(--radius); font-size: 0.75rem; line-height: 1.5; }

.notes { list-style: none; counter-reset: note; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; }
.notes li { counter-increment: note; padding: 1.1rem 0 1.25rem; border-top: 1px solid var(--line); }
.notes h3 { font-size: 1rem; font-weight: 600; display: flex; gap: 0.75rem; align-items: baseline; }
.notes h3::before { content: counter(note, decimal-leading-zero); font: 500 0.75rem/1 var(--mono); color: var(--accent); }
.notes p { color: var(--ink-2); font-size: 0.925rem; margin-top: 0.4rem; }

/* ---- playground ---- */

.pg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
.pg-field, .pg-check { font: 400 0.78rem/1 var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 0.5rem; max-width: 100%; min-width: 0; }
.pg-field select {
  font: 400 0.8rem/1 var(--mono); color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 0.45rem 0.5rem; max-width: 100%; min-width: 0;
}
.pg-check input { accent-color: var(--accent); }
.pg-spacer { flex: 1; }
.pg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pg-editor { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; }
.pg textarea {
  width: 100%; min-height: 30rem; flex: 1; resize: vertical; border: 0; padding: 1rem; background: var(--code-bg); color: var(--ink);
  font: 400 0.78rem/1.55 var(--mono); tab-size: 2;
}
.pg textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.pg-report { padding: 0.9rem 1rem; font: 400 0.78rem/1.5 var(--mono); border-top: 1px solid var(--line); max-height: 16rem; overflow: auto; }
.pg-report .sum { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-bottom: 0.5rem; }
.pg-report .sum b { font-weight: 500; }
.pg-report ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.pg-report li { display: grid; grid-template-columns: 3.5rem 1fr; gap: 0.5rem; }
.pg-report .lvl-error { color: var(--bad); }
.pg-report .lvl-warn { color: var(--warn); }
.pg-report .path { color: var(--muted); overflow-wrap: anywhere; }
.pg-out { padding: 1rem; min-width: 0; }
.pg-out .discord { margin: 0; }

/* ---- Discord lookalike (always dark, independent of site theme) ---- */

.discord { margin: 0; }
.discord figcaption { font: 400 0.7rem/1.4 var(--mono); color: var(--muted); margin-top: 0.5rem; }
.discord-frame {
  --dc-bg: #313338; --dc-card: #2b2d31; --dc-text: #dbdee1; --dc-head: #f2f3f5; --dc-muted: #949ba4;
  --dc-link: #00a8fc; --dc-btn: #4e5058; --dc-btn-hover: #6d6f78; --dc-code: #1e1f22; --dc-line: #3f4147;
  background: var(--dc-bg); color: var(--dc-text); border-radius: 8px; padding: 1rem 1rem 1.1rem 0.75rem;
  font: 400 15px/1.375 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow: hidden; color-scheme: dark;
}
.dc-message { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(from 200deg, #c24e22, #f07a45, #b0892f, #c24e22); }
.dc-main { min-width: 0; }
.dc-meta { display: flex; align-items: baseline; gap: 0.5rem; }
.dc-author { color: var(--dc-head); font-weight: 600; font-size: 15px; }
.dc-time { color: var(--dc-muted); font-size: 12px; }
.dc-link a { color: var(--dc-link); text-decoration: none; word-break: break-all; }
.dc-link a:hover { text-decoration: underline; }
.dc-embed { margin-top: 6px; max-width: 480px; }
.dc-container {
  background: var(--dc-card); border: 1px solid var(--dc-line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.dc-container.has-accent { border-left: 4px solid var(--dc-accent); }
.dc-text { min-width: 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.375; }
.dc-text a { color: var(--dc-link); text-decoration: none; }
.dc-text a:hover { text-decoration: underline; }
.dc-text code { background: var(--dc-code); color: var(--dc-text); padding: 0.1em 0.3em; border-radius: 4px; font-size: 0.85em; }
.dc-text pre { background: var(--dc-code); border: 1px solid #1e1f22; border-radius: 4px; padding: 0.5em; margin: 4px 0; overflow-x: auto; }
.dc-text pre code { background: none; padding: 0; }
.dc-text ul, .dc-text ol { margin: 4px 0; padding-left: 1.5em; }
.dc-text blockquote { margin: 2px 0; padding-left: 12px; border-left: 4px solid #4e5058; }
.dc-h1, .dc-h2, .dc-h3 { color: var(--dc-head); font-weight: 700; line-height: 1.375; margin: 4px 0 2px; }
.dc-h1 { font-size: 24px; } .dc-h2 { font-size: 20px; } .dc-h3 { font-size: 16px; }
.dc-h1 a, .dc-h2 a, .dc-h3 a { color: var(--dc-link); }
.dc-text > :first-child { margin-top: 0; }
.dc-sub { color: var(--dc-muted); font-size: 13px; }
.dc-sub a { color: var(--dc-link); }
.dc-gap { height: 0.4em; }
.dc-text strong { color: var(--dc-head); font-weight: 700; }
.dc-ts { background: rgba(78, 80, 88, 0.48); padding: 0 2px; border-radius: 3px; }
.dc-spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; }
.dc-spoiler.is-open, .dc-spoiler:focus { background: rgba(255, 255, 255, 0.1); color: inherit; }
.dc-sep { height: 4px; }
.dc-sep.is-lg { height: 16px; }
.dc-sep.has-line { display: flex; align-items: center; }
.dc-sep.has-line::before { content: ''; flex: 1; height: 1px; background: var(--dc-line); }
.dc-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 12px; border-radius: 8px; background: var(--dc-btn); color: #fff;
  font-size: 14px; font-weight: 500; text-decoration: none; transition: background 0.15s;
}
.dc-btn:hover { background: var(--dc-btn-hover); color: #fff; }
.dc-btn.is-disabled { opacity: 0.5; cursor: not-allowed; }
.dc-ext { width: 14px; height: 14px; flex: none; }
.dc-gallery { display: grid; gap: 4px; border-radius: 8px; overflow: hidden; }
.dc-gallery.n2 { grid-template-columns: 1fr 1fr; }
.dc-gallery.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.dc-gallery.n3 .dc-cell:first-child { grid-row: span 2; }
.dc-gallery.n4 { grid-template-columns: 1fr 1fr; }
.dc-gallery.n5 { grid-template-columns: repeat(3, 1fr); }
.dc-cell { background: var(--dc-code); min-height: 0; position: relative; overflow: hidden; }
.dc-cell img, .dc-cell video { display: block; width: 100%; height: 100%; object-fit: cover; }
.dc-gallery.n1 .dc-cell img { height: auto; max-height: 350px; object-fit: contain; }
.dc-section { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.dc-section-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dc-thumb { width: 85px; height: 85px; border-radius: 8px; overflow: hidden; background: var(--dc-code); position: relative; }
.dc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-spoiled > img, .dc-spoiled > video { filter: blur(24px) brightness(0.6); }
.dc-spoiled::after {
  content: 'SPOILER'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  font: 700 11px/1 'Helvetica Neue', Arial, sans-serif; letter-spacing: 0.04em; cursor: pointer;
}
.dc-spoiled.is-open > img, .dc-spoiled.is-open > video { filter: none; }
.dc-spoiled.is-open::after { display: none; }
.dc-container.dc-spoiled > * { visibility: hidden; }
.dc-container.dc-spoiled.is-open > * { visibility: visible; }
.dc-missing, .dc-unknown { color: var(--dc-muted); font-size: 12px; padding: 8px; }

/* ---- responsive ---- */

@media (max-width: 960px) {
  .designs { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .pg-grid { grid-template-columns: minmax(0, 1fr); }
  .pg-editor { border-right: 0; border-bottom: 1px solid var(--line); }
  .pg textarea { min-height: 20rem; }
}
@media (max-width: 640px) {
  .exhibit { grid-template-columns: 1fr; gap: 0.5rem; }
  .ex-meta { flex-direction: row; align-items: center; gap: 1rem; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .steps, .notes { grid-template-columns: minmax(0, 1fr); }
  .spec > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .share { flex-wrap: wrap; }
  .share-url { flex-basis: 100%; }
  .pg-field { flex: 1 1 100%; }
  .pg-field select { flex: 1; width: 0; }
  .discord-frame { padding: 0.75rem 0.6rem 0.9rem 0.5rem; font-size: 14px; }
  .dc-message { grid-template-columns: 32px minmax(0, 1fr); gap: 0 8px; }
  .dc-avatar { width: 32px; height: 32px; }
  .dc-container { padding: 12px; }
  .dc-thumb { width: 64px; height: 64px; }
}

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