/* Shared site chrome: design tokens, header, footer, buttons and the inner-page hero.

   This mirrors the landing site so the two look like one product.
   Source: https://github.com/InterImm/interimm.github.io (branch `hugo`, assets/css/main.css).
   The sections below are copied from that file. Keep them in sync rather than
   editing them here; put anything specific to this tool in style.css. The
   matching markup is the header and footer in index.html, and js/site.js is
   the same menu script as the landing site's assets/js/main.js. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;

  --bg: #f5f7fb;
  --bg-alt: #e9eef7;
  --surface: #ffffff;
  --text: #121a2b;
  --muted: #526078;
  --border: #d3dbea;
  --link: #1f4fd8;
  --focus: #1f4fd8;
  --accent: #f5b301;
  --accent-hover: #ffc72e;
  --accent-text: #1a1300;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.06), 0 10px 28px rgb(16 24 40 / 0.07);

  --space-bg: #070b18;
  --space-text: #eef2ff;
  --space-muted: #b6c2e4;

  --radius: 1rem;
  --wrap: 72rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Noto Color Emoji";
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --bg-alt: #0f1730;
    --surface: #141c33;
    --text: #e8edf8;
    --muted: #a3afc8;
    --border: #26304d;
    --link: #8fb4ff;
    --focus: #8fb4ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px rgb(0 0 0 / 0.35);
  }
  .brand-mark { filter: invert(1); }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}
main { flex: 1; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
img, video, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
ul, ol { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 0.25rem; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: 0.6rem 1rem; border-radius: 0.6rem;
  background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.text-center { text-align: center; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1rem; min-height: 3.75rem; padding-block: 0.5rem; }

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none;
}
.brand-mark { border-radius: 0.4rem; }

.site-nav { display: flex; flex: 1; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; }
.nav-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; list-style: none; margin: 0; padding: 0; }

.nav-link, .dropdown > summary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.75rem; border-radius: 0.6rem;
  color: var(--text); font-weight: 500; text-decoration: none; cursor: pointer;
}
.nav-link:hover, .dropdown > summary:hover, .dropdown[open] > summary { background: var(--bg-alt); }
.nav-link[aria-current="page"], .dropdown[data-current] > summary { color: var(--link); font-weight: 600; }
.lang-link { border: 1px solid var(--border); }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after {
  content: ""; width: 0.4em; height: 0.4em; margin-top: -0.2em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.dropdown-menu {
  position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 60;
  min-width: min(19rem, 90vw); margin: 0; padding: 0.4rem; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 0.8rem; box-shadow: var(--shadow);
}
.dropdown-menu a {
  display: block; padding: 0.5rem 0.75rem; border-radius: 0.5rem;
  color: var(--text); text-decoration: none;
}
.dropdown-menu a:hover { background: var(--bg-alt); }
.dropdown-menu a[aria-current="page"] { color: var(--link); font-weight: 600; }

.nav-toggle {
  display: none; margin-left: auto; padding: 0.4rem; border: 1px solid var(--border); border-radius: 0.6rem;
  background: transparent; color: var(--text); cursor: pointer;
}

@media (max-width: 56rem) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; flex-basis: 100%; padding-bottom: 0.75rem; }
  .js .site-nav.is-open { display: flex; flex-direction: column; align-items: stretch; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-tools { flex-direction: row; flex-wrap: wrap; padding-top: 0.5rem; border-top: 1px solid var(--border); }
  .dropdown-menu { position: static; min-width: 0; margin: 0.2rem 0 0.4rem 0.75rem; box-shadow: none; }
}

/* ---------- buttons, chips, pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5ch;
  padding: 0.55rem 1.15rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; line-height: 1.4;
  text-decoration: none; transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--link); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: transparent; transform: translateY(-1px); }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1.15rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0 0 1.25rem; padding: 0; }
.chips li {
  padding: 0.15rem 0.85rem; border: 1px solid currentColor; border-radius: 999px;
  font-size: 0.9rem; line-height: 1.6; opacity: 0.85;
}
.chips-small li { padding: 0.05rem 0.65rem; font-size: 0.8rem; color: var(--muted); border-color: var(--border); opacity: 1; }

.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; list-style: none; margin: 0; padding: 0; }
.pills a {
  display: inline-block; padding: 0.4rem 1rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
.pills a:hover { border-color: var(--link); color: var(--link); transform: translateY(-1px); }

/* ---------- cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column;
  padding: 1.5rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card-title { font-size: 1.25rem; margin-bottom: 0.5rem; }

/* ---------- inner pages ---------- */
.page-hero {
  padding-block: clamp(2.5rem, 7vw, 4.5rem); text-align: center;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); margin-bottom: 0.3em; }
.page-hero .lede { max-width: 42rem; margin: 0 auto 1rem; color: var(--muted); font-size: 1.15rem; }
.page-hero .chips { justify-content: center; margin: 0.75rem 0 0; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { margin-top: 2rem; padding-block: 2.5rem 1.5rem; background: var(--bg-alt); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.95rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.footer-col h2 { margin-bottom: 0.6rem; font-size: 1rem; color: var(--text); }
.footer-col ul { margin: 0; padding: 0; list-style: none; }
.footer-col li { margin-bottom: 0.3rem; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--link); }
.footer-legal { margin: 2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.85rem; }

/* ---------- motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
