/* ============================================================
   10 — Idea · "Signal"
   Cool glass over a deep field. Votes push a card up the board.
   Font: Space Grotesk.
   ============================================================ */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/SpaceGrotesk-Variable.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #0C1220;
  --glow-a: rgba(96, 132, 255, 0.20);
  --glow-b: rgba(72, 226, 197, 0.13);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.075);
  --hairline: rgba(255, 255, 255, 0.10);
  --ink: #EAEFF9;
  --muted: #93A0BC;
  --accent: #6084FF;
  --accent-2: #48E2C5;

  --review: #93A0BC;
  --planned: #6084FF;
  --shipped: #48E2C5;

  --display: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* The UA's `[hidden] { display: none }` loses to any author `display` rule
   below, and every demo here toggles `element.hidden` to show and hide
   panels. Without this, hiding silently stops working. */
[hidden] { display: none !important; }

/* A long unbroken token -- a pasted URL, a 200-character "word" -- must wrap
   rather than push its container past its grid track and break the row.
   `anywhere` rather than `break-word` on purpose: only `anywhere` reduces the
   element's min-content width, and a grid or flex item defaults to
   `min-width: auto`, which refuses to shrink below its longest word. With
   `break-word` alone, demo-06 and demo-10 still blew 1.4k px past the viewport.
   The `min-width: 0` below is the other half of the same fix. */
h1, h2, h3, h4, p, li, a, span, strong, em, code, label, time,
button, input, textarea { overflow-wrap: anywhere; }
.card, .post, .listing, .idea, .topic, .question, .profile-card, .submission,
.lesson, .resource, .nominee, .archive-item, .member-card, .comment, .reply,
.answer, .idea-body-wrap { min-width: 0; }


body {
  margin: 0;
  padding-block-end: 96px;
  background: var(--bg);
  background-image:
    radial-gradient(58rem 34rem at 12% -8%, var(--glow-a), transparent 62%),
    radial-gradient(46rem 30rem at 92% 4%, var(--glow-b), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.6;
}

.wrap { max-width: 800px; margin-inline: auto; padding: 0 20px; }

h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.025em; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar {
  padding-block: clamp(28px, 4.5vw, 54px) 22px;
  display: flex; flex-wrap: wrap; gap: 18px;
  justify-content: space-between; align-items: flex-end;
}
.topbar h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.06; }
.topbar > div > p { color: var(--muted); max-width: 44ch; margin-top: 12px; }

.identity-picker { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.identity-picker select {
  font: inherit; font-size: 14px; letter-spacing: 0; text-transform: none;
  margin-left: 6px; min-height: 44px; padding: 9px 12px;
  background: var(--glass-2); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 11px;
}

/* ---------- Compose ---------- */

.new-idea {
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 26px;
  backdrop-filter: blur(14px);
}
.new-idea h2 { font-size: 18px; margin-bottom: 16px; }

.field { display: block; margin-bottom: 14px; }
.field label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: rgba(0,0,0,0.28); border: 1px solid var(--hairline);
  border-radius: 11px; padding: 11px 13px; min-height: 44px;
}
.field textarea { resize: vertical; min-height: 5rem; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }

.btn {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  min-height: 44px; padding: 12px 22px;
  background: var(--accent); color: #060A16;
  border: 0; border-radius: 11px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -16px var(--accent); }

.btn-ghost {
  font: inherit; font-size: 12.5px; cursor: pointer;
  min-height: 44px; padding: 10px 15px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--hairline); border-radius: 11px;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- Board ---------- */

.idea-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

.idea {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 18px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 20px 22px;
  backdrop-filter: blur(14px);
  transition: border-color 160ms ease;
}
.idea:hover { border-color: rgba(96,132,255,0.42); }

.idea-votes { display: grid; gap: 8px; justify-items: center; align-content: start; }
.vote-count {
  font-size: 26px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.btn-vote {
  font: inherit; font-size: 15px; cursor: pointer;
  width: 100%; min-height: 44px;
  background: var(--glass-2); color: var(--accent);
  border: 1px solid var(--hairline); border-radius: 11px;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}
.btn-vote:hover { background: var(--accent); color: #060A16; transform: translateY(-2px); }

.status-tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
  margin-bottom: 9px;
  border: 1px solid currentColor;
}
.status-tag[data-status="under-review"] { color: var(--review); }
.status-tag[data-status="planned"]      { color: var(--planned); }
.status-tag[data-status="shipped"]      { color: var(--shipped); }

.idea-title { font-size: 18.5px; line-height: 1.3; margin-bottom: 8px; }
.idea-body-wrap > p[itemprop="body"] { color: #C9D3E6; }
.idea-meta { font-size: 12px; color: var(--muted); margin-top: 12px; }
.idea-meta strong { color: var(--ink); font-weight: 600; }

.idea-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- Comments ---------- */

.comments { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.comments:empty { margin: 0; }
.comment {
  background: rgba(0,0,0,0.26);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}
.comment-meta { font-size: 11px; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px; }
.comment-meta strong { color: var(--ink); font-weight: 600; }
.comment-body { margin: 0; }

.new-comment {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  background: rgba(12,18,32,0.94);
  border-top: 1px solid var(--hairline);
  backdrop-filter: blur(18px);
  padding: 16px 20px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.reply-panel-body { flex: 1 1 18rem; }
.reply-meta { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.new-comment textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: rgba(0,0,0,0.34); border: 1px solid var(--hairline);
  border-radius: 11px; padding: 10px 12px; min-height: 44px; resize: vertical;
}

/* ---------- Toasts ---------- */

.toast-stack { position: fixed; right: 16px; bottom: 108px; display: grid; gap: 8px; z-index: 50; }
.toast {
  font-size: 13px;
  background: rgba(22,30,50,0.96); color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 12px; padding: 12px 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -22px rgba(0,0,0,0.95);
}
.toast.error { border-color: rgba(255,120,110,0.55); color: #FFB4AC; }

/* ---------- Motion ---------- */

.motion .idea { opacity: 0; }

@media (max-width: 560px) {
  .idea { grid-template-columns: 3.4rem 1fr; gap: 14px; padding: 18px; }
  .vote-count { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .motion .idea { opacity: 1 !important; transform: none !important; }
  .btn, .btn-vote, .idea { transition: none !important; }
}


/* ---------- Ranked board ---------- */
/* It read as another dark glass page. A feedback board is a ranking, so show
   the rank: an oversized ordinal behind each card, and a signal bloom on the
   leader. */

.idea-list { counter-reset: rank; }
.idea { counter-increment: rank; position: relative; }
/* Rank as a small chip above the tally rather than a giant ghost numeral —
   the numeral rendered as a half-cut glyph hanging off the card edge. */
.idea-votes::before {
  content: "#" counter(rank);
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.idea:first-child .idea-votes::before { color: var(--accent-2); }

.idea:first-child {
  border-color: rgba(72,226,197,0.45);
  background:
    radial-gradient(90% 170% at 0% 0%, rgba(72,226,197,0.13), transparent 62%),
    var(--glass);
}
.idea:first-child .vote-count { color: var(--accent-2); }


/* ---------- Compose affordance ---------- */
.compose-jump { margin: 0 0 20px; }
.btn-jump {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  min-height: 44px; padding: 12px 20px;
  background: var(--glass-2); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: 999px;
  backdrop-filter: blur(14px);
}
.btn-jump:hover { border-color: var(--accent); color: var(--accent); }
.new-idea { margin-top: 34px; margin-bottom: 0; }


/* ---------- Board tally ---------- */
/* A feedback board is a scoreboard. Three glass tiles carrying the totals. */

.pl-stats { display: flex; gap: 10px; margin: 0; }
.pl-stats div {
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 14px 20px 15px;
  min-width: 92px;
  backdrop-filter: blur(14px);
}
.pl-stats dt {
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px;
}
.pl-stats dd {
  margin: 0; font-size: 30px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
}
.pl-stats div:nth-child(2) dd { color: var(--accent); }
.pl-stats div:nth-child(3) dd { color: var(--ink); }

@media (max-width: 640px) {
  .pl-stats { flex-wrap: wrap; }
}


/* ---------- Signal board ---------- */
/* A ranked list needs the rank and the state to read at a glance from across
   the room. Widen, give the tally real weight in its own bay, and move the
   status out of the body into a third column so the roadmap reads down the
   right edge as a single line of sight. */

@media (min-width: 940px) {
  .wrap { max-width: 1000px; }

  .idea {
    grid-template-columns: 6.75rem minmax(0, 1fr);
    column-gap: 26px;
    align-items: start;
  }
  /* The tally gets its own bay rather than floating against the card ground. */
  .idea-votes {
    background: rgba(255,255,255,0.028);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    padding: 12px 8px 14px;
    gap: 6px;
  }
  .vote-count { font-size: 34px; letter-spacing: -0.03em; }

  /* The status is a child of .idea-body-wrap, not of .idea — the <li> is under
     a ShapeConstraint, so it stays where the app writes it and the wrap
     becomes the grid instead. Ranged right on the title row, the roadmap then
     reads straight down the card edge. */
  .idea-body-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 20px;
    align-items: start;
  }
  .idea-body-wrap > * { grid-column: 1; }
  .idea-body-wrap > .status-tag {
    grid-column: 2; grid-row: 1;
    justify-self: end;
    margin: 2px 0 0;
  }
  .idea-body-wrap > .idea-title { grid-row: 1; padding-right: 0.5rem; }
}

.idea:first-child .vote-count { color: var(--accent-2); }
