/* Glow home: the entry point of the Glow ecosystem (GlowChat + GlowRoom). */
:root, [data-theme="dark"] {
  --bg: #262624;
  --panel: #1f1e1d;
  --card: #30302e;
  --border: #3e3e3a;
  --text: #ece9e1;
  --muted: #a39f94;
  --accent: #d97757;
  --gold: #e7b75d;
  --room: #10b981;
}
[data-theme="light"] {
  --bg: #faf9f5;
  --panel: #f0eee6;
  --card: #ffffff;
  --border: #dcd8cc;
  --text: #1f1e1d;
  --muted: #6b675d;
  --accent: #c15f3c;
  --gold: #a87a12;
  --room: #0f8a62;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 15% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(700px 380px at 95% 0%, color-mix(in srgb, var(--room) 12%, transparent), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px clamp(16px, 4vw, 40px); }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; font-size: 22px; letter-spacing: -.02em; }
.logo img { border-radius: 9px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.account-chip { font-size: 13px; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip.signed-in { color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); color: var(--muted); font-size: 16px; cursor: pointer; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }

main { width: min(1060px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 40px; flex: 1; }
.hero { padding: clamp(24px, 6vw, 64px) 0 28px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-weight: 650; font-size: 14px; letter-spacing: .02em; }
h1 { margin: 0; font-size: clamp(34px, 6.2vw, 58px); line-height: 1.05; letter-spacing: -.035em; }
.lede { max-width: 640px; margin: 16px auto 0; color: var(--muted); font-size: clamp(16px, 2vw, 18px); }
.lede b { color: var(--text); }

.start { max-width: 720px; margin: 28px auto 0; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 12px; text-align: left; box-shadow: 0 18px 50px rgba(0, 0, 0, .22); }
.start:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.start textarea { width: 100%; resize: vertical; min-height: 58px; max-height: 240px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 17px; padding: 6px 8px; }
.start-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px; }
.start-hint { font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.suggested { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; margin-top: 18px; }
.app-card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 22px; padding: 22px; overflow: hidden; }
.app-card::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%; opacity: .14; pointer-events: none; }
.app-card.chat::after { background: var(--accent); }
.app-card.room::after { background: var(--room); }
.app-card.lead::after { background: var(--gold); }
.app-card.lead .btn.primary { background: var(--gold); border-color: var(--gold); color: #1f1e1d; }
.app-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--card); border: 1px solid var(--border); }
.app-card h2 { margin: 14px 0 6px; font-size: 24px; letter-spacing: -.02em; }
.app-card p { margin: 0 0 10px; color: var(--muted); }
.app-card ul { margin: 0 0 16px; padding-left: 18px; font-size: 14.5px; }
.app-card li { margin: 3px 0; }
.app-links { display: flex; flex-wrap: wrap; gap: 8px; }
.app-card.room .btn.primary { background: var(--room); border-color: var(--room); }

.recent { margin-top: 30px; }
.recent h2, .account h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.01em; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.recent-col { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; }
.recent-col h3 { margin: 0 0 6px; font-size: 14px; color: var(--muted); font-weight: 650; }
.recent-col ul { list-style: none; margin: 0; padding: 0; }
.recent-col li a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 6px; border-radius: 10px; text-decoration: none; }
.recent-col li a:hover { background: var(--card); }
.recent-col .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.recent-col .empty { color: var(--muted); font-size: 14px; padding: 6px; }
.recent-col .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; }
.account p { margin: 0; color: var(--muted); max-width: 640px; }

.foot { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; padding: 18px; color: var(--muted); font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.link:hover { color: var(--accent); }

@media (max-width: 560px) {
  .start-hint { width: 100%; margin: 4px 0 0; }
  .start-actions .btn { flex: 1 1 auto; }
  .account-chip { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
