/* ============================================================
   NIMBUS — An Atlas of Skies
   Typographic system: Newsreader italic (haiku, numerals)
                       Instrument Sans light (labels, chrome)
   ============================================================ */

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

:root {
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  --chrome-ink: #e8dcc8;
  --chrome-accent: #f0b429;
  --vh: 100svh;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}
@media (max-height: 560px) {
  html { scroll-snap-type: y proximity; }
}

body {
  font-family: var(--sans);
  font-weight: 300;
  background: #0a0d1f;
  color: #dde2f8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(240, 180, 41, .35); }

a:focus-visible {
  outline: 1.5px solid var(--chrome-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- chrome: header + nav ---------- */

.chrome-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.35rem 2rem 0;
  pointer-events: none;
  color: var(--chrome-ink);
  transition: color .15s linear;
}
.chrome-header a { pointer-events: auto; }

.wordmark {
  font-family: var(--sans);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .34em;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: baseline;
  gap: 1.1em;
}
.wordmark-sub {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: .92rem;
  letter-spacing: .02em;
  text-transform: none;
  opacity: .78;
}

.chrome-link {
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--chrome-accent);
  padding-bottom: .2em;
  transition: opacity .2s;
}
.chrome-link:hover { opacity: .7; }

.plate-nav {
  position: fixed;
  right: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  color: var(--chrome-ink);
  transition: color .15s linear;
}
.plate-nav a {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: .7rem;
  text-decoration: none;
  color: inherit;
  opacity: .55;
  transition: opacity .25s;
}
.plate-nav a:hover, .plate-nav a.active { opacity: 1; }
.plate-nav i {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: transparent;
  flex: none;
  transition: background .25s, transform .25s;
}
.plate-nav a.active i { background: var(--chrome-accent); border-color: var(--chrome-accent); transform: scale(1.25); }
.plate-nav span {
  font-size: .62rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .25s, transform .25s;
}
.plate-nav a:hover span, .plate-nav a.active span { opacity: .95; transform: none; }

/* ---------- plates ---------- */

.plate {
  position: relative;
  min-height: 100svh;
  height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.plate-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.plate-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, var(--scrim-a) 0%, var(--scrim-b) 46%),
    linear-gradient(to bottom, color-mix(in srgb, var(--scrim-a) 55%, transparent) 0%, var(--scrim-b) 22%);
}

.plate-content {
  position: relative;
  z-index: 3;
  max-width: 44rem;
  padding: 0 2.4rem 11vh;
  color: var(--ink);
}
.side-left  { margin-right: auto; margin-left: 4vw; }
.side-right { margin-left: auto; margin-right: 8vw; }

.plate-meta {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-bottom: 1.7rem;
}
.plate-no {
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--accent);
}
.plate-name {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1;
}
.plate-data {
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .14em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  padding-top: .55rem;
  border-top: 1px solid var(--rule);
  width: fit-content;
  padding-right: 2.5rem;
}

.haiku {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.6rem, 2.5vw, 2.25rem);
  line-height: 1.42;
  letter-spacing: .005em;
  margin-bottom: 1.6rem;
}
.haiku span { display: block; }
.haiku span:nth-child(2) { padding-left: 1.4em; }
.haiku span:nth-child(3) { padding-left: .55em; }

/* the verse writes itself line by line */
.haiku span {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .85s ease, transform .85s cubic-bezier(.22,.8,.3,1);
}
.plate.in .haiku span { opacity: 1; transform: none; }
.plate.in .haiku span:nth-child(1) { transition-delay: .34s; }
.plate.in .haiku span:nth-child(2) { transition-delay: .56s; }
.plate.in .haiku span:nth-child(3) { transition-delay: .78s; }

.met-note {
  font-size: .82rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: .03em;
  color: var(--ink-soft);
  max-width: 26rem;
  padding-left: 1rem;
  border-left: 1px solid var(--rule);
}

.ghost-numeral {
  position: absolute;
  z-index: 2;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(14rem, 32vw, 30rem);
  line-height: 1;
  color: var(--ink);
  opacity: .07;
  pointer-events: none;
  user-select: none;
  bottom: -0.12em;
}
.side-left ~ .ghost-numeral { right: 4vw; }
.side-right ~ .ghost-numeral { left: 4vw; }
@media (prefers-reduced-motion: no-preference) {
  .ghost-numeral { animation: ghost-drift 30s ease-in-out infinite alternate; }
}
@keyframes ghost-drift {
  from { transform: translateY(0); }
  to   { transform: translateY(-1.6vh); }
}

/* reveal choreography */
.plate-content > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.22,.8,.3,1);
}
.plate.in .plate-content > * { opacity: 1; transform: none; }
/* the haiku container stays put; its lines carry their own reveal */
.plate-content > .haiku { opacity: 1; transform: none; transition: none; }
.plate.in .plate-content > *:nth-child(1) { transition-delay: .1s; }
.plate.in .plate-content > *:nth-child(2) { transition-delay: .28s; }
.plate.in .plate-content > *:nth-child(3) { transition-delay: .5s; }

/* ---------- cover ---------- */

.cover { align-items: center; justify-content: center; }
.cover-scrim {
  background: radial-gradient(ellipse 90% 75% at 50% 46%, rgba(8,10,26,.5), rgba(8,10,26,0) 68%);
}
.cover-content {
  position: relative;
  z-index: 3;
  text-align: center;
  color: #efe6d4;
  padding: 0 1.5rem;
  max-width: 46rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.2s ease .15s, transform 1.2s cubic-bezier(.22,.8,.3,1) .15s;
}
.plate.in .cover-content { opacity: 1; transform: none; }

.cover-kicker {
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(238,224,198,.75);
  margin-bottom: 2.6rem;
}
.cover-title {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(4rem, 12vw, 9.5rem);
  letter-spacing: .3em;
  text-indent: .3em; /* optically recenters tracked caps */
  line-height: 1;
  color: #f6ecd9;
}
.cover-sub {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  margin-top: 1.1rem;
  color: rgba(244,230,204,.92);
}
.cover-manifesto {
  font-size: .92rem;
  line-height: 1.8;
  letter-spacing: .02em;
  color: rgba(233,222,200,.8);
  max-width: 30rem;
  margin: 2.2rem auto 2.6rem;
}
.cover-index {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .4rem 1.6rem;
}
.cover-index a {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .66rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(238,226,202,.72);
  transition: color .2s;
  padding: .3rem 0;
}
.cover-index a:hover { color: #f6ecd9; }
.cover-index b {
  width: 1.7rem; height: 3px;
  background: var(--sw);
  border-radius: 2px;
  flex: none;
  transform-origin: left center;
  transition: transform .3s cubic-bezier(.22,.8,.3,1);
}
.cover-index a:hover b { transform: scaleX(1.4); }

.scroll-hint {
  margin-top: 3.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
}
.scroll-hint span {
  font-size: .62rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(238,226,202,.55);
}
.scroll-hint i {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, rgba(240,180,41,.9), rgba(240,180,41,0));
  animation: hint-drop 2.6s ease-in-out infinite;
  transform-origin: top;
}
@keyframes hint-drop {
  0%   { transform: scaleY(0); opacity: 0; }
  35%  { transform: scaleY(1); opacity: 1; }
  75%  { transform: scaleY(1); opacity: 0; }
  100% { transform: scaleY(0); opacity: 0; }
}

/* ---------- colophon ---------- */

.colophon {
  align-items: stretch;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, #1a2150 0%, rgba(26,33,80,0) 60%),
    #0a0d1f;
  height: auto;
  min-height: 100svh;
}
.colophon-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 10vh 2.4rem 2.4rem;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  color: #dde2f8;
}
/* center the endpaper between the top of the page and the footer */
.colophon .plate-meta { margin-top: auto; margin-bottom: 3rem; }
.colophon .plate-no { color: #98a0ff; }

.colophon-cols {
  display: grid;
  grid-template-columns: minmax(0, 30rem) minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
  margin-bottom: 4rem; /* minimum breathing room above the footer */
}
.colophon-about p {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.06rem;
  line-height: 1.85;
  color: rgba(215,221,246,.88);
}
.colophon-about p + p { margin-top: 1.3rem; }

.colophon-index { list-style: none; }
.colophon-index a {
  display: grid;
  grid-template-columns: 2.2rem 1.6rem minmax(7rem, max-content) 1fr;
  align-items: baseline;
  gap: 1.1rem;
  padding: .85rem .4rem;
  text-decoration: none;
  color: #d7ddf6;
  border-bottom: 1px solid rgba(150,158,230,.16);
  transition: background .2s, padding-left .25s;
}
.colophon-index li:first-child a { border-top: 1px solid rgba(150,158,230,.16); }
.colophon-index a:hover { background: rgba(150,158,230,.07); padding-left: .8rem; }
.colophon-index b { width: 100%; height: 3px; background: var(--sw); border-radius: 2px; align-self: center; }
.ci-no {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: rgba(215,221,246,.65);
}
.ci-name {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 400;
}
.ci-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: .95rem;
  color: rgba(205,212,242,.55);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-footer {
  margin-top: auto;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(150,158,230,.2);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: .74rem;
  letter-spacing: .06em;
  color: rgba(205,212,242,.6);
}
.site-footer a { color: #b9c0f5; text-decoration: none; border-bottom: 1px solid rgba(152,160,255,.5); }
.site-footer a:hover { color: #e4e8ff; }
.footer-fine { color: rgba(205,212,242,.42); }

/* ---------- grain ---------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .side-right { margin-right: auto; margin-left: 4vw; }
  .side-right ~ .ghost-numeral { left: auto; right: 2vw; }
  .colophon-cols { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 640px) {
  .chrome-header { padding: 1.1rem 1.2rem 0; }
  .wordmark { font-size: .82rem; gap: .8em; }
  .wordmark-sub { display: none; }
  .plate-nav { right: .55rem; gap: .75rem; }
  .plate-nav span { display: none; }
  .plate-nav i { width: 6px; height: 6px; }
  .plate-content { padding: 0 2.1rem 9vh 1.4rem; max-width: 100%; }
  .side-left, .side-right { margin-left: 0; margin-right: 0; }
  .haiku { font-size: 1.42rem; }
  .haiku span:nth-child(2) { padding-left: .9em; }
  .plate-name { font-size: 1.45rem; }
  .plate-data { font-size: .62rem; letter-spacing: .1em; }
  .met-note { font-size: .76rem; }
  .ghost-numeral { font-size: 13rem; opacity: .06; }
  .cover-title { letter-spacing: .22em; text-indent: .22em; }
  .cover-manifesto { font-size: .85rem; }
  .cover-index { gap: .3rem 1.1rem; padding: 0 .5rem; }
  .scroll-hint { margin-top: 2.2rem; }
  .colophon-inner { padding: 14vh 1.4rem 2rem; }
  .colophon-index a { grid-template-columns: 1.6rem 1.4rem 1fr; }
  .ci-line { display: none; }
  .site-footer { flex-direction: column; gap: .7rem; }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plate-content > *, .cover-content, .haiku span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .ghost-numeral, .cover-index b { animation: none; transition: none; }
  .scroll-hint i { animation: none; opacity: .6; transform: none; }
  .plate-nav a, .plate-nav i, .plate-nav span { transition: none; }
}
