:root {
  --bg: #0a0a1a;
  --bg-deep: #080812;
  --bg-soft: #17142f;
  --text: #f8f7ff;
  --muted: #c3bddb;
  --muted-strong: #ddd7f2;
  --primary: #6c5ce7;
  --secondary: #a29bfe;
  --accent: #fd79a8;
  --gold: #ffeaa7;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --shadow: 0 24px 80px rgba(6, 4, 18, 0.45);
  --shadow-soft: 0 16px 48px rgba(8, 8, 24, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 20%, rgba(108, 92, 231, 0.28), transparent 28%),
    radial-gradient(circle at 80% 22%, rgba(253, 121, 168, 0.18), transparent 20%),
    radial-gradient(circle at 52% 78%, rgba(162, 155, 254, 0.16), transparent 26%),
    linear-gradient(180deg, #0a0918 0%, #0f0d22 48%, #15122d 100%);
}

body.light-mode {
  --text: #19152b;
  --muted: #625d79;
  --muted-strong: #4a4661;
  --line: rgba(31, 20, 72, 0.1);
  --line-strong: rgba(31, 20, 72, 0.16);
  --glass: rgba(255, 255, 255, 0.56);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 60px rgba(56, 43, 122, 0.14);
  --shadow-soft: 0 16px 40px rgba(56, 43, 122, 0.1);
  background:
    radial-gradient(circle at 18% 20%, rgba(108, 92, 231, 0.18), transparent 28%),
    radial-gradient(circle at 80% 22%, rgba(253, 121, 168, 0.14), transparent 20%),
    radial-gradient(circle at 52% 78%, rgba(162, 155, 254, 0.12), transparent 26%),
    linear-gradient(180deg, #fbfaff 0%, #f0eeff 52%, #ebe9ff 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

#nebula-canvas {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 30vw;
  height: 30vw;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.44;
  pointer-events: none;
}

.ambient-left {
  top: 10vh;
  left: -8vw;
  background: rgba(108, 92, 231, 0.32);
}

.ambient-right {
  right: -10vw;
  bottom: 14vh;
  background: rgba(253, 121, 168, 0.22);
}

.page-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.site-header,
.site-nav,
.hero-actions,
.hero-metrics,
.assistant-actions,
.generator-actions,
.footer-links,
.voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 30;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(17, 12, 35, 0.64);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  color: #fff;
  background:
    radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.32), transparent 28%),
    linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-copy strong,
.site-footer strong {
  display: block;
  font-family: "Uncial Antiqua", serif;
  letter-spacing: 0.04em;
}

.brand-copy small,
.eyebrow,
.hero-text,
.section-text,
.status,
.community-card p,
.footer-meta,
.poster-kicker,
.product-tag,
.sigil-label,
.voice-help {
  color: var(--muted);
}

.site-nav a,
.ghost-button,
.secondary-button,
.primary-button {
  min-height: 46px;
  border-radius: 999px;
  padding: 11px 20px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.site-nav a,
.ghost-button,
.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.primary-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 16px 32px rgba(108, 92, 231, 0.3);
}

.site-nav a:hover,
.ghost-button:hover,
.secondary-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
}

.site-nav a:disabled,
.ghost-button:disabled,
.secondary-button:disabled,
.primary-button:disabled {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(180deg, var(--glass-strong), var(--glass));
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.hero-section,
.avatar-section,
.lab-layout,
.product-grid,
.community-grid,
.story-timeline,
.voice-grid {
  display: grid;
  gap: 24px;
}

.hero-section {
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  align-items: center;
  min-height: calc(100vh - 170px);
  padding: 40px 0 28px;
  scroll-margin-top: 112px;
}

.hero-copy,
.avatar-copy,
.avatar-panel,
.voice-panel,
.generator-panel,
.poster-panel,
.site-footer {
  padding: 30px;
}

.hero-copy h1 {
  max-width: 10ch;
  margin-bottom: 18px;
  font-family: "Uncial Antiqua", serif;
  font-size: clamp(3.2rem, 7vw, 5.8rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin-bottom: 16px;
  font-family: "Orbitron", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-text,
.section-text,
.story-card p,
.product-card p {
  max-width: 40ch;
  font-size: 1rem;
  line-height: 1.85;
}

.hero-metrics {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.hero-metrics li {
  min-width: 152px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
}

.hero-metrics strong,
.poster-preview strong,
.story-step {
  display: block;
  font-family: "Orbitron", sans-serif;
}

.hero-metrics strong {
  margin-bottom: 6px;
  font-size: 1.5rem;
  color: var(--gold);
}

.hero-stage {
  position: relative;
  min-height: 620px;
  overflow: hidden;
}

.orbit-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-ring-large {
  width: min(34vw, 500px);
  height: min(34vw, 500px);
  animation: orbit-spin 18s linear infinite;
}

.orbit-ring-small {
  width: min(18vw, 220px);
  height: min(18vw, 220px);
  animation: orbit-spin 10s linear infinite reverse;
}

.hero-sigil {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(28vw, 350px);
  min-height: 350px;
  padding: 28px;
  transform: translate(-50%, -50%);
  display: grid;
  align-content: end;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.18), transparent 24%),
    radial-gradient(circle at 52% 44%, rgba(108, 92, 231, 0.42), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.hero-sigil strong {
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.content-section {
  padding: 42px 0;
  scroll-margin-top: 112px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  max-width: 14ch;
  margin-bottom: 0;
  font-family: "Uncial Antiqua", serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.12;
}

.story-timeline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-card,
.product-card,
.community-card {
  padding: 24px;
}

.story-step {
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.22em;
}

.avatar-section {
  grid-template-columns: minmax(0, 0.82fr) minmax(340px, 1.18fr);
  grid-template-areas:
    "copy stage"
    "voice stage";
  align-items: stretch;
}

.avatar-copy {
  grid-area: copy;
  display: flex;
}

.avatar-copy-inner {
  display: grid;
  align-content: start;
  gap: 18px;
}

.avatar-heading {
  margin-bottom: 0;
}

.avatar-heading h2 {
  max-width: 10ch;
}

.avatar-lead {
  max-width: 34ch;
}

.avatar-panel {
  grid-area: stage;
}

.avatar-container {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.16), transparent 20%),
    radial-gradient(circle at 50% 58%, rgba(108, 92, 231, 0.32), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

.avatar-fallback {
  position: absolute;
  inset: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 24px;
}

.avatar-core {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.82), transparent 18%),
    radial-gradient(circle at 50% 52%, rgba(108, 92, 231, 0.86), rgba(253, 121, 168, 0.2) 62%, transparent 63%),
    radial-gradient(circle at 50% 50%, rgba(255, 234, 167, 0.9), transparent 13%);
  box-shadow:
    0 0 28px rgba(255, 234, 167, 0.32),
    0 0 80px rgba(108, 92, 231, 0.34);
  animation: core-pulse 4s ease-in-out infinite;
}

.status {
  min-height: 48px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.7;
}

.voice-panel {
  grid-area: voice;
  display: grid;
  gap: 22px;
  box-shadow: var(--shadow-soft);
}

.voice-panel-heading {
  display: grid;
  gap: 10px;
}

.voice-panel-heading h3 {
  margin-bottom: 0;
  font-size: 1.7rem;
  line-height: 1.2;
}

.voice-help {
  max-width: 52ch;
  margin-bottom: 0;
  line-height: 1.75;
}

.voice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voice-actions {
  justify-content: flex-start;
}

.product-grid,
.community-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tilt-card {
  transform-style: preserve-3d;
  transition: transform 200ms ease-in-out, box-shadow 200ms ease-in-out;
}

.tilt-card:hover {
  box-shadow: 0 28px 80px rgba(8, 8, 28, 0.52);
}

.product-tag,
.community-rank,
.poster-kicker,
.sigil-label {
  display: inline-block;
  margin-bottom: 14px;
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lab-layout {
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  align-items: stretch;
}

.generator-panel {
  display: grid;
  gap: 20px;
}

.control-field {
  display: grid;
  gap: 10px;
}

.control-field span {
  color: var(--muted-strong);
  font-weight: 700;
}

.control-field input[type="text"],
.control-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--text);
  background: rgba(7, 5, 18, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.control-field input[type="text"] {
  min-height: 54px;
  padding: 0 16px;
}

.control-field textarea {
  min-height: 176px;
  padding: 16px;
  resize: vertical;
  line-height: 1.75;
}

.control-field input[type="text"]::placeholder,
.control-field textarea::placeholder {
  color: var(--muted);
}

.control-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.poster-panel {
  display: grid;
  place-items: center;
}

.poster-preview {
  position: relative;
  width: min(100%, 540px);
  aspect-ratio: 4 / 5;
  padding: 28px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 26%, rgba(255, 255, 255, 0.35), transparent 16%),
    radial-gradient(circle at 60% 42%, rgba(108, 92, 231, 0.85), transparent 28%),
    radial-gradient(circle at 42% 64%, rgba(253, 121, 168, 0.45), transparent 26%),
    linear-gradient(180deg, rgba(4, 4, 18, 0.88), rgba(18, 18, 42, 0.96));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.poster-preview::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.poster-preview strong {
  margin-top: 180px;
  margin-bottom: 10px;
  font-family: "Uncial Antiqua", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}

.site-footer {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.footer-links a {
  color: var(--muted);
}

.reveal-card {
  opacity: 0;
  transform: translateY(28px);
  transition: transform 500ms ease, opacity 500ms ease;
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes orbit-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes core-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1080px) {
  .hero-section,
  .story-timeline,
  .product-grid,
  .community-grid,
  .lab-layout,
  .voice-grid {
    grid-template-columns: 1fr;
  }

  .avatar-section {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "stage"
      "voice";
  }

  .hero-stage {
    min-height: 440px;
  }

  .hero-sigil {
    width: min(80vw, 350px);
    min-height: 300px;
  }

  .avatar-container {
    min-height: 520px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 16px;
  }

  .site-header {
    gap: 14px;
    padding: 16px;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a,
  .ghost-button,
  .secondary-button,
  .primary-button {
    width: 100%;
    text-align: center;
  }

  .hero-copy,
  .avatar-copy,
  .avatar-panel,
  .voice-panel,
  .generator-panel,
  .poster-panel,
  .site-footer {
    padding: 22px;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: clamp(2.8rem, 12vw, 4rem);
  }

  .section-heading h2,
  .avatar-heading h2 {
    max-width: none;
  }

  .hero-text,
  .section-text,
  .avatar-lead,
  .voice-help {
    max-width: none;
  }

  .avatar-container {
    min-height: 420px;
  }

  .control-field textarea {
    min-height: 150px;
  }
}
