/* Weber AI Systems — n8n demo page.
 *
 * Identity comes from the engineering-drawing world the assistant answers from:
 * hairline rules instead of card shadows, 3px radii instead of soft corners, and
 * monospace with tabular numerals for anything that reads as specification.
 * --primary is Weber's own blue, already used elsewhere in this project.
 */

:root {
  --primary: #1a3f6c;
  --ink: #0f1c28;
  --muted: #5a6b7a;
  --paper: #f1f4f7;
  --surface: #ffffff;
  --rule: #c6d2dc;
  /* Semantic only, deliberately not the accent. */
  --signal: #a8541b;

  --radius: 3px;
  --measure: 62ch;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", monospace;

  color-scheme: light dark;
}

/* Dark is a token swap, not an inversion: the ground moves to dark steel and the
   accent is lifted, because #1a3f6c fails contrast on a dark ground. */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5b8fc7;
    --ink: #e8eef4;
    --muted: #93a4b3;
    --paper: #0d161d;
    --surface: #131f29;
    --rule: #263644;
    --signal: #d08a4f;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---- masthead ------------------------------------------------------------ */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
}

.wordmark {
  font-weight: 650;
  letter-spacing: -0.015em;
}

/* Reads as a drawing stamp rather than a marketing pill. */
.stamp {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0.1rem 0.4rem;
}

/* ---- layout -------------------------------------------------------------- */
main {
  max-width: 68rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.lede {
  max-width: var(--measure);
  margin-bottom: 3rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.deck {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--muted);
}

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

@media (max-width: 62rem) {
  .columns {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ---- prose --------------------------------------------------------------- */
.prose {
  min-width: 0;
  max-width: var(--measure);
}

.prose h2 {
  margin: 2.5rem 0 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.prose > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--muted);
}

/* Numbered because the three steps really are a sequence. */
.steps {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 1.5rem;
}

.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0.85rem;
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--primary);
  padding-top: 0.28rem;
}

/* The body is a wrapper rather than a set of grid-placed children: placing each
   child individually needed a :not(::before) exclusion, which is invalid CSS —
   the rule was dropped and every paragraph collapsed into the 1.75rem number
   column. min-width:0 lets the snippet scroll instead of stretching the grid. */
.steps__body {
  min-width: 0;
}

.steps h3 {
  margin: 0 0 0.3rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.steps p {
  margin: 0;
  font-size: 0.9375rem;
}

/* ---- snippets ------------------------------------------------------------ */
.snippet {
  position: relative;
  margin: 0.25rem 0 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.snippet pre {
  margin: 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  tab-size: 2;
}

.snippet code {
  font: inherit;
  color: var(--ink);
  white-space: pre;
}

.copy {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.copy:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.copy:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.copy.is-done {
  color: var(--primary);
  border-color: var(--primary);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--surface);
}

/* ---- datasheet ----------------------------------------------------------- */
.datasheet {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  position: sticky;
  top: 1.5rem;
}

.datasheet__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.datasheet__title,
.datasheet__rev {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.datasheet__title {
  color: var(--ink);
}

.datasheet__rev {
  color: var(--muted);
}

.datasheet dl {
  margin: 0;
  padding: 0.35rem 1rem;
}

.datasheet dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.datasheet dl > div:last-child {
  border-bottom: 0;
}

.datasheet dt {
  font-size: 0.8125rem;
  color: var(--muted);
}

.datasheet dd {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: right;
}

/* Values that read as measurements get the monospace + tabular treatment. */
.datasheet dd.code,
.datasheet .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  font-weight: 400;
}

.datasheet__foot {
  margin: 0;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---- footer -------------------------------------------------------------- */
footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--muted);
}

.dim {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
}

/* Keep the fixed widget from covering the footer on short viewports. */
@media (max-height: 40rem) {
  footer {
    padding-bottom: 5.5rem;
  }
}
