/* Lodestone hubs: a calm "desktop" of apps. */
:root {
  --ink: #f4f6fb;
  --muted: rgba(244, 246, 251, 0.72);
  --glass: rgba(255, 255, 255, 0.10);
  --glass-edge: rgba(255, 255, 255, 0.18);
  --accent: #7cc4ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0b1530;
  overflow-x: hidden;
}

/* Wallpaper: soft blobs of colour, a different mood for each hub. */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 60vw at 12% 18%, var(--w1), transparent 60%),
    radial-gradient(55vw 55vw at 88% 22%, var(--w2), transparent 62%),
    radial-gradient(70vw 70vw at 55% 105%, var(--w3), transparent 60%),
    linear-gradient(160deg, var(--w0a), var(--w0b));
}
.wallpaper::after {
  /* A faint grain so the gradients don't band. */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: radial-gradient(rgba(255,255,255,0.8) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
}
.w-home { --w0a: #0d1b3d; --w0b: #0a2a3a; --w1: #2f5bd8aa; --w2: #18a6a088; --w3: #6b46c188; }
.w-finance { --w0a: #0a2219; --w0b: #10202f; --w1: #1f9d6baa; --w2: #c9a22788; --w3: #1d4ed888; opacity: 0; }
.wallpaper { transition: opacity 0.6s ease; }
body.finance .w-finance { opacity: 1; }
body.home { --accent: #8fd3ff; }
body.finance { --accent: #d9bd8c; }

/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(8, 14, 30, 0.35);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--glass-edge);
}
button { font: inherit; color: inherit; }
.brand { display: flex; align-items: center; gap: 11px; background: none; border: 0; padding: 4px; cursor: pointer; border-radius: 10px; justify-self: start; }
.brand .mark { height: 28px; width: auto; }
.brand .wordmark { height: 11px; width: auto; }
.switcher {
  display: flex;
  padding: 4px;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
}
.switcher button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s, color 0.2s;
}
.switcher button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.switcher button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.switcher button[aria-current="page"] { background: var(--ink); color: #0b1530; }
.clock { justify-self: end; text-align: right; font-variant-numeric: tabular-nums; }
.clock .time { font-weight: 700; font-size: 15px; }
.clock .date { font-size: 12px; color: var(--muted); }

main {
  flex: 1;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 56px 24px 140px;
}
.hello h1 { margin: 0; font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -0.02em; }
.hello p { margin: 8px 0 0; color: var(--muted); font-size: 17px; }

/* The app grid */
.apps {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 30px 18px;
}
.app {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  border-radius: 18px;
  padding: 8px 4px;
  outline: none;
}
.icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}
.icon img { width: 100%; height: 100%; }
.icon svg { width: 42px; height: 42px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app .name { font-weight: 600; font-size: 14px; line-height: 1.2; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); }
.app .what { font-size: 12px; color: var(--muted); line-height: 1.3; max-width: 140px; }
a.app:hover .icon, a.app:focus-visible .icon { transform: translateY(-4px) scale(1.04); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--accent); }
a.app:active .icon { transform: scale(0.96); }

/* Coming soon: frosted and quiet. */
.app.soon:hover .icon { filter: saturate(0.75) brightness(1); opacity: 0.92; }
.app.soon .icon { filter: saturate(0.55) brightness(0.9); opacity: 0.78; }
.badge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  white-space: nowrap;
}

/* Gradients for placeholder icons */
.g-blue { background: linear-gradient(145deg, #4f8cff, #2b55d6); }
.g-teal { background: linear-gradient(145deg, #2bc4b4, #148a86); }
.g-green { background: linear-gradient(145deg, #4cc27a, #1f8a4c); }
.g-amber { background: linear-gradient(145deg, #f5b84a, #d98a1f); }
.g-pink { background: linear-gradient(145deg, #f07aa7, #c2477a); }
.g-purple { background: linear-gradient(145deg, #9b7bf0, #6747c9); }
.g-slate { background: linear-gradient(145deg, #7d8aa3, #4a5568); }
.g-gold { background: linear-gradient(145deg, #e9c46a, #b98a1e); }
.g-emerald { background: linear-gradient(145deg, #34d399, #059669); }
.g-red { background: linear-gradient(145deg, #f87171, #c03535); }

/* The dock */
.dock-wrap { position: fixed; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; pointer-events: none; z-index: 10; }
.dock {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.dock a, .dock button { position: relative; display: block; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.dock .icon { width: 52px; height: 52px; border-radius: 15px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3); }
.dock .icon svg { width: 26px; height: 26px; }
.dock a:hover .icon, .dock button:hover .icon { transform: translateY(-6px) scale(1.1); }
.dock .tip {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 16, 32, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.dock a:hover .tip, .dock button:hover .tip, .dock a:focus-visible .tip, .dock button:focus-visible .tip { opacity: 1; }
.dock button[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--ink);
}
.dock .sep { width: 1px; background: var(--glass-edge); margin: 4px 2px; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 0 0 96px; }
footer a { color: var(--muted); }

@media (max-width: 640px) {
  .bar { grid-template-columns: auto 1fr; }
  .clock { display: none; }
  .switcher { justify-self: end; }
  .switcher button { padding: 7px 12px; }
  .switcher button span { display: none; }
  .brand .wordmark { display: none; }
  main { padding-top: 36px; }
  .apps { grid-template-columns: repeat(4, 1fr); gap: 22px 8px; }
  .icon { width: 64px; height: 64px; border-radius: 17px; }
  .icon svg { width: 32px; height: 32px; }
  .app .what { display: none; }
  .app .name { font-size: 12px; }
  .badge { font-size: 8px; padding: 2px 6px; bottom: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* An app, opened in a window over the desktop. */
.window {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #f6f5f1;
  opacity: 0;
  transform: scale(0.96) translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.window.open { opacity: 1; transform: none; }
.window[hidden] { display: none; }
.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 10px 0 6px;
  background: rgba(8, 14, 30, 0.94);
  color: var(--ink);
  flex: none;
}
.titlebar .close {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255,255,255,0.08); cursor: pointer;
  display: grid; place-items: center;
}
.titlebar .close:hover { background: rgba(255,255,255,0.16); }
.titlebar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.titlebar .mark { height: 22px; width: auto; }
.titlebar .title { font-weight: 700; font-size: 15px; flex: 1; }
.titlebar .newtab { color: var(--muted); font-size: 13px; text-decoration: none; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; }
.titlebar .newtab:hover { color: var(--ink); background: rgba(255,255,255,0.08); }
.window iframe { flex: 1; width: 100%; border: 0; background: #f6f5f1; }
body.app-open { overflow: hidden; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translate(-50%, 12px);
  background: rgba(10, 16, 32, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .titlebar .newtab { font-size: 0; }
}

footer a { text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }
footer .social { display: block; margin-top: 6px; opacity: 0.85; }
.apps[hidden] { display: none; }
