@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #080a0d;
  --surface: #101318;
  --surface-raised: #171b22;
  --surface-soft: #0d1014;
  --line: #252b34;
  --line-strong: #36404c;
  --text: #f4f7f6;
  --muted: #8c96a3;
  --accent: #6ee7c2;
  --accent-strong: #2cc99c;
  --accent-wash: rgba(110, 231, 194, 0.11);
  --warning: #f7c66b;
  --danger: #ff789c;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  --ease: 180ms ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 12% -10%, rgba(64, 130, 116, 0.18), transparent 34rem),
    radial-gradient(circle at 100% 0%, rgba(66, 89, 144, 0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 264px;
  gap: 24px;
  padding: 24px;
}

.glass,
.glass-soft {
  background: rgba(16, 19, 24, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.glass-soft {
  background: var(--surface-soft);
  box-shadow: none;
}

.sidebar,
.right-rail {
  align-self: start;
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.sidebar {
  min-height: calc(100vh - 48px);
}

.right-rail {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.main-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #06251d;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
}

.brand-block h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.035em;
}

.brand-block h1 {
  font-size: 1.12rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.muted,
.post-meta,
.result-meta,
.resource-meta,
.note-meta {
  color: var(--muted);
}

.copy {
  font-size: 0.9rem;
  line-height: 1.65;
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.avatar-large,
.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
}

.avatar-large {
  width: 52px;
  height: 52px;
  font-size: 1.1rem;
}

.avatar {
  width: 40px;
  height: 40px;
  font-size: 0.8rem;
}

.profile-meta strong {
  display: block;
  font-size: 0.98rem;
}

.profile-meta span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.profile-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-stats strong {
  font-size: 1.1rem;
}

.profile-stats span {
  color: var(--muted);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stack-actions,
.stack,
.inline-actions {
  display: flex;
  gap: 9px;
}

.stack-actions,
.stack {
  flex-direction: column;
}

.button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), color var(--ease);
}

.button:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--accent);
  color: #06251d;
}

.primary:hover {
  background: #91f1d4;
}

.ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.ghost:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--ease);
}

.nav-item::before {
  content: "•";
  color: var(--line-strong);
  font-size: 1.1rem;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(110, 231, 194, 0.18);
  background: var(--accent-wash);
  color: var(--text);
}

.nav-item.active::before {
  color: var(--accent);
}

.mini-card {
  padding: 16px;
}

.mini-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
}

.topbar h2 {
  margin-top: 5px;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(210px, 0.75fr);
  gap: 16px;
}

.hero-card,
.teaser-card {
  padding: 24px;
}

.hero-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 25px;
  min-height: 230px;
  background:
    linear-gradient(135deg, rgba(110, 231, 194, 0.13), transparent 55%),
    var(--surface);
}

.hero-card h3 {
  max-width: 560px;
  margin: 10px 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.08;
}

.hero-card .copy {
  max-width: 620px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 10, 13, 0.35);
}

.metric-card strong {
  font-size: 1.22rem;
}

.metric-card small {
  color: var(--muted);
  font-size: 0.68rem;
}

.teaser-card {
  min-height: 230px;
}

.teaser-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.teaser-line {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: #d9dfdf;
  font-size: 0.85rem;
}

.panel-stack {
  display: grid;
}

.panel {
  display: none;
  overflow: hidden;
}

.panel.active {
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin-top: 7px;
  font-size: 1.2rem;
}

.composer,
.search-form,
.planner-form {
  display: flex;
  gap: 10px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.composer,
.planner-form {
  flex-direction: column;
}

.composer-footer,
.resource-row,
.feed-top,
.leader-row,
.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer-footer input {
  flex: 1;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  padding: 11px 12px;
  outline: 0;
  transition: var(--ease);
}

textarea {
  min-height: 106px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.feed-list,
.notes-grid,
.leaderboard-list,
.results-grid,
.tool-grid {
  display: grid;
  gap: 12px;
  padding: 18px 24px 24px;
}

.feed-card,
.note-card,
.leader-card,
.result-card,
.resource-card,
.tool-card,
.answer {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.feed-card,
.note-card,
.leader-card,
.result-card,
.resource-card,
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-card:hover,
.note-card:hover,
.leader-card:hover {
  border-color: var(--line-strong);
}

.feed-top {
  justify-content: flex-start;
}

.feed-content,
.note-body {
  color: #e2e8e7;
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.post-meta,
.result-meta,
.resource-meta,
.note-meta {
  font-size: 0.76rem;
}

.post-actions,
.note-actions,
.leader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.post-actions .button,
.note-actions .button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.74rem;
}

.pill,
.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
}

.note-card.pinned {
  border-color: rgba(247, 198, 107, 0.45);
}

.note-card.pinned .pill {
  color: var(--warning);
  border-color: rgba(247, 198, 107, 0.35);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 14px 24px 0;
}

.chip {
  background: var(--accent-wash);
  color: var(--accent);
  cursor: pointer;
}

.chip:hover {
  background: rgba(110, 231, 194, 0.2);
}

.search-form {
  flex-direction: row;
}

.search-form input {
  flex: 1;
}

.lazy-section {
  display: grid;
  gap: 12px;
  padding: 0 24px 24px;
}

.scroll-list {
  display: grid;
  gap: 9px;
  max-height: 290px;
  overflow: auto;
}

.tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-card {
  align-self: start;
}

.answer {
  min-height: 70px;
  color: #d7dfde;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.76rem;
}

.metric-grid,
.mini-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.stat-card {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 8, 0.78);
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 16px 0;
  padding: 4px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.auth-tab {
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tab.active {
  background: var(--surface-raised);
  color: var(--text);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-hint {
  margin-top: 14px;
  font-size: 0.8rem;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .right-rail {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    padding: 12px 12px 88px;
  }

  .sidebar {
    position: static;
    min-height: 0;
    margin-bottom: 14px;
    padding: 14px;
  }

  .profile-card,
  .sidebar > .mini-card {
    display: none;
  }

  .brand-block {
    padding-bottom: 0;
  }

  .nav-list {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(16, 19, 24, 0.94);
    box-shadow: var(--shadow);
  }

  .nav-item {
    justify-content: center;
    padding: 9px 3px;
    font-size: 0.68rem;
    text-align: center;
  }

  .nav-item::before {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    padding: 16px;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .hero-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .teaser-card {
    padding: 20px;
  }

  .hero-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel-head,
  .composer,
  .search-form,
  .planner-form {
    padding-right: 16px;
    padding-left: 16px;
  }

  .feed-list,
  .notes-grid,
  .leaderboard-list,
  .results-grid,
  .tool-grid {
    padding-right: 16px;
    padding-left: 16px;
  }

  .chip-row,
  .lazy-section {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 420px) {
  .topbar {
    display: block;
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
    }
  }

  .topbar-actions {
    flex-direction: row;
    margin-top: 14px;
  }

  .topbar-actions .button {
    flex: 1;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-form,
  .composer-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Visual layer: keep the dashboard calm to use, but make the first impression loud. */
:root {
  --bg: #070910;
  --surface: #10131d;
  --surface-raised: #191d2a;
  --surface-soft: #0c0f18;
  --line: rgba(155, 168, 207, 0.15);
  --line-strong: rgba(155, 168, 207, 0.32);
  --accent: #7cf5d2;
  --accent-strong: #36dcb1;
  --accent-wash: rgba(124, 245, 210, 0.1);
  --purple: #a78bfa;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 12% -10%, rgba(65, 223, 180, 0.2), transparent 32rem),
    radial-gradient(circle at 90% 8%, rgba(125, 92, 242, 0.19), transparent 30rem),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}

.app-shell {
  gap: 20px;
  padding: 20px;
}

.glass,
.glass-soft {
  border-color: var(--line);
}

.sidebar,
.right-rail {
  background: rgba(12, 15, 24, 0.82);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #b7a4ff);
  box-shadow: 0 0 26px rgba(124, 245, 210, 0.3);
  font-size: 1.2rem;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 245, 210, 0.12), 0 0 16px var(--accent);
  vertical-align: 1px;
}

.topbar,
.hero-card,
.teaser-card,
.panel {
  border-color: rgba(155, 168, 207, 0.2);
}

.topbar {
  padding: 20px 24px;
  background: var(--surface);
}

.topbar h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 290px;
  padding: 30px;
  background: linear-gradient(135deg, rgba(124, 245, 210, 0.12), var(--surface) 60%);
}

.hero-card::after {
  position: absolute;
  right: -4rem;
  bottom: -7rem;
  width: 18rem;
  height: 18rem;
  border: 1px solid rgba(124, 245, 210, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(124, 245, 210, 0.025);
  content: "";
  pointer-events: none;
}

.hero-card h3 {
  max-width: 650px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.gradient-text {
  color: var(--accent);
  background: linear-gradient(100deg, var(--accent), #c5b5ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
}

.hero-actions .primary span,
.text-button span {
  margin-left: 7px;
  font-size: 1.05rem;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.text-button:hover {
  color: var(--text);
}

.metric-card,
.feed-card,
.note-card,
.leader-card,
.result-card,
.tool-card {
  transition: border-color var(--ease), background var(--ease);
}

.metric-card:hover,
.feed-card:hover,
.note-card:hover,
.leader-card:hover,
.result-card:hover,
.tool-card:hover {
  border-color: rgba(124, 245, 210, 0.35);
  background: rgba(18, 23, 34, 0.9);
  box-shadow: none;
}

.nav-item {
  padding: 12px;
}

.nav-item::before {
  width: 18px;
  content: "✦";
  color: var(--line-strong);
  font-size: 0.7rem;
  text-align: center;
}

.nav-item.active::before {
  color: var(--accent);
}

.button {
  border-radius: 12px;
}

.primary {
  box-shadow: none;
}

.modal {
  border-color: rgba(124, 245, 210, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px 12px 88px;
  }

  .hero-card {
    min-height: 0;
    padding: 24px 20px;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}
