:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #fff5fb;
  background: #100b19;
  color-scheme: dark;
  font-size: 100%;
  --background: #100b19;
  --panel: #20152c;
  --muted: #d1c0db;
  --accent: #ff87bd;
  --border: #493453;
  --portrait: url("./mira-portrait.png");
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #ffc4dc; outline-offset: 4px; }

.topbar {
  max-width: 76rem;
  margin: auto;
  min-height: 4.75rem;
  padding: .75rem clamp(1rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.wordmark { font-weight: 800; font-size: 1.5rem; letter-spacing: -.065em; }
.wordmark span { color: var(--accent); }
.topbar nav { display: flex; gap: clamp(.85rem, 3vw, 2rem); color: var(--muted); }
.topbar nav a { padding-block: .45rem; white-space: nowrap; }
.topbar nav a[aria-current] { color: #fff; box-shadow: 0 2px 0 var(--accent); }
.age { border: 1px solid var(--border); border-radius: 999px; padding: .3rem .65rem; color: var(--muted); font-size: .875rem; }
main { max-width: 76rem; margin: auto; padding: 1.2rem clamp(1rem, 4vw, 3rem) 3rem; }

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(17rem, .82fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  min-height: 36rem;
  padding: clamp(1.5rem, 5vw, 4rem);
  background: radial-gradient(ellipse at 92% 10%, #652a6a 0%, transparent 62%), linear-gradient(135deg, #261739, #171124 75%);
  border: 1px solid var(--border);
  border-radius: 2rem;
}
.hero h1 { margin: 0; font-size: clamp(3.1rem, 7vw, 6.4rem); line-height: .99; letter-spacing: -.075em; }
.hero h1 em { font: italic 1.12em/.95 Georgia, serif; color: var(--accent); letter-spacing: -.085em; }
.hero-copy p { max-width: 25rem; margin: 1.5rem 0; color: var(--muted); font-size: 1.12rem; line-height: 1.6; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .75rem 1.2rem; color: #250e25; background: linear-gradient(105deg,#ff9ab9,#f6a0ff); border: 0; border-radius: .85rem; font-weight: 750; cursor: pointer; }
.button:hover:not(:disabled) { background: #ffb3d9; }

.profile-card { display: grid; min-height: 27rem; isolation: isolate; border-radius: 1.5rem; overflow: hidden; border: 1px solid #c77eaa; background: #43244c; }
.portrait, .profile-caption { grid-area: 1/1; }
.portrait { background: linear-gradient(0deg, #160a22 0%, transparent 48%), var(--portrait) 50% 31% / cover no-repeat; transition: transform .25s; }
.profile-card:hover .portrait { transform: scale(1.025); }
.profile-caption { position: relative; align-self: end; padding: 1.4rem; }
.profile-caption span { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 750; letter-spacing: -.045em; }
.profile-caption p { margin: .35rem 0 0; color: #f1dbe9; line-height: 1.4; }

.chat { max-width: 48rem; margin: auto; background: var(--panel); border-radius: 1.35rem; border: 1px solid var(--border); overflow: hidden; }
.chat-header { display: flex; align-items: center; gap: .85rem; padding: 1.05rem; border-bottom: 1px solid var(--border); }
.chat-header h1 { margin: 0; font-size: 1.2rem; }
.chat-header p { margin: .2rem 0 0; color: var(--muted); font-size: .875rem; }
.avatar { width: 3rem; height: 3rem; border-radius: 50%; background: #6e406d var(--portrait) 50% 32% / 150% no-repeat; }
.messages { min-height: 16rem; max-height: min(55dvh, 35rem); overflow-y: auto; margin: 0; list-style: none; padding: 1.2rem; display: flex; flex-direction: column; gap: .65rem; }
.message { width: fit-content; max-width: min(85%, 32rem); border-radius: 1rem 1rem 1rem .3rem; padding: .9rem 1rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; flex-shrink: 0; }
.received { background: #402750; }
.sent { align-self: end; background: #673857; border-radius: 1rem 1rem .3rem 1rem; }
.move-label { display: block; margin-bottom: .25rem; color: #ffc4df; font-size: .875rem; }
.demo-status { margin: 0 1.15rem .65rem; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.composer { display: flex; gap: .65rem; padding: 0 1rem 1rem; }
.composer input { min-width: 0; flex: 1; padding: .75rem; background: #170f21; border: 1px solid var(--border); border-radius: .75rem; }
.composer input::placeholder { color: #d6bbdb; }
.composer button:disabled { opacity: .55; cursor: default; }
.panel { max-width: 35rem; margin: auto; background: var(--panel); padding: clamp(1.2rem, 4vw, 2rem); border: 1px solid var(--border); border-radius: 1.35rem; }
.panel h1 { margin: 0; font-size: clamp(1.45rem, 4vw, 2.1rem); }
.panel h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.panel p { color: var(--muted); overflow-wrap: anywhere; }
#auth { display: grid; gap: .9rem; }
#auth label:not(.check):not([hidden]) { display: grid; gap: .4rem; }
#auth input:not([type="checkbox"]) { width: 100%; min-height: 2.8rem; padding: .65rem; border: 1px solid var(--border); background: #170f21; border-radius: .65rem; }
.check { display: flex; align-items: start; gap: .55rem; line-height: 1.4; color: var(--muted); }
.check input { margin: .25rem 0 0; accent-color: var(--accent); }
.text-button { background: none; color: var(--accent); border: 0; cursor: pointer; min-height: 2.6rem; text-decoration: underline; }
.wallet { border: 1px solid var(--border); border-radius: .75rem; padding: .9rem; margin-bottom: .8rem; }
.wallet p, .wallet ul { margin-block: .35rem; }
.wallet ul { padding-inline-start: 1.2rem; color: var(--muted); }
.form-status:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 46rem) {
  main { padding-top: .5rem; }
  .hero { grid-template-columns: 1fr; min-height: 0; border-radius: 1.3rem; }
  .profile-card { min-height: 22rem; }
}
@media (max-width: 23rem) {
  .topbar { gap: .55rem; }
  .topbar nav { gap: .65rem; font-size: .875rem; }
  .wordmark { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .portrait { transition: none; }
}
@media (max-width: 30rem) {
  .topbar { display: grid; grid-template-columns: 1fr auto; }
  .topbar nav { grid-row: 2; grid-column: 1 / -1; }
}
