@import url(fonts.css);

/* Melior – web. Panel grey of a control cabinet, blue control wiring, the green of a live signal. */
:root {
  --panel: #e6eae9;
  --surface: #f7f9f8;
  --ink: #17212b;
  --muted: #55626d;
  --line: #c8d0cf;
  --wire: #1e5bd6;
  --wire-ink: #ffffff;
  --live: #12a05a;
  --danger: #c22f2f;
  --radius-s: 6px;
  --radius-l: 14px;
  --display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --text: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 66ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --panel: #10171d;
    --surface: #172129;
    --ink: #e5ebee;
    --muted: #97a4ae;
    --line: #2a3742;
    --wire: #5d8eff;
    --wire-ink: #0d1520;
    --live: #2fd27c;
    --danger: #ff6b6b;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  font-feature-settings: "kern", "liga";
}
img, svg { display: block; max-width: 100%; }
a { color: var(--wire); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--wire); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.2; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lead { font-size: 1.25rem; line-height: 1.5; color: var(--muted); }
.muted { color: var(--muted); }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font: 700 1.45rem/1 var(--display); }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--wire); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--ink); padding: 8px; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav .button { margin-top: 12px; text-align: center; }
}

/* buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: var(--radius-s); border: 2px solid var(--wire); background: var(--wire); color: var(--wire-ink);
  font: 600 1rem/1 var(--text); text-decoration: none; cursor: pointer; }
.button:hover { filter: brightness(1.08); text-decoration: none; }
.button.secondary { background: transparent; color: var(--wire); }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button[disabled] { opacity: 0.55; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { max-width: 12ch; }
.hero .lead { margin-bottom: 28px; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }

.schematic { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 12px 12px 4px; }
.schematic svg { width: 100%; height: auto; font-family: var(--display); }
.schematic figcaption { color: var(--muted); font-size: 0.95rem; padding: 4px 10px 10px; }
.sch-wire { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.2s; }
.sch-wire.on { stroke: var(--live); stroke-dasharray: 10 8; animation: flow 0.9s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -18; } }
.sch-pin { fill: var(--muted); font-size: 15px; font-weight: 500; }
.sch-label { fill: var(--ink); font-size: 17px; font-weight: 600; }
.sch-block rect { fill: var(--panel); stroke: var(--ink); stroke-width: 2.5; }
.sch-block .symbol { fill: var(--ink); font-size: 46px; font-weight: 700; }
.sch-block .name { fill: var(--muted); font-size: 15px; font-weight: 600; }
.sch-block, .sch-switch { cursor: pointer; }
.sch-block:hover rect, .sch-switch:hover .body { stroke: var(--wire); }
.sch-block:focus-visible, .sch-switch:focus-visible { outline: none; }
.sch-block:focus-visible rect, .sch-switch:focus-visible .body { stroke: var(--wire); stroke-width: 4; }
.sch-switch .body { fill: var(--panel); stroke: var(--ink); stroke-width: 2.5; }
.sch-switch .knob { fill: var(--muted); transition: transform 0.18s ease, fill 0.18s; }
.sch-switch[aria-pressed="true"] .knob { fill: var(--live); transform: translateX(30px); }
.sch-lamp .glass { fill: var(--panel); stroke: var(--ink); stroke-width: 2.5; transition: fill 0.2s; }
.sch-lamp .cross { stroke: var(--ink); stroke-width: 2.5; }
.sch-lamp.on .glass { fill: var(--live); }
.sch-lamp .halo { fill: var(--live); opacity: 0; transition: opacity 0.25s; }
.sch-lamp.on .halo { opacity: 0.22; }
@media (prefers-reduced-motion: reduce) {
  .sch-wire.on { animation: none; stroke-dasharray: none; }
  .sch-switch .knob { transition: none; }
}

/* sections */
.section { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 36px; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 56px; margin: 0; }
.features div { border-left: 3px solid var(--wire); padding-left: 18px; }
.features dt { font: 600 1.25rem/1.25 var(--display); margin-bottom: 6px; }
.features dd { margin: 0; color: var(--muted); }
@media (max-width: 700px) { .features { grid-template-columns: 1fr; } }

/* hardware: terminal strip */
.rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--ink); border-radius: var(--radius-s);
  background: var(--surface); }
.rail > div { padding: 18px 18px 20px; border-right: 1px solid var(--line); }
.rail > div:last-child { border-right: 0; }
.rail h3 { margin-bottom: 4px; }
.rail p { color: var(--muted); font-size: 0.98rem; margin: 0; }
.rail .conn { display: block; font: 500 0.95rem/1.3 var(--display); color: var(--wire); margin-bottom: 10px; }
@media (max-width: 900px) { .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail > div:nth-child(2) { border-right: 0; } .rail > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
@media (max-width: 520px) { .rail { grid-template-columns: 1fr; } .rail > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .rail > div:last-child { border-bottom: 0; } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.checks { list-style: none; padding: 0; margin: 0 0 24px; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 0.45em; width: 14px; height: 14px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 22%, transparent); }

/* download */
.downloads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 760px) { .downloads { grid-template-columns: 1fr; } }
.download { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 28px; }
.download h2 { font-size: 1.9rem; margin-bottom: 4px; }
.download .meta { color: var(--muted); margin-bottom: 18px; }
.download ul { padding-left: 1.1em; color: var(--muted); margin: 18px 0 0; }
.notice { border-left: 3px solid var(--live); padding: 4px 0 4px 16px; margin: 32px 0 0; }

/* forms and account */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(20px, 4vw, 32px); }
.narrow { max-width: 460px; margin-inline: auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; margin-bottom: -1px;
  font: 600 1.05rem var(--display); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--wire); }
label { display: block; font-weight: 500; margin-bottom: 16px; }
label small { display: block; font-weight: 400; color: var(--muted); }
input[type=email], input[type=password], input[type=text], input[type=date], select, textarea {
  display: block; width: 100%; margin-top: 6px; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 400 1rem var(--text); }
input:focus-visible, select:focus-visible { outline: 3px solid var(--wire); outline-offset: 0; border-color: var(--wire); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 0.35em; width: 18px; height: 18px; flex: none; }
.message { border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 18px; border: 1px solid var(--line); }
.message.error { border-color: var(--danger); color: var(--danger); }
.message.ok { border-color: var(--live); }
.message[hidden] { display: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--wire); font: inherit; text-decoration: underline;
  text-underline-offset: 0.18em; cursor: pointer; }

.account { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.account nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 88px; }
.account nav a { padding: 10px 12px; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); font-weight: 500; }
.account nav a:hover { background: var(--surface); }
.account section { margin-bottom: 24px; scroll-margin-top: 88px; }
.account section h2 { font-size: 1.6rem; }
@media (max-width: 820px) { .account { grid-template-columns: 1fr; } .account nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0 0 20px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.devices { list-style: none; padding: 0; margin: 0; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.devices li:last-child { border-bottom: 0; }
.devices .this { color: var(--live); font-weight: 600; }
.feature-list { columns: 2; column-gap: 32px; padding-left: 1.1em; }
@media (max-width: 560px) { .feature-list { columns: 1; } }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

textarea { line-height: 1.5; resize: vertical; }
.page { border-top: 0; }
.page-title { font-size: clamp(2rem, 4vw, 2.8rem); }
.form-title { font-size: 1.5rem; }
.after-form { margin-top: 18px; }
.nav-action { text-align: left; padding: 10px 12px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.spaced { margin-top: 56px; }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-weight: 500; }
table.data td.num, table.data th.num { text-align: right; }
.mail-list { list-style: none; padding: 0; margin: 0; }
.mail-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 4px; color: var(--ink); font: inherit; cursor: pointer; }
.mail-list button:hover { background: var(--panel); }
.mail-list .who { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list .when { color: var(--muted); font-size: 0.92rem; }
.mail-list .subj { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list .unread .who, .mail-list .unread .subj { font-weight: 700; }
.mail-list .spam { color: var(--danger); font-size: 0.9rem; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel); border-radius: var(--radius-s); padding: 16px; margin: 16px 0; }
.mail-html { width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; margin: 16px 0; }
.empty { color: var(--muted); padding: 24px 0; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* prose pages */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.6rem; margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer .spacer { margin-left: auto; }
