/* FluxDM website — one stylesheet for the public pages and the admin panel.
   Palette: cool paper, deep ink, FluxDM blue and the logo's violet, green for "done". */

:root {
    --paper: #eef2fb;
    --paper-2: #e3e9f7;
    --card: #ffffff;
    --ink: #14213d;
    --ink-2: #47557a;
    --ink-3: #6b789a;
    --line: #d3dbee;
    --blue: #3d63e0;
    --blue-deep: #2b4bbd;
    --violet: #7c5cfa;
    --green: #1f9d63;
    --green-soft: #dcf3e8;
    --amber: #9a5d06;
    --amber-soft: #fbefd9;
    --red: #c2302f;
    --red-soft: #fce4e4;

    --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --text: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;

    --step--1: 0.875rem;
    --step-0: 1rem;
    --step-1: 1.25rem;
    --step-2: 1.6rem;
    --step-3: 2.2rem;
    --step-4: clamp(2.4rem, 5.2vw, 3.9rem);

    --radius-s: 6px;
    --radius-m: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 var(--step-0)/1.6 var(--text);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-deep); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); font-weight: 800; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }
.muted { color: var(--ink-3); }
.lede { font-size: var(--step-1); color: var(--ink-2); max-width: 36em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    padding: .7em 1.25em; border: 0; border-radius: var(--radius-s);
    background: var(--blue); color: #fff; font: 600 var(--step-0)/1.2 var(--text);
    text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--blue-deep); color: #fff; }
.btn-large { padding: .95em 1.6em; font-size: var(--step-1); }
.btn-small { padding: .4em .8em; font-size: var(--step--1); }
.btn-quiet { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-quiet:hover { background: var(--paper-2); color: var(--ink); }
.btn-danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px #efc2c2; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.link-button { background: none; border: 0; padding: 0; color: var(--blue-deep); font: inherit; text-decoration: underline; cursor: pointer; }

/* ------------------------------------------------------------- top bar */
.topbar { padding: 18px 0; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.25rem/1 var(--display); color: var(--ink); text-decoration: none; }
.topnav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.topnav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.topnav a:not(.btn):hover { color: var(--ink); }

/* ------------------------------------------------------------- hero */
.hero { padding: 48px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero-grid > * { min-width: 0; } /* let long file names shrink instead of widening the page */
.hero h1 { max-width: 11em; }
.cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 28px; }
.cta-meta { color: var(--ink-3); font-size: var(--step--1); max-width: 18em; }

/* The live "connections" figure: the visual signature of the page */
.lanes {
    margin: 0; padding: 26px 26px 22px;
    background: var(--ink); color: #dbe3fb;
    border-radius: var(--radius-m);
    box-shadow: 0 30px 60px -30px rgba(20, 33, 61, .55);
}
.lanes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.lanes-file { min-width: 0; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lanes-speed { font: 700 var(--step-2)/1 var(--display); color: #fff; white-space: nowrap; }
.lanes-speed b { font-variant-numeric: tabular-nums; }
.lanes-bar { position: relative; height: 34px; background: #24345c; border-radius: 6px; overflow: hidden; }
.lane-slot { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--ink); }
.lane-slot:first-child { border-left: 0; }
.lane-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--violet)); transition: width .09s linear; }
.lane-fill.is-done { background: #39b57b; }
.lanes-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; font-size: var(--step--1); }
.lanes-list li { display: flex; justify-content: space-between; color: #9fb0db; font-variant-numeric: tabular-nums; }
.lanes-list li.is-done span:last-child { color: #6fd3a2; }
.lanes-foot { margin: 16px 0 0; font-size: var(--step--1); color: #9fb0db; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- features */
.features { padding: 72px 0; background: var(--card); }
.feature-list { list-style: none; margin: 28px 0 56px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 34px 64px; }
.feature-list li { border-top: 2px solid var(--ink); padding-top: 14px; }
.feature-list p { color: var(--ink-2); margin: 0; max-width: 34em; }
.shot { margin: 0; }
.shot img { border-radius: var(--radius-m); box-shadow: 0 0 0 1px var(--line), 0 24px 48px -28px rgba(20, 33, 61, .45); }

/* ------------------------------------------------------------- steps (a real sequence) */
.steps { padding: 72px 0; }
.step-list { list-style: none; counter-reset: step; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step-list li { counter-increment: step; position: relative; padding-top: 58px; }
.step-list li::before {
    content: counter(step); position: absolute; top: 0; left: 0;
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    font: 800 var(--step-1)/1 var(--display); color: #fff; background: var(--blue);
}
.step-list p { color: var(--ink-2); margin: 0; }

/* ------------------------------------------------------------- changelog + faq */
.changelog { padding: 72px 0; background: var(--card); }
.release { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.release header h3 { margin: 0; }
.release time { color: var(--ink-3); font-size: var(--step--1); }
.release-notes { color: var(--ink-2); max-width: 40em; }
.faq { padding: 72px 0 88px; }
.faq details { border-top: 1px solid var(--line); padding: 16px 0; max-width: 46em; }
.faq summary { cursor: pointer; font-weight: 600; font-size: var(--step-1); }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }

.footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--ink-3); font-size: var(--step--1); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 20px; }

/* ------------------------------------------------------------- forms + account */
.auth { max-width: 460px; padding: 40px 0 80px; }
.auth h1 { font-size: var(--step-3); }
.form { display: grid; gap: 16px; margin: 24px 0; max-width: 460px; }
.form-wide { max-width: 680px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: var(--step--1); color: var(--ink-2); }
.form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); font-size: var(--step-0); }
.form label.check input { margin-top: 5px; }
input, textarea, select {
    font: inherit; color: var(--ink); background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius-s); padding: .65em .8em; width: 100%;
}
input[type=checkbox] { width: auto; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
textarea.code { font: .85rem/1.45 ui-monospace, Consolas, monospace; background: var(--paper-2); }
.notice { padding: 12px 16px; border-radius: var(--radius-s); background: var(--amber-soft); color: #5c3a04; margin: 12px 0; }
.notice.ok { background: var(--green-soft); color: #0f5c39; }
.notice.bad { background: var(--red-soft); color: #8a1f1f; }

.account { padding: 24px 0 80px; max-width: 760px; }
.panel { background: var(--card); border-radius: var(--radius-m); padding: 24px 26px; margin: 18px 0; box-shadow: 0 0 0 1px var(--line); }
.panel h2 { font-size: var(--step-1); }
.panel-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.key { font: 700 clamp(1.25rem, 3.5vw, 1.8rem)/1.2 var(--display); letter-spacing: .06em; margin: 0; word-break: break-all; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; margin: 18px 0 0; }
.facts dt { font-size: var(--step--1); color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.inline-form { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.pill { display: inline-block; padding: .15em .65em; border-radius: 999px; font-size: var(--step--1); font-weight: 600; }
.pill-ok { background: var(--green-soft); color: #0f6b43; }
.pill-wait { background: var(--amber-soft); color: var(--amber); }
.pill-bad { background: var(--red-soft); color: var(--red); }

.prose { max-width: 720px; padding: 32px 0 80px; }
.prose h1 { font-size: var(--step-3); }
.prose h2 { font-size: var(--step-2); margin-top: 1.6em; }
.prose li { margin-bottom: .5em; color: var(--ink-2); }

/* ------------------------------------------------------------- admin */
.admin-body { background: var(--paper); }
.admin-bar { display: flex; align-items: center; gap: 28px; padding: 14px 24px; background: var(--ink); flex-wrap: wrap; }
.admin-bar .brand { color: #fff; font-size: 1.05rem; }
.admin-bar nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.admin-bar nav a { color: #b9c5e6; text-decoration: none; padding: 6px 12px; border-radius: var(--radius-s); font-weight: 500; }
.admin-bar nav a:hover { color: #fff; }
.admin-bar nav a.on { background: #2a3b66; color: #fff; }
.admin-bar .link-button { color: #b9c5e6; }
.count { background: var(--amber-soft); color: var(--amber); border-radius: 999px; padding: 0 .5em; font-size: .8em; font-weight: 700; }
.admin-main { width: min(1180px, 100% - 32px); margin: 28px auto 80px; }
.admin-title { font-size: var(--step-3); }
.narrow { max-width: 520px; margin: 48px auto; padding: 0 16px; }
.admin-panel { background: var(--card); border-radius: var(--radius-m); padding: 22px 24px; margin: 18px 0; box-shadow: 0 0 0 1px var(--line); overflow-x: auto; }
.admin-panel h2 { font-size: var(--step-1); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 18px 0; }
.stat-grid div { background: var(--card); border-radius: var(--radius-m); padding: 16px 18px; box-shadow: 0 0 0 1px var(--line); }
.stat-grid dt { color: var(--ink-3); font-size: var(--step--1); }
.stat-grid dd { margin: 4px 0 0; font: 800 var(--step-2)/1 var(--display); }
.stat-grid small { font: 400 var(--step--1) var(--text); color: var(--ink-3); }
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); background: var(--card); }
.table th { text-align: left; color: var(--ink-3); font-weight: 600; padding: 10px 12px; border-bottom: 2px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .actions form { display: flex; gap: 6px; flex-wrap: wrap; }
.mono-key { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
.note { color: var(--amber); }
.note-edit { margin-top: 8px; }
.note-edit summary { cursor: pointer; color: var(--ink-3); }
.note-edit form { margin-top: 6px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0 18px; }
.filters input { max-width: 320px; }
.filters select { width: auto; }
.pager { display: flex; gap: 6px; margin-top: 16px; }
.pager a { padding: 4px 10px; border-radius: var(--radius-s); text-decoration: none; }
.pager a.on { background: var(--ink); color: #fff; }
.checks { list-style: none; padding: 0; }
.checks li { padding: 4px 0; }
.checks .ok { color: var(--green); }
.checks .bad { color: var(--red); }
.alt-source summary { cursor: pointer; color: var(--ink-2); }
.alt-source label { margin-top: 10px; }

/* ------------------------------------------------------------- small screens */
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .feature-list, .step-list { grid-template-columns: 1fr; }
    .release { grid-template-columns: 1fr; gap: 6px; }
    .lanes-list { grid-template-columns: 1fr; }
    .topnav { gap: 14px; }
    .hero { padding-top: 24px; }
    .lanes { padding: 20px 18px 18px; }
    .lanes-speed { font-size: var(--step-1); }
}
@media (prefers-reduced-motion: reduce) {
    .lane-fill { transition: none; }
}
