:root {
  --abyss: #080a1c;
  --violet: #7b5cff;
  --cyan: #5ee7f2;
  --pink: #ff7ab6;
  --star: #e9ecff;
  --haze: #8c90b8;

  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --display: "Syne", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 7vw, 8rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--abyss);
  color: var(--star);
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
  border-radius: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- stage ---------- */

#stage {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
  z-index: 0;
}

.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(3, 4, 14, 0.8) 100%);
}
.veil::after {
  content: "";
  position: absolute; inset: 0;
  background: 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='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.045;
}

.no-gl body, html.no-gl {
  background: radial-gradient(80% 60% at 60% 40%, #1b1a4a 0%, var(--abyss) 70%);
}

/* ---------- chrome ---------- */

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.6rem var(--gutter);
  pointer-events: none;
}
.top a { pointer-events: auto; text-decoration: none; }

.mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.top-link {
  font-size: 0.9rem;
  color: var(--haze);
  transition: color 0.25s;
}
.top-link:hover { color: var(--star); }

.rail {
  position: fixed; z-index: 10;
  right: calc(var(--gutter) * 0.45);
  top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.9rem;
  align-items: flex-end;
}
.rail a {
  position: relative;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--haze);
  opacity: 0.6;
  transition: color 0.3s, opacity 0.3s;
}
.rail a::before {
  content: "";
  position: absolute; right: calc(100% + 0.7rem); top: 50%;
  width: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
  transition: width 0.4s cubic-bezier(.2, .7, .2, 1);
}
.rail a:hover { opacity: 1; }
.rail a.is-active { color: var(--star); opacity: 1; }
.rail a.is-active::before { width: 2rem; }

/* ---------- panels ---------- */

main { position: relative; z-index: 5; }

.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 6rem var(--gutter);
}

.panel--left  .copy { justify-self: start; }
.panel--right .copy { justify-self: end; }
.panel--center .copy { justify-self: center; text-align: center; }

.copy {
  max-width: 31rem;
  text-shadow: 0 0 18px var(--abyss), 0 0 4px var(--abyss);
}

h2 {
  margin: 0 0 1.4rem;
  font-weight: 600;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.25;
  letter-spacing: 0.04em;
}

h3 { margin: 0; font-weight: 600; font-size: 1.15rem; letter-spacing: 0.08em; }

p { margin: 0 0 1.1rem; }

/* hero */

.panel--hero {
  align-items: end;
  justify-items: center;
  text-align: center;
  padding-bottom: 9vh;
  grid-template-rows: 1fr auto;
}

.hero-copy { align-self: end; margin-bottom: 2.6rem; }

.hero-line {
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.hint, .scroll-cue {
  font-size: 0.85rem;
  color: var(--haze);
  letter-spacing: 0.1em;
  margin: 0;
}

.scroll-cue { opacity: 0.7; }

.for-touch { display: none; }
@media (hover: none) {
  .for-mouse { display: none; }
  .for-touch { display: inline; }
}

.hero-copy, .scroll-cue, .top, .rail {
  animation: arrive 1.4s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: 1.9s;
}
.scroll-cue { animation-delay: 2.3s; }

@keyframes arrive {
  from { opacity: 0; filter: blur(6px); }
  to   { opacity: 1; filter: blur(0); }
}

/* about */

.facts { margin: 2rem 0 0; display: grid; gap: 0.5rem; }
.facts div {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(233, 236, 255, 0.12);
}
.facts dt { color: var(--haze); font-size: 0.9rem; }
.facts dd { margin: 0; }

/* works */

.works { list-style: none; margin: 0; padding: 0; }
.works li { border-top: 1px solid rgba(233, 236, 255, 0.12); }
.works li:last-child { border-bottom: 1px solid rgba(233, 236, 255, 0.12); }

.works a {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1.5rem;
  padding: 1.05rem 0;
  text-decoration: none;
  transition: padding 0.35s cubic-bezier(.2, .7, .2, 1);
}
.w-name {
  font-size: 1.35rem; font-weight: 600; letter-spacing: 0.06em;
  transition: color 0.3s;
}
.w-year {
  font-family: var(--display); font-weight: 500;
  color: var(--haze); font-size: 0.95rem;
  align-self: center;
}
.w-desc {
  grid-column: 1 / -1;
  color: var(--haze); font-size: 0.93rem; line-height: 1.7;
  margin-top: 0.15rem;
}
.works a:hover, .works a:focus-visible { padding-left: 0.9rem; }
.works a:hover .w-name, .works a:focus-visible .w-name { color: var(--cyan); }

/* practice: a real sequence, so it is numbered */

.steps {
  list-style: none; margin: 0; padding: 0;
  counter-reset: step;
  display: grid; gap: 1.3rem;
}
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.6rem 1fr;
  column-gap: 0.6rem;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--serif); font-weight: 900;
  font-size: 2rem; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--pink);
  padding-top: 0.15rem;
}
.steps p { margin: 0.2rem 0 0; color: var(--haze); font-size: 0.95rem; line-height: 1.75; }

/* contact */

.panel--center { align-items: start; padding-top: 18vh; }

.mail {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4.6vw, 3.6rem);
  letter-spacing: -0.01em;
  text-decoration: none;
  padding-bottom: 0.2rem;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)) left bottom / 100% 2px no-repeat;
  margin: 0.2rem 0 1.4rem;
  transition: background-size 0.5s cubic-bezier(.2, .7, .2, 1);
}
.mail:hover { background-size: 100% 100%; color: var(--abyss); text-shadow: none; }

.panel--center .copy { max-width: 46rem; }

.reply { color: var(--haze); }

.social {
  list-style: none; padding: 0; margin: 1.6rem 0 0;
  display: flex; justify-content: center; gap: 2rem;
}
.social a {
  font-family: var(--display); font-weight: 500; font-size: 0.95rem;
  text-decoration: none; color: var(--haze);
  transition: color 0.25s;
}
.social a:hover { color: var(--star); }

.footnote { margin-top: 3rem; font-size: 0.78rem; color: var(--haze); opacity: 0.6; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .rail { display: none; }
  .panel { align-items: end; padding-bottom: 10vh; }
  .panel--left .copy, .panel--right .copy { justify-self: stretch; }
  .panel--center { align-items: end; padding-top: 6rem; }
  .copy { text-shadow: 0 0 14px var(--abyss), 0 0 14px var(--abyss), 0 0 4px var(--abyss); }
  .panel--hero { padding-bottom: 8vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy, .scroll-cue, .top, .rail { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
