/* johlayson.com personal site (2026-10-06): black & white, the universe video behind every page */
:root {
  --bg: #000;
  --text: #fff;
  --muted: rgba(255, 255, 255, .62);
  --faint: rgba(255, 255, 255, .38);
  --line: rgba(255, 255, 255, .14);
  --serif: "Gambetta", Georgia, "Times New Roman", serif;
  --sans: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(28px, 6vw, 56px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: #fff; color: #000; }
:focus-visible { outline: 1px solid #fff; outline-offset: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The universe: fixed behind everything */
.universe {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: #000 url("/assets/universe-poster.jpg") center / cover no-repeat;
}
.universe video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity 1.2s ease;
}
.universe video.is-playing { opacity: 1; }
.universe::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .55) 100%);
}
.page-about .universe::after { background: rgba(0, 0, 0, .8); }

/* Header */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
}
.page-about .top {
  background: linear-gradient(rgba(0, 0, 0, .85), rgba(0, 0, 0, 0));
}
.wordmark {
  font: 400 14px/1 var(--serif); letter-spacing: .02em; margin: 0;
}
.wordmark a { text-decoration: none; }
.nav { display: flex; gap: clamp(18px, 3vw, 36px); }
.nav a {
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  color: var(--muted); padding: 6px 0; border-bottom: 1px solid transparent;
  transition: color .3s, border-color .3s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }

/* Home and Thoughts: just the universe */
.empty { min-height: 100vh; min-height: 100svh; }

/* About: one section per screen, text floats in and out as you scroll (assets/float.js) */
.about { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); }
/* Keep the floating text from ever making the page wider than the screen */
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
.slide {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px 0;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(32px, 4.5vw, 46px); letter-spacing: -.01em; }
h1 em, h2 em { font-style: italic; }
.lead { font-size: 15px; color: var(--muted); margin: 24px 0 0; max-width: 640px; }
.lead strong { color: var(--text); font-weight: 500; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint);
}
.slide-intro { position: relative; }
.scroll-hint span {
  width: 1px; height: 40px; background: linear-gradient(transparent, #fff);
  animation: hint 2.4s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { transform: scaleY(.4); opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }

/* Floating text: float.js sets the transforms, these keep it smooth */
.js-float [data-f] { will-change: transform, opacity; }
.split .w { display: inline-block; white-space: nowrap; }
.split .c {
  /* --k (0 settled, 1 scattered) comes from the heading; --s staggers each letter */
  --kk: clamp(0, (var(--k, 0) - var(--s)) / (1 - var(--s)), 1);
  display: inline-block;
  transform: translate(calc(var(--dx) * var(--kk)), calc(var(--dy) * var(--kk))) rotate(calc(var(--r) * var(--kk)));
  opacity: calc(1 - var(--kk));
}
.label {
  font: 500 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 22px;
}
h2 { font-size: clamp(20px, 2.4vw, 23px); margin-bottom: 18px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }

/* The pale blue dot: a faint sunbeam with Earth caught in it */
.dot { position: relative; width: 100%; height: 120px; margin-bottom: 28px; }
.dot .beam {
  position: absolute; left: 8%; right: 8%; top: 50%; height: 26px; margin-top: -13px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09) 30%, rgba(255, 255, 255, .14) 55%, transparent);
  transform: rotate(-14deg); filter: blur(6px);
}
.dot .earth {
  position: absolute; left: 58%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%;
  background: #dfe9ff; box-shadow: 0 0 6px 1px rgba(205, 222, 255, .8), 0 0 22px 4px rgba(205, 222, 255, .18);
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.quote { margin: 12px 0 28px; padding: 0; }
.quote p { font: italic 500 clamp(20px, 2.8vw, 26px)/1.3 var(--serif); margin: 0 0 16px; }
.quote footer { color: var(--faint); font-size: 13px; letter-spacing: .04em; }
.quote cite { font-style: italic; }

/* Thank you, signed */
.signature {
  font: 400 22px/1.1 var(--serif); letter-spacing: .01em; margin: 12px 0 36px; padding: 0 .2em 0 0;
  text-shadow: 0 0 24px rgba(255, 255, 255, .22);
}
.js-float .signature { clip-path: inset(0 100% 0 0); }
.js-float .signature.signed { clip-path: inset(0 0 0 0); transition: clip-path 2.4s cubic-bezier(.6, .05, .3, 1); }

.slide p a { color: var(--text); text-underline-offset: 4px; text-decoration-color: var(--faint); }
.slide p a:hover { text-decoration-color: var(--text); }

/* Contact: icons only */
.icons { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; }
.icons a {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
  transition: color .3s, border-color .3s, background-color .3s;
}
.icons a:hover { color: #000; background: #fff; border-color: #fff; }
.icons svg { width: 19px; height: 19px; }

.foot { padding: 48px 0 0; color: var(--faint); font-size: 13px; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .top { padding-top: 16px; padding-bottom: 16px; }
  .wordmark { font-size: 14px; }
  .nav { gap: 18px; }
  .nav a { font-size: 9px; letter-spacing: .14em; }
  .slide { padding: 96px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .universe video { display: none; }
  * { transition: none !important; }
}

/* 404: lost in space */
.lost { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 var(--gutter); }
.lost h1 { font-size: clamp(24px, 3.4vw, 31px); font-weight: 400; margin-bottom: 14px; }
.lost a { color: var(--muted); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; text-underline-offset: 5px; }
.lost a:hover { color: var(--text); }
