/* Thromblo Creates - studio hub.
   A Discord-like shell: a vertical rail of product "server icons" on the left,
   and a stage on the right where each product pops out as a cute detail bubble.
   True-black (OLED) base, per-product accents (AwayWard gold, Silf violet,
   Quick BRT cyan). No em dashes anywhere. */

/* The Cinzel family is reused only for the studio wordmark + display headings,
   to tie the hub to the AwayWard brand. The hub UI itself uses a system sans. */
@font-face {
  font-family: "Cinzel";
  src: url("../assets/fonts/Cinzel.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel Decorative";
  src: url("../assets/fonts/CinzelDecorative-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* OLED base: true black, with surfaces that lift only a little so the panel
     never glows against the black. */
  --black: #000000;
  --surface-0: #060608;
  --surface-1: #0b0b0f;
  --surface-2: #121218;
  --rail: #050507;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);

  /* text tuned for true black: bright but not pure-white headings, a soft body,
     and a muted tier that still clears AA on #000. */
  --ink: #f3f3f7;
  --ink-soft: #c7c7d2;
  --muted: #9595a6;

  /* studio signature + per-product accents */
  --gold: #f0c75e;
  --violet: #9a6bf2;
  --cyan: #38e0d6;

  /* the active accent (overridden per bubble + per rail tile) */
  --accent: var(--gold);
  --accent-btn: linear-gradient(180deg, #f6dc8f, #f0c75e 55%, #a88a3c);
  --accent-ink: #1a1404;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  --font-fancy: "Cinzel Decorative", "Cinzel", serif;

  --rail-w: 84px;
  --radius: 16px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--ink); line-height: 1.18; margin: 0 0 .5em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ============================ app shell ============================ */
.app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ============================ left rail ============================ */
.rail {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  background: var(--rail);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 0 16px;
  z-index: 30;
  /* keep every icon reachable on very short viewports (landscape phones, split windows) */
  overflow-y: auto;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-sep {
  width: 36px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  margin: 4px 0;
}
.rail-spacer { flex: 1 1 auto; }

/* a server-icon tile: rounded square that morphs toward a circle on hover/active */
.tile {
  position: relative;
  width: 52px;
  height: 52px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--surface-2);
  border-radius: 30%;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: border-radius .22s ease, background .22s ease, transform .22s ease, box-shadow .22s ease;
  outline-offset: 4px;
}
.tile img { width: 30px; height: 30px; pointer-events: none; transition: transform .22s ease; }
.tile:hover { border-radius: 38%; background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.tile:hover img { transform: scale(1.06); }
.tile.is-active {
  border-radius: 40%;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-1));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent),
              0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent);
}
.tile-home { background: var(--surface-1); }
.tile-home img { width: 34px; height: 34px; }

/* per-tile accent so hover/active glow in the product's color */
.tile[data-target="home"]     { --accent: var(--gold); }
.tile[data-target="awayward"] { --accent: var(--gold); }
.tile[data-target="silf"]     { --accent: var(--violet); }
.tile[data-target="quickbrt"] { --accent: var(--cyan); }

/* Discord-style pill indicator on the inner edge */
.tile::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 5px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height .22s ease;
}
.tile:hover::before { height: 20px; }
.tile.is-active::before { height: 34px; }

/* hover tooltip flying out to the right (the little "bubble" label) */
.tile .tip {
  position: absolute;
  left: calc(100% + 16px);
  top: 50%;
  transform: translateY(-50%) scale(.92);
  transform-origin: left center;
  background: var(--surface-2);
  color: var(--ink);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .14s ease, transform .14s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
  z-index: 5;
}
.tile .tip::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  width: 10px; height: 10px;
  background: var(--surface-2);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateY(-50%) rotate(45deg);
}
.tile:hover .tip, .tile:focus-visible .tip { opacity: 1; transform: translateY(-50%) scale(1); }
.tile .tip b { color: var(--accent); }

/* small circular external-link dots at the bottom of the rail */
.dot {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-1);
  color: var(--muted);
  border: 1px solid var(--line-soft);
  transition: color .18s ease, background .18s ease, transform .18s ease, border-radius .18s ease;
}
.dot:hover { color: var(--ink); background: var(--surface-2); transform: translateY(-2px); }
.dot svg { width: 20px; height: 20px; }
.dot.discord:hover { color: #c4b5fd; }
.dot.patreon:hover { color: #f0a892; }
.dot.github:hover { color: #fff; }

/* ============================ stage ============================ */
.stage {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 clamp(18px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stage-scroll { width: 100%; max-width: 920px; padding: clamp(30px, 6vh, 72px) 0 64px; }

/* a bubble: a rounded card that pops out of the rail with an accent glow + tail */
.bubble {
  position: relative;
  background:
    radial-gradient(520px 280px at 12% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4vw, 46px);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .6),
              0 0 0 1px rgba(255, 255, 255, .02) inset;
}
.bubble[hidden] { display: none; }
/* the speech-bubble tail pointing back toward the active rail icon */
.bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 54px;
  width: 18px; height: 18px;
  background: var(--surface-1);
  border-left: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  transform: rotate(45deg);
  border-radius: 0 0 0 5px;
}

/* per-bubble accent assignment (also drives the no-JS theming) */
#b-home,     .b-home     { --accent: var(--gold);  --accent-btn: linear-gradient(180deg, #f6dc8f, #f0c75e 55%, #a88a3c); --accent-ink: #1a1404; }
#b-awayward, .b-awayward { --accent: var(--gold);  --accent-btn: linear-gradient(180deg, #f6dc8f, #f0c75e 55%, #a88a3c); --accent-ink: #1a1404; }
#b-silf,     .b-silf     { --accent: var(--violet);--accent-btn: linear-gradient(180deg, #a78bfa, #7c4dff 55%, #6d28d9); --accent-ink: #ffffff; }
#b-quickbrt, .b-quickbrt { --accent: var(--cyan);  --accent-btn: linear-gradient(180deg, #7af0e6, #38e0d6 55%, #18a8bd); --accent-ink: #04201f; }

/* pop-in animation, replayed each time a bubble is shown */
@keyframes pop {
  0%   { opacity: 0; transform: translateY(14px) scale(.965); }
  60%  { opacity: 1; transform: translateY(-2px) scale(1.005); }
  100% { opacity: 1; transform: none; }
}
.bubble.in { animation: pop .42s cubic-bezier(.22, 1, .36, 1); }

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .26em;
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.badge .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.badge.soon { color: var(--muted); border-color: var(--line); background: transparent; }
.badge.soon .pip { background: var(--muted); box-shadow: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: .96rem;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .14s ease, background .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: var(--accent-ink);
  background: var(--accent-btn);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 32%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px color-mix(in srgb, var(--accent) 44%, transparent); }
.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, .04);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ============================ home bubble ============================ */
.home-hero { text-align: center; padding: 8px 0 6px; }
.home-mark { width: 84px; height: 84px; margin: 0 auto 18px; filter: drop-shadow(0 0 24px rgba(240, 199, 94, .35)); animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.wordmark {
  font-family: var(--font-fancy);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: .04em;
  margin: 0 0 6px;
  background: linear-gradient(180deg, #fff6df, var(--gold) 60%, #a88a3c);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.home-hero .lede { max-width: 620px; margin: 10px auto 0; color: var(--ink-soft); font-size: 1.12rem; }

/* live stats deck */
.stat-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 34px 0 8px;
}
.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
}
.stat-card .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  line-height: 1.1;
}
.stat-card .num.live { color: var(--gold); }
.stat-card .lbl { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 6px; }
.stat-card .sub { font-size: .82rem; color: var(--ink-soft); margin-top: 4px; min-height: 1.1em; }
.stat-card .num.skeleton {
  color: transparent;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, #1b1b22 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  width: 70%; margin: 0 auto; height: 1.4em;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.stats-foot { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 14px; }

/* product mini-cards on home */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 30px; }
.proj-card {
  --accent: var(--gold);
  text-align: left;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  color: inherit;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  display: flex; flex-direction: column; gap: 8px;
}
.proj-card.silf { --accent: var(--violet); }
.proj-card.quickbrt { --accent: var(--cyan); }
.proj-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 22%, transparent); }
.proj-card img { width: 40px; height: 40px; }
.proj-card h3 { margin: 4px 0 0; font-size: 1.12rem; }
.proj-card p { margin: 0; font-size: .92rem; color: var(--muted); }
.proj-card .badge { align-self: flex-start; margin-top: auto; }

/* ============================ product bubble ============================ */
.prod-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.prod-glyph {
  width: 72px; height: 72px;
  border-radius: 22%;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  display: grid; place-items: center;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 24%, transparent);
}
.prod-glyph img { width: 46px; height: 46px; }
.prod-head .meta { flex: 1 1 240px; }
.prod-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.4vw, 2.5rem);
  margin: 0 0 8px;
}
.prod-tagline { color: var(--accent); font-weight: 600; font-size: 1.04rem; margin: 0; }
.prod-blurb { margin: 22px 0 0; color: var(--ink-soft); font-size: 1.06rem; max-width: 66ch; }

/* inline per-product stat chips */
.mini-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.mini-stat {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  min-width: 110px;
}
.mini-stat .m-num { font-size: 1.3rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-stat .m-num.skeleton { color: transparent; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, #1b1b22 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; width: 64px; height: 1.2em; }
.mini-stat .m-lbl { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* feature chips */
.feat-head { margin: 30px 0 12px; font-size: .82rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 14px;
  font-size: .94rem;
  color: var(--ink-soft);
}
.chip .ci { color: var(--accent); font-size: 1rem; line-height: 1; }

/* notify line on coming-soon products inside the hub */
.soon-note {
  margin-top: 24px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  color: var(--ink-soft);
  font-size: .96rem;
}

/* footer meta under the bubble */
.stage-foot {
  width: 100%; max-width: 920px;
  margin: 28px auto 0;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: .84rem;
  border-top: 1px solid var(--line-soft);
  padding: 20px 0 8px;
}
.stage-foot a { color: var(--muted); }
.stage-foot a:hover { color: var(--ink); }

/* ============================ responsive ============================ */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .rail {
    position: sticky; top: 0;
    width: 100%; height: auto; flex-basis: auto;
    flex-direction: row;
    border-right: 0; border-bottom: 1px solid var(--line-soft);
    padding: 10px 12px;
    gap: 8px;
    overflow-x: auto;
  }
  .rail-sep { width: 2px; height: 30px; margin: 0 4px; }
  .rail-spacer { flex: 0 0 6px; }
  .tile { width: 46px; height: 46px; flex: 0 0 46px; }
  .tile img { width: 26px; height: 26px; }
  .tile-home img { width: 30px; height: 30px; }
  /* pill moves to the bottom edge on the horizontal rail */
  .tile::before { left: 50%; top: auto; bottom: -10px; width: 0; height: 5px; transform: translateX(-50%); border-radius: 4px 4px 0 0; transition: width .22s ease; }
  .tile:hover::before { width: 18px; height: 5px; }
  .tile.is-active::before { width: 28px; height: 5px; }
  .tile .tip { display: none; }
  .dot { width: 40px; height: 40px; flex: 0 0 40px; }
  /* tail points up toward the top rail */
  .bubble::before { left: 32px; top: -10px; border-left: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line)); border-bottom: 0; border-top: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line)); border-radius: 5px 0 0 0; }
  .stat-deck { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
}

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