/* Palette is derived, not picked. One hue (OKLCH H 250) at a chroma low enough
   that the page reads as monochrome, with every role pinned to a fixed
   lightness rung and a fixed chroma multiplier off that hue. The full
   derivation and the constraint table it has to satisfy live in the colour
   study; what matters here is that these values are outputs of a rule, so
   changing one by hand breaks the system rather than tweaking it.

   The two-tone wordmark works on the lightness gap between --bone and
   --accent (2.64:1), not on hue. That is why it survives at near-zero chroma:
   "pure" and "idle" separate because one is lighter, not because one is
   bluer. */
:root {
  --ground:  #0b0c0d;   /* L .155 — page ground */
  --surface: #181a1b;   /* L .215 — card, badge */
  --edge:    #303234;   /* L .315 — borders, dormant traces */
  --accent:  #8894a0;   /* L .660 — "idle", live traces */
  --lifted:  #b0b8c1;   /* L .780 — accent where it carries text */
  --bone:    #eceded;   /* L .945 — "pure", body text */
  --muted:   #a7a8a8;   /* L .730 — secondary copy */
  --faint:   #7f8081;   /* L .600 — the quietest text that still clears 4.5 */

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.5rem;
  padding: 3rem 1.5rem;
  background: var(--ground);
  color: var(--bone);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------- layers */

#field,
.lift,
.grain,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#field    { z-index: 1; width: 100%; height: 100%; }
.lift     { z-index: 0; }
.grain    { z-index: 2; }
.vignette { z-index: 2; }

main, footer {
  position: relative;
  z-index: 3;
}

/* The board is masked out behind the copy, which would otherwise leave a dead
   patch in the middle of the page. This puts a little light back — static, and
   a multi-stop gradient rather than a blur, because a large blurred surface is
   re-rasterised every frame and was the single biggest cause of this page
   lagging on real hardware. */
.lift {
  background: radial-gradient(ellipse 70% 55% at 50% 44%,
    rgba(196, 204, 212, 0.052) 0%,
    rgba(196, 204, 212, 0.030) 34%,
    rgba(196, 204, 212, 0.011) 60%,
    transparent 78%);
}

/* Film grain — breaks up gradient banding and gives the ground some tooth.
   Plain opacity rather than mix-blend-mode: a blend mode on a full-screen
   layer above animated content forces a recomposite of everything beneath.

   The feColorMatrix is not decoration. feTurbulence generates noise in all
   four channels, so the raw filter lays coloured speckle over a palette whose
   entire point is that it has no hue — saturate 0 puts the grain back in
   greyscale. */
.grain {
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  background: radial-gradient(ellipse at center, transparent 54%, rgba(0, 0, 0, 0.72) 100%);
}

/* ----------------------------------------------------------------- badge */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.9rem;
  margin-bottom: 2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lifted);
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: rgba(24, 26, 27, 0.72);
}

.pip {
  width: 5px;
  height: 5px;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(136, 148, 160, 0.7);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* ------------------------------------------------------------------ type */

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 40rem;
}

/* Two flat colours in two spans, so no background-clip and none of the
   descender clipping it used to cause here. The wordmark now paints as
   ordinary text and needs no padding or line-height defence. */
h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.9rem, 12.5vw, 6.4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

h1 .pure { color: var(--bone); }
h1 .idle { color: var(--accent); }

.tagline {
  margin: 1.5rem 0 0;
  font-size: clamp(0.98rem, 2.6vw, 1.14rem);
  line-height: 1.65;
  color: var(--muted);
  text-wrap: balance;
}

.soon {
  margin: 2.4rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  color: var(--faint);
}

/* --------------------------------------------------------------- project */

/* Not a link — the repo is private, so this is a teaser only. */
.project {
  display: block;
  width: 100%;
  max-width: 26rem;
  margin-top: 2.6rem;
  padding: 1.2rem 1.3rem 1.25rem;
  text-align: left;
  border: 1px solid var(--edge);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  background: rgba(24, 26, 27, 0.86);
}

.project-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.project-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--bone);
}

/* Monochrome on purpose. A coloured status chip would be the only hue on the
   page and would read as an alert rather than a state — the palette keeps
   semantic colour in reserve for things that are actually wrong. */
.tag {
  padding: 0.15rem 0.45rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lifted);
  border: 1px solid var(--edge);
  border-radius: 2px;
}

.project-desc {
  margin: 0.7rem 0 0;
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--muted);
}

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

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--edge);
  border-radius: 2px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.mark {
  flex: none;
  transition: transform 0.2s ease;
}

.link:hover,
.link:focus-visible {
  color: var(--bone);
  border-color: var(--accent);
  background: rgba(136, 148, 160, 0.08);
}

.link:hover .mark { transform: rotate(-8deg) scale(1.08); }

.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.copyright {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--faint);
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  .pip { animation: none; }
  .link, .mark { transition: none; }
  .link:hover .mark { transform: none; }
}

@media (max-width: 560px) {
  /* Let the tagline find its own breaks rather than fighting the hard one. */
  .tagline br { display: none; }
}
