/* vxlab — one stylesheet for the whole site.
   Without JS the home page is a plain list. The inline script in index.html adds
   .stairs to <html>, and helix.js then places each landing beside its rung. */

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

:root{
  --bg:#08080c;
  --bg-low:#0a0d14;   /* bottom of the page gradient */
  --ink:#d0d4da;      /* primary text */
  --ink-2:#8a93a0;    /* secondary text */
  --steel:#6f9ac4;    /* the one accent: landings, links, focus */

  --max-w:1320px;
  --viewport-h:100vh;
  --edge:max(clamp(1.25rem,4vw,3.25rem), calc((100vw - var(--max-w)) / 2 + 1.5rem));
  --font:'Unbounded',system-ui,sans-serif;
}
@supports (height:100dvh){ :root{ --viewport-h:100dvh; } }

html{ background:var(--bg); }
body{
  min-height:var(--viewport-h);
  padding:clamp(1.5rem,5vh,3rem) var(--edge);
  background:linear-gradient(to bottom, var(--bg), var(--bg-low));
  color:var(--ink);
  font-family:var(--font);
  font-weight:300;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

::selection{ background:rgba(111,154,196,.35); color:var(--ink); }

a{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-color:var(--steel);
  text-decoration-thickness:1px;
  text-underline-offset:.3em;
}
a:hover{ text-decoration-color:var(--ink); }
:focus-visible{ outline:1px solid var(--steel); outline-offset:6px; }

/* ── wordmark ── */
.wordmark{
  font-weight:700;
  font-size:clamp(3rem,7.2vw,6rem);
  line-height:1;
  letter-spacing:-.02em;
  white-space:nowrap;
  color:var(--ink);
}
.wordmark .lab{
  display:inline-block;
  font-weight:300;
  transition:margin-left .7s cubic-bezier(.22,1,.36,1);
}
.wordmark:hover .lab{ margin-left:.16em; }

.statement{
  margin-top:1.4rem;
  max-width:30ch;
  font-size:.95rem;
  color:var(--ink-2);
}

/* ── directory: plain list (no JS) ── */
canvas#helix{ display:none; }

.directory{ margin-top:3.5rem; }
.landings{ list-style:none; display:flex; flex-direction:column; gap:2.4rem; }
.landing h2{ font-size:inherit; font-weight:inherit; }
.landing-name{
  display:block;
  width:max-content;
  max-width:100%;
  padding:0;
  border:0;
  background:none;
  font:inherit;
  font-size:1.6rem;
  font-weight:700;
  line-height:1.15;
  text-align:left;
  color:var(--ink);
  cursor:pointer;
}
.placard{ margin-top:.5rem; max-width:22rem; font-size:.8rem; }
.placard-status{ margin-top:.5rem; font-size:.74rem; color:var(--ink-2); }
.placard a{ display:inline-block; margin-top:.7rem; }

/* ── directory: staircase ── */
.stairs body{
  height:var(--viewport-h);
  padding:0;
  overflow:hidden;
  overscroll-behavior:none;
  touch-action:pinch-zoom;   /* one-finger drags go to helix.js; pinch-zoom still works */
}
.stairs canvas#helix{
  display:block;
  position:fixed; top:0; left:0; z-index:1;
  width:100%; height:var(--viewport-h);
  opacity:0;
  animation:appear 2.4s .15s ease forwards;
}
body.dragging, body.dragging *{ cursor:grabbing !important; user-select:none; -webkit-user-select:none; }

.stairs .masthead{
  position:fixed; z-index:2;
  left:var(--edge); top:50%;
  transform:translateY(-50%);
  pointer-events:none;
  animation:appear 1.6s .3s ease backwards;
}
.stairs .masthead > *{ pointer-events:auto; }

.stairs .directory{
  position:fixed; inset:0; z-index:2;
  margin:0;
  padding-left:var(--edge);   /* helix.js reads this to learn the page edge in px */
  pointer-events:none;
  animation:appear 1.6s .6s ease backwards;
}
.stairs .landings{ display:block; }
.stairs .landing{
  --near:0;                   /* 0 = a landing away, 1 = at eye level; set by helix.js */
  position:absolute; top:0;
  left:var(--col-x,0);
  width:var(--col-w,20rem);
}
.stairs .landing h2{ transform:translateY(-50%); }   /* centre the name on its rung */
.stairs .landing-name{
  pointer-events:auto;
  font-size:calc(.95rem + .65rem * var(--near));
  font-weight:calc(300 + 400 * var(--near));
  color:var(--ink-2);
  color:color-mix(in srgb, var(--ink) calc(var(--near) * 100%), var(--ink-2));
}
.stairs .landing-name:hover,
.stairs .landing-name:focus-visible{ color:var(--ink); }
.stairs .placard{
  margin-top:0;
  opacity:calc((var(--near) - .6) * 2.5);
  visibility:hidden;
  pointer-events:none;
}
.stairs .is-current .placard{ visibility:visible; pointer-events:auto; }

@keyframes appear{ from{opacity:0} to{opacity:1} }

/* ── plain pages (404) ── */
.page main{ max-width:34rem; }
.page .wordmark{ display:inline-block; font-size:1.6rem; text-decoration:none; }
.page h1{ margin-top:4rem; font-size:1.6rem; font-weight:700; line-height:1.2; }
.page p{ margin-top:1rem; font-size:.9rem; color:var(--ink-2); }

/* ── narrow: helix moves to the right edge, text keeps one left column ── */
@media (max-width:999px){
  .wordmark{ font-size:clamp(2.2rem,8vw,3.2rem); }
  .statement{ margin-top:.7rem; font-size:.8rem; }
  .stairs .masthead{ top:clamp(1.25rem,4vh,2.5rem); transform:none; }
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-delay:0s !important;
    transition-duration:.001ms !important;
  }
}
