/* Paper, ink, and one mineral green. */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: block;
  src: url("../fonts/source-serif-4-roman.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-weight: 200 900;
  font-display: block;
  src: url("../fonts/noto-serif-sc.woff2") format("woff2");
  unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE30-FE4F, U+FF00-FFEF;
}

:root {
  --paper: #f4f1ea;
  --ink: #1c1b19;
  --soft: #3a3834;
  --quiet: #4e4a45;
  --rule: rgba(28, 27, 25, 0.16);
  --qing: #1a453e;
  --qing-deep: #14362f;
  --wash: rgba(26, 69, 62, 0.05);
  --selection: #d5e3de;
  --serif: "Source Serif 4", "Iowan Old Style", Palatino, "Palatino Linotype", "Noto Serif SC", serif;
  --measure: 37.5rem;
  --sheet: 54rem;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url("../assets/grain.png"),
    radial-gradient(ellipse 72% 48% at 108% -8%, var(--wash), transparent 58%),
    radial-gradient(ellipse 40% 32% at -12% 108%, rgba(26, 69, 62, 0.035), transparent 52%);
  background-repeat: repeat, no-repeat, no-repeat;
  background-size: 220px 220px, auto, auto;
  font-family: var(--serif);
  font-weight: 450;
  font-optical-sizing: auto;
  font-synthesis: none;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--qing);
  pointer-events: none;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 1px solid var(--qing);
  outline-offset: 3px;
}

a:link,
a:visited {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--qing);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover,
a:active {
  color: var(--qing-deep);
  text-decoration-color: var(--qing-deep);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 6;
  padding: 0.4rem 0.7rem;
  background: var(--paper);
  color: var(--ink);
}

.skip:focus {
  top: 0.7rem;
}

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

html:not([data-pref="zh"]) .v-zh {
  display: none;
}

html[data-pref="zh"] .v-en {
  display: none;
}

.sheet {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: min(var(--sheet), calc(100% - clamp(2.5rem, 6vw, 7rem)));
  margin-inline: auto;
}

.mast {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem 1.5rem;
  padding-top: 1.7rem;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.38rem;
  color: inherit;
  text-decoration: none;
}

.brand:link,
.brand:visited,
.brand:hover,
.brand:active {
  color: inherit;
  text-decoration: none;
}

.brand-zh {
  font-weight: 500;
  font-size: 1.18rem;
  line-height: 1;
  letter-spacing: 0.28em;
  margin-right: -0.28em;
}

.brand-rule {
  display: block;
  width: 1.35rem;
  height: 1px;
  background: var(--qing);
}

.brand-en {
  font-weight: 500;
  font-size: 0.66rem;
  line-height: 1;
  letter-spacing: 0.34em;
  margin-right: -0.34em;
  font-variant-numeric: lining-nums;
}

.lang {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  margin-left: auto;
  padding-top: 0.12rem;
}

.opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.02rem 0.28rem;
  color: var(--quiet);
  font-weight: 500;
  font-size: 0.86rem;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.opt-zh {
  letter-spacing: 0.14em;
  margin-right: -0.14em;
}

.opt input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.opt::after {
  content: "";
  position: absolute;
  inset: -0.55rem -0.45rem;
}

.opt:hover {
  color: var(--ink);
}

html[data-pref="en"] .opt-en,
html[data-pref="zh"] .opt-zh {
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--qing);
}

.lang-sep {
  width: 1px;
  height: 0.72rem;
  background: var(--rule);
}

main {
  flex: 1 0 auto;
  padding-top: clamp(3.4rem, 10vh, 6.4rem);
  padding-bottom: 0.5rem;
}

h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1.82rem, 5.2vw, 4.15rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
}

h1 .v-en,
h1 .v-zh {
  display: block;
}

h1 .ln {
  display: block;
}

h1 .v-zh {
  font-weight: 500;
  font-size: 1.3em;
  line-height: 1.28;
  letter-spacing: 0.02em;
  max-width: none;
}

.descriptor {
  margin: 1.45rem 0 0;
  max-width: var(--measure);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
}

.descriptor .v-en {
  font-size: 0.92rem;
  letter-spacing: 0.28em;
  margin-right: -0.28em;
  font-variant-caps: all-small-caps;
}

.descriptor .v-zh {
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  margin-right: -0.16em;
}

.statement {
  max-width: var(--measure);
  margin-top: 3.2rem;
  padding-top: 2.15rem;
  border-top: 1px solid var(--rule);
}

.statement section + section {
  margin-top: 2.85rem;
}

.kicker {
  display: flex;
  align-items: baseline;
  margin: 0 0 0.62rem;
  color: var(--qing);
  font-weight: 550;
  font-size: 0.74rem;
  line-height: 1.2;
  letter-spacing: 0.16em;
  font-variant-caps: all-small-caps;
}

.kicker .v-zh {
  font-weight: 500;
  font-size: 0.84rem;
  letter-spacing: 0.28em;
  margin-right: -0.28em;
  font-variant-caps: normal;
}

.statement p,
.contact p {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.72;
  text-wrap: pretty;
  hyphens: manual;
  font-variant-numeric: oldstyle-nums proportional-nums;
}

html[data-pref="zh"] .statement p {
  line-height: 1.98;
  text-align: justify;
  text-align-last: start;
  line-break: strict;
  hanging-punctuation: allow-end;
}

.contact {
  max-width: var(--measure);
  margin-top: 3.15rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.contact p {
  max-width: 36em;
}

.colophon {
  max-width: var(--measure);
  margin-top: 4.15rem;
  padding-top: 1.45rem;
  padding-bottom: calc(2.6rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
}

.imprint {
  display: grid;
  gap: 1.2rem;
  margin: 0;
}

.imprint div {
  display: grid;
  gap: 0.28rem;
}

.imprint dt {
  margin: 0;
  color: var(--qing);
  font-weight: 550;
  font-size: 0.7rem;
  line-height: 1.3;
  letter-spacing: 0.15em;
  font-variant-caps: all-small-caps;
}

.imprint dt .v-zh {
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  margin-right: -0.22em;
  font-variant-caps: normal;
}

.imprint dd {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 450;
  font-variant-numeric: oldstyle-nums proportional-nums;
}

.imprint address {
  margin: 0;
  font-style: normal;
}

.keep {
  white-space: nowrap;
}

br.narrow {
  display: none;
}

.code {
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.045em;
  font-weight: 500;
}

.email,
.email a {
  font-variant-numeric: lining-nums;
  letter-spacing: 0.01em;
}

.domain {
  margin: 1.7rem 0 0;
  color: var(--quiet);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  font-variant-numeric: lining-nums;
}

.missing .kicker {
  margin-bottom: 0.85rem;
}

.miss-line {
  margin: 0;
  max-width: 16em;
  font-size: clamp(1.7rem, 3.1vw, 2.2rem);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.miss-line.v-zh {
  letter-spacing: 0.04em;
  font-weight: 500;
}

.return {
  margin: 1.8rem 0 0;
  font-size: 1.05rem;
}

@media (min-width: 760px) {
  .statement p,
  .contact p {
    font-size: 1.1875rem;
    line-height: 1.7;
  }

  html[data-pref="zh"] .statement p {
    line-height: 1.98;
  }

  .mast {
    padding-top: 1.85rem;
  }
}

@media (max-width: 640px) {
  br.narrow {
    display: inline;
  }
}

@media (max-width: 420px) {
  h1 {
    letter-spacing: -0.018em;
  }

  .brand-zh {
    font-size: 1.08rem;
    letter-spacing: 0.22em;
    margin-right: -0.22em;
  }

  .descriptor .v-en {
    letter-spacing: 0.2em;
    margin-right: -0.2em;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ink: #12110f;
    --quiet: #2c2a27;
    --qing: #0f2e29;
    --rule: rgba(18, 17, 15, 0.48);
    --paper: #f7f5ef;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  body::before,
  .lang,
  .skip {
    display: none !important;
  }

  .v-en,
  .v-zh {
    display: block !important;
  }

  .v-zh {
    margin-top: 0.35rem;
  }

  .sheet {
    width: auto;
  }

  a:link,
  a:visited {
    color: inherit;
    text-decoration: underline;
  }

  .statement section,
  .contact,
  .colophon {
    break-inside: avoid;
  }

  @page {
    margin: 16mm;
  }
}
