/*
 * The ICT Setter site, in the products' own visual language: the teal identity
 * rail, quiet neutral surfaces, the host system's UI font, teal as the one brand
 * colour. Plain CSS, no build step beyond assembling the pages.
 */
:root {
  --bg: #f7f8f9;
  --surface: #ffffff;
  --sunken: #eef1f3;
  --text: #1a1e23;
  --muted: #59636e;
  --border: #dde2e6;
  --border-strong: #8d97a1;
  --brand: #1d7c72;
  --brand-soft: #e0f0ee;
  --rail: #185952;
  --rail-text: #ffffff;
  --rail-muted: rgb(255 255 255 / 78%);
  --rail-active: rgb(255 255 255 / 14%);
  --sans:
    'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial,
    'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  --mono: 'Cascadia Mono', 'SF Mono', Consolas, 'Liberation Mono', monospace;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1f1e;
    --surface: #202625;
    --sunken: #272e2d;
    --text: #e6ebea;
    --muted: #a3afad;
    --border: #34403e;
    --border-strong: #5c6b69;
    --brand: #4dcbbf;
    --brand-soft: #193b37;
    --rail: #0e1a18;
    --rail-active: rgb(255 255 255 / 10%);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 0.9375rem/1.65 var(--sans);
}
:lang(zh-Hant) body {
  line-height: 1.8;
}
a {
  color: var(--brand);
  text-underline-offset: 0.2em;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
code {
  font: 0.85em var(--mono);
  background: var(--sunken);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 3;
  background: var(--surface);
  padding: 0.4rem 0.7rem;
}

/* ---- The shell: identity rail and content, as in the apps ---------------- */
.shell {
  display: grid;
  grid-template-columns: 13.5rem 1fr;
  min-height: 100vh;
}
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem 0.75rem;
  background: var(--rail);
  color: var(--rail-text);
}
.brand {
  display: block;
  padding: 0 0.6rem;
  color: var(--rail-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--rail-muted);
}
.rail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.rail a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  color: var(--rail-muted);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.35;
}
.rail a:hover {
  color: var(--rail-text);
  background: var(--rail-active);
}
.rail a[aria-current='page'] {
  color: var(--rail-text);
  background: var(--rail-active);
  font-weight: 600;
}
.rail .lang {
  margin-top: auto;
  border-top: 1px solid rgb(255 255 255 / 18%);
  padding-top: 0.75rem;
}
.main {
  min-width: 0;
  padding: 3rem clamp(16px, 5vw, 4rem) 2.5rem;
}
.content {
  max-width: 46rem;
}

/* ---- Type ------------------------------------------------------------------ */
.content h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 3.4vw, 2.25rem);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.intro {
  margin: 0 0 2.5rem;
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 40rem;
}
.content h2 {
  margin: 3rem 0 0.75rem;
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 650;
}
.content h3 {
  margin: 1.75rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 650;
}
.content p,
.content ul,
.content ol {
  margin: 0 0 0.9rem;
}
.content ul,
.content ol {
  padding-left: 1.25rem;
}
.content li {
  margin-bottom: 0.3rem;
}
.content li::marker {
  color: var(--muted);
}

/* ---- Home: the two products ------------------------------------------------- */
.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0 0 1rem;
}
.product {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.1rem;
}
.product h2 {
  margin: 0 0 0.15rem;
  font-size: 1.15rem;
}
.product .role {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
}
.product ul {
  margin: 0 0 1rem;
}
.product .more {
  margin-top: auto;
  font-weight: 600;
  text-decoration: none;
}
.product .more:hover {
  text-decoration: underline;
}
.path {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
  border-left: 2px solid var(--border);
}
.path li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0.85rem 1.75rem;
  margin: 0;
}
.path li::before {
  content: counter(step);
  position: absolute;
  left: -0.8rem;
  top: 0.1rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--brand);
  /* The surface colour reads on the brand fill in both light and dark mode. */
  color: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5rem;
  text-align: center;
}

/* ---- Panels and tables -------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1rem;
}
.panel > :last-child {
  margin-bottom: 0;
}
.note {
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
}
.note > :last-child {
  margin-bottom: 0;
}
.table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
tr:last-child td {
  border-bottom: 0;
}
th {
  background: var(--sunken);
  font-weight: 600;
}
td:first-child {
  font-weight: 600;
  white-space: nowrap;
}
pre {
  overflow-x: auto;
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font: 0.8125rem/1.55 var(--mono);
  margin: 0.5rem 0 1.25rem;
}

/* ---- Figures: screenshots of the apps and pages of a printed paper ----------- */
.figure {
  margin: 1.5rem 0;
}
.figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.figure figcaption {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}
/* Printed pages stay white, as paper is, in dark mode too. */
.pages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.pages img {
  background: #ffffff;
  border-radius: 2px;
}
.pages figcaption {
  grid-column: 1 / -1;
}

/* ---- Footer -------------------------------------------------------------------- */
.footer {
  max-width: 46rem;
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8125rem;
}
.footer p {
  margin: 0 0 0.4rem;
}

/* ---- Phones: the rail becomes a bar across the top ---------------------------- */
@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 16px;
  }
  .brand {
    padding: 0;
  }
  .rail ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.1rem 0.25rem;
    order: 3;
    width: 100%;
  }
  .rail a {
    padding: 0.3rem 0.5rem;
  }
  .rail .lang {
    margin: 0 0 0 auto;
    border: 0;
    padding: 0;
  }
  .main {
    padding-top: 2rem;
  }
  .products {
    grid-template-columns: 1fr;
  }
}
@media print {
  .rail,
  .skip {
    display: none;
  }
  .shell {
    display: block;
  }
}
