/* BackOz's website (D-143): sober, in BackOz's colours, light and dark,
   readable on a phone. Titles in Gloock (SIL OFL 1.1, served from this
   site, its licence at /fonts/OFL.txt); text in the system's own font. */

@font-face {
  font-family: "Gloock";
  src: url("/fonts/Gloock-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #F6F3EC;
  --surface: #FFFDF8;
  --text: #20242A;
  --muted: #555B63;
  --accent: #2F6B4F;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3EEE7;
  --rule: #E2DBCE;
  --error: #A3362A;
  --shadow: 0 1px 2px rgba(32, 36, 42, .06), 0 8px 24px rgba(32, 36, 42, .06);
  --serif: "Gloock", "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --surface: #1A1E22;
    --text: #F2F0EB;
    --muted: #AEB4BB;
    --accent: #6DBB95;
    --accent-ink: #0F2219;
    --accent-soft: #1D2B24;
    --rule: #2D3238;
    --error: #F2907E;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

/* Japanese, Korean and Chinese: Gloock draws the Latin letters and
   figures of a title, the system's serif its characters. */
:lang(ja) { --serif: "Gloock", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; }
:lang(ko) { --serif: "Gloock", "AppleMyungjo", "Noto Serif KR", serif; }
:lang(zh-Hans) { --serif: "Gloock", "Songti SC", "Noto Serif SC", serif; }
:lang(zh-Hant) { --serif: "Gloock", "Songti TC", "Noto Serif TC", serif; }
:lang(ja) body { font-family: -apple-system, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; }
:lang(ko) body { font-family: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
:lang(zh-Hans) body { font-family: -apple-system, "PingFang SC", "Noto Sans SC", sans-serif; }
:lang(zh-Hant) body { font-family: -apple-system, "PingFang TC", "Noto Sans TC", sans-serif; }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--text); }
/* Gloock has one weight, never thickened; the Japanese, Korean and Chinese
   characters take their system serif's demibold, nearer Gloock's colour. */
h1, h2, h3, .brand span, .hero .subtitle, footer.site .small { font-synthesis: none; }
:lang(ja) :is(h1, h2, h3, .subtitle), :lang(ko) :is(h1, h2, h3, .subtitle),
:lang(zh-Hans) :is(h1, h2, h3, .subtitle), :lang(zh-Hant) :is(h1, h2, h3, .subtitle) { font-weight: 600; }
h1 { font-size: clamp(2.2rem, 7vw, 3rem); line-height: 1.08; letter-spacing: -.015em; margin: 0 0 .9rem; }
h2 { font-size: 1.55rem; line-height: 1.2; letter-spacing: -.01em; margin: 2.6rem 0 .6rem; }
h3 { font-size: 1.25rem; line-height: 1.25; margin: 0 0 .45rem; }
p { margin: 0 0 .7rem; }

/* The header: BackOz, the language selector, the three pages. */
header.site, main, footer.site { max-width: 46rem; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }
header.site { padding-top: 1.1rem; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; }
.brand img { border-radius: 10px; box-shadow: var(--shadow); }
.brand span { font-family: "Gloock", var(--serif); font-size: 1.6rem; line-height: 1; letter-spacing: -.01em; }
nav.pages { display: flex; flex-wrap: wrap; gap: .35rem 1.3rem; margin: 1rem 0 0; padding: .7rem 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: .98rem; }
nav.pages a { color: var(--muted); text-decoration: none; }
nav.pages a:hover { color: var(--text); }
nav.pages a[aria-current="page"] { color: var(--text); font-weight: 600; }

.languages { position: relative; }
.languages summary { list-style: none; display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  padding: .4rem .75rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: .93rem; }
.languages summary::-webkit-details-marker { display: none; }
.languages summary::after { content: ""; width: .45rem; height: .45rem; margin-left: .1rem;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.languages[open] summary::after { transform: translateY(2px) rotate(225deg); }
.languages ul { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 10; margin: 0; padding: .4rem;
  list-style: none; min-width: 13rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: var(--shadow); }
.languages li a { display: block; padding: .45rem .7rem; border-radius: 9px; color: var(--text); text-decoration: none; }
.languages li a:hover { background: var(--accent-soft); }
.languages li a[aria-current="true"] { font-weight: 600; color: var(--accent); }

main { padding-top: 2.4rem; padding-bottom: 3.5rem; }
.lead { font-size: 1.12rem; color: var(--muted); }

/* Home. */
.hero { text-align: center; padding: 1.5rem 0 .5rem; }
.hero .icon { border-radius: 28px; box-shadow: var(--shadow); margin-bottom: 1.4rem; }
.hero h1 { margin-bottom: .3rem; }
.hero .subtitle { font-family: var(--serif); font-size: 1.35rem; color: var(--accent); margin-bottom: 1.1rem; }
.hero .lead { max-width: 34rem; margin: 0 auto; }
.cards { list-style: none; margin: 2.4rem 0 0; padding: 0; display: grid; gap: .8rem; }
.cards a { display: flex; justify-content: space-between; align-items: center; padding: 1.05rem 1.2rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; color: var(--text);
  text-decoration: none; font-weight: 600; box-shadow: var(--shadow); }
.cards a::after { content: "→"; color: var(--accent); font-weight: 400; }
.cards a:hover { border-color: var(--accent); }

/* Support. */
.jump a { display: inline-block; padding: .5rem .95rem; border: 1px solid var(--accent); border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: .95rem; }
.jump a:hover { background: var(--accent-soft); }
.question { padding: 1.3rem 0; border-top: 1px solid var(--rule); }
.question p { color: var(--muted); }
.question p:last-child { margin-bottom: 0; }
.publisher { color: var(--muted); font-size: .92rem; }
a.out::after { content: " ↗"; }

.contact { margin-top: 2.6rem; padding: 1.4rem 1.25rem 1.5rem; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 20px; box-shadow: var(--shadow); }
.contact h2 { margin-top: 0; }
label { display: block; font-weight: 600; margin: 1rem 0 .35rem; }
textarea, input[type="email"] { width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 12px; padding: .75rem .85rem; }
textarea { resize: vertical; min-height: 9rem; }
textarea[aria-invalid="true"], input[aria-invalid="true"] { border-color: var(--error); }
.hint { font-size: .92rem; color: var(--muted); margin: .35rem 0 0; }
.error { font-size: .95rem; color: var(--error); margin: .4rem 0 0; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button { margin-top: 1.3rem; width: 100%; font: inherit; font-weight: 600; color: var(--accent-ink);
  background: var(--accent); border: 0; border-radius: 14px; padding: .9rem 1rem; cursor: pointer; }
button:hover { filter: brightness(1.05); }
button:disabled { opacity: .6; cursor: progress; }
.note { font-size: .9rem; color: var(--muted); margin: 1rem 0 0; }
.status { margin-top: 1.2rem; padding: .9rem 1rem; border-radius: 12px; background: var(--accent-soft); }
.status strong { display: block; margin-bottom: .2rem; }
.status.problem { background: transparent; border: 1px solid var(--error); }
.status.problem strong { color: var(--error); }
.done h3 { font-size: 1.5rem; }

/* The privacy policy and the terms. */
main section h2 { font-size: 1.3rem; margin: 2rem 0 .4rem; }
main section p { color: var(--muted); }
.link { margin-top: -.2rem; }
.date { margin-top: 2.4rem; font-size: .92rem; color: var(--muted); }
.sent { text-align: center; padding-top: 2rem; }

/* The footer. */
footer.site { padding-top: 1.4rem; padding-bottom: 2.6rem; border-top: 1px solid var(--rule); color: var(--muted);
  font-size: .9rem; }
footer.site .small { font-family: var(--serif); font-size: 1rem; color: var(--text); margin-top: .8rem; }

/* The language chooser at / and the page not found. */
body.chooser main { max-width: 34rem; }
.choices { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: .6rem; }
.choices a { display: flex; flex-direction: column; padding: .85rem 1.1rem; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 14px; color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.choices a:hover { border-color: var(--accent); }
.choices .name { font-weight: 600; }
.choices .sub { color: var(--muted); font-size: .95rem; }
.choices.compact { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }

@media (max-width: 30rem) {
  body { font-size: 16.5px; }
  .brand span { font-size: 1.45rem; }
  .languages ul { right: -.25rem; }
  .contact { padding: 1.2rem 1rem 1.3rem; border-radius: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .cards a, .choices a { transition: border-color .15s ease; }
}
