/* Same look as ai-e-rechnung.christianpfrang.com: black, grey, lots of white. System fonts only. */

:root {
  --bg: #ffffff;
  --surface: #f6f6f4;
  --surface-2: #ecece8;
  --text: #111111;
  --quiet: #5f5f5a;
  --line: #d6d6d0;
  --accent: #000000;
  --on-accent: #ffffff;
  --good: #1f7a3a;
  --good-bg: #e6f2e9;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --warn: #8a5a00;
  --warn-bg: #fbf0db;
  --link: #2a5fc7;
  --link-tint: #e6eefb;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Fira Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --surface: #1b1b1a; --surface-2: #262624; --text: #ededea; --quiet: #a3a39c;
    --line: #393936; --accent: #ededea; --on-accent: #121212; --good: #6cc788; --good-bg: #1a2b1f;
    --bad: #ff8a7f; --bad-bg: #351a17; --warn: #e2b35a; --warn-bg: #2e2614; --link: #8fb0f2; --link-tint: #1a2235; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --surface: #1b1b1a; --surface-2: #262624; --text: #ededea; --quiet: #a3a39c;
  --line: #393936; --accent: #ededea; --on-accent: #121212; --good: #6cc788; --good-bg: #1a2b1f;
  --bad: #ff8a7f; --bad-bg: #351a17; --warn: #e2b35a; --warn-bg: #2e2614; --link: #8fb0f2; --link-tint: #1a2235; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
a { color: inherit; }
code { font: .88em var(--mono); background: var(--surface-2); padding: .05em .3em; border-radius: 4px; overflow-wrap: anywhere; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wide { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* header */
.head { border-top: 3px solid var(--accent); border-bottom: 1px solid var(--line); }
.head-inner { display: flex; align-items: center; height: 56px; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: -.01em; }

/* hero */
.hero { padding-top: 56px; padding-bottom: 16px; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 16px; max-width: 20ch; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--quiet); max-width: 60ch; margin: 0; }
.status { font-size: 13px; color: var(--quiet); margin: 16px 0 0; }

/* text sections */
.text { padding-top: 48px; }
.text h2, .demo > h2 { font-size: 28px; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 14px; }
.text h3 { font-size: 19px; margin: 28px 0 10px; }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 12px; }

/* demo */
.demo { padding-top: 56px; }
.intro { color: var(--quiet); max-width: 68ch; margin: 0 0 16px; }
.scenarios { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.scenario { text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.scenario strong { display: block; }
.scenario span { color: var(--quiet); font-size: 14px; }
.scenario[aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.field { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.stations { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); background: var(--bg); }
.stations button { border: 0; background: none; padding: 12px 10px; cursor: pointer; text-align: left; border-bottom: 3px solid transparent;
  display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.stations .nr { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; }
.stations .name { font-size: 14px; line-height: 1.3; }
.stations button[aria-selected="true"] { border-bottom-color: var(--accent); }
.stations button[aria-selected="true"] .nr { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.station { padding: 28px 28px 8px; min-height: 520px; display: grid; gap: 18px; align-content: start; }
.station h3 { font-size: clamp(22px, 3vw, 28px); line-height: 1.2; letter-spacing: -.01em; margin: 0; max-width: 34ch; }
.station .lead { font-size: 17px; }
.hint { font-size: 13px; color: var(--quiet); margin: 0; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 28px 24px; }
.counter { color: var(--quiet); font-size: 14px; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 18px; cursor: pointer; text-decoration: none; font-size: 15px; }
.btn.main { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn[disabled] { opacity: .35; cursor: default; }

/* standards work */
.standards { padding-top: 56px; }
.std-box { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); padding: 28px; }
.std-box h2 { font-size: 28px; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 10px; }
.std-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.std-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.std-card h3 { margin: 0; font-size: 17px; line-height: 1.3; }
.std-card p { margin: 0; font-size: 15px; }
.std-card .refs { font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--quiet); white-space: nowrap; }
.chip.rel { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* sequence diagram (wide screens) */
.seq { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding-bottom: 8px; }
.lane-head { text-align: center; padding: 12px 6px 8px; font-weight: 600; font-size: 14px; }
.lifeline { position: absolute; top: 44px; bottom: 0; width: 1px; background: var(--line); }
.srow { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); min-height: 46px; align-items: center; position: relative; transition: opacity .2s; }
.srow.dim { opacity: .25; }
.arrow { position: relative; height: 46px; }
.arrow .line { position: absolute; left: 0; right: 0; bottom: 18px; height: 2px; background: var(--text); }
.arrow.dashed .line { background: repeating-linear-gradient(90deg, var(--text) 0 6px, transparent 6px 11px); }
.arrow .line::after { content: ""; position: absolute; top: -5px; border: 6px solid transparent; }
.arrow.ltr .line::after { right: -2px; border-left: 9px solid var(--text); border-right: 0; }
.arrow.rtl .line::after { left: -2px; border-right: 9px solid var(--text); border-left: 0; }
.arrow .label { position: absolute; left: 50%; transform: translateX(-50%); bottom: 24px; white-space: nowrap; font-size: 13px; background: var(--bg); padding: 0 6px; }
.srow.tampered .line { background: var(--bad); }
.srow.tampered .arrow.ltr .line::after { border-left-color: var(--bad); }
.srow.tampered .arrow.rtl .line::after { border-right-color: var(--bad); }
.srow.tampered .label { color: var(--bad); }
.box { margin: 4px 10px; padding: 6px 10px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; font-size: 13px; text-align: center; position: relative; z-index: 1; }
.box.tamper, .box.refuse { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.box.pay { border-color: var(--good); background: var(--good-bg); color: var(--good); font-weight: 600; }
.box.refuse { font-weight: 600; }
.box.unknown { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.tag { font: 600 10.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-right: 6px; color: var(--quiet); background: var(--bg); }

/* sequence as a list (phones) */
.seq-list { display: none; list-style: none; margin: 0; padding: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.seq-list li { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 14px; transition: opacity .2s; }
.seq-list li:first-child { border-top: 0; }
.seq-list li.dim { opacity: .3; }
.seq-list .who { display: block; font-size: 12px; color: var(--quiet); }
.seq-list li.tampered { color: var(--bad); }

/* panels inside steps */
pre.json, pre.code { margin: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  font: 12.5px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
pre.code { white-space: pre; word-break: normal; }
pre.json div { padding-left: 14px; position: relative; }
pre.json div::before { position: absolute; left: 0; }
pre.json .add { background: var(--bad-bg); color: var(--bad); } pre.json .add::before { content: "+"; }
pre.json .del { color: var(--quiet); text-decoration: line-through; } pre.json .del::before { content: "−"; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.panel h4 { margin: 0; font-size: 15px; }
.panel .outcome { font-size: 18px; font-weight: 600; }
.panel.good .outcome { color: var(--good); } .panel.bad .outcome { color: var(--bad); } .panel.unknown .outcome { color: var(--warn); }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.code-block { display: grid; gap: 6px; }

.checks { list-style: none; margin: 0; padding: 0; font-size: 14px; max-width: 860px; }
.checks li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 2px 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.checks .mark { font-weight: 700; }
.checks .ok .mark { color: var(--good); } .checks .bad .mark { color: var(--bad); } .checks .neutral .mark { color: var(--quiet); }
.checks .by { font-size: 12px; color: var(--quiet); white-space: nowrap; }
.checks .by.added { color: var(--text); font-weight: 600; }
.checks .detail { grid-column: 2 / -1; font: 12px var(--mono); color: var(--quiet); overflow-wrap: anywhere; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--quiet); } .kv dd { margin: 0; font: 13px var(--mono); overflow-wrap: anywhere; }
.msg { font-size: 15px; margin: 0; } .msg.ok { color: var(--good); } .msg.bad { color: var(--bad); } .msg.warn { color: var(--warn); }

.foot { border-top: 1px solid var(--line); padding: 24px 0 40px; margin-top: 64px; font-size: 13px; color: var(--quiet); }
.foot p { margin: 4px 0; max-width: 90ch; }

@media (max-width: 900px) {
  .scenarios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .stations button { flex-direction: column; align-items: center; text-align: center; padding: 10px 4px; }
  .stations .name { font-size: 11.5px; }
  .station { padding: 20px 16px 4px; min-height: 0; }
  .nav { padding: 12px 16px 16px; }
  .two, .std-grid { grid-template-columns: 1fr; }
  .std-box { padding: 20px 16px; }
  .scenarios { grid-template-columns: 1fr; }
  .seq { display: none; }
  .seq-list { display: block; }
}
@media (max-width: 420px) {
  .stations .name { display: none; }
}
@media (prefers-reduced-motion: reduce) { .srow, .seq-list li { transition: none; } }

/* header menu */
.head-inner { justify-content: space-between; gap: 16px; }
.menu { display: flex; gap: 18px; font-size: 15px; }
.menu a { text-decoration: none; color: var(--quiet); }
.menu a:hover, .menu a[aria-current] { color: var(--text); }
.menu a[aria-current] { font-weight: 600; }
.hero .lead a { color: var(--link); }

/* contact box, as on christianpfrang.com */
.contact { margin-top: 56px; padding: 20px 18px; border: 2px solid var(--link); border-radius: 9px; background: var(--link-tint); text-align: center; }
.contact p { margin: 0; }
.contact p + p { margin-top: 4px; }
.contact .email { color: var(--text); font-weight: 650; font-size: 1.05rem; text-decoration: none; overflow-wrap: anywhere; }
.contact .email:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .head-inner { height: auto; padding-block: 12px; flex-wrap: wrap; }
  .menu { gap: 14px; font-size: 14px; }
}

/* running commentary under each step */
.log { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.btn.small { padding: 3px 12px; font-size: 13px; }
.log-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--quiet); text-transform: uppercase; letter-spacing: .05em; }
.log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.log li { display: grid; grid-template-columns: 13ch minmax(0, 1fr); gap: 10px; font: 12.5px/1.45 var(--mono); transition: opacity .2s; }
.log li span { overflow-wrap: anywhere; }
.log li time { color: var(--quiet); }
.log li.dim { opacity: .35; }
@media (max-width: 520px) { .log li { grid-template-columns: 1fr; gap: 0; } }
