/* The Rune desktop: speckled sky, carved runes, glass windows, the chat and the taskbar.
 * One file for every page (the app, its login, the preorder page), so they always look like one product.
 * Served as desk.css by both sites; page-specific styles go in each page's own file.
 * Every colour is a variable below, so the member app's themes (member/public/themes.css) can change them.
 * These values are the default look, the one the preorder page and the login always show. */
:root {
  --bg: #0f0d15; --glass: #17141fee; --glass-2: #1f1a2b; --line: #2a2536; --text: #ece8f3; --muted: #a39cb3; --faint: #6f6784;
  --accent: #a48bff; --accent-2: #7c5cff; --accent-soft: #a48bff22; --good: #7ee2a8; --error: #ff8f8f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  /* the sky's glow, the carved runes, and glass that has gone solid (weak devices, a window being dragged) */
  --sky-glow: radial-gradient(120% 90% at 70% 10%, #120f1b, #0b0a10 60%); --rune: #b39dff; --glass-solid: #19152a;
  --win-shadow: 0 1px 0 #ffffff0d inset, 0 24px 70px #000a; --win-shadow-focus: 0 1px 0 #ffffff12 inset, 0 24px 80px #000c, 0 0 40px #7c5cff22;
  --bar-shadow: 0 10px 40px #0008;
  /* the accent at different strengths, for borders */
  --accent-44: #a48bff44; --accent-55: #a48bff55; --accent-66: #a48bff66; --accent-88: #a48bff88;
  /* her bubbles, text fields, links and light text on dark */
  --bubble: #221d30; --field: #0f0d15; --link: #d9ceff; --soft: #e6ddff; --you-text: #fff; --on-accent: #140f22; --code-bg: #0003;
  --fail-bg: #3a1f28; --fail-text: #ffc9c9; --close-bg: #ff6b6b22; --close-text: #ffb3b3;
  --stop-bg: #2a2338; --stop-hover: #3a2f4f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--sky-glow) fixed, var(--bg); color: var(--text); font: 16px/1.5 var(--sans); }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* carved runes */
.rn { overflow: visible; fill: none; stroke: var(--rune); stroke-width: 10; stroke-linecap: butt; stroke-linejoin: miter; flex: none; }
.rn .stone { filter: url(#carve); }
.rn .aura { filter: url(#aura); opacity: .6; animation: breathe 4.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.carving .stone, .carving .aura { stroke-dasharray: 190; stroke-dashoffset: 190; animation: carvein 2.8s cubic-bezier(.55,0,.25,1) infinite; }
.carving .aura { animation-name: carvein, breathe; animation-duration: 2.8s, 2.8s; }
@keyframes carvein { 0% { stroke-dashoffset: 190; opacity: 1; } 55% { stroke-dashoffset: 0; } 80% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }

/* the desktop */
#desk { position: relative; z-index: 1; height: 100%; }
.win { position: absolute; display: flex; flex-direction: column; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--win-shadow); }
.win.focused { border-color: var(--accent-55); box-shadow: var(--win-shadow-focus); }
.win.opening { animation: open .38s cubic-bezier(.2,.9,.3,1.15); }
@keyframes open { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.bar { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border-bottom: 1px solid var(--line); user-select: none; -webkit-user-select: none; touch-action: none; flex: none; }
body.desktop .bar { cursor: grab; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none !important; }
body.dragging iframe { pointer-events: none; }
.bar .rn { width: 22px; height: 22px; }
.bar b { font: 600 15px var(--serif); display: block; line-height: 1.25; }
.bar small { color: var(--muted); font-size: 12px; }
.bar .title { min-width: 0; } .bar .title b, .bar .title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 30px; text-align: center; text-decoration: none; flex: none; }
.x + .x { margin-left: 0; }
.x:hover { background: var(--accent-soft); color: var(--text); }
.x.close:hover { background: var(--close-bg); color: var(--close-text); }
.status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); margin-right: 6px; vertical-align: 1px; }
.status.off::before { background: var(--error); box-shadow: 0 0 8px var(--error); }

/* chat */
.msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 7px; font-size: 15px; }
.m { max-width: 86%; padding: 8px 12px; border-radius: 16px; animation: pop .3s ease-out; overflow-wrap: anywhere; white-space: pre-wrap; }
.instant .m, .m.old { animation: none; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.m.rune { align-self: flex-start; background: var(--bubble); border-bottom-left-radius: 5px; }
.m.you { align-self: flex-end; background: var(--accent-2); color: var(--you-text); border-bottom-right-radius: 5px; }
/* typed while she was working: waits for her to finish, then she reads them all together */
.m.you.queued { opacity: .72; }
.m.you.queued::after { content: " · she'll read this next"; font-size: 11px; opacity: .8; }
.m.you.unsent { background: var(--fail-bg); color: var(--fail-text); }
.m.you.unsent::after { content: " · not sent"; font-size: 11px; }
.m a { color: var(--link); }
.m.you a { color: var(--you-text); }
.m code { font: 13px var(--mono); background: var(--code-bg); padding: 1px 5px; border-radius: 5px; }
.m pre { font: 12.5px/1.5 var(--mono); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 6px 0 0; overflow-x: auto; white-space: pre; }
.m.fail { background: var(--fail-bg); color: var(--fail-text); }
.day { align-self: center; font-size: 12px; color: var(--faint); margin: 6px 0 2px; }
.thinking { align-self: flex-start; display: flex; align-items: center; gap: 9px; padding: 7px 13px 7px 9px; background: var(--bubble); border-radius: 16px; border-bottom-left-radius: 5px; color: var(--muted); font-size: 13px; }
.thinking .rn { width: 22px; height: 22px; }
.made-card { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; max-width: 86%; }
.file { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; background: var(--field); border: 1px solid var(--line); border-radius: 10px; font: 13px var(--sans); color: var(--link); cursor: pointer; }
.file:hover { border-color: var(--accent-66); }
.file em { font-style: normal; color: var(--good); font-size: 11px; }
.compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); flex: none; }
.compose textarea { flex: 1; min-width: 0; resize: none; max-height: 160px; font: 15px/1.4 var(--sans); color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px; }
.compose button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-size: 18px; cursor: pointer; flex: none; }
.compose button:disabled { opacity: .5; cursor: default; }
.compose button.stop { background: var(--stop-bg); color: var(--soft); border: 1px solid var(--accent-66); font-size: 14px; }
.compose button.stop:hover { background: var(--stop-hover); }
.earlier { align-self: center; font: 13px var(--sans); color: var(--muted); background: var(--field); border: 1px solid var(--line); border-radius: 99px; padding: 5px 14px; cursor: pointer; margin-bottom: 6px; }
.earlier:hover { color: var(--text); border-color: var(--accent-66); }
.stopped-note { align-self: flex-start; font-size: 12px; color: var(--faint); padding: 2px 6px; }
.chat-note { align-self: center; font-size: 12px; color: var(--muted); background: var(--field); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px; margin: 4px 0; }
.compose input { flex: 1; min-width: 0; font: 15px/1.4 var(--sans); color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px; }
.compose textarea:focus, .compose input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--sans); color: var(--on-accent); background: var(--accent); border: 0; border-radius: 10px; padding: 7px 12px; text-decoration: none; cursor: pointer; }
.btn.ghost { color: var(--text); background: var(--glass-2); border: 1px solid var(--line); font-weight: 500; }

/* what she made */
.vers { display: flex; gap: 5px; padding: 7px 10px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.vers button { font: 12px var(--sans); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px; cursor: pointer; white-space: nowrap; }
.vers button.on { color: var(--link); border-color: var(--accent); background: var(--accent-soft); }
.vers button.new::after { content: " new"; color: var(--good); }

/* taskbar */
.taskbar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 2000; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--bar-shadow); }
.task-logo { width: 22px; height: 22px; margin: 0 6px 0 2px; }
.taskbar button { font: 13px var(--sans); color: var(--text); background: transparent; border: 0; border-radius: 9px; padding: 6px 11px; cursor: pointer; white-space: nowrap; }
.taskbar button:hover { background: var(--accent-soft); }
.made-label { font-size: 13px; color: var(--faint); padding: 0 8px; white-space: nowrap; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
  .rn .aura, .carving .stone, .carving .aura { animation: none; stroke-dashoffset: 0; }
  .win.opening, .m { animation: none; }
}
