/* ---------------------------------------------
   Low Horse, shared by every *.lowhorse.app page
   that isn't a game. Paper and ink.
   --------------------------------------------- */

@font-face {
  font-family: "Departure Mono";
  src: url("/shared/fonts/DepartureMono-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --paper: #f5f1e6;
  --ink: #211d12;
  --ink-soft: #6f6754;
  --ink-far: color-mix(in srgb, var(--ink) 58%, var(--paper));
  --line: #ddd5c2;
  --accent: #d94e26;
  --iris: #14120b;
  --grain-opacity: 0.28;

  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Space Grotesk", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Departure Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101208;
    --ink: #ebe7d8;
    --ink-soft: #9d9682;
    --line: #2b2e1d;
    --accent: #ff6b45;
    --iris: #050603;
    --grain-opacity: 0.22;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101208;
  --ink: #ebe7d8;
  --ink-soft: #9d9682;
  --line: #2b2e1d;
  --accent: #ff6b45;
  --iris: #050603;
  --grain-opacity: 0.22;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* galleries park slides off-screen; never let them widen the page */
html { overflow-x: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 200ms ease, color 200ms ease;
}

/* paper grain over everything, ink included */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .41  0 0 0 0 .33  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

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

/* ---------- logo ---------- */

.top {
  position: relative;
  padding: clamp(22px, 5vh, 56px) 16px 0;
  text-align: center;
}

.logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1;
  letter-spacing: 0.36em;
  margin-right: -0.36em; /* tracking hangs off the end; pull it back to true center */
  white-space: nowrap;
}
.logo span + span { margin-left: 0.2em; }
.logo a { color: inherit; text-decoration: none; }

/* ---------- light / dark ---------- */

.theme-toggle {
  position: absolute;
  top: clamp(14px, 3vh, 28px);
  right: 16px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  z-index: 6;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; }
