@font-face {
  font-family: Geist;
  src: url("./assets/Geist-Variable.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Geist, Inter, system-ui, sans-serif;
  --page-bg: radial-gradient(circle at 50% 46%, #10231b 0, #0a110e 28%, #090909 68%);
  --text-main: #f5f3ef;
  --text-muted: rgba(255,255,255,.52);
  --text-faint: rgba(255,255,255,.28);
  --header-fade: rgba(9,9,9,.78);
  --glass: rgba(255,255,255,.085);
  --glass-hover: rgba(255,255,255,.14);
  --glass-border: rgba(255,255,255,.15);
  background: #090909;
  color: var(--text-main);
}

:root.light {
  color-scheme: light;
  --page-bg: #f5f5f5;
  --text-main: #18201c;
  --text-muted: rgba(24,32,28,.58);
  --text-faint: rgba(24,32,28,.36);
  --header-fade: rgba(247,248,245,.9);
  --glass: rgba(255,255,255,.66);
  --glass-hover: rgba(255,255,255,.94);
  --glass-border: rgba(24,32,28,.16);
  background: #f5f5f5;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--page-bg); transition: background .45s, color .35s; }
a { color: inherit; text-decoration: none; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  background: linear-gradient(to bottom, var(--header-fade), transparent);
}

/* 嵌入 Photo_Wall 时只保留主题切换按钮，避免出现第二层导航。 */
.site-header {
  justify-content: flex-end;
  pointer-events: none;
  background: none;
}
.site-header .brand, .site-header nav a { display: none; }
.site-header nav, #theme-toggle { pointer-events: auto; }
.site-header { display: none; }

.brand img { display: block; width: 84px; height: auto; filter: brightness(0) invert(1); opacity: .92; }
:root.light .brand img { filter: brightness(0); opacity: .82; }
nav { display: flex; gap: 28px; align-items: center; }
nav a { position: relative; padding: 10px 0; color: var(--text-muted); font-size: 14px; transition: color .25s; }
nav a:hover, nav a.active { color: var(--text-main); }
nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s; }
nav a:hover::after, nav a.active::after { transform: scaleX(1); }
#theme-toggle { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: var(--text-muted); background: transparent; border: 1px solid var(--glass-border); border-radius: 50%; cursor: pointer; transition: color .25s, background .25s, transform .35s; }
#theme-toggle:hover { color: var(--text-main); background: var(--glass); transform: rotate(18deg); }
#theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.hero { position: relative; width: 100%; height: 100dvh; isolation: isolate; }
.atmosphere { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora { position: absolute; top: 18%; width: min(42vw, 680px); aspect-ratio: 1; border-radius: 50%; filter: blur(90px); opacity: .13; animation: aurora-drift 12s ease-in-out infinite alternate; }
.aurora-left { left: 4%; background: radial-gradient(circle, rgba(18,132,78,.85), transparent 68%); }
.aurora-right { right: 2%; top: 34%; background: radial-gradient(circle, rgba(149,25,34,.72), transparent 68%); animation-delay: -5s; }
.ground-glow { position: absolute; left: 50%; bottom: 1.5%; width: min(60vw, 900px); height: 18%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(220,178,67,.16), rgba(21,102,62,.08) 42%, transparent 72%); filter: blur(18px); }
.snow-ground { position: absolute; left: 50%; bottom: -7%; width: min(72vw, 1080px); height: 14%; transform: translateX(-50%); border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 0%, rgba(235,242,237,.11), transparent 68%); filter: blur(4px); }
:root.light .aurora { opacity: .10; }
:root.light .ground-glow { background: radial-gradient(ellipse, rgba(208,163,43,.18), rgba(36,124,76,.08) 42%, transparent 72%); }
:root.light .snow-ground { background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.82), rgba(214,226,218,.25) 48%, transparent 72%); }
.meteor-shower { display: none; position: absolute; inset: 0; overflow: hidden; }
:root.light .meteor-shower { display: block; }
.meteor {
  position: absolute;
  top: var(--meteor-y);
  left: -24vw;
  width: clamp(82px, 9vw, 138px);
  height: 18px;
  opacity: 0;
  transform: rotate(31deg);
  animation: meteor-cross var(--meteor-duration) linear infinite;
  animation-delay: var(--meteor-delay);
}
.meteor::before {
  content: "";
  position: absolute;
  inset: 6px 5px 6px 0;
  background: linear-gradient(90deg, transparent, rgba(41,81,105,.16) 24%, rgba(42,83,106,.72) 78%, rgba(183,121,30,.92));
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  filter: drop-shadow(0 0 3px rgba(53,91,111,.3));
}
.meteor::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b8791e;
  box-shadow: 0 0 0 2px rgba(255,255,255,.82), 0 0 8px 3px rgba(191,126,29,.38), 0 0 18px 5px rgba(75,111,128,.18);
  transform: translateY(-50%);
}
.meteor:nth-child(1) { --meteor-y: 4%; --meteor-duration: 7.8s; --meteor-delay: -1.2s; }
.meteor:nth-child(2) { --meteor-y: 22%; --meteor-duration: 9.6s; --meteor-delay: -6.1s; }
.meteor:nth-child(3) { --meteor-y: 39%; --meteor-duration: 8.7s; --meteor-delay: -3.7s; }
.meteor:nth-child(4) { --meteor-y: 12%; --meteor-duration: 11.4s; --meteor-delay: -8.4s; }
@keyframes meteor-cross {
  0% { opacity: 0; transform: translate3d(0, -18vh, 0) rotate(31deg) scale(.82); }
  2% { opacity: .95; }
  11% { opacity: .88; }
  16%, 100% { opacity: 0; transform: translate3d(132vw, 70vh, 0) rotate(31deg) scale(1); }
}
@keyframes aurora-drift { from { transform: translate3d(-3%, -2%, 0) scale(.92); } to { transform: translate3d(4%, 3%, 0) scale(1.08); } }
#scene, #photos { position: absolute; inset: 0; width: 100%; height: 100%; }
#scene { z-index: 2; touch-action: none; cursor: grab; }
#photos { z-index: 3; pointer-events: none; }
#scene:active { cursor: grabbing; }

.headline { position: absolute; z-index: 1; top: 14%; left: 0; width: 100%; text-align: center; pointer-events: none; }
.headline h1 { margin: 0 20px 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(58px, 9vw, 140px); font-weight: 400; font-style: italic; line-height: .9; letter-spacing: -.045em; color: var(--text-main); opacity: .9; }
.subtitle { display: flex; justify-content: center; align-items: center; gap: 16px; }
.subtitle span { width: clamp(50px, 6vw, 80px); height: 1px; background: linear-gradient(90deg, transparent, var(--text-faint), transparent); }
.subtitle p { margin: 0; color: var(--text-muted); font-size: 10px; font-weight: 300; letter-spacing: .25em; }

#toggle {
  position: fixed;
  z-index: 10;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  height: 45px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 24px;
  color: var(--text-main);
  font: 500 14px/1 Geist, sans-serif;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 10px 40px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: background .25s, transform .25s;
}
#toggle:hover { background: var(--glass-hover); transform: translateX(-50%) translateY(-2px); }
#toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.webgl-error { position: fixed; z-index: 30; inset: 50% auto auto 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,.7); font-size: 14px; }

@media (max-width: 720px) {
  .site-header { height: 64px; padding: 0 18px; }
  .brand img { width: 70px; }
  nav { gap: 16px; }
  nav a { font-size: 12px; }
  nav a:nth-child(2), nav a:nth-child(3) { display: none; }
  #theme-toggle { width: 31px; height: 31px; }
  .headline { top: 16%; }
  .headline h1 { font-size: clamp(50px, 16vw, 82px); }
  .subtitle p { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  #scene { cursor: default; }
  .aurora, .meteor { animation: none; }
  .meteor-shower { display: none; }
}
