/* Avatar.gift — deep-space & memory theme (2026-07-15 品牌定稿同源)
   Palette: Space #16163A→#0C0C22→#050510 / Moonlight #EAE8F4 / Mist #A3A0BF
            Accent violet #A78BFA / Cyan #22D3EE / Indigo #818CF8 / Pink #E879F9 */

:root {
  --space-top: #16163A;
  --space-mid: #0C0C22;
  --space-deep: #050510;
  --moon: #EAE8F4;
  --mist: #A3A0BF;
  --accent: #A78BFA;
  --accent-dim: rgba(167, 139, 250, 0.55);
  --cyan: #22D3EE;
  --indigo: #818CF8;
  --pink: #E879F9;
  --line: rgba(234, 232, 244, 0.1);
  --display: ui-serif, "New York", "Songti SC", "STSong", Georgia, "Noto Serif SC", serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Noto Sans SC", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  overflow-x: clip;
  background:
    radial-gradient(120% 90% at 70% -25%, rgba(124, 58, 237, 0.18) 0%, rgba(124, 58, 237, 0) 55%),
    linear-gradient(180deg, var(--space-top) 0%, var(--space-mid) 48%, var(--space-deep) 100%)
    var(--space-deep);
  color: var(--moon);
  font-family: var(--body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}

/* ── bilingual: html.zh shows .zh, hides .en ── */
html:not(.zh) .zh { display: none !important; }
html.zh .en { display: none !important; }

::selection { background: rgba(167, 139, 250, 0.3); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ── header ── */
.site-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.6rem 1.5rem;
}
.wordmark {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moon);
}
.wordmark:hover { text-decoration: none; color: var(--accent); }

.lang-toggle { display: flex; align-items: center; gap: 0.15rem; }
.lang-toggle button {
  background: none;
  border: none;
  color: var(--mist);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s;
}
.lang-toggle button:hover { color: var(--moon); }
.lang-toggle button[aria-pressed="true"] { color: var(--accent); }
.lang-toggle .sep { color: var(--line); font-size: 0.85rem; }

/* ── index hero ── */
#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.veil {
  /* soft vignette so text always sits on quiet sky */
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(70% 55% at 50% 46%, rgba(8, 8, 24, 0.55) 0%, rgba(8, 8, 24, 0) 70%);
}
.index-main { position: relative; z-index: 2; }

.hero {
  min-height: calc(100svh - 5.4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 4rem;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 8.5vw, 5rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 15em;
}
/* 中文标语首行"在生命学会永生之前，"= 11 个字形(含全角逗号)×1.1em 字距 = 12.1em 行宽,
   字号必须 ≤ (视口宽 − 左右 padding 3rem − 少许余量)/12.1 才不折行/不溢出 */
html.zh .hero h1 { letter-spacing: 0.1em; line-height: 1.22; font-size: clamp(1.6rem, calc((100vw - 3.5rem) / 12.1), 4.8rem); }
.hero h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--cyan) 0%, var(--accent) 55%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(167, 139, 250, 0.4));
}
html.zh .hero h1 em { font-style: normal; }
.hero .sub {
  margin-top: 1.75rem;
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  color: var(--mist);
  max-width: 36em;
}
.hero .sub strong { color: var(--moon); font-weight: 500; }
.hero .sub p + p { margin-top: 1em; }
.hero .soon {
  margin-top: 3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-size: 0.92rem;
  color: var(--mist);
  background: rgba(8, 8, 24, 0.45);
  backdrop-filter: blur(6px);
}
.hero .soon .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.hero .device-note {
  margin-top: 0.95rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--mist);
  opacity: 0.85;
}

/* ── hero avatar figure(App Icon 同款:分身像 + AI 星芒)── */
.avatar-figure {
  --af: clamp(120px, 22vw, 168px);
  position: relative;
  width: var(--af);
  height: var(--af);
  margin-bottom: 2.4rem;
}
.avatar-figure .af-head {
  position: absolute;
  left: 24%;
  top: 11%;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%,
    #F4F0FF 0%, #C9B8FF 16%, #A78BFA 44%, #7C3AED 72%, #4C1D95 100%);
  box-shadow:
    0 0 34px rgba(124, 58, 237, 0.5),
    0 0 90px rgba(124, 58, 237, 0.22);
}
.avatar-figure .af-body {
  position: absolute;
  left: 6%;
  bottom: 0;
  width: 78%;
  height: 42%;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(100deg,
    var(--cyan) 0%, #4F8EF7 34%, #7C6CF8 62%, #A855F7 100%);
  box-shadow: 0 0 44px rgba(79, 142, 247, 0.26);
}
.avatar-figure .af-sparks {
  position: absolute;
  right: -14%;
  top: -4%;
  width: 46%;
  height: auto;
  overflow: visible;
}
@media (prefers-reduced-motion: no-preference) {
  .avatar-figure .sp {
    transform-box: fill-box;
    transform-origin: center;
    animation: twinkle 3.4s ease-in-out infinite;
  }
  .avatar-figure .sp2 { animation-delay: 1.2s; animation-duration: 2.7s; }
  .avatar-figure .sp3 { animation-delay: 2.1s; animation-duration: 4s; }
  @keyframes twinkle {
    0%, 100% { opacity: 0.55; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1); }
  }
}

/* page-load sequence */
@media (prefers-reduced-motion: no-preference) {
  html.js .rise { opacity: 0; transform: translateY(14px); animation: rise 0.9s cubic-bezier(0.2, 0.6, 0.2, 1) forwards; }
  .rise-2 { animation-delay: 0.12s; }
  .rise-3 { animation-delay: 0.26s; }
  .rise-4 { animation-delay: 0.4s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ── row sections (features / principles) ── */
.rows-label {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 1.2rem;
}
html.zh .rows-label { letter-spacing: 0.5em; font-size: 0.82rem; }

.principles {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 3.5rem;
}
.principle {
  display: grid;
  grid-template-columns: 1.6rem 12.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 2.1rem 0;
  border-top: 1px solid var(--line);
}
.principle:last-child { border-bottom: 1px solid var(--line); }
.principle .star { color: var(--accent-dim); font-size: 0.95rem; line-height: 1; }

/* ── 双身份分组(29号分工公理):App 内身份色同源——青=助手(手),紫=灵魂(心) ── */
.duo-label {
  display: block;
  padding: 0 0 0.85rem calc(1.6rem + 1rem); /* 与条目标题列对齐 */
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-dim);
}
html.zh .duo-label { letter-spacing: 0.42em; font-size: 0.78rem; }
.duo-label em {
  font-style: normal;
  font-size: 0.85em;
  letter-spacing: 0.14em;
  opacity: 0.75;
}
.duo-label.duo-assistant { color: rgba(34, 211, 238, 0.72); }
.duo-label.duo-soul { margin-top: 3rem; }
.principle.assistant .star { color: rgba(34, 211, 238, 0.7); }

.principle h2 {
  font-family: var(--display);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--moon);
}
html.zh .principle h2 { letter-spacing: 0.08em; }
.principle p { color: var(--mist); font-size: 1rem; }

/* ── closing line ── */
.creed {
  text-align: center;
  padding: 3.5rem 1.5rem 6rem;
}
.creed .star { color: var(--accent-dim); display: block; margin-bottom: 1.4rem; }
.creed p {
  font-family: var(--display);
  font-size: clamp(1.45rem, 3.6vw, 2rem);
  font-weight: 500;
  line-height: 1.4;
  max-width: 24em;
  margin: 0 auto;
  color: var(--moon);
}
html.zh .creed p { letter-spacing: 0.08em; }

/* ── footer ── */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 2.2rem 1.5rem 2.8rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--mist);
}
.site-footer nav { margin-bottom: 0.7rem; }
.site-footer nav a { color: var(--mist); margin: 0 0.9rem; }
.site-footer nav a:hover { color: var(--moon); text-decoration: none; }
.site-footer .fine { font-size: 0.82rem; opacity: 0.75; }

/* ── article pages (privacy / support) ── */
.article {
  position: relative;
  z-index: 2;
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
}
.article h1 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 5.5vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
html.zh .article h1 { letter-spacing: 0.1em; }
.article .updated { color: var(--mist); font-size: 0.9rem; margin-bottom: 2.8rem; }
.article .lede { font-size: 1.08rem; margin-bottom: 1rem; }
.article .lede strong { color: var(--accent); font-weight: 500; }
.article h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  margin: 2.6rem 0 0.8rem;
}
html.zh .article h2 { letter-spacing: 0.06em; }
.article p, .article li { color: var(--moon); margin-bottom: 0.75rem; }
.article ul { padding-left: 1.25rem; }
.article li::marker { color: var(--accent-dim); }
.article .muted { color: var(--mist); font-size: 0.92rem; }
.article .card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
  margin: 2rem 0;
  background: rgba(234, 232, 244, 0.03);
}
.article .card p { margin-bottom: 0.4rem; }
.faq-q { color: var(--moon); font-weight: 600; }

@media (max-width: 480px) {
  .hero h1 { font-size: 2.15rem; }
  /* zh 不再单独覆盖:基础规则的 calc 已按视口收缩,固定字号在小屏必溢出 */
  .creed p { font-size: 1.35rem; }
  .avatar-figure { margin-bottom: 1.9rem; }
}

@media (max-width: 640px) {
  .principle { grid-template-columns: 1.4rem 1fr; }
  .principle p { grid-column: 2; }
  .duo-label { padding-left: calc(1.4rem + 1rem); } /* 跟随窄屏网格列宽 */
  .site-header { padding: 1.3rem 1.25rem; }
}
