/* ------------------------------------------------------------
   Shared by every page: tokens, reset, light rays, header, footer
------------------------------------------------------------ */
:root {
  color-scheme: dark;

  --ink: #000;
  --paper: #fff;
  --ray-deep: #0a2a8f;
  --ray: #1b8cff;
  --ray-hot: #a8e2ff;

  --faded: rgb(255 255 255 / .26);
  --quiet: rgb(255 255 255 / .42);

  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --marker: "Permanent Marker", "Inter Tight", sans-serif;

  --page-x: clamp(1.25rem, 5vw + .5rem, 11rem);
  --page-y: clamp(2.5rem, 5vw + 1rem, 5.5rem);
  --page-y-tight: clamp(1.25rem, 2vw + .5rem, 2.75rem);

  --logo: clamp(2.75rem, 3.5vw + 1rem, 4rem);
  --hero-gap: clamp(2.75rem, 4vw + 1.25rem, 4.75rem);
  --hero-size: clamp(2.2rem, 5.3vw + 1rem, 4.5rem);
  --contact-size: clamp(1.5rem, 2.4vw + .75rem, 2rem);
  --foot-size: clamp(1.0625rem, 1.3vw + .55rem, 1.4rem);

  --hit: .4rem;      /* extra padding that enlarges link targets */
  --radius: .4rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }
svg { display: block; }

html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  min-height: 100dvh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-weight: 550;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

:focus-visible {
  outline: 2px solid var(--ray-hot);
  outline-offset: 2px;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  padding: .5rem .8rem; border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font-size: .875rem;
}
.skip:focus { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ------------------------------------------------------------
   Light: the canvas draws rays, grid and grain.
   The gradient underneath is what shows if WebGL is unavailable.
------------------------------------------------------------ */
.light {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 95% at 92% -12%,
      #a8e2ff 0%, #1b8cff 20%, #0a2a8f 42%, #020a26 62%, #000 78%);
}
.light canvas { display: block; width: 100%; height: 100%; }
.light.is-live { background: var(--ink); }

/* ------------------------------------------------------------
   Header: mark on the left, page link and lamp on the right
------------------------------------------------------------ */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--page-y) var(--page-x) 0;
}
.top-end { display: flex; align-items: center; gap: clamp(1.1rem, 2.5vw, 2rem); }

.mark {
  display: grid; place-items: center;
  width: var(--logo); height: var(--logo);
  background: var(--paper); color: var(--ink);
  font-family: var(--marker);
  font-size: calc(var(--logo) * .56);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: 1;
  border-radius: 2px;
}
/* The letters lean a little, like they were inked by hand. */
.mark > span { display: block; transform: rotate(-5deg) translateY(.02em); }

.nav-link {
  margin: calc(-1 * var(--hit)); padding: var(--hit);
  border-radius: var(--radius);
  font-size: clamp(1.0625rem, .6vw + .95rem, 1.3rem);
  letter-spacing: -.01em;
  line-height: 1.2;
  color: rgb(255 255 255 / .62);
  transition: color .3s ease-out, text-shadow .3s ease-out;
}
.nav-link:hover { color: var(--paper); }
/* With the lights on, the link is lit too. */
[data-light="on"] .nav-link {
  color: var(--paper);
  text-shadow: 0 0 .9rem rgb(0 40 140 / .95), 0 0 .3rem rgb(0 40 140 / .6);
}

.lamp {
  display: inline-flex;
  margin: calc(-1 * var(--hit)); padding: var(--hit);
  border-radius: var(--radius);
  color: var(--quiet);
  cursor: pointer;
  transition: color .2s ease-out, transform .15s ease-out, filter .3s ease-out;
}
.lamp:hover { color: var(--paper); }
.lamp:active { transform: scale(.9); }
.lamp[aria-pressed="true"] {
  color: var(--paper);
  filter: drop-shadow(0 0 .45rem rgb(0 40 140 / .9));
}
.lamp .glow { opacity: 0; transition: opacity .3s ease-out; }
.lamp[aria-pressed="true"] .glow { opacity: 1; }

/* ------------------------------------------------------------
   Footer: sits on a blurred veil over whatever is behind it
------------------------------------------------------------ */
.foot {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: space-between;
  row-gap: clamp(5rem, 22vh, 16rem);
  padding: clamp(3.5rem, 12vh, 7rem) var(--page-x) var(--page-y-tight);
}
.foot::before {
  content: "";
  position: absolute; inset: 0;
  background: rgb(0 0 0 / .34);
  -webkit-backdrop-filter: blur(.5rem);
  backdrop-filter: blur(.5rem);
  -webkit-mask-image: linear-gradient(transparent, #000 clamp(2rem, 9vh, 6rem));
  mask-image: linear-gradient(transparent, #000 clamp(2rem, 9vh, 6rem));
  pointer-events: none;
}
.foot > :not(.sr-only) { position: relative; }

.contact {
  display: flex; flex-direction: column; align-items: flex-start;
  font-size: var(--contact-size);
  line-height: 1.5;
  letter-spacing: -.012em;
}
.contact li { display: flex; flex-wrap: wrap; align-items: center; }
.contact li:first-child { margin-bottom: .5em; }

.contact a {
  display: inline-flex; align-items: center; gap: .45rem;
  margin: calc(-1 * var(--hit)); padding: var(--hit);
  border-radius: var(--radius);
  white-space: nowrap;
}
.contact a svg {
  width: .72em; height: .72em;
  transition: transform .2s ease-out;
}
.contact a:hover svg, .contact a:focus-visible svg { transform: translateX(.18em); }
.contact a:active { background: rgb(255 255 255 / .08); }

.copy {
  margin-left: 1rem;
  padding: var(--hit);
  border-radius: var(--radius);
  color: var(--quiet);
  cursor: copy;
  opacity: 0;
  transition: opacity .2s ease-in, color .2s ease-out;
}
.contact a:hover ~ .copy,
.contact a:focus-visible ~ .copy,
.copy:hover, .copy:focus-visible { opacity: 1; }
.copy.is-copied { color: var(--ray-hot); cursor: default; opacity: 1; }
@media (hover: none) { .copy { display: none; } }

.bookend {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem;
  font-size: var(--foot-size);
  letter-spacing: -.01em;
}
.year { display: flex; align-items: center; gap: .55em; }
.year .mark {
  width: 1.5em; height: 1.5em;
  font-size: 1em;
}
.year .mark > span { font-size: .78em; }
.visits { margin-left: 1.1em; color: var(--quiet); font-weight: 500; }
.visits[hidden] { display: none; }
.note { flex: 1 1 auto; text-align: right; }

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