/*
 * Glassvow's public pages: the game's dusk ground, leaded glass, amber lantern
 * light and frost (RunStyle and GlassStyle colours), its display faces over the
 * reader's own system text face. Dark is the native ground; the parchment
 * theme follows a light preference and print. No script, no third-party
 * request: the fonts sit beside this file and site/_headers allows only self.
 * Generated pages come from tools/build_site.py; this file is written by hand.
 */

@font-face {
  font-family: "Cinzel";
  src: url("fonts/Cinzel-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* Heading glyphs only; tools/build_site.py --display-font keeps it in step. */
@font-face {
  font-family: "Glassvow Serif TC";
  src: url("fonts/NotoSerifTC-SemiBold-display.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
  unicode-range: U+2E80-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}

:root {
  --ground: #0b0e1a;
  --ground-top: #141730;
  --dusk: #1d1a35;
  --pane: #111729;
  --ink: #d7dcea;
  --ink-strong: #f1ede3;
  --ink-dim: #9aa2bd;
  --amber: #f2c14e;
  --ember: #ff9a4d;
  --frost: #8fd0ff;
  --frost-line: rgb(143 208 255 / 0.45);
  --lead: rgb(242 193 78 / 0.3);
  --rule: rgb(143 208 255 / 0.14);
  --sheen: rgb(143 208 255 / 0.07);
  --sheen-edge: rgb(255 255 255 / 0.06);
  --hearth: rgb(242 193 78 / 0.1);
  --hearth-deep: rgb(242 193 78 / 0.16);
  --select: rgb(242 193 78 / 0.3);

  --face-display: "Cinzel", "Glassvow Serif TC", "Noto Serif TC", "Songti TC", Georgia, serif;
  --face-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans",
    "PingFang TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;
  --measure: 36rem;
  --gutter: 1.25rem;

  color-scheme: dark light;
}

@media (prefers-color-scheme: light), print {
  :root {
    --ground: #f5f0e5;
    --ground-top: #ece3cf;
    --dusk: #fbf5e6;
    --pane: #fcf9f2;
    --ink: #23273a;
    --ink-strong: #0b0e1a;
    --ink-dim: #555b72;
    --amber: #8a5710;
    --ember: #a6461a;
    --frost: #1b5a8a;
    --frost-line: rgb(27 90 138 / 0.4);
    --lead: rgb(138 87 16 / 0.32);
    --rule: rgb(27 90 138 / 0.16);
    --sheen: rgb(255 255 255 / 0.65);
    --sheen-edge: rgb(255 255 255 / 0.9);
    --hearth: rgb(242 193 78 / 0.2);
    --hearth-deep: rgb(138 87 16 / 0.18);
    --select: rgb(242 193 78 / 0.4);
  }
}

@media (min-width: 48rem) {
  :root {
    --gutter: 2rem;
  }
}

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

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(64rem 30rem at 50% -8rem, var(--hearth), transparent 70%),
    linear-gradient(var(--ground-top), var(--ground) 36rem);
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--face-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

html:lang(zh-Hant) body {
  line-height: 1.85;
}

::selection {
  background: var(--select);
}

h1,
h2,
.display {
  font-family: var(--face-display);
  font-weight: 700;
  font-synthesis: none;
}

a {
  color: var(--frost);
  text-decoration-color: var(--frost-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--ember);
  text-decoration-color: currentColor;
}

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

/* The reading column and its two bookends */

.masthead,
main,
.colophon {
  width: min(var(--measure), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.masthead,
.colophon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.masthead {
  padding-block: 0.75rem 0;
}

.colophon {
  margin-top: 1rem;
  padding-block: 1rem 2.5rem;
  border-top: 1px solid var(--rule);
}

.brand {
  padding-block: 0.75rem;
  color: var(--amber);
  font-size: 0.9375rem;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand:lang(zh-Hant) {
  letter-spacing: 0.3em;
}

.switch {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 1rem;
  border: 1px solid var(--lead);
  border-radius: 3px;
  background: linear-gradient(var(--sheen), transparent), var(--pane);
  box-shadow: inset 0 1px 0 var(--sheen-edge);
  font-size: 0.9375rem;
  text-decoration: none;
}

.switch:hover {
  border-color: var(--amber);
}

main {
  padding-bottom: 1.5rem;
}

/* The policy */

article h1 {
  margin: 1.75rem 0 0.5rem;
  color: var(--amber);
  font-size: clamp(1.875rem, 1.3rem + 2.6vw, 2.875rem);
  line-height: 1.12;
  letter-spacing: 0.015em;
  text-wrap: balance;
}

article h1:lang(zh-Hant) {
  line-height: 1.3;
  letter-spacing: 0.04em;
}

/* Full-width brackets open with half an em of blank; trim it at line starts. */
h1:lang(zh-Hant),
h2:lang(zh-Hant) {
  text-spacing-trim: trim-start;
}

/* The date line the policy opens with. */
article > h1 + p {
  margin: 0 0 1.75rem;
  color: var(--ink-dim);
  font-size: 0.9375rem;
}

article > h1 + p em {
  font-style: normal;
}

/* The "In short" summary closes the introduction: one lit pane of glass. */
article > p:last-of-type {
  margin: 1.5rem 0 0;
  padding: 1rem 1.125rem 1.0625rem;
  border: 1px solid var(--lead);
  border-radius: 3px;
  background: linear-gradient(var(--sheen), transparent 65%), var(--pane);
  box-shadow: inset 0 1px 0 var(--sheen-edge), 0 1.5rem 2.5rem -1.75rem var(--hearth-deep);
}

article > p:last-of-type > strong:first-child {
  color: var(--amber);
}

section {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 0 0 0.875rem;
  color: var(--ink-strong);
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.375rem);
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

h2:lang(zh-Hant) {
  letter-spacing: 0.06em;
}

p,
ul {
  margin: 0 0 1rem;
}

p {
  text-wrap: pretty;
}

/* WebKit's pretty wrapping leaves Chinese lines short and splits words such
   as 廣告; Chinese breaks between any two characters, so fill each line. */
html:lang(zh-Hant) p {
  text-wrap: wrap;
}

ul {
  padding-inline-start: 1.25rem;
  list-style-type: "◆";
}

li {
  margin-block: 0.5rem;
  padding-inline-start: 0.5rem;
}

li::marker {
  color: var(--amber);
  font-size: 0.625em;
}

strong {
  color: var(--ink-strong);
  font-weight: 600;
}

html:lang(zh-Hant) section em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink-strong);
}

/* Home and not-found: a threshold rather than a column */

body.home {
  background:
    radial-gradient(22rem 12rem at 50% 30%, var(--hearth), transparent 70%),
    radial-gradient(46rem 34rem at 50% 32%, var(--dusk), var(--ground) 74%);
  background-color: var(--ground);
}

.threshold {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(34rem, 100% - 2 * var(--gutter));
  min-height: 100vh;
  min-height: 100dvh;
  padding-block: 3rem;
  text-align: center;
}

.title {
  margin: 0 0 1.5rem;
  line-height: 1;
}

.title-en {
  display: block;
  margin-inline-end: -0.14em;
  color: var(--amber);
  font-size: clamp(2.375rem, 1.5rem + 5vw, 4.25rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.title-zh {
  display: block;
  margin-top: 0.875rem;
  margin-inline-end: -0.4em;
  color: var(--ink-strong);
  font-size: clamp(1.625rem, 1.2rem + 2.4vw, 2.625rem);
  letter-spacing: 0.4em;
}

.lede {
  margin: 0.125rem 0;
  text-wrap: balance;
}

.panes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.75rem;
  width: 100%;
  margin: 2.25rem 0 2rem;
}

.pane {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.875rem 1.125rem 1rem;
  border: 1px solid var(--lead);
  border-radius: 3px;
  background: linear-gradient(var(--sheen), transparent 65%), var(--pane);
  box-shadow: inset 0 1px 0 var(--sheen-edge), 0 1.5rem 2.5rem -1.75rem var(--hearth-deep);
  text-align: start;
  text-decoration: none;
}

.pane:hover {
  border-color: var(--amber);
}

.pane-kicker {
  color: var(--ink-dim);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.pane-title {
  color: var(--frost);
  font-size: 1.125rem;
  letter-spacing: 0.03em;
}

.pane:hover .pane-title {
  color: var(--ember);
}

.support {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
}

.address {
  margin: 0.25rem 0 0;
  color: var(--ink-strong);
  -webkit-user-select: all;
  user-select: all;
}

.lost {
  margin: 0.75rem 0 0;
  color: var(--ink-strong);
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  line-height: 1.3;
}

.lost [lang] {
  display: block;
  margin-top: 0.375rem;
  color: var(--ink-dim);
  font-size: 0.75em;
  letter-spacing: 0.12em;
}

@media print {
  body,
  body.home {
    background: none;
  }

  .masthead,
  .colophon {
    display: none;
  }

  article > p:last-of-type {
    box-shadow: none;
  }
}
