:root {
  --ink: #090d0f;
  --ink-soft: #101719;
  --ink-lift: #172023;
  --paper: #e9e1d2;
  --paper-dim: #ada99d;
  --moon: #d8bd83;
  --moon-bright: #f0dca6;
  --aqua: #86aaa4;
  --line: rgba(233, 225, 210, .15);
  --line-strong: rgba(233, 225, 210, .28);
  --display: "Iowan Old Style", "Baskerville", "Songti SC", "STSong", serif;
  --body: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", "Menlo", "Consolas", monospace;
  --shell: min(1480px, calc(100vw - 64px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--paper);
  background:
    radial-gradient(circle at 74% 8%, rgba(75, 108, 104, .2), transparent 30%),
    radial-gradient(circle at 14% 38%, rgba(129, 99, 55, .09), transparent 24%),
    var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.4), transparent 72%);
  opacity: .22;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: .78;
}

.grain {
  position: fixed;
  inset: -100%;
  z-index: 10;
  opacity: .035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  animation: grain 8s steps(8) infinite;
}

@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(3%, -2%); }
  40% { transform: translate(-2%, 4%); }
  60% { transform: translate(4%, 2%); }
  80% { transform: translate(-4%, -3%); }
}

a { color: inherit; text-decoration: none; }
button, textarea { font: inherit; }
button { color: inherit; }
::selection { color: var(--ink); background: var(--moon); }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 84px;
  padding: 0 32px;
  background: rgba(9, 13, 15, .72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 13px; width: max-content; }
.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid var(--moon);
  border-radius: 50%;
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(216, 189, 131, .5);
  border-radius: 50%;
}
.brand-mark i { position: absolute; top: -2px; left: 50%; height: 38px; border-left: 1px solid var(--moon); transform: rotate(38deg); }
.brand b { display: block; font-family: var(--display); font-size: 15px; font-weight: 500; letter-spacing: .18em; }
.brand small { display: block; color: var(--paper-dim); font-family: var(--mono); font-size: 8px; letter-spacing: .24em; }

nav { display: flex; gap: 42px; }
nav a { position: relative; color: var(--paper-dim); font-size: 12px; letter-spacing: .14em; }
nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -7px; height: 1px; background: var(--moon); transition: right .3s ease; }
nav a:hover, nav a:focus-visible { color: var(--paper); }
nav a:hover::after, nav a:focus-visible::after { right: 0; }

.observatory-status { justify-self: end; color: var(--paper-dim); font-family: var(--mono); font-size: 9px; letter-spacing: .18em; }
.observatory-status i { display: inline-block; width: 6px; height: 6px; margin-right: 9px; background: #8fbd9a; border-radius: 50%; box-shadow: 0 0 12px #8fbd9a; }

.section-shell { width: var(--shell); margin-inline: auto; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  min-height: 100svh;
  padding-top: 148px;
  padding-bottom: 82px;
  align-items: center;
}
.hero-index { position: absolute; top: 116px; right: 0; color: var(--paper-dim); font-family: var(--mono); font-size: 9px; letter-spacing: .18em; writing-mode: vertical-rl; }
.eyebrow { margin: 0 0 28px; color: var(--moon); font-family: var(--mono); font-size: 10px; letter-spacing: .23em; text-transform: uppercase; }
.hero h1 {
  margin: 0;
  max-width: 820px;
  font-family: var(--display);
  font-size: clamp(56px, 6.3vw, 108px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.055em;
}
.hero h1 em { color: var(--moon-bright); font-weight: 400; }
.lead { max-width: 620px; margin: 38px 0 0; color: var(--paper-dim); font-size: 17px; line-height: 2; }
.hero-actions { display: flex; align-items: center; gap: 36px; margin-top: 44px; }
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 228px;
  padding: 17px 19px;
  color: var(--ink);
  background: var(--moon);
  font-size: 12px;
  letter-spacing: .14em;
  transition: background .3s ease, transform .3s ease;
}
.primary-action:hover { background: var(--moon-bright); transform: translateY(-3px); }
.primary-action b { font-size: 17px; font-weight: 400; }
.text-action { color: var(--paper-dim); border-bottom: 1px solid var(--line-strong); font-size: 12px; letter-spacing: .08em; }
.text-action span { display: inline-block; margin-left: 10px; color: var(--moon); transition: transform .25s ease; }
.text-action:hover span { transform: translateY(4px); }

.orbital-stage { position: relative; aspect-ratio: 1; max-width: 620px; width: 100%; justify-self: end; }
.orbital-stage::before, .orbital-stage::after { content: ""; position: absolute; inset: 50%; background: var(--line-strong); }
.orbital-stage::before { width: 1px; height: 90%; transform: translateY(-50%); }
.orbital-stage::after { width: 90%; height: 1px; transform: translateX(-50%); }
.orbit { position: absolute; inset: 9%; border: 1px solid rgba(216,189,131,.24); border-radius: 50%; animation: orbit 30s linear infinite; }
.orbit-b { inset: 21%; border-style: dashed; animation-duration: 22s; animation-direction: reverse; }
.orbit-c { inset: 34%; animation-duration: 15s; }
.orbit span { position: absolute; top: 18%; left: 3%; width: 8px; height: 8px; background: var(--moon); border-radius: 50%; box-shadow: 0 0 18px var(--moon); }
.orbit-b span { top: 88%; left: 62%; width: 5px; height: 5px; background: var(--aqua); box-shadow: 0 0 14px var(--aqua); }
.orbit-c span { top: -4px; left: 50%; width: 6px; height: 6px; }
@keyframes orbit { to { transform: rotate(1turn); } }
.moon-core {
  position: absolute;
  inset: 39%;
  z-index: 2;
  display: grid;
  place-content: center;
  text-align: center;
  background: radial-gradient(circle at 38% 34%, #eee4cf, #a8997d 55%, #5d5a52 100%);
  color: var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(216,189,131,.2);
}
.moon-number { font-family: var(--display); font-size: clamp(24px, 3vw, 42px); line-height: 1; letter-spacing: -.04em; }
.moon-core small { margin-top: 8px; font-family: var(--mono); font-size: 6px; letter-spacing: .16em; }
.orbit-note { position: absolute; color: var(--paper-dim); font-family: var(--mono); font-size: 8px; letter-spacing: .15em; }
.note-a { top: 19%; right: 1%; }
.note-b { bottom: 12%; left: 7%; }
.hero-foot { position: absolute; bottom: 24px; left: 0; right: 0; display: flex; justify-content: space-between; padding-top: 17px; color: var(--paper-dim); border-top: 1px solid var(--line); font-family: var(--mono); font-size: 8px; letter-spacing: .13em; }

.section-kicker { padding: 16px 0; color: var(--paper-dim); border-top: 1px solid var(--line-strong); font-family: var(--mono); font-size: 9px; letter-spacing: .2em; }
.manifesto { display: grid; grid-template-columns: .32fr 1.02fr .66fr; padding: 150px 0 180px; }
.manifesto .section-kicker { grid-column: 1 / -1; margin-bottom: 90px; }
.manifesto-heading { grid-column: 2; }
.manifesto h2 { margin: 0; font-family: var(--display); font-size: clamp(44px, 5vw, 78px); font-weight: 400; line-height: 1.22; letter-spacing: -.045em; }
.manifesto h2 span { color: var(--moon); }
.manifesto-copy { align-self: end; padding-left: 52px; }
.manifesto-copy > p { margin: 0 0 46px; color: var(--paper-dim); line-height: 2; }
.manifesto dl { margin: 0; }
.manifesto dl div { display: grid; grid-template-columns: 36px 1fr; padding: 15px 0; border-top: 1px solid var(--line); }
.manifesto dt { color: var(--moon); font-family: var(--mono); font-size: 9px; }
.manifesto dd { margin: 0; font-size: 13px; letter-spacing: .06em; }

.instrument { padding: 0 0 180px; }
.instrument .section-kicker { margin-bottom: 0; }
.instrument-grid { display: grid; grid-template-columns: .78fr 1.22fr; min-height: 780px; border-bottom: 1px solid var(--line-strong); }
.instrument-intro { position: relative; padding: 92px 9% 76px 0; border-right: 1px solid var(--line-strong); }
.instrument-intro h2, .library-title h2 { margin: 0; font-family: var(--display); font-size: clamp(64px, 7vw, 108px); font-weight: 400; line-height: .92; letter-spacing: -.06em; }
.instrument-intro > p:not(.eyebrow) { max-width: 400px; margin-top: 38px; color: var(--paper-dim); line-height: 2; }
.privacy-note { position: absolute; bottom: 76px; left: 0; color: var(--aqua); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; }
.instrument-panel { position: relative; padding: 86px 0 80px 10%; }
.instrument-panel > label, fieldset legend { display: block; margin-bottom: 16px; color: var(--paper-dim); font-size: 11px; letter-spacing: .13em; }
textarea {
  display: block;
  width: 100%;
  min-height: 170px;
  padding: 24px 0;
  resize: vertical;
  color: var(--paper);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  outline: 0;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.8;
}
textarea:focus { border-color: var(--moon); }
textarea::placeholder { color: rgba(233,225,210,.24); }
.input-meta { display: flex; justify-content: space-between; margin-top: 10px; color: var(--paper-dim); font-family: var(--mono); font-size: 8px; letter-spacing: .1em; }
fieldset { margin: 48px 0 42px; padding: 0; border: 0; }
.mood-grid { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line-strong); }
.mood-grid label { position: relative; cursor: pointer; }
.mood-grid label + label { border-left: 1px solid var(--line-strong); }
.mood-grid input { position: absolute; opacity: 0; }
.mood-grid span { display: grid; place-content: center; height: 58px; color: var(--paper-dim); font-size: 12px; transition: .25s ease; }
.mood-grid input:checked + span { color: var(--ink); background: var(--moon); }
.mood-grid input:focus-visible + span { outline: 2px solid var(--moon-bright); outline-offset: -4px; }
.analyze-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 22px;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: .15em;
  transition: background .25s ease;
}
.analyze-button:hover { background: var(--moon-bright); }
.analyze-button i { font-size: 19px; font-style: normal; transition: transform .5s ease; }
.analyze-button:hover i { transform: rotate(90deg); }
.analysis-result {
  position: absolute;
  inset: 56px -1px 56px 6%;
  z-index: 4;
  overflow-y: auto;
  padding: 38px 42px;
  background: rgba(16, 23, 25, .97);
  border: 1px solid var(--moon);
  box-shadow: 0 28px 100px rgba(0,0,0,.42);
  backdrop-filter: blur(16px);
  animation: revealResult .45s cubic-bezier(.2,.8,.2,1);
}
@keyframes revealResult { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.result-head { display: flex; justify-content: space-between; color: var(--moon); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 9px; letter-spacing: .18em; }
.result-head button { position: relative; top: -12px; padding: 0 8px; color: var(--paper-dim); background: none; border: 0; cursor: pointer; font-size: 28px; font-weight: 200; }
.result-theme { margin: 60px 0; font-family: var(--display); font-size: clamp(36px, 4vw, 60px); line-height: 1.2; }
.result-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.result-columns > div { padding-top: 15px; border-top: 1px solid var(--line); }
.result-columns span { color: var(--paper-dim); font-family: var(--mono); font-size: 8px; letter-spacing: .14em; }
.result-columns p { line-height: 1.9; }
.analysis-result blockquote { margin: 40px 0 24px; padding: 24px 0 0 32px; color: var(--moon-bright); border-top: 1px solid var(--line); border-left: 0; font-family: var(--display); font-size: 22px; }
.analysis-result small { color: var(--paper-dim); font-size: 10px; }

.atlas { padding: 0 0 180px; }
.atlas-head { display: grid; grid-template-columns: 1fr .55fr; align-items: end; padding: 78px 0 64px; }
.atlas-head h2 { margin: 0; font-family: var(--display); font-size: clamp(58px, 6.5vw, 100px); font-weight: 400; line-height: 1; letter-spacing: -.055em; }
.atlas-head em { color: var(--moon); font-weight: 400; }
.atlas-head p { max-width: 460px; justify-self: end; margin: 0; color: var(--paper-dim); line-height: 2; }
.atlas-track { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); overflow-x: auto; }
.atlas-card {
  min-width: 180px;
  min-height: 340px;
  padding: 24px 20px 25px;
  text-align: left;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line-strong);
  cursor: pointer;
  transition: background .35s ease, color .35s ease;
}
.atlas-card:last-child { border-right: 0; }
.atlas-card span { display: block; color: var(--paper-dim); font-family: var(--mono); font-size: 8px; letter-spacing: .13em; }
.atlas-card b { display: block; margin-top: 36px; font-family: var(--display); font-size: 28px; font-weight: 400; }
.atlas-card i { display: grid; place-items: center; height: 150px; color: var(--moon); font-family: var(--display); font-size: 72px; font-style: normal; transition: transform .4s ease; }
.atlas-card small { color: var(--paper-dim); font-size: 10px; letter-spacing: .1em; }
.atlas-card:hover, .atlas-card.active { color: var(--ink); background: var(--paper); }
.atlas-card:hover span, .atlas-card:hover small, .atlas-card.active span, .atlas-card.active small { color: #5d5c56; }
.atlas-card:hover i, .atlas-card.active i { color: #8a7144; transform: scale(1.12) rotate(-5deg); }
.atlas-reading { display: grid; grid-template-columns: .42fr 1fr; padding: 28px 0; border-bottom: 1px solid var(--line); }
.atlas-reading span { color: var(--moon); font-family: var(--mono); font-size: 9px; letter-spacing: .16em; }
.atlas-reading p { max-width: 700px; margin: 0; color: var(--paper-dim); }

.library { padding: 0 0 180px; }
.library-layout { display: grid; grid-template-columns: .72fr 1.28fr; min-height: 600px; border-bottom: 1px solid var(--line-strong); }
.library-title { padding: 82px 8% 70px 0; border-right: 1px solid var(--line-strong); }
.library-title > p:last-child { max-width: 380px; margin-top: 42px; color: var(--paper-dim); line-height: 2; }
.download-list { padding-left: 8%; }
.download-list a { display: grid; grid-template-columns: 68px 1fr 30px; align-items: center; gap: 22px; min-height: 170px; border-bottom: 1px solid var(--line-strong); transition: padding .3s ease, background .3s ease; }
.download-list a:hover { padding: 0 22px; background: rgba(216,189,131,.055); }
.file-type { display: grid; place-items: center; width: 55px; height: 55px; color: var(--moon); border: 1px solid rgba(216,189,131,.5); border-radius: 50%; font-family: var(--mono); font-size: 9px; }
.download-list b { display: block; font-family: var(--display); font-size: 25px; font-weight: 400; }
.download-list small { color: var(--paper-dim); }
.download-list i { color: var(--moon); font-size: 20px; font-style: normal; transition: transform .25s ease; }
.download-list a:hover i { transform: translateY(5px); }

.closing { display: grid; place-items: center; min-height: 620px; padding-bottom: 90px; text-align: center; }
.closing-symbol { color: var(--moon); font-size: 72px; text-shadow: 0 0 50px rgba(216,189,131,.32); }
.closing p { margin: 20px 0 34px; font-family: var(--display); font-size: clamp(42px, 5vw, 74px); line-height: 1.2; }
.closing a { color: var(--paper-dim); border-bottom: 1px solid var(--line-strong); font-size: 11px; letter-spacing: .12em; }
footer { display: flex; justify-content: space-between; gap: 24px; padding: 24px 32px; color: var(--paper-dim); border-top: 1px solid var(--line); font-family: var(--mono); font-size: 8px; letter-spacing: .1em; }

.reveal { opacity: 0; transform: translateY(32px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.75,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

:focus-visible { outline: 1px solid var(--moon); outline-offset: 5px; }

@media (max-width: 1050px) {
  :root { --shell: min(100% - 40px, 900px); }
  .site-header { grid-template-columns: 1fr auto; padding-inline: 20px; }
  nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 140px; }
  .hero-copy { z-index: 2; }
  .orbital-stage { position: absolute; top: 18%; right: -24%; width: 68vw; opacity: .5; }
  .manifesto { grid-template-columns: 1fr 1fr; }
  .manifesto-heading { grid-column: 1; }
  .manifesto-copy { grid-column: 2; }
  .instrument-grid, .library-layout { grid-template-columns: 1fr; }
  .instrument-intro, .library-title { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .instrument-intro { min-height: 570px; }
  .instrument-panel { padding-left: 0; }
  .analysis-result { left: 0; }
  .atlas-track { grid-template-columns: repeat(6, minmax(190px, 1fr)); }
  .library-title { padding-bottom: 80px; }
  .download-list { padding-left: 0; }
}

@media (max-width: 680px) {
  :root { --shell: calc(100vw - 32px); }
  body { font-size: 14px; }
  .site-header { min-height: 70px; }
  .observatory-status { display: none; }
  .brand b { font-size: 13px; }
  .hero { min-height: 900px; padding-top: 124px; align-items: start; }
  .hero h1 { font-size: clamp(48px, 14vw, 72px); }
  .lead { font-size: 15px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 22px; }
  .orbital-stage { top: 49%; right: -34%; width: 100vw; }
  .hero-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .hero-foot span:nth-child(2) { display: none; }
  .manifesto { grid-template-columns: 1fr; padding: 100px 0 120px; }
  .manifesto .section-kicker { margin-bottom: 55px; }
  .manifesto-heading, .manifesto-copy { grid-column: 1; }
  .manifesto h2 { font-size: 42px; }
  .manifesto-copy { padding: 52px 0 0; }
  .instrument, .atlas, .library { padding-bottom: 120px; }
  .instrument-intro { min-height: 500px; padding-top: 70px; }
  .instrument-intro h2, .library-title h2 { font-size: 65px; }
  .privacy-note { bottom: 52px; }
  .instrument-panel { padding-top: 60px; }
  .mood-grid { grid-template-columns: repeat(3, 1fr); }
  .mood-grid label:nth-child(4) { border-left: 0; }
  .mood-grid label:nth-child(n+4) { border-top: 1px solid var(--line-strong); }
  .analysis-result { inset: 36px -1px 36px -1px; padding: 30px 22px; }
  .result-theme { margin: 40px 0; }
  .result-columns { grid-template-columns: 1fr; gap: 14px; }
  .atlas-head { grid-template-columns: 1fr; gap: 40px; }
  .atlas-head h2 { font-size: 58px; }
  .atlas-reading { grid-template-columns: 1fr; gap: 16px; }
  .library-title { padding-top: 65px; }
  .download-list a { grid-template-columns: 55px 1fr 20px; gap: 14px; min-height: 135px; }
  .download-list b { font-size: 19px; }
  .download-list small { font-size: 10px; }
  .file-type { width: 45px; height: 45px; }
  .closing { min-height: 500px; }
  footer { flex-direction: column; padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
