:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #1d1f24; --muted: #5d6270; --line: #e3e1da;
  --accent: #23466e; --accent-soft: #e6edf6; --bad: #b42318; --radius: 10px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
.card { max-width: 400px; margin: 8vh auto; background: var(--panel); padding: 32px;
  border: 1px solid var(--line); border-radius: var(--radius); }
h1 { margin: 0 0 6px; font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.note { background: var(--accent-soft); color: var(--accent); padding: 10px 12px; border-radius: 8px; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 10px 14px;
  border-radius: 8px; font: inherit; cursor: pointer; min-height: 44px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
#inapp { margin: 0 0 14px; font-size: 14px; }
#inapp p { margin: 0 0 4px; }
.or { text-align: center; color: var(--muted); margin: 14px 0; font-size: 14px; }
form { display: grid; gap: 10px; }
.field { display: grid; gap: 4px; font-size: 14px; color: var(--muted); margin-top: 6px; }
input[type=email], input[type=password], input[type=text] { font: inherit; font-size: 16px; padding: 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); width: 100%; }
input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.link { background: none; border: 0; padding: 4px 0; color: var(--accent); font: inherit; font-size: 14px;
  cursor: pointer; text-decoration: underline; }
.invite { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.invite summary { cursor: pointer; color: var(--accent); font-size: 15px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14px; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.check a { color: var(--accent); }
.err { color: var(--bad); min-height: 1.5em; margin: 14px 0 0; }
@media (max-width: 480px) { .card { margin: 0; min-height: 100vh; border: 0; border-radius: 0; padding: 24px 18px; } }

/* ── The sign-in page: a gate in the void (login.html, body.void; the ring itself is gate.js). Scoped so me.html,
   which shares this file, keeps the card styles above. Words appear only when needed. ── */
body.void {
  --abyss: #05040f; --deep: #120c33; --haze: #2a1d5c;
  --ice: #8fe3ff; --lilac: #b9a2ff; --ember: #ffc9a3; --aurora: #7af0c8; --rose: #ff9aa8;
  --mist: rgba(222, 216, 245, .74); --glass: rgba(255, 255, 255, .05); --rim: rgba(255, 236, 210, .18);
  --px: 0px; --py: 0px; --lidv: 50%;
  color-scheme: dark; /* native bits (autofill, checkbox, password eye, suggestion list) render dark, never white */
  margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  color: #f1eeff; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse 70% 55% at 50% 36%, var(--haze) 0%, var(--deep) 48%, var(--abyss) 100%) fixed;
  overflow-x: hidden;
}
body.void::before { /* far dust */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .55;
  background:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 14%, #d9d2ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 78%, #bfefff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 84%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 52%, #ffe2cf 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 58%, #d9d2ff 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 6%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 94%, #bfefff 50%, transparent 51%);
}
body.void::after { /* grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.void .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.void svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.void svg .dot { fill: currentColor; }

.void .stage { position: relative; z-index: 1; width: min(100% - 32px, 340px); padding: 6vh 0 8vh;
  display: flex; flex-direction: column; align-items: center; gap: 30px; }

/* the gate: gate.js draws the ring on a full-screen canvas (canvas.lyra-gate-sky, anchored on
   #iris). The button itself is only the round hit area, plus the face when someone is signed in. */
.void .eye { --size: min(72vw, 320px, 42vh); position: relative; width: var(--size); height: var(--size);
  padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; color: inherit;
  -webkit-tap-highlight-color: transparent; }
.void .eye:focus-visible { outline: 1px solid rgba(255, 220, 175, .7); outline-offset: 10px; }
.void .eye:disabled { cursor: progress; }
/* no WebGL: a still ring in CSS, so the page still reads as a gate */
html:not(.lyra-gate-on) .void .rim { position: absolute; inset: 7%; border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255, 246, 232, .9), 0 0 18px 4px rgba(255, 210, 154, .45),
    0 0 60px 14px rgba(185, 162, 255, .25), inset 0 0 40px 6px rgba(159, 230, 255, .18);
  background: radial-gradient(circle, rgba(255, 244, 228, .9) 0 3%, rgba(255, 214, 160, .25) 9%, rgba(13, 8, 40, .4) 40%, transparent 70%); }
html:not(.lyra-gate-on) .void .stage[data-lid="low"] .rim { opacity: .35; }
.void .pupil { position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; border-radius: 50%;
  translate: calc(-50% + var(--px)) calc(-50% + var(--py)); overflow: hidden; pointer-events: none;
  transition: translate .35s ease-out, scale .7s cubic-bezier(.6, 0, .2, 1); }
.void .pupil:has(img:not([hidden])) { box-shadow: 0 0 0 1px rgba(255, 240, 220, .55), 0 0 30px 8px rgba(255, 214, 160, .35); }
.void .pupil img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .9; filter: saturate(.85); animation: rise .6s ease both; }
.void .stage[data-state="error"] .orbs, .void .stage[data-state="error"] .veil { animation: shudder .5s ease; }
.void .stage[data-state="open"] .pupil { scale: 1.6; }

/* the light you step into on success */
.void .portal { position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(circle at 50% var(--cy, 36%), #fffaf2 0%, #ffe6c4 18%, #c9b4ff 46%, #1a1145 78%, var(--abyss) 100%);
  clip-path: circle(0 at 50% var(--cy, 36%)); transition: clip-path 1s cubic-bezier(.7, 0, .3, 1) .2s; }
body.void.through .portal { clip-path: circle(150% at 50% var(--cy, 36%)); }

/* controls */
.void .controls { display: flex; flex-direction: column; align-items: center; width: 100%; }
.void .orbs { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 3vw, 22px);
  animation: rise .45s ease both; }
.void .stage:not([data-woke]) .orbs { animation: rise 1s ease 1.2s both; }
.void .orb, .void .glyph { position: relative; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--rim); background: var(--glass); color: #e9e4ff; cursor: pointer; padding: 0;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .25s, box-shadow .25s, transform .25s; -webkit-tap-highlight-color: transparent; }
.void .orb { width: 58px; height: 58px; }
.void .glyph { width: 44px; height: 44px; color: var(--mist); }
.void .glyph svg { width: 19px; height: 19px; }
.void .orb:hover, .void .glyph:hover { border-color: rgba(255, 214, 160, .55);
  box-shadow: 0 0 24px rgba(255, 210, 154, .18); transform: translateY(-1px); }
.void .orb:focus-visible, .void .glyph:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.void .orb:disabled, .void .glyph:disabled { opacity: .45; cursor: progress; transform: none; }
.void .glyph.go { color: #fff; border-color: rgba(255, 220, 175, .5);
  background: linear-gradient(180deg, rgba(255, 226, 190, .14), rgba(255, 255, 255, .04)); }
.void .glyph[aria-pressed="true"] { color: var(--aurora); border-color: rgba(122, 240, 200, .55); }
.void .badge { position: absolute; right: -5px; bottom: -5px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: var(--deep); border: 1px solid var(--rim); color: var(--ice); }
.void .badge svg { width: 15px; height: 15px; }
.void .glyphs { display: flex; justify-content: center; gap: 16px; margin-top: 8px; }

/* fields: a line, a glyph, no labels */
.void .veil { width: 100%; display: grid; gap: 14px; animation: rise .5s ease both; }
.void .line { display: flex; align-items: center; gap: 12px; color: var(--mist);
  border-bottom: 1px solid var(--rim); padding: 2px 2px 0; transition: border-color .3s, box-shadow .3s; }
.void .line:focus-within { border-color: var(--ember); box-shadow: 0 10px 18px -16px var(--ember); color: #fff; }
.void .line svg { flex: none; width: 19px; height: 19px; }
.void .line input { flex: 1; min-width: 0; border: 0; border-radius: 0; background: transparent; padding: 12px 0;
  color: #f6f3ff; font: inherit; font-size: 17px; letter-spacing: .02em; caret-color: var(--ember); outline: none; }
.void .line input::placeholder { color: rgba(214, 208, 240, .28); letter-spacing: .12em; }
/* Chrome/Edge/Safari paint autofilled fields with their own light box (light-dark(#e8f0fe, …) !important) — the
   "white box" after a failed sign-in, when the browser fills the saved email back in (2026-11-07). Clip that paint to
   the glyphs (invisible under the text fill), and keep the long-transition trick for older engines. */
.void .line input:-webkit-autofill, .void .line input:-webkit-autofill:hover, .void .line input:-webkit-autofill:focus,
.void .line input:autofill { -webkit-text-fill-color: #f6f3ff; caret-color: var(--ember);
  -webkit-background-clip: text; background-clip: text; box-shadow: none;
  transition: background-color 99999s ease-out 0s; }
.void .check { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 0; font-size: 13px; color: var(--mist); }
.void .check input { margin-top: 2px; width: 17px; height: 17px; flex: none; accent-color: var(--lilac); }
.void .check a { color: var(--ice); }

/* the only words: whispers that appear when something needs saying */
.void .whisper { margin: 0; max-width: 32ch; text-align: center; font-size: 14px; color: var(--mist);
  letter-spacing: .01em; }
.void .whisper.small { font-size: 12.5px; opacity: .8; }
.void .whisper b { color: #f1eeff; font-weight: 600; white-space: nowrap; }
.void .device { justify-items: center; }
.void .device-code { margin: 4px 0; font: 600 34px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .14em; color: #fff; text-shadow: 0 0 22px rgba(255, 214, 160, .35); user-select: all; }
@media (max-width: 380px) { .void .orb { width: 52px; height: 52px; } }
.void .whisper.err { min-height: 1.5em; color: var(--rose); }
.void .whisper.err:empty { visibility: hidden; }
.void #signedin .whisper { color: #f1eeff; font-size: 15px; }

@keyframes rise { from { opacity: 0; translate: 0 10px; } }
@keyframes shudder { 20% { translate: -7px 0; } 45% { translate: 6px 0; } 70% { translate: -3px 0; } }

@media (prefers-reduced-motion: reduce) {
  .void .orbs, .void .veil, .void .pupil img { animation: none; }
  .void .stage[data-state="error"] .orbs, .void .stage[data-state="error"] .veil { animation: none; }
  .void .pupil, .void .portal { transition: none; }
}

/* ── The Jia sign-in page (login-jia.html, body.hearth): a warm card and a lit house.
   Served instead of the eye when ?next= points into /jia/. Same ids, same login.js. ── */
body.hearth {
  --cream: #fbf5ec; --paper: #fffdf9; --ink: #3a2e28; --soft: #85746a; --edge: #ecdfd0;
  --persimmon: #d9693f; --persimmon-dark: #b9532e; --lamp: #f5c15a; --sage: #8fae8b; --rose: #c2412d;
  --abyss: var(--cream); /* the success fade (.portal) goes warm, not dark */
  margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  color: var(--ink);
  font: 16px/1.55 -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, #fde7cf 0%, rgba(253, 231, 207, 0) 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, #eef3e6 0%, rgba(238, 243, 230, 0) 70%),
    var(--cream);
}
.hearth .stage { width: min(100% - 32px, 380px); padding: 5vh 0 6vh; display: flex; flex-direction: column;
  align-items: center; position: relative; z-index: 1; }
.hearth svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

/* the house: a lamp in the window while you wait, a little smoke */
.hearth .home-mark { pointer-events: none; border: 0; background: none; padding: 0; margin: 0 0 6px;
  width: 112px; height: 98px; position: relative; color: var(--ink); }
.hearth .house { width: 100%; height: 100%; stroke-width: 4; }
.hearth .roof { stroke: var(--persimmon); stroke-width: 6; }
.hearth .walls, .hearth .door { stroke: var(--ink); }
.hearth .chimney { stroke: var(--ink); fill: var(--paper); }
.hearth .window { fill: var(--lamp); stroke: var(--ink); transition: fill .4s; }
.hearth .smoke { stroke: #c9b8a8; stroke-width: 3; animation: smoke 3.6s ease-in-out infinite; }
.hearth #face { position: absolute; left: 29%; top: 56%; width: 18%; height: 19%; object-fit: cover;
  border-radius: 3px; }
.hearth .stage[data-state="busy"] .window { animation: lamp 1s ease-in-out infinite; }
.hearth .stage[data-state="open"] .window { fill: #ffd98a; }

.hearth .hello { margin: 4px 0 0; font-size: 30px; font-weight: 650; letter-spacing: .04em; }
.hearth .sub { margin: 2px 0 22px; color: var(--soft); font-size: 15px; letter-spacing: .03em; }

.hearth .card, .hearth .card[class] { width: 100%; max-width: none; min-height: 0; margin: 0; background: var(--paper);
  border: 1px solid var(--edge); border-radius: 22px; padding: 24px 22px 20px; box-shadow: 0 18px 40px -26px rgba(98, 62, 34, .45), 0 2px 6px rgba(98, 62, 34, .05);
  animation: settle .5s ease both; }
.hearth form { display: grid; gap: 14px; }
.hearth .field { display: grid; gap: 6px; font-size: 14px; color: var(--soft); }
.hearth .field input { font: inherit; font-size: 17px; color: var(--ink); background: #fff;
  border: 1.5px solid var(--edge); border-radius: 14px; padding: 12px 14px; width: 100%;
  transition: border-color .2s, box-shadow .2s; }
.hearth .field input:focus { outline: none; border-color: var(--persimmon);
  box-shadow: 0 0 0 4px rgba(217, 105, 63, .14); }
.hearth .field input::placeholder { color: #c4b6aa; }

.hearth .primary { margin-top: 4px; width: 100%; min-height: 50px; border: 0; border-radius: 14px;
  background: var(--persimmon); color: #fff; font: inherit; font-size: 17px; font-weight: 600;
  letter-spacing: .2em; cursor: pointer; transition: background .2s, transform .1s; }
.hearth .primary:hover { background: var(--persimmon-dark); }
.hearth .primary:active { transform: scale(.985); }
.hearth .primary:focus-visible, .hearth .google:focus-visible, .hearth .link:focus-visible {
  outline: 3px solid rgba(217, 105, 63, .35); outline-offset: 2px; }
.hearth .stage[data-state="busy"] .primary { opacity: .65; cursor: progress; }
.hearth button:disabled { cursor: progress; }

.hearth .row { display: flex; justify-content: space-between; gap: 12px; }
.hearth .row.center { justify-content: center; margin-top: 10px; }
.hearth .link { background: none; border: 0; padding: 6px 2px; color: var(--soft); font: inherit;
  font-size: 14px; cursor: pointer; text-decoration: none; }
.hearth .link:hover, .hearth .link[aria-pressed="true"] { color: var(--persimmon-dark); }

.hearth #invite { display: grid; gap: 12px; margin-top: 12px; } /* its own card: it stays when #signin hides */
.hearth .check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--soft); }
.hearth .check input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--persimmon); }
.hearth .check a { color: var(--persimmon-dark); }

.hearth .or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: #b3a397; font-size: 13px; }
.hearth .or::before, .hearth .or::after { content: ""; flex: 1; height: 1px; background: var(--edge); }
.hearth .google { position: relative; width: 100%; min-height: 48px; display: flex; align-items: center;
  justify-content: center; gap: 10px; border: 1.5px solid var(--edge); border-radius: 14px; background: #fff;
  color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; transition: border-color .2s; }
.hearth .google:hover { border-color: #d8c6b3; }
.hearth .google svg { width: 18px; height: 18px; }
.hearth .badge { font-size: 12px; color: var(--soft); }

.hearth #signedin { text-align: center; }
.hearth #signedin .whisper { margin: 0; color: var(--soft); font-size: 14px; }
.hearth .who { margin: 2px 0 16px; font-size: 17px; font-weight: 600; word-break: break-all; }

.hearth .whisper { margin: 14px 0 0; max-width: 34ch; text-align: center; font-size: 14px; color: var(--soft); }
.hearth .whisper.err { min-height: 1.5em; color: var(--rose); }
.hearth .whisper.err:empty { visibility: hidden; }
.hearth .stage[data-state="error"] .card { animation: nudge .4s ease; }

.hearth .portal { position: fixed; inset: 0; z-index: 5; pointer-events: none; background: var(--cream);
  opacity: 0; transition: opacity .5s ease .2s; }
body.hearth.through .portal { opacity: 1; }

@keyframes smoke { 0%, 100% { opacity: .2; transform: translateY(2px); } 50% { opacity: .9; transform: translateY(-3px); } }
@keyframes beat { 50% { transform: scale(1.25); } }
@keyframes lamp { 50% { fill: #ffd98a; } }
@keyframes settle { from { opacity: 0; transform: translateY(8px); } }
@keyframes nudge { 25% { transform: translateX(-6px); } 60% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .hearth .smoke, .hearth .card, .hearth .stage[data-state="busy"] .window, .hearth .stage[data-state="error"] .card { animation: none; }
  .hearth .portal { transition: none; }
}
