/* Lander Sans: TeX Gyre Heros (GUST Font License), subset and renamed, see
   fonts/README-lander-sans.txt. Served from this domain: no third-party request. */
@font-face {
  font-family: "Lander Sans";
  src: url("/fonts/lander-sans-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}

@font-face {
  font-family: "Lander Sans";
  src: url("/fonts/lander-sans-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* Ink on paper. Two values, swapped for dark mode. */
:root {
  color-scheme: light dark;
  --paper: #f1efec;
  --ink: #0a0a0a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121211;
    --ink: #f1efec;
  }
}

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

html {
  font-family: "Lander Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

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

body { margin: 0; }

main {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(2.5rem, 8vh, 6rem) clamp(1.25rem, 8vw, 8rem) clamp(3rem, 11vh, 8rem);
}

/* One lockup, centred on the page: the headline, and the contact block
   right-aligned to the headline's widest line, like a printed poster.
   --w (the widest line in em) comes from the Worker. The size makes that line
   fill the available width, capped by height so the address always stays in
   the first screen. The poster is exactly as wide as that line. */
.poster {
  --fs: clamp(2rem, 100cqi / var(--w, 9) * 0.995, min(12rem, 20vh - 1.5rem));
  --efs: clamp(1.25rem, 0.9rem + 1.2vw, 1.875rem);
  width: min(100%, var(--w, 9) * var(--fs) + 1px); /* 1px: sub-pixel headroom so the exact-width line never wraps */
}

.lockup {
  margin: 0;
  font-size: var(--fs);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.01em;
}

.lockup > span {
  display: block;
  overflow-wrap: anywhere;
}

/* Right edge lines up with the visible end of the headline's last letter, not
   its box: pulled in by that letter's trailing space (--inset, from the Worker),
   less the email's own trailing space at its size. */
.contact {
  margin-top: calc(var(--fs) * 0.45);
  padding-right: max(0px, var(--fs) * var(--inset, 0) - var(--efs) * var(--mail-rsb, 0));
  text-align: right;
}

.address { margin: 0; }

.email {
  font-size: var(--efs);
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

a.email {
  text-decoration-line: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

a.email:hover { text-decoration-thickness: 0.14em; }

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

.en,
.note {
  margin: 0.875rem 0 0;
  font-size: 1.0625rem;
  line-height: 1.45;
}

.note:first-child { margin: 0 0 1rem; }

.en > span {
  display: block;
  text-wrap: balance;
}

@media (prefers-reduced-motion: reduce) {
  a.email { transition: none; }
}
