/* TrackBerkeley's ground: TrackASUC's paper, ink and Manrope, with the City of
 * Berkeley's colours (sampled off its logo) for what the lens looks at. */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/assets/fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --paper: #F5F4F0;
  --ink: #0B0C0F;
  --ink-muted: #4F514A;
  --ink-quiet: #71736B;
  --lens: #d75a4d;
  --rule-ink: rgba(0, 38, 118, 0.03);

  /* The City's logo, left to right: the red edge, the white face, terracotta, gold, the
   * black field, and the two eyes. */
  --city-red: #AE2736;
  --city-terracotta: #B27347;
  --city-gold: #E2BC5B;
  --city-blue: #2660A4;
  --city-green: #71764D;

  --ground: var(--paper);
  --mark: var(--ink);
  --quiet: var(--ink-muted);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* After sunset in Berkeley the sheet turns over: the logo's own black field. */
:root[data-sky='night'] {
  --ground: var(--ink);
  --mark: var(--paper);
  --quiet: #A9AAA2;
  --rule-ink: rgba(245, 244, 240, 0.035);
  color-scheme: dark;
}

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

html, body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100svh;
  background: var(--ground);
  color: var(--mark);
  font-family: 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  overflow: hidden;
  transition: background-color 1.6s var(--ease-out), color 1.6s var(--ease-out);
}

/* Ledger rules every 44px, thinning out down the page, over one static grain. */
.ground {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.ground::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(to bottom, var(--rule-ink) 0, var(--rule-ink) 1px, transparent 1px, transparent 44px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
}
.ground::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
}
:root[data-sky='night'] .ground::after { opacity: 0.05; mix-blend-mode: screen; }

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

/* The lockup. Letters are ink at rest; the stroke shows only while they write. */
.mark { display: block; overflow: visible; color: var(--mark); }
.mark .letter {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 22;
  stroke-opacity: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 1.6s var(--ease-out), stroke 1.6s var(--ease-out);
}
.mark .ring { fill: none; stroke: currentColor; }
.mark .handle, .mark .glint { fill: currentColor; }
.mark .glass-fill { fill: var(--ground); transition: fill 1.6s var(--ease-out); }

/* The byline: TrackASUC's own wordmark, small, at the foot. */
.byline {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 5;
  transform: translateX(-50%);
  display: block;
  padding: 10px 12px;
  color: var(--quiet);
  transition: color 0.4s var(--ease-out);
}
.byline:hover, .byline:focus-visible { color: var(--mark); }
.byline:focus-visible { outline: 1.5px solid currentColor; outline-offset: 2px; border-radius: 3px; }
.byline svg { display: block; height: 13px; width: auto; overflow: visible; }
