/* The lower half of the observatory: destinations, projects and field notes. */
.hero h1 { animation: title-glow 6s ease-in-out infinite; }
.cta { position: relative; overflow: hidden; isolation: isolate; }
.cta::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(105deg, transparent 35%, #fff8 50%, transparent 65%); transform: translateX(-150%); transition: transform .65s ease; pointer-events: none; }
.cta:hover::before, .cta:focus-visible::before { transform: translateX(150%); }
.strip span:first-child { position: relative; isolation: isolate; }
.strip span:first-child::after { content: ""; position: absolute; inset: -8px -18px; pointer-events: none; background: radial-gradient(circle, #f5d3bd 0 1px, transparent 2px), radial-gradient(circle, #a8c9ed 0 1px, transparent 2px); background-size: 45px 22px, 67px 26px; opacity: .55; animation: text-particles 9s linear infinite; z-index: -1; }
@keyframes title-glow { 0%, 100% { text-shadow: 0 0 10px #cedbff10; } 50% { text-shadow: 0 0 22px #d9e4ff38; } }
@keyframes text-particles { from { background-position: 0 0, 0 0; } to { background-position: 90px 0, -67px 0; } }
@media (prefers-reduced-motion: reduce) { .hero h1, .strip span:first-child::after { animation: none; } .cta::before { transition: none; } }

.scene .point {
  isolation: isolate;
  transition: color .3s ease, opacity .3s ease, filter .3s ease;
}
.scene:has(.point:hover) .point:not(:hover),
.scene:has(.point:focus-visible) .point:not(:focus-visible) {
  opacity: .42;
}
.node-preview {
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  transform: translate(-50%, 5px);
  width: max-content;
  max-width: min(220px, 70vw);
  padding: 10px 13px;
  border: 1px solid #8d9bb766;
  background: #141e30ed;
  color: #e1e8f1;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.scene .point:hover .node-preview,
.scene .point:focus-visible .node-preview {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.preview-en { display: none; }
html:lang(en) .preview-zh { display: none; }
html:lang(en) .preview-en { display: inline; }
@media (hover: none) {
  .scene .point:hover .node-preview { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .scene .point, .node-preview { transition: none; }
}

#spaces, #work, #writing {
  --section-drift: 0px;
  padding-block: clamp(88px, 12vw, 160px);
}

#spaces::before {
  background: radial-gradient(ellipse at 82% calc(18% + var(--section-drift)), #304d7166, transparent 48%), linear-gradient(180deg, #0d1422, #10192a 24%, #10192a);
}
#work::before {
  background: radial-gradient(ellipse at 12% calc(80% + var(--section-drift)), #63455355, transparent 48%), linear-gradient(180deg, #10192a, #151a29 24%, #151a29);
}
#writing::before {
  background: radial-gradient(ellipse at 85% calc(30% + var(--section-drift)), #35547855, transparent 48%), linear-gradient(180deg, #151a29, #101827 24%, #101827);
}

#spaces::after, #work::after, #writing::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: clamp(260px, 44vw, 620px);
  aspect-ratio: 1;
  top: 6%;
  right: 0;
  border: 1px solid #aec7ec1c;
  border-radius: 50%;
  box-shadow: 0 0 0 55px #a5c3e708, 0 0 0 110px #a5c3e706;
  transform: translate3d(0, var(--section-drift), 0);
}
#work::after { right: auto; left: 0; top: 32%; border-color: #e7b8a41a; }
#writing::after { top: 28%; right: 0; }

#spaces .heading, #work .heading, #writing .heading {
  align-items: end;
  gap: 24px;
  margin-bottom: clamp(38px, 5vw, 72px);
}
#spaces .heading h2, #work .heading h2, #writing .heading h2 {
  max-width: 800px;
  font-size: clamp(36px, 5.2vw, 72px);
  line-height: 1.15;
  letter-spacing: -.045em;
}
#spaces .heading h2::before, #work .heading h2::before, #writing .heading h2::before {
  display: block;
  margin-bottom: 24px;
  color: #e3b6a0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  line-height: 1.4;
}
#spaces .heading h2::before { content: "01 / EXPLORE THE SPACES"; }
#work .heading h2::before { content: "02 / SELECTED PROJECTS"; }
#writing .heading h2::before { content: "03 / FIELD NOTES"; }
#spaces .heading p, #work .heading p, #writing .heading p {
  max-width: 280px;
  margin: 0 0 5px;
  color: #bac5d5;
  opacity: 1;
  line-height: 1.7;
}

#spaces .places { gap: 16px; counter-reset: place; }
#spaces .place, #spaces .place:first-child {
  counter-increment: place;
  position: relative;
  min-width: 0;
  min-height: clamp(300px, 30vw, 390px);
  padding: clamp(24px, 2.5vw, 38px);
  overflow: hidden;
  background: linear-gradient(155deg, #253950e8, #172438f2 70%);
  border: 1px solid #7489a35c;
  color: #f1f4f8;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
#spaces .place:nth-child(2) { background: linear-gradient(155deg, #35374be8, #202638f2 70%); }
#spaces .place:nth-child(3) { background: linear-gradient(155deg, #3b3444e8, #242334f2 70%); }
#spaces .place::before {
  content: "0" counter(place);
  position: absolute;
  right: 24px;
  top: 22px;
  color: #c6d5e799;
  font-size: 11px;
  letter-spacing: .12em;
}
#spaces .place::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: 40px;
  width: 160px;
  aspect-ratio: 1;
  border: 1px solid #d3e1f126;
  border-radius: 50%;
  box-shadow: 0 0 0 22px #d3e1f10b, 0 0 0 44px #d3e1f108;
  pointer-events: none;
}
#spaces .place:hover, #spaces .place:focus-visible {
  transform: translateY(-5px);
  border-color: #e2b8a3;
  box-shadow: 0 18px 40px #05081280;
}
#spaces .place small { color: #e6bca8; opacity: 1; }
#spaces .place h3 { margin: auto 0 12px; padding-top: 54px; font-size: clamp(24px, 2.3vw, 32px); }
#spaces .place p { max-width: 28ch; margin: 0; color: #d2dbe6; opacity: 1; }
#spaces .place .url { position: relative; z-index: 1; padding-top: 32px; color: #d7e2ef; }
#spaces .place .arrow { color: #efc4ae; }

#work { counter-reset: project; }
#work .work {
  counter-increment: project;
  grid-template-columns: 48px minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: clamp(16px, 2vw, 32px);
  padding: 30px 0;
  border-color: #8290a64d;
}
#work .work::before { content: "0" counter(project); color: #d6aa98; font-size: 12px; letter-spacing: .1em; }
#work .work h3, #writing .article h3 { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.4; }
#work .work p, #writing .article p { color: #c2ccda; line-height: 1.75; }
#work .work a { display: inline-flex; align-items: center; min-height: 44px; color: #f0c0a9; white-space: nowrap; }
#work .work a:hover { color: #fff; }

#writing .article {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .8fr) auto;
  gap: clamp(20px, 3vw, 48px);
  padding: 30px 20px;
  margin-inline: -20px;
  border-color: #8290a64d;
  transition: background .2s ease;
}
#writing .article:hover, #writing .article:focus-visible { background: #293b5166; }
#writing .article:hover h3, #writing .article:focus-visible h3 { color: #f0c0a9; }
#writing .category { color: #efc0aa; }
#work .all, #writing .all {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 38px;
  padding: 0 0 5px;
  color: #f2c6b1;
  border-color: #d4a795;
}
#work .all:hover, #writing .all:hover { color: #fff; }

footer { align-items: center; gap: 24px; padding-block: 48px; border-top: 1px solid #8290a64d; letter-spacing: .04em; }
footer a { display: inline-flex; align-items: center; min-height: 44px; }
footer a:hover { color: #f0c0a9; }

@keyframes section-arrival {
  from { opacity: .65; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.section-arrived { animation: section-arrival .7s cubic-bezier(.2,.7,.2,1); }

@media (max-width: 760px) {
  #spaces, #work, #writing { min-height: 0; padding-block: 80px; }
  #spaces .heading, #work .heading, #writing .heading { display: block; }
  #spaces .heading p, #work .heading p, #writing .heading p { margin-top: 18px; }
  #spaces .places { grid-template-columns: 1fr; }
  #spaces .place, #spaces .place:first-child { min-height: 250px; }
  #spaces .place h3 { padding-top: 40px; }
  #work .work { grid-template-columns: 30px minmax(0, 1fr); gap: 8px 16px; padding: 24px 0; }
  #work .work::before { grid-row: 1 / 4; padding-top: 5px; }
  #work .work p, #work .work a { grid-column: 2; }
  #writing .article { grid-template-columns: 1fr; gap: 10px; padding-block: 24px; }
  #writing .category { margin-top: 4px; }
  footer { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  #spaces::after, #work::after, #writing::after { transform: none; }
  #spaces .place, #spaces .place:first-child, #writing .article { transition: none; }
  #spaces .place:hover, #spaces .place:focus-visible { transform: none; }
  .section-arrived { animation: none; }
}

#spaces.discovery { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 0; }
.discovery-copy { order: 2; max-width: none; display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 24px; align-items: center; padding-top: 30px; }
.discovery-label { color: #e8bba4; font-size: 12px; letter-spacing: .14em; }
.discovery h2 { font-size: clamp(36px,4vw,60px); line-height: 1.2; letter-spacing: -.04em; margin: 28px 0; }
.discovery-intro { color: #c2ccda; font-size: 16px; line-height: 1.9; }
.discovery-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 32px; }
.discovery-actions a { min-height: 48px; display: inline-flex; align-items: center; font-size: 14px; }
.discovery-primary { background: #d7a38d; color: #241c20; padding: 0 20px; font-weight: 700; }
.discovery-primary:hover { background: #f0c5af; }
.discovery-secondary { color: #e8c5b5; border-bottom: 1px solid #c69480; }
.discovery-visual { display: block; position: relative; overflow: hidden; border: 1px solid #9aa8be55; background: #111723; box-shadow: 0 24px 80px #0007; }
.discovery-visual img { display: block; width: 100%; height: auto; transition: transform .7s ease; }
.discovery-visual:hover img, .discovery-visual:focus-visible img { transform: scale(1.025); }
.discovery-caption { display: block; padding: 13px 16px; color: #c7d1dd; font-size: 11px; letter-spacing: .14em; }
.discovery-visual { order: 1; width: 100%; max-width: 1180px; margin: 0 auto; }
.discovery-visual img { aspect-ratio: 16 / 7; object-fit: cover; object-position: center; }
.discovery-label { grid-column: 1; grid-row: 1; margin: 0; }
.discovery h2 { grid-column: 1; grid-row: 2; margin: 10px 0 0; font-weight: 800; white-space: nowrap; }
.discovery-intro { grid-column: 1 / -1; grid-row: 3; margin: 10px 0 0; max-width: none; line-height: 1.6; }
.discovery-actions { grid-column: 2; grid-row: 2; justify-content: flex-end; flex-wrap: nowrap; margin-top: 10px; white-space: nowrap; }
@media (min-width: 761px) and (min-height: 650px) {
  #spaces.discovery { min-height: calc(100dvh - 78px); padding-block: clamp(28px, 4vh, 48px); }
  .discovery-visual { width: min(100%, 1180px, calc((100dvh - 410px) * 16 / 7)); }
  .discovery-copy { width: min(100%, 1180px, calc((100dvh - 410px) * 16 / 7)); margin-inline: auto; padding-top: 20px; }
  .discovery h2 { font-size: clamp(32px, 3.2vw, 48px); }
  .discovery-actions { margin-top: 10px; }
}
@media (max-width:760px) { #spaces.discovery { gap: 0; } .discovery-copy { display: block; padding-top: 22px; } .discovery h2 { margin: 16px 0; white-space: normal; } .discovery-intro { margin-top: 0; } .discovery-visual img { aspect-ratio: 16 / 10; } .discovery-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 20px; } }
@media (prefers-reduced-motion:reduce) { .discovery-visual img { transition: none; } .discovery-visual:hover img, .discovery-visual:focus-visible img { transform: none; } }

.scene .core { box-shadow: inset -18px -20px 35px #0c1223a8, 0 0 0 1px #e6cabd44, 0 0 28px #ddae9b55, 0 0 85px #7f94bf35; }
.click-stars { position: fixed; z-index: 9999; pointer-events: none; width: 1px; height: 1px; animation: star-burst 1.1s ease-out forwards; }
.click-stars span { position: absolute; width: 10px; height: 10px; background: #fbe7d6; filter: drop-shadow(0 0 5px #e8b8a0); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); transform: rotate(var(--angle)) translateY(calc(-1 * var(--distance))); }
.click-constellation span { width: var(--distance); height: 1px; clip-path: none; transform-origin: left center; transform: rotate(var(--angle)); background: linear-gradient(90deg, #eec8ba88, #adcbffdd); filter: drop-shadow(0 0 4px #9abaff); }
.click-constellation span::after { content: ''; position: absolute; right: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: #fff3e7; box-shadow: 0 0 10px 3px #b7caffaa; }
@keyframes star-burst { 0% { opacity: 0; transform: scale(.1); } 18% { opacity: 1; } 75% { opacity: .8; } 100% { opacity: 0; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .click-stars { display: none; animation: none; } }
