:root {
  color-scheme: dark;
  --ink: #081418;
  --paper: #eef5f2;
  --muted: rgba(229, 240, 236, .62);
  --line: rgba(218, 232, 227, .17);
  --jade: #a8d8c9;
  --gold: #c7b985;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ink); scroll-behavior: smooth; }
body { min-height: 100svh; margin: 0; overflow-x: hidden; color: var(--paper); background: var(--ink); }
a { color: inherit; }
button, textarea { font: inherit; }
.skip-link { position: fixed; z-index: 100; left: 18px; top: -60px; padding: 10px 14px; background: white; color: #111; transition: top .2s; }
.skip-link:focus { top: 18px; }

.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #172a30; pointer-events: none; }
.sky-image { position: absolute; inset: -3%; background: url('/images/nine-heavens-desktop.webp') center / cover no-repeat; filter: saturate(.62) contrast(1.04); animation: breathe 18s ease-in-out infinite alternate; }
.sky-veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,16,20,.94), rgba(8,22,27,.58) 58%, rgba(8,20,24,.42)), linear-gradient(0deg, rgba(5,15,19,.9), transparent 55%); }

.site-header { position: absolute; z-index: 10; inset: 0 0 auto; height: 84px; padding: 0 clamp(22px,4vw,68px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(8,20,24,.2); backdrop-filter: blur(15px); }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand > span { font: 500 clamp(21px,2vw,29px)/1 Georgia, serif; letter-spacing: .03em; }
.brand > i { width: 1px; height: 13px; background: var(--line); }
.brand > small { color: var(--muted); font-size: 10px; letter-spacing: .28em; }
.site-header nav { display: flex; align-items: center; gap: clamp(18px,2.6vw,42px); }
.site-header nav a { color: var(--muted); font-size: 11px; text-decoration: none; letter-spacing: .08em; transition: color .2s; }
.site-header nav a:hover { color: white; }
.status { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(199,185,133,.08); }
.status b { font-weight: 500; }
.status.online i { background: var(--jade); box-shadow: 0 0 0 5px rgba(168,216,201,.1), 0 0 16px rgba(168,216,201,.32); animation: pulse 2.4s infinite; }

main, footer { position: relative; z-index: 1; }
.eyebrow { margin: 0; color: var(--jade); font-size: 10px; letter-spacing: .28em; }
.agent-hero { min-height: 100svh; padding: 150px clamp(24px,8vw,128px) 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.agent-copy { width: min(760px,70vw); animation: rise .9s cubic-bezier(.16,1,.3,1) both; }
.agent-copy h1 { margin: 24px 0 0; font: 400 clamp(74px,10vw,154px)/.78 Georgia, "Times New Roman", serif; letter-spacing: -.065em; }
.agent-copy h1 span { display: block; margin-top: 28px; font: 400 clamp(28px,3.8vw,56px)/1 "Songti SC", serif; letter-spacing: .16em; }
.agent-statement { margin: 42px 0 0; font: 400 clamp(22px,2.2vw,32px)/1.3 "Songti SC", serif; }
.agent-description { width: min(600px,100%); margin: 20px 0 0; color: var(--muted); font-size: 14px; line-height: 1.9; }
.hero-link { display: inline-flex; gap: 14px; margin-top: 36px; padding-bottom: 7px; border-bottom: 1px solid rgba(168,216,201,.45); color: var(--jade); font-size: 11px; text-decoration: none; letter-spacing: .1em; }
.hero-link span { transition: transform .2s; }
.hero-link:hover span { transform: translateY(4px); }
.agent-index { align-self: flex-end; display: flex; align-items: flex-end; gap: 14px; color: rgba(236,244,241,.35); writing-mode: vertical-rl; }
.agent-index span { font-size: 8px; letter-spacing: .24em; }
.agent-index b { color: var(--gold); font: 400 28px/1 Georgia, serif; }

.architecture { min-height: 92svh; padding: 110px clamp(24px,6vw,96px); background: rgba(6,18,22,.88); backdrop-filter: blur(18px); }
.section-heading { display: grid; grid-template-columns: minmax(260px,1fr) minmax(320px,1.6fr) minmax(260px,1fr); align-items: end; gap: 40px; }
.section-heading h2 { margin: 0; font: 400 clamp(42px,5vw,72px)/1.05 "Songti SC", Georgia, serif; letter-spacing: -.04em; }
.section-heading > p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.9; }
.flow { position: relative; margin: 110px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6,1fr); list-style: none; border-top: 1px solid var(--line); }
.flow::before { content: ''; position: absolute; top: -2px; left: 0; width: 15%; height: 3px; background: linear-gradient(90deg,transparent,var(--jade),transparent); animation: flow 4.6s linear infinite; }
.flow li { min-height: 170px; padding: 28px 18px 20px 0; border-right: 1px solid var(--line); }
.flow li:last-child { border-right: 0; }
.flow span,.flow b,.flow small { display: block; }
.flow span { color: var(--gold); font: 400 10px/1 monospace; }
.flow b { margin-top: 48px; font: 400 clamp(14px,1.4vw,20px)/1.2 Georgia, "PingFang SC", serif; }
.flow small { margin-top: 10px; color: var(--muted); font-size: 9px; line-height: 1.5; }

.console { padding: 104px clamp(24px,6vw,96px) 90px; background: rgba(5,15,19,.96); }
.console-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 64px; }
.console-heading h2 { margin: 13px 0 0; font: 400 clamp(42px,5vw,70px)/1 Georgia, serif; }
.console-heading > p { width: min(430px,40vw); margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.console-layout { min-height: 610px; display: grid; grid-template-columns: minmax(0,1fr) minmax(285px,24vw); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.conversation { min-width: 0; padding: 56px clamp(20px,4vw,64px) 32px 0; display: flex; flex-direction: column; }
.messages { width: min(820px,100%); flex: 1; min-height: 300px; max-height: 440px; overflow: auto; padding-right: 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.message { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 14px; margin: 0 0 27px; animation: message-in .42s cubic-bezier(.16,1,.3,1) both; }
.message.user { margin-left: min(15%,90px); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(168,216,201,.36); border-radius: 50%; color: var(--jade); font: 500 13px/1 "Songti SC",serif; }
.message b { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .08em; }
.message p { margin: 0; white-space: pre-wrap; color: rgba(244,249,247,.94); font-size: 14px; line-height: 1.75; }
.message.pending p { color: var(--muted); }
.typing::after { content: ''; display: inline-block; width: 15px; height: 3px; margin-left: 7px; border-radius: 2px; background: var(--jade); animation: typing 1.1s ease-in-out infinite; }
.composer { width: min(820px,100%); min-height: 66px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; padding: 12px 12px 12px 20px; border: 1px solid rgba(219,234,229,.22); background: rgba(13,30,35,.6); transition: border-color .2s; }
.composer:focus-within { border-color: rgba(168,216,201,.52); }
.composer label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.composer textarea { width: 100%; max-height: 150px; resize: none; padding: 10px 0; border: 0; outline: 0; background: transparent; color: white; line-height: 1.5; }
.composer textarea::placeholder { color: rgba(229,239,236,.38); }
.composer button { height: 42px; padding: 0 17px; display: flex; align-items: center; gap: 9px; border: 0; background: var(--paper); color: #102126; cursor: pointer; transition: transform .2s; }
.composer button:hover { transform: translateY(-2px); }
.composer button:disabled { opacity: .48; cursor: wait; transform: none; }
.composer button span { font-size: 11px; font-weight: 650; }
.composer button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.composer-note { width: min(820px,100%); margin: 11px 0 0; color: rgba(226,238,234,.34); font-size: 9px; text-align: center; }
.core-rail { padding: 56px 0 40px clamp(26px,3vw,48px); border-left: 1px solid var(--line); }
.rail-title { display: grid; grid-template-columns: 44px 1fr; align-items: center; column-gap: 13px; }
.rail-title > span { grid-row: 1/3; display: grid; place-items: center; width: 40px; height: 32px; border: 1px solid var(--line); color: var(--gold); font-size: 8px; }
.rail-title b { font: 400 17px/1.2 Georgia,serif; }
.rail-title small { margin-top: 5px; color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.core-rail ul { margin: 62px 0 0; padding: 0; list-style: none; }
.core-rail li { min-height: 76px; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.core-rail li:last-child { border-bottom: 1px solid var(--line); }
.core-rail li > span { color: var(--muted); font: 500 9px/1 monospace; }
.core-rail li b,.core-rail li small { display: block; }
.core-rail li b { font-size: 12px; font-weight: 500; }
.core-rail li small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.core-rail li.active b { color: var(--jade); }
.core-rail > p { margin-top: 42px; color: var(--muted); font-size: 10px; line-height: 1.9; }
footer { min-height: 54px; padding: 0 clamp(24px,6vw,96px); display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: rgba(226,238,234,.38); font-size: 9px; letter-spacing: .13em; background: #061014; }

@keyframes breathe { from { transform: scale(1.02) translate3d(-.5%,0,0); } to { transform: scale(1.065) translate3d(.7%,-1%,0); } }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flow { from { transform: translateX(-20%); } to { transform: translateX(660%); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes message-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes typing { 0%,100% { transform: scaleX(.35); opacity: .45; } 50% { transform: scaleX(1); opacity: 1; } }

@media (max-width: 900px) {
  .site-header { height: 70px; }
  .site-header nav a { display: none; }
  .agent-hero { padding: 126px 20px 58px; align-items: flex-start; }
  .agent-copy { width: 100%; }
  .agent-copy h1 { font-size: clamp(64px,20vw,92px); }
  .agent-copy h1 span { margin-top: 23px; font-size: 31px; }
  .agent-statement { margin-top: 34px; }
  .agent-index { display: none; }
  .section-heading { grid-template-columns: 1fr; gap: 28px; }
  .flow { margin-top: 70px; grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line); }
  .flow::before { top: 0; left: -2px; width: 3px; height: 15%; background: linear-gradient(transparent,var(--jade),transparent); animation: flow-mobile 4.6s linear infinite; }
  .flow li { min-height: 96px; padding: 20px 20px; border-top: 1px solid var(--line); border-right: 0; }
  .flow b { margin-top: 13px; }
  .console { padding: 80px 20px 60px; }
  .console-heading { display: block; }
  .console-heading > p { width: 100%; margin-top: 24px; }
  .console-layout { grid-template-columns: 1fr; }
  .conversation { min-height: 620px; padding: 42px 0 26px; }
  .messages { min-height: 330px; }
  .core-rail { padding: 48px 0; border-left: 0; border-top: 1px solid var(--line); }
  footer span:last-child { display: none; }
  .sky-image { background-image: url('/images/nine-heavens-mobile.webp'); background-position: center top; }
}

@keyframes flow-mobile { from { transform: translateY(-20%); } to { transform: translateY(660%); } }

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