/* Lebamap. One stylesheet for every public page; the admin inlines its own.
   Palette is black, white and grays only. Two faces ship, for a retro feel:
   Fraunces Black (soft, wonky) for the mark and headings, Space Mono for
   everything small. */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-900-soft-latin.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/assets/fonts/space-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #000000;
  /* 5.7:1 on white, so the small footer type still passes AA. */
  --gray: #5f5f5f;
  --line: #e4e4e4;
  --display: "Fraunces", "Cooper Black", "Georgia", "Times New Roman", serif;
  --mono: "Space Mono", ui-monospace, "Consolas", "Courier New", monospace;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .9375rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
::selection { background: var(--ink); color: var(--paper); }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------- the mark */

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}

.mark {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  /* Seven heavy letters: 15vw keeps the word inside a 320px phone with its
     gutters, and 9.5rem stops it short of shouting on a wide screen. */
  font-size: clamp(2.5rem, 15vw, 9.5rem);
  line-height: 1;
  letter-spacing: .02em;
  /* Tracking adds space after the last letter too; this gives it back so the
     word sits on the true centre line. */
  margin-right: -.02em;
  white-space: nowrap;
}

/* ------------------------------------------------------------- footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 18px var(--gutter);
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  border-top: 1px solid var(--line);
  font-size: .75rem;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray);
}
.foot__v { font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot nav a {
  display: inline-block;
  /* 12px text, 32px tall hit area. */
  padding: 10px 0;
  text-decoration: none;
  transition: color .2s ease;
}
.foot nav a:hover, .foot nav a[aria-current="page"] { color: var(--ink); }

@media (max-width: 360px) {
  .foot { letter-spacing: .02em; gap: 6px 16px; }
  .foot nav { gap: 4px 14px; }
}

/* ------------------------------------------------------------- legal pages */

.top {
  padding: 22px var(--gutter) 0;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
}
.top a {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: .02em;
  text-decoration: none;
}

.doc {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 9vw, 96px) var(--gutter) clamp(56px, 10vw, 112px);
}
.doc h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: .005em;
}
.doc .meta {
  margin: 14px 0 0;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray);
}
.doc .lede { margin: 32px 0 0; font-size: 1rem; }
.doc h2 {
  margin: 48px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.35rem, 3.6vw, 1.7rem);
  line-height: 1.2;
}
.doc p, .doc ul { margin: 14px 0 0; }
.doc ul { padding-left: 1.1em; }
.doc li + li { margin-top: 6px; }
.doc a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc code { font-family: var(--mono); font-size: .95em; background: #f2f2f2; padding: 0 .25em; }

/* ------------------------------------------------------------- 404 */

.lost { text-align: center; }
.lost .mark { font-size: clamp(4rem, 17vw, 10rem); }
.lost p {
  margin: 22px 0 0;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray);
}
.lost p a { text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.lost p a:hover { color: var(--ink); }

/* ------------------------------------------------------------- the gate */

/* The under-construction gate (assets/js/construction-gate.js). It covers
   the home page until the preview password is entered. */
html.is-gated, html.is-gated body { overflow: hidden; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: env(safe-area-inset-top);
  transition: opacity .5s ease, visibility .5s ease;
}
.gate.is-leaving { opacity: 0; visibility: hidden; }

.gate__card {
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 48px var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: gate-in .9s cubic-bezier(.2, .7, .2, 1) both;
}

.gate__mark {
  margin: 0 -.02em 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.5rem, 12vw, 4.25rem);
  line-height: 1;
  letter-spacing: .02em;
  white-space: nowrap;
}

.gate__title {
  margin: 28px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  min-width: 180px;
  font-size: .75rem;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-right: -.2em;
}

.gate__text {
  margin: 18px 0 0;
  max-width: 30ch;
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--gray);
  text-wrap: balance;
}

.gate__form { width: 100%; margin-top: 40px; text-align: left; }
.gate__label {
  display: block;
  font-size: .75rem;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray);
}
.gate__row {
  display: flex;
  align-items: stretch;
  margin-top: 10px;
  border-bottom: 2px solid var(--ink);
}
.gate__input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  /* 16px or more, so a phone does not zoom the page on focus. */
  font: 1rem/1.2 var(--mono);
  letter-spacing: .08em;
  -webkit-appearance: none;
  appearance: none;
}
.gate__input:focus { outline: none; }
.gate__row:focus-within { box-shadow: 0 2px 0 var(--ink); }
.gate__btn {
  flex: none;
  min-height: 48px;
  padding: 0 4px 0 20px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: .75rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.gate__btn:hover { opacity: .6; }
.gate__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.gate__error {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--ink);
}
.gate.is-wrong .gate__row { animation: gate-shake .4s ease; }

.gate__foot {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 12px var(--gutter);
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  font-size: .75rem;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray);
}
.gate__foot a { display: inline-block; padding: 10px 0; text-decoration: none; transition: color .2s ease; }
.gate__foot a:hover { color: var(--ink); }

@keyframes gate-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gate-shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@media (max-height: 560px) {
  .gate__card { justify-content: flex-start; padding-top: 28px; }
  .gate__title { margin-top: 18px; padding-top: 16px; }
  .gate__form { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
