@font-face {
  font-family: "Noto Serif Display"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/noto-serif-display-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif Display"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("assets/fonts/noto-serif-display-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/noto-serif-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("assets/fonts/noto-serif-italic.woff2") format("woff2");
}

:root {
  --bg: #05060d;
  --text: #eef1fb;
  --muted: #b1b9d1;
  --line: rgba(255, 255, 255, .09);
  --glass: rgba(14, 17, 32, .6);
  --accent: #8fb6ff;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --serif: "Noto Serif Display", ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --sp: 0;
  --px: 0;
  --py: 0;
}

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

* { box-sizing: border-box; margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: fixed; top: 12px; left: 12px; z-index: 50; padding: 12px 20px; border-radius: 999px;
  background: #f3f6ff; color: #0a0d1c; font-weight: 600; text-decoration: none; transform: translateY(-160%);
}
.skip:focus { transform: none; }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px;
}
.btn:focus-visible, .socials a:focus-visible { border-radius: 999px; }
main:focus { outline: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Backdrop stack */
.bg {
  position: fixed; inset: -4%; z-index: -4;
  background: url("assets/bg-1280.webp") 62% 42% / cover no-repeat, var(--bg);
  transform:
    translate3d(calc(var(--px) * -14px), calc(var(--py) * -10px - var(--sp) * 90px), 0)
    scale(calc(1.04 + var(--sp) * .12));
  transition: transform .5s var(--ease);
  animation: bgin 1.8s ease both;
  will-change: transform;
}
#shader {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; pointer-events: none;
  mix-blend-mode: screen; opacity: 0; transition: opacity 2.4s ease .4s;
}
#shader.on { opacity: .55; }
.veil {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 90% at 62% 40%, transparent 30%, rgba(5, 6, 13, .55) 75%, var(--bg) 100%),
    linear-gradient(180deg, rgba(5, 6, 13, .35), rgba(5, 6, 13, .1) 30%, rgba(5, 6, 13, .7) 100%);
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes bgin { from { opacity: 0; filter: blur(12px); } to { opacity: 1; filter: none; } }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 20; }
.progress i {
  display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(var(--sp));
  background: linear-gradient(90deg, var(--accent), #ffb59f);
}

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 28px;
  padding: 22px clamp(20px, 5vw, 56px);
}
/* The soft fade lives on a pseudo-element so it never fades the links themselves */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 6, 13, .75), rgba(5, 6, 13, 0));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
  mask-image: linear-gradient(180deg, #000 60%, transparent);
}
.brand { color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: .02em; }
.brand span { color: var(--muted); font-weight: 400; }

.grad {
  font-style: italic; padding: 0 .12em .2em; margin: 0 -.12em -.2em;
  background: linear-gradient(100deg, #cfe0ff 10%, var(--accent) 45%, #ffb59f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

main { max-width: 1240px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }

.eyebrow { text-transform: uppercase; letter-spacing: .22em; font-size: .8rem; color: var(--accent); margin-bottom: 22px; }
h1 {
  font-family: var(--serif); font-weight: 400; font-kerning: normal; text-rendering: optimizeLegibility;
  font-size: clamp(2.8rem, 8.4vw, 7.4rem); line-height: .98; letter-spacing: -.03em;
  max-width: 11ch; text-shadow: 0 2px 40px rgba(5, 6, 13, .6);
}
.lede { max-width: 46ch; margin-top: 30px; font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: #dbe1f3; text-shadow: 0 1px 18px rgba(5, 6, 13, .7); }

.cta { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 28px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .95rem;
  transition: box-shadow .3s, background .2s; will-change: transform;
}
.btn span { display: inline-block; pointer-events: none; }
.btn.primary { background: #f3f6ff; color: #0a0d1c; box-shadow: 0 8px 40px rgba(143, 182, 255, .28); }
.btn.primary:hover { box-shadow: 0 10px 56px rgba(143, 182, 255, .55); }
.btn.ghost { color: var(--text); border: 1px solid var(--line); background: rgba(255, 255, 255, .04); backdrop-filter: blur(10px); }
.btn.ghost:hover { background: rgba(255, 255, 255, .09); }

/* Link row: four plain footer-style text links, not buttons */
.linklist { display: flex; flex-wrap: wrap; gap: 0 clamp(18px, 3.4vw, 56px); }
.linklist a { color: var(--text); text-decoration: none; font-size: .95rem; padding: 11px 0; transition: color .2s; }
.linklist a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

.home { min-height: 100svh; display: flex; flex-direction: column; }
.home main { flex: 1; width: 100%; display: flex; align-items: flex-end; padding-bottom: clamp(22px, 5vh, 56px); }
/* Featured line: quiet, serif, sits just above the footer */
.featured { font-family: "Noto Serif", Georgia, "Times New Roman", serif; font-size: clamp(1rem, 1.35vw, 1.1rem); line-height: 1.5; letter-spacing: .005em; color: #cfd6ea; text-shadow: 0 1px 12px rgba(5, 6, 13, .95), 0 0 2px rgba(5, 6, 13, .6); }
.featured span { font-style: italic; color: var(--accent); margin-right: .7em; }
.featured a { color: #f4f6fd; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease), color .2s; padding-bottom: 1px; }
.featured a:hover, .featured a:focus-visible { background-size: 100% 1px; color: #fff; }
.featured i { font-style: normal; display: inline-block; transition: transform .25s var(--ease); }
.featured a:hover i { transform: translateX(3px); }
footer { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px) 34px; overflow: hidden; }
.wordmark {
  font-family: var(--serif); font-size: clamp(2.6rem, 15vw, 12.5rem); line-height: 1; letter-spacing: -.05em;
  width: fit-content; margin: clamp(80px, 12vw, 160px) auto 0; padding-bottom: .12em; user-select: none;
  /* the original top-to-bottom fade, kept on top of the colour gradient */
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .95), rgba(0, 0, 0, .14) 85%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .95), rgba(0, 0, 0, .14) 85%);
}
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 10px; }
.foot-left { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.motion-toggle {
  font: inherit; color: var(--muted); background: none; border: 0; padding: 11px 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: 3px;
}
.motion-toggle:hover { color: var(--text); }
.motion-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.paused *, .paused *::before, .paused *::after { animation-play-state: paused !important; }
.foot-left a { padding: 11px 0; color: var(--muted); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: 3px; transition: color .2s; }
.foot-left a:hover { color: var(--text); }
.socials { display: flex; gap: 4px; }
.socials a {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--muted);
  border: 1px solid transparent; transition: color .2s, background .2s, border-color .2s;
}
.socials a:hover { color: var(--text); background: rgba(255, 255, 255, .07); border-color: var(--line); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.socials .mail svg { fill: none; }
.socials .gf {
  width: 18px; height: 18px; background: currentColor; display: block;
  -webkit-mask: url("assets/gitfor.png") center / contain no-repeat; mask: url("assets/gitfor.png") center / contain no-repeat;
}

/* Sub pages (privacy, 404, hosting) */
/* Footer stays at the bottom of the screen on short pages */
.subpage { min-height: 100svh; display: flex; flex-direction: column; }
.subpage main { flex: 1; width: 100%; }
.sub-foot { margin-top: 60px; padding-top: 0; }
.sub-foot .foot-row { margin-top: 0; }
.doc { max-width: 780px; margin: 0 auto; padding: 130px clamp(20px, 5vw, 48px) 0; }
.sheet {
  padding: clamp(26px, 5vw, 56px); border-radius: 28px; background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 90px -30px rgba(0, 0, 0, .8);
}
.sheet h1 { font-size: clamp(2.2rem, 5.6vw, 3.6rem); max-width: none; line-height: 1.05; }
.sheet .updated { color: var(--muted); font-size: .85rem; margin: 14px 0 28px; }
.sheet h2 { font-size: 1.5rem; margin: 34px 0 10px; }
.sheet p { color: #dbe1f3; max-width: 64ch; }
.sheet p + p { margin-top: 12px; }
.sheet a { color: var(--accent); text-underline-offset: 3px; }
.dotgrid-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -4; display: block; }
.dotbg .bg { display: none; }
/* Cluemaster: a plain page, a compact Game of Life board under the title */
.boardpage::before { content: ""; position: fixed; inset: 0; z-index: -3; background: rgba(5, 6, 13, .74); pointer-events: none; }
.boardpage .doc { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-top: 80px; }
.boardpage h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); max-width: none; line-height: 1.05; }
.boardpage .eyebrow { margin-bottom: 14px; }
.boardpage .soon { color: var(--muted); font-size: .9rem; margin-top: 10px; }
.dotgrid { display: block; width: min(100%, 560px); height: clamp(180px, 32vw, 250px); margin-top: 34px; border-radius: 14px; border: 1px solid var(--line); background: rgba(5, 6, 13, .35); }
.dotgrid[data-style="board"] { border: 0; background: none; height: clamp(230px, 42vw, 300px); }
/* On the dot-matrix home page the wordmark is a small, quiet signature above the footer row */
.dotbg .wordmark {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem); letter-spacing: -.02em; line-height: 1.2;
  margin: 0 0 18px; opacity: .75;
  -webkit-mask-image: none; mask-image: none;
}
.sheet ul.feat { list-style: none; padding: 0; max-width: none; margin: 22px 0 0; display: grid; gap: 16px; }
.feat li { display: flex; align-items: center; gap: 18px; margin: 0; }
.feat .lifeicon { flex: none; width: 68px; height: 68px; border-radius: 10px; border: 1px solid var(--line); background: rgba(5, 6, 13, .35); }
.feat b { display: block; font-weight: 600; color: var(--text); }
.feat span { display: block; color: #ccd3e8; font-size: .95rem; }
.sheet ul { color: #dbe1f3; max-width: 64ch; margin: 14px 0 0; padding-left: 1.3em; }
.sheet li + li { margin-top: 8px; }
.lost {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 100px clamp(20px, 5vw, 48px) 40px;
}
.lost .big {
  font-family: var(--serif); font-size: clamp(6rem, 26vw, 16rem); line-height: .9; letter-spacing: -.05em;
  background: linear-gradient(100deg, #cfe0ff 10%, var(--accent) 45%, #ffb59f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; margin: 4px 0 10px;
}
.lost h1 { font-size: clamp(1.8rem, 4.6vw, 3rem); max-width: 20ch; }
.lost .lede { margin-inline: auto; }
.lost .cta { justify-content: center; }

@media (min-width: 900px) {
  .bg {
    background-image: url("assets/bg-2400.webp");
  }
}
@media (min-width: 2200px) {
  .bg {
    background-image: url("assets/bg-3840.webp");
  }
}

@media (min-width: 900px) {
  .bg {
    inset: -4% -4% -4% 22%; background-position: 55% 40%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 32%);
    mask-image: linear-gradient(90deg, transparent, #000 32%);
  }
}

@media (max-width: 899px) {
  .bg { inset: -30% -4% 34% -4%; background-position: 58% 40%; }
}
@media (max-width: 520px) {
  .linklist { gap: 0 10px; }
  .linklist a { font-size: .86rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bg { animation: none; }
}
