/* Dualan website - Copyright (C) 2026 DualanApp. Shared by every page. */
:root {
  --bg: #141518; --bg-2: #1b1c1f; --card: #222328; --card-2: #2a2b31; --line: #33353c;
  --text: #ecedf1; --dim: #a0a3ad; --faint: #8f929c;
  --accent: #4f8cff; --btn: #2563eb; --accent-soft: rgba(79,140,255,.14);
  --good: #3ecf8e; --good-soft: rgba(62,207,142,.13); --warn: #e8b64a;
  --radius: 4px; color-scheme: dark;
  /* headings and numbers; Bahnschrift ships with Windows 10 and 11 */
  --display: Bahnschrift, "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --soft: cubic-bezier(.16, 1, .3, 1); /* things coming into view: quick to start, a long gentle stop */
}
/* light: picked with the switch in the nav (data-theme on <html>, theme.js), or Windows is
   light and nothing was picked */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #f5f6f8; --bg-2: #eceef2; --card: #ffffff; --card-2: #f1f2f5; --line: #dfe1e6;
    --text: #17181c; --dim: #555966; --faint: #656974; --accent: #2563eb; --btn: #2563eb;
    --accent-soft: rgba(37,99,235,.10); --good: #0f7a4f; --good-soft: rgba(22,163,106,.10); --warn: #8f5a0a; color-scheme: light; }
}
:root[data-theme="light"] { --bg: #f5f6f8; --bg-2: #eceef2; --card: #ffffff; --card-2: #f1f2f5; --line: #dfe1e6;
  --text: #17181c; --dim: #555966; --faint: #656974; --accent: #2563eb; --btn: #2563eb;
  --accent-soft: rgba(37,99,235,.10); --good: #0f7a4f; --good-soft: rgba(22,163,106,.10); --warn: #8f5a0a; color-scheme: light; }
/* fields: one size everywhere, and on focus the border turns blue (no second ring around it) */
input, select, textarea { font: inherit; }
/* dropdowns: the same chevron in every browser, with room on the right like the text has on the left */
select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23888c96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; background-size: 12px 8px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* the footer stays at the bottom of the window on short pages */
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 16px/1.65 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif; }
body > main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* up to 1440 px wide, so a big monitor gets room without everything drifting apart;
   running text (p, li) keeps a readable line length inside that */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 56px); }
.doc p, .doc li, .lead, .sub { max-width: 75ch; }
.doc img.cover, .doc .post img { max-width: 860px; height: auto; }
.doc form, .doc table { max-width: 900px; }
.display { font-family: var(--display); font-weight: 600; font-stretch: 82%; letter-spacing: -0.01em; }

/* nav: the same on every page, staying at the top. The page you're on is marked like a
   source that's live in OBS: a bar on the top edge, right above its name. */
header.site { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: var(--bg); transition: background .2s; }
header.site.scrolled { background: var(--bg-2); }
header .wrap { display: flex; align-items: stretch; gap: 8px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--text); margin-right: 28px; }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 5px; background: #2f80ff; flex: none; transition: transform .3s var(--ease); }
.brand:hover .logo { transform: rotate(-8deg); }
.logo svg { display: block; width: 100%; height: 100%; }
header nav { display: flex; align-items: stretch; flex: 1; }
header nav a, header .get { position: relative; display: flex; align-items: center; padding: 0 14px;
  font-family: var(--display); font-size: 16px; color: var(--dim); white-space: nowrap; transition: color .15s; }
header nav a:hover, header .get:hover { color: var(--text); text-decoration: none; }
header a[aria-current] { color: var(--text); }
/* the bar: grows in on the current page, a thin preview on hover */
header nav a::before { content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 3px; background: var(--accent);
  border-radius: 0 0 2px 2px; transform: scaleX(0); transition: transform .25s var(--ease); }
header nav a:hover::before { transform: scaleX(.35); background: var(--faint); }
header nav a[aria-current]::before { transform: scaleX(1); background: var(--accent); animation: tally .5s var(--ease); }
@keyframes tally { from { transform: scaleX(0); } }
/* two buttons on the right, like the Dualan window: controls in grey, download in blue */
header .get { color: #fff; background: var(--btn); margin: 14px 0; padding: 0 16px; border-radius: 3px; font-weight: 600; }
header .get:hover { color: #fff; filter: brightness(1.08); }
header .get.ctl { color: var(--text); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }
header .get.ctl:hover { color: var(--text); }
header .get[aria-current] { color: #fff; } /* the page it leads to: still a button */
header .get.ctl[aria-current] { color: var(--text); }
header .get + .get { margin-left: 8px; }
/* light or dark: one click switches, the icon shows what you switch to */
.theme { display: flex; align-items: center; justify-content: center; width: 38px; margin: 14px 8px 14px 0; padding: 0; border-radius: 3px;
  background: none; border: 1px solid transparent; color: var(--dim); cursor: pointer; transition: color .15s, border-color .15s; }
.theme:hover { color: var(--text); border-color: var(--line); }
.theme svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; transition: transform .4s var(--ease); }
.theme:active svg { transform: rotate(40deg); }
.theme .to-dark, :root[data-theme="light"] .theme .to-light { display: none; }
:root[data-theme="light"] .theme .to-dark { display: block; }
/* phones: the links move to a second row you can swipe sideways */
@media (max-width: 860px) {
  header.site { position: static; } /* two rows would take too much of a phone screen */
  header .wrap { flex-wrap: wrap; height: auto; row-gap: 0; padding-top: 10px; }
  .brand { margin-right: auto; }
  header nav { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; }
  header nav a { padding: 12px 14px; }
  header .get { margin: 4px 0; padding: 8px 12px; }
}
[hidden] { display: none !important; } /* also on buttons and other elements with their own display */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 3px; font-weight: 600; font-size: 15px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text); cursor: pointer; font-family: inherit;
  transition: transform .15s var(--ease), filter .15s; }
.btn:hover { text-decoration: none; filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #fff; } /* a deeper blue than links: white text stays readable */
.btn.small { padding: 7px 14px; font-size: 14px; }

/* a field's own message (site.js), instead of the browser's bubble */
.field-msg, .doc .field-msg { margin: 6px 0 0; color: #e5484d; font-size: 14px; }
input.bad, textarea.bad, select.bad { border-color: #e5484d !important; }

/* every reading page opens like the front page: its title and first lines rise in */
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }
main.doc h1, main.doc .lead, main.doc .crumb { animation: rise-in .9s var(--soft) both; }
main.doc .lead { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) { main.doc h1, main.doc .lead, main.doc .crumb { animation: none; } }
/* things that come into view as you scroll (site.js marks them); still for reduced motion */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .9s var(--soft), transform 1.1s var(--soft); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } header nav a[aria-current]::before { animation: none; } }

/* reading pages */
main.doc { padding: 64px 0 88px; }
.doc h1 { font-family: var(--display); font-weight: 600; font-stretch: 82%; font-size: clamp(38px, 5.2vw, 60px); line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 14px; }
.doc .lead { color: var(--dim); font-size: 18px; margin: 0 0 40px; }
.doc h2 { font-family: var(--display); font-weight: 600; font-size: 25px; margin: 48px 0 10px; }
.doc h3 { font-size: 17px; margin: 28px 0 6px; }
.doc p, .doc li { color: var(--dim); }
.doc b, .doc strong { color: var(--text); }
.doc code, kbd { font-family: "Cascadia Mono", Consolas, monospace; font-size: 14px; background: var(--card-2); border: 1px solid var(--line); border-radius: 2px; padding: 1px 5px; color: var(--text); white-space: nowrap; }
.doc img { width: 100%; max-width: 860px; height: auto; border-radius: 4px; border: 1px solid var(--line); margin: 14px 0 6px; }
.doc .note { background: var(--card); border-radius: 4px; padding: 14px 18px; margin: 18px 0; color: var(--dim); max-width: 860px; }
.doc .note.warn { background: color-mix(in srgb, var(--warn) 13%, var(--card)); color: var(--text); }
ol.steps { padding-left: 0; list-style: none; counter-reset: s; }
ol.steps > li { counter-increment: s; position: relative; padding: 0 0 18px 44px; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; font-family: var(--display); font-size: 24px; line-height: 1.1;
  color: var(--accent); font-variant-numeric: tabular-nums; }
details { border-top: 1px solid var(--line); padding: 14px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; color: var(--text); }
details p, details li { margin: 10px 0 0; }

/* footer: what the site has, in four short columns */
footer { padding: 48px 0 40px; color: var(--dim); font-size: 14.5px; border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 24px; }
footer .cols { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
footer .about p { margin: 10px 0 0; max-width: 34ch; }
footer h2 { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--text); margin: 4px 0 8px; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li a { display: inline-block; padding: 5px 0; color: var(--dim); } /* bigger tap area on phones */
footer li a:hover { color: var(--text); }
footer .legal { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); }
@media (max-width: 760px) { footer .cols { grid-template-columns: 1fr 1fr; } footer .about { grid-column: 1 / -1; } }

/* blog articles (src/layouts/Post.astro) */
.doc .crumb { margin: 0 0 6px; font-size: 15px; }
.post table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 15px; }
.post th, .post td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.post th { color: var(--faint); font-weight: 600; }
/* on a phone a wide table scrolls by itself, the page doesn't */
@media (max-width: 760px) { .post table { display: block; overflow-x: auto; } .post td { min-width: 110px; } .doc code { white-space: normal; overflow-wrap: anywhere; } }
.post .checked { color: var(--dim); font-size: 15px; margin-top: 32px; }
