@font-face{font-family:'Hanken Grotesk';src:url(/static/fonts/hanken-grotesk.woff2) format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:'Hanken Grotesk';src:url(/static/fonts/hanken-grotesk-italic.woff2) format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:'Pixelify Sans';src:url(/static/fonts/pixelify-sans.woff2) format('woff2');font-weight:400 700;font-display:swap}

:root{
  color-scheme:dark;
  --night:#140f16;--plum:#1d1620;--cream:#f3e6da;--muted:#b9a2ad;--faint:rgba(243,230,218,.28);--hair:rgba(243,230,218,.12);--pink:#ff8fbf;--error:#f6a9b9;
  --text:'Hanken Grotesk',system-ui,sans-serif;--pixel:'Pixelify Sans',ui-monospace,monospace;
  --edge:clamp(18px,2.6vw,40px);--ease:cubic-bezier(.22,.7,.2,1);
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden;background:var(--night);color:var(--cream);font-family:var(--text);-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit;cursor:pointer}
button:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--pink);outline-offset:4px}
.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}
[hidden]{display:none!important}

/* Text links instead of pills: pixel type with a hard two-pixel underline that steps in on hover. */
.link{background:none;border:0;border-radius:0;padding:4px 0;font-family:var(--pixel);font-size:15px;letter-spacing:.05em;line-height:1.2;color:var(--cream);
  text-shadow:0 1px 0 rgba(0,0,0,.55);box-shadow:inset 0 -2px 0 transparent;transition:box-shadow .15s steps(2),color .15s}
.link:hover{box-shadow:inset 0 -2px 0 var(--pink)}
.link:disabled{opacity:.45;cursor:default;box-shadow:none}
.label{margin:0;font-family:var(--pixel);font-weight:400;font-size:13px;letter-spacing:.12em;text-transform:lowercase;color:var(--pink)}

/* The room is the page. scene.js crops the 640x360 grid to cover this box and moves the camera. */
#scene{position:fixed;inset:0;width:100%;height:100%;display:block}
.shade{position:fixed;inset:0;pointer-events:none;opacity:0;transition:opacity .8s var(--ease);
  background:linear-gradient(90deg,rgba(20,15,22,.9) 0%,rgba(20,15,22,.72) 30%,rgba(20,15,22,0) 56%)}
body[data-state=talking] .shade{opacity:1}

.top{position:fixed;top:0;left:0;right:0;display:flex;justify-content:space-between;align-items:center;padding:var(--edge);pointer-events:none;z-index:3}
.top>*{pointer-events:auto}
.mark{margin:0;font-family:var(--pixel);font-weight:500;font-size:clamp(30px,2.9vw,46px);line-height:1;letter-spacing:.1em;text-shadow:0 2px 0 rgba(0,0,0,.5)}
.top .link{font-size:clamp(15px,1.15vw,18px)}

/* Watching: a quiet invitation, bottom left. */
.hint{position:fixed;left:var(--edge);bottom:var(--edge);display:flex;align-items:center;gap:10px;background:none;border:0;padding:6px 0;
  font-family:var(--pixel);font-size:15px;letter-spacing:.04em;color:var(--cream);text-shadow:0 1px 0 rgba(0,0,0,.6);transition:opacity .5s var(--ease);z-index:2}
.caret{width:9px;height:17px;background:var(--pink);animation:blink 1.1s steps(1) infinite}
@keyframes blink{50%{opacity:0}}
body[data-state=talking] .hint{opacity:0;pointer-events:none}

.status{position:fixed;right:var(--edge);bottom:var(--edge);margin:0;font-family:var(--pixel);font-size:13px;letter-spacing:.05em;color:var(--muted);text-transform:lowercase;text-shadow:0 1px 0 rgba(0,0,0,.6);z-index:2}

/* Talking: the camera moves her right and the left column becomes the conversation. */
.talk{position:fixed;left:calc(var(--edge) + 1vw);top:0;bottom:0;width:min(560px,40vw);display:flex;flex-direction:column;justify-content:center;gap:22px;
  opacity:0;pointer-events:none;transform:translateX(-12px);transition:opacity .6s var(--ease),transform .8s var(--ease);z-index:2}
body[data-state=talking] .talk{opacity:1;pointer-events:auto;transform:none;transition-delay:.25s}
.lines{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:18px}
.lines li{transition:filter .6s var(--ease),opacity .6s var(--ease)}
/* The exchange before the current one stays readable; only older lines fade back. */
.lines li.past{filter:blur(.4px);opacity:.68}
.lines li.older{filter:blur(1.6px);opacity:.4}
.lines li.gone{display:none}
.lines .her{font-size:clamp(22px,2.05vw,34px);line-height:1.22;font-weight:430;letter-spacing:-.01em;text-wrap:pretty;white-space:pre-wrap;overflow-wrap:anywhere}
.lines .you{font-size:clamp(14px,1.1vw,17px);line-height:1.45;color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere}
.lines .you::before{content:'you — ';font-family:var(--pixel);font-size:.85em;letter-spacing:.04em;color:var(--faint)}
.lines .her[data-streaming]::after{content:'';display:inline-block;width:.42em;height:.9em;margin-left:.12em;vertical-align:-.08em;background:var(--cream);animation:blink 1.1s steps(1) infinite}

.reply-link{display:block;width:max-content;margin-top:12px;font-family:var(--pixel);font-size:15px;font-weight:400;letter-spacing:.05em;color:var(--pink);text-decoration:none;box-shadow:inset 0 -2px 0 transparent;transition:box-shadow .15s steps(2)}
.reply-link:hover{box-shadow:inset 0 -2px 0 var(--pink)}
.about .reply-link{margin-top:6px;font-size:13px}

/* First-visit starters: a short list of things to say, not buttons. */
.starters{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
.starter{background:none;border:0;padding:5px 0;text-align:left;font-family:var(--text);font-size:clamp(15px,1.15vw,18px);line-height:1.35;color:var(--muted);transition:color .15s}
.starter::before{content:'→ ';font-family:var(--pixel);color:var(--faint);transition:color .15s}
.starter:hover,.starter:focus-visible{color:var(--cream)}
.starter:hover::before,.starter:focus-visible::before{color:var(--pink)}

.say{display:flex;align-items:flex-end;gap:14px;border-bottom:2px solid var(--faint);padding-bottom:6px}
.say:focus-within{border-color:rgba(243,230,218,.6)}
#message{flex:1;min-width:0;resize:none;background:transparent;border:0;outline:none;color:var(--cream);font:inherit;font-size:clamp(16px,1.25vw,19px);line-height:1.4;padding:8px 0;max-height:7.5em;caret-color:var(--pink)}
#message::placeholder{color:var(--muted);opacity:.8}
#message:disabled{opacity:.6}
.enter{flex:none;background:none;border:0;padding:8px 0;font-family:var(--pixel);font-size:13px;letter-spacing:.05em;color:var(--muted);transition:color .15s}
.enter:hover:not(:disabled){color:var(--pink)}
.enter:disabled{opacity:.35;cursor:default}
.error{margin:0;font-size:14px;line-height:1.5;color:var(--error)}

.back{position:fixed;left:var(--edge);bottom:var(--edge);z-index:3;opacity:0;pointer-events:none;transition:opacity .4s var(--ease),box-shadow .15s steps(2)}
body[data-state=talking] .back{opacity:1;pointer-events:auto;transition-delay:.4s,0s}

.notice{position:fixed;left:var(--edge);top:calc(var(--edge) + clamp(30px,2.9vw,46px) + 18px);max-width:min(360px,calc(100vw - 2*var(--edge)));display:flex;flex-wrap:wrap;align-items:center;gap:4px 18px;
  padding:14px 16px;background:rgba(29,22,32,.9);border-left:2px solid var(--pink);z-index:4}
.notice p{flex-basis:100%;margin:0 0 4px;font-size:13px;line-height:1.55;color:var(--muted)}
.notice .link{font-size:13px}
body[data-state=talking] .notice{display:none}

/* About: everything that isn't the conversation, in one quiet drawer. */
.about{position:fixed;top:0;right:0;bottom:0;width:min(440px,100vw);overflow:auto;overscroll-behavior:contain;padding:var(--edge);background:var(--plum);
  border-left:2px solid var(--hair);box-shadow:-24px 0 60px rgba(0,0,0,.45);z-index:5;display:flex;flex-direction:column;gap:28px;animation:slide .35s var(--ease)}
@keyframes slide{from{transform:translateX(28px);opacity:0}}
.about-head{display:flex;justify-content:space-between;align-items:center}
.about-intro{display:grid;grid-template-columns:64px 1fr;column-gap:16px;row-gap:14px;align-items:center}
.portrait{width:64px;height:64px;image-rendering:pixelated}
.about h2{margin:0;font-family:var(--pixel);font-weight:500;font-size:34px;line-height:1;letter-spacing:.1em}
.about .lede{grid-column:1/-1;margin:0;font-size:17px;line-height:1.55}
.about .made{grid-column:1/-1;margin:0;font-family:var(--pixel);font-size:14px;letter-spacing:.04em;color:var(--muted)}
.about .made a{color:var(--cream);text-decoration:none;box-shadow:inset 0 -2px 0 var(--pink)}
.about section{display:flex;flex-direction:column;gap:10px;padding-top:18px;border-top:2px solid var(--hair)}
.about .small{margin:0;font-size:13px;line-height:1.6;color:var(--muted)}
.about .meta{margin:0;font-family:var(--pixel);font-size:12px;letter-spacing:.05em;color:var(--muted)}
.about .foot{margin-top:auto;padding-top:8px;opacity:.7}
.about ol{list-style:none;margin:0;padding:0 6px 0 0;max-height:38vh;overflow:auto}
.about li.exchange{padding:12px 0;border-bottom:1px solid var(--hair);display:grid;gap:6px}
.about li.exchange:first-child{padding-top:2px}
.about .msg{white-space:pre-wrap;overflow-wrap:anywhere}
.about .msg strong{display:block;margin-bottom:2px;font-family:var(--pixel);font-weight:400;font-size:11px;letter-spacing:.08em;text-transform:lowercase;color:var(--muted)}
.about .msg[data-role=user] span{font-size:14px;line-height:1.5;color:var(--muted)}
.about .msg[data-role=assistant] span{font-size:16px;line-height:1.5}
.about .msg[data-role=assistant] strong{color:var(--pink)}
.about .empty{padding-top:2px}
/* A pixel checkbox to match. */
.toggle{display:flex;gap:12px;align-items:center;font-family:var(--pixel);font-size:14px;letter-spacing:.04em;min-height:36px;cursor:pointer}
.toggle input{appearance:none;-webkit-appearance:none;margin:0;width:16px;height:16px;border:2px solid var(--cream);background:transparent;cursor:pointer;box-shadow:inset 0 0 0 2px var(--plum)}
.toggle input:checked{background:var(--pink)}
.top .links{display:flex;gap:clamp(18px,2vw,30px)}
/* Feedback: the chat input's underline field, a few lines tall, in the About panel. */
.note{display:flex;flex-direction:column;gap:8px}
#feedback-text{resize:vertical;min-height:4.6em;max-height:14em;background:transparent;border:0;border-bottom:2px solid var(--faint);outline:none;color:var(--cream);font:inherit;font-size:15px;line-height:1.5;padding:6px 0;caret-color:var(--pink)}
#feedback-text:focus{border-color:rgba(243,230,218,.6)}
#feedback-text::placeholder{color:var(--muted);opacity:.8}
.note-foot{display:flex;justify-content:space-between;align-items:center;gap:12px}
.danger{align-self:flex-start;color:var(--error)}
.danger:hover{box-shadow:inset 0 -2px 0 var(--error)}

/* Phones and tall windows: the room fills the screen as a portrait close-up of her at the desk; when you
   talk, the conversation fades in over the lower part on a dark gradient, and her face stays visible above. */
@media (max-aspect-ratio:4/5){
  .shade{background:linear-gradient(180deg,rgba(20,15,22,0) 34%,rgba(20,15,22,.8) 56%,rgba(20,15,22,.95) 100%)}
  .mark{font-size:28px}
  .talk{left:20px;right:20px;width:auto;top:auto;bottom:0;max-height:58dvh;justify-content:flex-end;padding-bottom:calc(14px + env(safe-area-inset-bottom));gap:14px}
  .lines{overflow:auto}
  .lines .her{font-size:20px}
  .hint{bottom:calc(var(--edge) + env(safe-area-inset-bottom));text-shadow:0 1px 0 rgba(0,0,0,.8),0 0 10px rgba(0,0,0,.6)}
  .status{top:calc(var(--edge) + 42px);bottom:auto;left:var(--edge);right:auto}
  .back{top:calc(var(--edge) + 38px);bottom:auto;left:auto;right:var(--edge)}
  .notice{top:auto;bottom:calc(var(--edge) + 44px + env(safe-area-inset-bottom))}
  body[data-state=talking] .status{display:none}
  .about{width:100vw;border-left:0}
}

/* Loading screen (boot.js). Without script it still lifts itself after 8s. */
.boot{position:fixed;inset:0;z-index:10;display:grid;grid-template-rows:1fr 1fr;row-gap:.6em;padding:0 var(--edge);background:var(--night);
  font-family:var(--pixel);font-size:clamp(19px,3.4vw,52px);line-height:1.15;letter-spacing:.04em;color:var(--cream);
  transition:opacity .6s var(--ease);animation:boot-gone 0s 8s forwards}
.boot-text{visibility:hidden;margin-left:30%}
.boot-text:first-child{align-self:end}
.boot-text:last-child{align-self:start;margin-left:42%}
.boot-text p{margin:0;white-space:pre}
.boot.playing .boot-text{visibility:visible}
.boot-text span{opacity:0}
.boot-text span.on{opacity:1}
.boot-text span.glitch{color:var(--pink)}
.boot.lifted{opacity:0;pointer-events:none}
@keyframes boot-gone{to{opacity:0;visibility:hidden}}
/* The reveal: the whole page switches on like a CRT, dot → line → full picture under a white flash that fades.
   No filter on body: it would change fixed positioning and the scene's camera framing. */
body.power-on{animation:power-on .75s linear both}
body.power-on::before,body.power-on::after{content:'';position:fixed;inset:0;z-index:11;pointer-events:none}
body.power-on::before{background:repeating-linear-gradient(0deg,rgba(0,0,0,.35) 0 1px,transparent 1px 3px);animation:power-scan .75s linear both}
body.power-on::after{background:#fff;animation:power-flash .75s linear both}
@keyframes power-on{
  0%{clip-path:inset(50% 50%)}
  10%{clip-path:inset(calc(50% - 2px) calc(50% - 2px))}
  30%{clip-path:inset(calc(50% - 1px) 0);animation-timing-function:cubic-bezier(.2,.9,.25,1)}
  62%,100%{clip-path:inset(0)}}
@keyframes power-flash{0%,30%{opacity:1}62%{opacity:.12}100%{opacity:0}}
@keyframes power-scan{0%,55%{opacity:1}100%{opacity:0}}
@media (max-width:700px){.boot-text{margin-left:0}.boot-text:last-child{margin-left:18%}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}
body.reduce-motion *,body.reduce-motion *::before,body.reduce-motion *::after{transition:none!important;animation:none!important}
