:root {
  --bg: #fbf5ed; --card: #fffaf4; --ink: #241b21; --muted: #66575b; --line: #dbcac0;
  --accent: #a73339; --accent-ink: #fff9f0; --rain: #3b628e; --dry: #8d5b13; --neutral: #66575b;
  --danger: #a32d37; --sea: #2c6e8f;
  --display: Georgia, "Times New Roman", serif;
}
:root[data-theme="dark"] {
  --bg: #121417; --card: #1b1e23; --ink: #eceae4; --muted: #9aa0aa; --line: #2b2f36;
  --accent: #5fb39b; --accent-ink: #0d1412; --rain: #7aa6e6; --dry: #e0a552; --neutral: #9aa0aa;
  --danger: #e07a6b; --sea: #5aa7cc;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 1280px; margin: 0 auto; padding: 16px 24px 80px; }
nav.top { display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; padding: 7px 0 25px; }
nav.top .brand { font-family: var(--display); font-weight: 700; font-size: 27px; margin-right: auto; color: var(--ink); text-decoration: none; letter-spacing: -.03em; }
nav.top a.link { color: var(--muted); text-decoration: none; padding: 4px 2px; }
nav.top a.link[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); }
h1 { font-family: var(--display); font-size: 29px; margin: 0; letter-spacing: -0.025em; line-height: 1.1; }
h2 { font-family: var(--display); font-size: 23px; margin: 0 0 10px; letter-spacing: -.015em; line-height: 1.15; }
.sub { color: var(--muted); margin: 4px 0 0; }
button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 14px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.label { color: var(--muted); font-size: 13px; }
.value { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.small { font-size: 13px; color: var(--muted); }
.cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
input, select { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-variant-numeric: tabular-nums; }
input.big { font-size: 20px; }
.row { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0; align-items: center; }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); margin: 10px 0 8px; }
.bar span { display: block; height: 100%; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid currentColor; }
.status { min-height: 22px; margin-top: 10px; font-size: 14px; overflow-wrap: anywhere; }
.err { color: var(--danger); }
a { color: var(--accent); }
.disclaimer { margin-top: 28px; color: var(--muted); font-size: 13px; }
.list { display: grid; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.nfts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.nfts img { width: 100%; border-radius: 10px; display: block; background: var(--line); aspect-ratio: 1; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.table-wrap { overflow-x: auto; }
svg.chart { width: 100%; height: 120px; display: block; }

/* The public home page introduces the character and maps the deployed abilities. */
html { scroll-behavior: smooth; }
::selection { background: #e8a288; color: #241b21; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.home-hero { display: grid; grid-template-columns: 1.03fr .97fr; min-height: 590px; overflow: hidden; background: #efc9ae; border-radius: 18px; isolation: isolate; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(32px, 4vw, 54px); z-index: 2; }
.home-hero h1 { font-size: clamp(3.8rem, 6.1vw, 5.8rem); line-height: .98; letter-spacing: -.04em; max-width: 14ch; }
.hero-intro { max-width: 50ch; font-family: var(--display); font-size: clamp(1.15rem, 1.55vw, 1.4rem); line-height: 1.38; margin: 23px 0; }
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-button { display: inline-flex; gap: 18px; align-items: center; justify-content: space-between; padding: 13px 18px; border-radius: 8px; background: var(--ink); color: #fff9f1; text-decoration: none; font-weight: 650; transition: background .2s, transform .2s; }
.hero-button:hover { background: #a73339; transform: translateY(-2px); }
.hero-text-link { color: var(--ink); text-underline-offset: 5px; font-weight: 600; }
.hero-note { margin-top: 34px; font-size: 13px; font-weight: 600; color: #634443; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero-note a { color: inherit; text-underline-offset: 3px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #286d54; box-shadow: 0 0 0 4px #286d5420; }
.hero-visual { position: relative; min-height: 590px; }
.hero-mobile-visual { display: none; }
.hero-halo { position: absolute; width: min(48vw, 590px); aspect-ratio: 1; border-radius: 50%; background: #e9af8c; right: -11%; top: 8%; }
.hero-visual img { position: absolute; height: 106%; width: auto; max-width: none; right: 5%; bottom: -13%; object-fit: contain; filter: drop-shadow(12px 25px 24px #4f211638); }
.hero-ticket { position: absolute; left: -18px; bottom: 25px; width: min(235px, 42%); transform: rotate(-4deg); padding: 16px 18px 17px; background: #fff7e9; box-shadow: 4px 12px 20px #52332f29; color: #2d1e23; }
.hero-ticket span { display: block; font-size: 11px; letter-spacing: .12em; font-weight: 800; border-bottom: 1px solid #baa9a0; padding-bottom: 6px; }
.hero-ticket strong { display: block; font-family: var(--display); font-size: 22px; line-height: 1.07; margin: 14px 0 8px; }
.hero-ticket small { display: block; font-size: 12px; line-height: 1.35; }

.abilities { padding: 80px 0 46px; scroll-margin-top: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 27px; }
.section-head h2 { font-size: clamp(2.4rem, 4.2vw, 4.3rem); margin: 0 0 7px; }
.section-head p { margin: 0; font-size: 16px; color: var(--muted); }
.section-head > a { color: var(--ink); text-underline-offset: 5px; white-space: nowrap; font-weight: 600; }
.ability-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #bca99f; column-gap: 34px; }
.ability { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 13px; align-items: start; min-height: 123px; padding: 20px 0 18px; border-bottom: 1px solid #bca99f; color: var(--ink); text-decoration: none; }
a.ability:hover strong { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.ability-no { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 6px; }
.ability strong { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(21px, 2vw, 26px); line-height: 1.1; }
.ability small { display: block; max-width: 43ch; margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ability-state { display: inline-block; max-width: 110px; padding: 4px 8px; margin-top: 2px; border-radius: 4px; border: 1px solid #c5b4aa; color: #66575b; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em; }
.ability-state.ready { border-color: #668c70; color: #285a3b; }
.ability-state.paused { border-color: #b88781; color: #903c40; }

.agent-story { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; padding: 40px clamp(25px, 5vw, 70px); margin: 24px 0 85px; background: #2d2029; color: #fff7ec; border-radius: 14px; }
.agent-story h2 { font-size: clamp(2rem, 3.2vw, 3.4rem); max-width: 17ch; margin-bottom: 18px; }
.agent-story p { max-width: 58ch; margin: 0; color: #e6d7cf; font-size: 15px; }
.agent-story a { color: #efb59b; text-underline-offset: 4px; }
.story-steps { display: grid; gap: 0; counter-reset: step; }
.story-steps span { display: flex; align-items: center; gap: 17px; padding: 14px 0; border-bottom: 1px solid #806b76; font-family: var(--display); font-size: 22px; }
.story-steps span::before { counter-increment: step; content: "0" counter(step); font: 700 11px/1 system-ui, sans-serif; color: #efb59b; letter-spacing: .08em; }
.story-steps span:last-child { border-bottom: 0; }
.trade-area { scroll-margin-top: 18px; }
.trade-heading { margin-bottom: 4px; }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr .9fr; min-height: 520px; }
  .hero-copy { padding: 38px; }
  .home-hero h1 { font-size: clamp(3.1rem, 7.2vw, 5rem); }
  .hero-visual { min-height: 520px; }
  .hero-visual img { height: 97%; right: -13%; bottom: -8%; }
  .hero-ticket { left: -32px; bottom: 24px; }
  .ability { grid-template-columns: 23px minmax(0, 1fr); }
  .ability-state { grid-column: 2; margin-top: -3px; }
}
@media (max-width: 700px) {
  main { padding: 12px 15px 60px; }
  nav.top { gap: 8px 14px; padding-bottom: 18px; }
  nav.top .brand { width: 100%; font-size: 25px; }
  nav.top a.link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
  .home-hero { display: flex; flex-direction: column; }
  .hero-copy { padding: 35px 26px 0; }
  .home-hero h1 { font-size: clamp(3.7rem, 15vw, 5.8rem); }
  .hero-mobile-visual { display: block; position: relative; align-self: stretch; height: 166px; overflow: hidden; margin: 18px -26px 0; background: #e9af8c; }
  .hero-mobile-visual img { position: absolute; width: 215px; height: auto; right: 20px; top: -28px; filter: drop-shadow(7px 12px 12px #4f211638); }
  .hero-intro { margin: 22px 0; }
  .hero-note { margin-top: 28px; }
  .hero-visual { display: none; }
  .hero-halo { width: 88vw; right: -13%; top: 8%; }
  .hero-visual img { height: 108%; right: 2%; bottom: -14%; }
  .hero-ticket { left: 19px; bottom: 16px; width: 175px; padding: 11px 13px; }
  .hero-ticket strong { font-size: 18px; }
  .hero-ticket small { font-size: 11px; }
  .abilities { padding-top: 60px; }
  .section-head { align-items: start; flex-direction: column; gap: 10px; }
  .section-head h2 { font-size: 2.8rem; }
  .ability-list { grid-template-columns: 1fr; }
  .ability { min-height: 0; grid-template-columns: 25px minmax(0, 1fr) auto; padding: 17px 0; }
  .ability-state { grid-column: 3; margin-top: 2px; }
  .ability small { font-size: 14px; }
  .ability-state { font-size: 12px; max-width: 120px; }
  .agent-story { grid-template-columns: 1fr; gap: 25px; padding: 32px 25px; margin-bottom: 65px; }
}
@media (max-width: 440px) {
  .ability { grid-template-columns: 25px minmax(0, 1fr); }
  .ability-state { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .hero-button { transition: none; } }
