/* RAMen in the browser: the main site's night (site/assets/site.css), as a phone app. */
:root {
  color-scheme: dark;
  --ink: #070a17;
  --night: #0d1a35;
  --night-2: #13244a;
  --text: #ffffff; --muted: #dcd6ea; --faint: #b9b2cc;
  --line: rgba(255, 255, 255, .14); --line-2: rgba(255, 255, 255, .3);
  --cream: #fff3e2; --broth: #f29a43; --broth-hi: #ffb46a; --aqua: #3fe0d0;
  --shine: linear-gradient(90deg, #ffd08a 0%, #f29a43 18%, #f2a3c7 38%, #c9b6ff 55%, #3fe0d0 72%, #ffd08a 100%);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); }
body { color: var(--text); font: 400 17px/1.55 var(--font); letter-spacing: -0.011em; -webkit-font-smoothing: antialiased;
       -webkit-text-size-adjust: 100%; overscroll-behavior: none;
       background: radial-gradient(120% 60% at 50% 0%, #1b2f5e 0%, var(--night) 60%) fixed, var(--night); }
button, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
#app { height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.center-screen { align-items: center; justify-content: center; text-align: center; padding: 24px; }

h1, h2 { margin: 0; font-weight: 850; letter-spacing: -0.04em; text-wrap: balance; }
.shine { background: var(--shine); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
         color: transparent; animation: shine 9s linear infinite; }
@keyframes shine { to { background-position: 200% 0; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 26px;
       border-radius: 999px; border: 2.5px solid var(--ink); font: 780 16.5px/1 var(--font); cursor: pointer;
       text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; -webkit-tap-highlight-color: transparent; }
.btn.primary { background: var(--broth); color: #1d0c02; box-shadow: 0 5px 0 var(--ink), 0 20px 44px -16px rgba(242, 154, 67, .8); }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary[disabled] { opacity: .6; transform: none; }
.btn.line { background: rgba(255, 255, 255, .07); color: #fff; border-color: rgba(255, 255, 255, .7); box-shadow: none; }
.btn.sm { height: 40px; padding: 0 17px; font-size: 15px; border-width: 2px; }
.btn.sm.primary { box-shadow: 0 3px 0 var(--ink); }
.btn .size { font-weight: 650; opacity: .75; }
.fine { color: var(--faint); font-size: 14.5px; margin: 14px 0 0; }
.error { color: #ffb4a8; font-size: 15px; margin: 14px 0 0; }

/* first run */
.welcome { margin: auto; width: min(560px, 100% - 40px); text-align: center; padding: calc(var(--top) + 40px) 0 calc(var(--bottom) + 32px); }
.bowl { width: 112px; height: 112px; margin: 0 auto 22px; border-radius: 26px; border: 2.5px solid var(--ink);
        box-shadow: 0 6px 0 var(--ink), 0 24px 60px -20px rgba(63, 224, 208, .45); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .8; } }
.welcome h1 { font-size: clamp(36px, 10vw, 54px); line-height: 1.02; }
.lede { color: var(--muted); font-size: 18px; margin: 18px auto 0; max-width: 34ch; }
.actions { margin-top: 28px; }
.progress { margin: 26px auto 0; max-width: 360px; }
.progress .bar { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 2px solid var(--ink); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--broth); transition: width .25s; }
.install { margin: 30px auto 0; max-width: 380px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.install p { margin: 0 0 12px; }
.install a { color: var(--cream); }
.install .share { display: inline-block; vertical-align: -4px; width: 20px; height: 20px; }

/* top bar */
.bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
           padding: calc(var(--top) + 10px) 16px 10px; border-bottom: 1px solid var(--line);
           background: rgba(13, 26, 53, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font: 850 21px/1 var(--font); letter-spacing: -0.04em; }
.brand b { color: var(--broth); }
.title { flex: 1; min-width: 0; font-size: 17px; font-weight: 750; letter-spacing: -0.02em; text-align: center;
         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent;
        color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.icon:active { background: rgba(255, 255, 255, .08); }

/* the chats */
.list-wrap { flex: 1; overflow-y: auto; padding: 8px 0 calc(var(--bottom) + 24px); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list button { width: 100%; display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 15px 20px; border: 0;
               background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.list button:active { background: rgba(255, 255, 255, .05); }
.list .t { font-weight: 680; font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.list .s { color: var(--faint); font-size: 14px; }
.empty { text-align: center; padding: 18vh 32px 0; color: var(--muted); }
.empty h2 { font-size: 34px; color: #fff; margin-bottom: 10px; }
.empty p { margin: 0 auto; max-width: 30ch; }
#install2 { padding: 22px 24px 0; text-align: center; }

/* one chat */
.thread { flex: 1; overflow-y: auto; padding: 18px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 100%; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 85%; background: var(--night-2); border: 1px solid var(--line-2);
            padding: 10px 15px; border-radius: 20px 20px 6px 20px; white-space: pre-wrap; }
.msg.assistant { align-self: stretch; padding: 2px 4px; }
.msg.assistant p { margin: 0 0 10px; }
.msg.assistant p:last-child { margin-bottom: 0; }
.msg.assistant ul, .msg.assistant ol { margin: 0 0 10px; padding-left: 22px; }
.msg.assistant code { font-family: var(--mono); font-size: .88em; background: rgba(255, 255, 255, .08); padding: 1px 5px; border-radius: 6px; }
.msg.assistant pre { background: rgba(0, 0, 0, .3); border: 1px solid var(--line); padding: 10px 12px; border-radius: 12px; overflow-x: auto; }
.msg.assistant pre code { background: none; padding: 0; }
.msg.writing::after { content: ''; display: inline-block; width: 9px; height: 9px; margin-left: 4px; border-radius: 50%;
                      background: var(--broth); animation: pulse 1s ease-in-out infinite; }
.note { align-self: center; color: var(--faint); font-size: 13.5px; text-align: center; max-width: 36ch; }
.note b { color: var(--aqua); font-weight: 700; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 10px 12px calc(var(--bottom) + 10px);
            border-top: 1px solid var(--line); background: rgba(13, 26, 53, .92); }
.composer textarea { flex: 1; resize: none; max-height: 40vh; min-height: 46px; padding: 11px 16px; border-radius: 23px;
                     border: 1.5px solid var(--line-2); background: rgba(255, 255, 255, .06); outline: none; line-height: 1.4; font-size: 16.5px; }
.composer textarea:focus { border-color: var(--broth); }
.send { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ink);
        background: var(--broth); color: #1d0c02; cursor: pointer; box-shadow: 0 3px 0 var(--ink); -webkit-tap-highlight-color: transparent; }
.send:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.send[disabled] { opacity: .5; }
.send.stop { background: var(--cream); }

@media (prefers-reduced-motion: reduce) { .shine, .pulse, .msg.writing::after { animation: none; } }
