:root {
  --bg: #0f0f10;
  --surface: #171719;
  --surface-2: #1d1d20;
  --text: #f1efea;
  --muted: #aaa6a0;
  --faint: #77736e;
  --accent: #d55b48;
  --accent-soft: rgba(213, 91, 72, .14);
  --line: rgba(241, 239, 234, .12);
  --max: 1080px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  line-height: 1.65;
}
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
::selection { color: #fff; background: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -5rem;
  left: 1rem;
  padding: .7rem 1rem;
  color: var(--bg);
  background: var(--text);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 70px;
  padding: 0 max(1.25rem, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid transparent;
  background: rgba(15, 15, 16, .78);
  backdrop-filter: blur(16px);
  transition: border-color .2s;
}
.site-header.is-scrolled { border-color: var(--line); }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  width: max-content;
  text-decoration: none;
  letter-spacing: .02em;
}
.wordmark-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.site-header nav { display: flex; gap: 2rem; }
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .84rem;
}
.site-header nav a:hover,
.site-header nav a:focus-visible { color: var(--text); }
.support-button {
  justify-self: end;
  min-height: 40px;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.support-button:hover,
.support-button:focus-visible { border-color: var(--accent); }

main { display: block; }
.hero,
.section,
.site-footer {
  width: min(calc(100% - 2.5rem), var(--max));
  margin-inline: auto;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  gap: clamp(3rem, 8vw, 7rem);
  align-items: center;
  min-height: calc(100svh - 70px);
  padding: clamp(5rem, 12vh, 8rem) 0;
}
.kicker,
.section-label {
  margin: 0 0 1.2rem;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.hero h1,
.section h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.hero h1 { font-size: clamp(3.2rem, 7.4vw, 6.8rem); }
.hero-text {
  max-width: 650px;
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.24rem);
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2rem;
}
.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: .7rem 1rem;
  color: #fff;
  border-radius: 9px;
  background: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.primary-link:hover,
.primary-link:focus-visible { background: #e36753; }
.status {
  color: var(--muted);
  font-size: .8rem;
}
.status i,
.chat-state i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: .5rem;
  border-radius: 50%;
  background: var(--accent);
}

.identity-placeholder {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 76% 14%, var(--accent-soft), transparent 32%),
    var(--surface);
}
.identity-letter {
  color: var(--accent);
  font-size: clamp(8rem, 18vw, 13rem);
  font-weight: 800;
  line-height: .8;
  letter-spacing: -.1em;
}
.identity-placeholder strong { font-size: 1.25rem; }
.identity-placeholder p {
  margin: .3rem 0 0;
  color: var(--muted);
}

.section {
  padding: clamp(5rem, 10vw, 8rem) 0;
  border-top: 1px solid var(--line);
}
.section h2 { font-size: clamp(2.4rem, 5vw, 4.7rem); }
.section-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 7vw, 6rem);
  align-items: end;
}
.section-heading p,
.chat-copy > p:not(.section-label) {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.abilities > h2 { max-width: 680px; }
.ability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}
.ability-grid article {
  min-height: 250px;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.ability-grid article > span {
  color: var(--accent);
  font-size: .72rem;
  letter-spacing: .12em;
}
.ability-grid h3 {
  margin: 4rem 0 .55rem;
  font-size: 1.3rem;
}
.ability-grid p { margin: 0; color: var(--muted); }
.boundary-card {
  border-color: rgba(213, 91, 72, .38) !important;
  background: linear-gradient(145deg, var(--accent-soft), var(--surface)) !important;
}

.chat-section {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(420px, 1.22fr);
  gap: clamp(2.5rem, 8vw, 6rem);
  align-items: center;
}
.chat-copy > p:not(.section-label) { margin-top: 1.4rem; }
.scope-list {
  display: grid;
  gap: .65rem;
  margin: 1.7rem 0 0;
  padding: 0;
  list-style: none;
}
.scope-list li {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--muted);
}
.scope-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.chat-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.chat-identity { display: flex; align-items: center; gap: .8rem; }
.chat-identity > span,
.assistant-message > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}
.chat-identity > div { display: flex; flex-direction: column; }
.chat-identity small { color: var(--faint); }
.chat-state { color: var(--muted); font-size: .76rem; }
.message-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 330px;
  padding: 2rem 1.25rem;
}
.message { display: flex; gap: .8rem; align-items: flex-start; }
.message p {
  max-width: 78%;
  margin: 0;
  padding: .8rem 1rem;
  border-radius: 4px 13px 13px 13px;
  color: var(--text);
  background: var(--surface-2);
}
.system-message { justify-content: center; margin-top: auto; }
.system-message p {
  max-width: none;
  padding: .55rem .8rem;
  border: 1px solid rgba(213, 91, 72, .22);
  border-radius: 999px;
  color: var(--muted);
  background: var(--accent-soft);
  font-size: .8rem;
}
.chat-composer {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: .55rem;
  margin: 0 1rem;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.chat-composer button,
.chat-composer input {
  min-width: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
}
.chat-composer button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
}
.chat-composer button:disabled,
.chat-composer input:disabled { opacity: .72; cursor: not-allowed; }
.chat-composer svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat-notice {
  margin: .65rem 1.1rem 1rem;
  color: var(--faint);
  font-size: .72rem;
  text-align: center;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  font-size: .78rem;
}
.site-footer p { margin: 0; }
.site-footer p span { margin-left: 1rem; color: var(--faint); }
.site-footer button {
  padding: .4rem;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}
.site-footer a { color: var(--muted); text-decoration: none; }

.support-dialog {
  width: min(92vw, 470px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .65);
}
.support-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.dialog-inner { position: relative; padding: 2rem; }
.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.support-dialog h2 { margin: 0 3rem 1rem 0; }
.support-dialog p { color: var(--muted); }
.dialog-note { font-size: .78rem; }
.dialog-action {
  min-height: 42px;
  padding: .6rem 1rem;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}
.dialog-action.is-link { display: inline-flex; align-items: center; text-decoration: none; }
.noscript {
  position: fixed;
  z-index: 99;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: #7c2d22;
  text-align: center;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .identity-placeholder { min-height: 340px; }
  .ability-grid { grid-template-columns: 1fr; }
  .ability-grid article { min-height: auto; }
  .ability-grid h3 { margin-top: 2rem; }
  .chat-section { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 64px;
    padding-inline: 1rem;
  }
  .site-header nav { display: none; }
  .support-button { min-height: 44px; }
  .hero,
  .section,
  .site-footer { width: min(calc(100% - 2rem), var(--max)); }
  .hero { min-height: auto; padding: 5rem 0; }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.7rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .identity-placeholder { min-height: 290px; }
  .section { padding: 4.5rem 0; }
  .section-heading { grid-template-columns: 1fr; }
  .chat-shell { border-radius: 14px; }
  .message-list { min-height: 300px; padding-inline: .9rem; }
  .message p { max-width: calc(100% - 50px); }
  .chat-composer { margin-inline: .7rem; }
  .site-footer { grid-template-columns: 1fr auto; }
  .site-footer p span { display: block; margin: .15rem 0 0; }
  .site-footer > a { display: none; }
}

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