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

/* === CAMPFIRE PALETTE === */
:root {
  /* Night sky */
  --night-deep: #0c1445;
  --night-mid: #1a1a2e;
  /* --night-light: #16213e; UNUSED - commented out P2-14 */

  /* Forest night - UNUSED - commented out P2-14
  --forest-deep: #0d1117;
  --forest-mid: #161b22;
  --forest-light: #21262d;
  */

  /* Fire warmth */
  --fire-bright: #ff6b35;
  --fire-core: #f7931e;
  --fire-glow: #ffcc02;
  --ember: #e85d04;
  --coal: #dc2f02;

  /* Campfire orange - new */
  --campfire: #f97316;
  --campfire-light: #fb923c;
  --campfire-dark: #ea580c;

  /* Ember glow - new */
  --ember-glow: #fbbf24;
  --ember-warm: #f59e0b;

  /* Pine green - new */
  --pine: #059669;
  --pine-light: #10b981;
  --pine-dark: #047857;

  /* Claude coral */
  --coral: #d4846c;
  --coral-light: #e8a894;
  --coral-dark: #b86b52;

  /* Moonlight - new */
  --moonlight: #e2e8f0;
  --moonlight-dim: #cbd5e1;
  --moonlight-bright: #f1f5f9;

  /* Starlight purple - new */
  --starlight: #8b5cf6;
  --starlight-light: #a78bfa;
  --starlight-dark: #7c3aed;

  /* Cozy neutrals */
  --cream: #faf6f0;
  --parchment: #f5efe6;
  --bark: #3d3024;
  --smoke: rgba(255, 255, 255, 0.08);

  /* Surfaces */
  --surface-0: var(--night-deep);
  --surface-1: #16213e;
  --surface-2: #1a1a2e;
  --surface-3: #24243e;

  /* Semantic */
  --text-bright: #faf6f0;
  --text-dim: rgba(250, 246, 240, 0.75);
  --text-muted: rgba(250, 246, 240, 0.5);
  --card-bg: rgba(26, 26, 46, 0.85);
  --card-border: rgba(255, 107, 53, 0.2);
  --card-glow: rgba(255, 107, 53, 0.05);

  /* Visibility colors */
  --public: #38bdf8;
  --public-bg: rgba(14, 165, 233, 0.1);
  --private: #fb923c;
  --private-bg: rgba(249, 115, 22, 0.1);

  /* Typography */
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;

  /* Shadows */
  --shadow-fire: 0 8px 32px rgba(255, 107, 53, 0.25);
  --shadow-deep: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.3);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* === SKIP LINK === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 1001;
  padding: 12px 20px;
  background: var(--campfire);
  color: white;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text-bright);
  min-height: 100vh;
  background: var(--night-deep);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === ICONS === */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.icon--xs {
  width: 0.85em;
  height: 0.85em;
}

.icon--sm {
  width: 1em;
  height: 1em;
}

.icon--md {
  width: 1.2em;
  height: 1.2em;
}

.icon--lg {
  width: 1.6em;
  height: 1.6em;
}

.icon--xl {
  width: 3rem;
  height: 3rem;
}

.icon--nav {
  width: 1rem;
  height: 1rem;
}

/* === CANVAS BACKGROUND === */
#campfire-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* === LAYOUT === */
.topbar, .content, .footer {
  position: relative;
  z-index: 1;
}

/* === TOP BAR === */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(12, 20, 69, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* === BRAND === */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-fast);
}

.brand:hover {
  transform: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--fire-bright) 0%, var(--fire-core) 50%, var(--ember) 100%);
  box-shadow: var(--shadow-fire), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.fire-icon::before {
  content: "";
  display: block;
  width: 20px;
  height: 26px;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, var(--fire-glow) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 50% 80%, var(--fire-bright) 0%, transparent 60%),
    radial-gradient(ellipse 30% 50% at 40% 70%, var(--ember) 0%, transparent 50%),
    radial-gradient(ellipse 30% 50% at 60% 70%, var(--ember) 0%, transparent 50%);
  animation: flame-dance 0.8s ease-in-out infinite alternate;
}

@keyframes flame-dance {
  0% { transform: scaleY(1) scaleX(1); }
  100% { transform: scaleY(1.1) scaleX(0.95); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--cream) 0%, var(--coral-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

/* === NAVIGATION === */
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 999px;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.nav a:hover {
  color: var(--text-bright);
  background: var(--smoke);
  border-color: var(--card-border);
}

.nav a.active {
  color: var(--fire-bright);
  background: rgba(255, 107, 53, 0.12);
  border-color: rgba(255, 107, 53, 0.3);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* === UTILITY BAR === */
.utility {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* === FORM ELEMENTS === */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field--inline {
  flex-direction: column;
}

.field input,
.field textarea,
.field select {
  border: 1px solid var(--card-border);
  background: rgba(26, 26, 46, 0.8);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-bright);
  transition: all 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--fire-bright);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field-hint {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === BUTTONS === */
.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s ease;
  background: linear-gradient(135deg, var(--fire-bright) 0%, var(--ember) 100%);
  color: var(--cream);
  box-shadow: var(--shadow-fire);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(255, 107, 53, 0.35);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
  box-shadow: 0 8px 24px rgba(212, 132, 108, 0.3);
}

.btn-secondary:hover {
  box-shadow: 0 12px 32px rgba(212, 132, 108, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  box-shadow: none;
  border: 1px solid var(--card-border);
}

.btn-ghost:hover {
  background: var(--smoke);
  color: var(--text-bright);
  border-color: rgba(255, 107, 53, 0.3);
  box-shadow: none;
  transform: none;
}

/* === AUTH CHIP === */
.auth-chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--smoke);
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
  border: 1px solid var(--card-border);
}

#logoutBtn {
  display: none;
}

/* === MAIN CONTENT === */
.content {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}

/* === PANELS === */
.panel {
  background: rgba(22, 33, 62, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 28px;
  animation: none;
  backdrop-filter: none;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.panel-head h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cream) 0%, var(--coral-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.panel-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.panel-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: flex-end;
}

/* === GRID === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.grid--detail {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* === CARDS === */
.card {
  border: 1px solid var(--card-border);
  background: rgba(22, 33, 62, 0.7);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 180px;
  animation: none;
  transition: all var(--transition-normal);
  backdrop-filter: none;
}

.card:hover {
  border-color: rgba(255, 107, 53, 0.35);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--coral-light);
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--fire-bright);
}

/* === SKILL CARDS === */
.skill-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.skill-badge {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(232, 93, 4, 0.15) 100%);
  border: 1px solid rgba(255, 107, 53, 0.3);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fire-bright);
}

.skill-badge .icon {
  width: 1.4rem;
  height: 1.4rem;
}

.skill-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  transition: color 0.2s ease;
}

.skill-title:hover {
  color: var(--fire-bright);
}

.skill-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.skill-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.skill-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--card-border);
}

.card-actions a,
.card-actions button {
  font-size: 0.85rem;
  padding: 8px 14px;
}

/* === NOTICES === */
.notice {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--smoke);
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 20px;
  border: 1px solid var(--card-border);
}

.notice--error {
  background: rgba(220, 47, 2, 0.15);
  border-color: rgba(220, 47, 2, 0.3);
  color: #ff8a80;
}

/* === CODE BLOCKS === */
.code-block {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: rgba(12, 20, 69, 0.6);
  padding: 16px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: var(--coral-light);
  border: 1px solid var(--card-border);
  overflow-x: auto;
}

/* === LISTS === */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list a {
  color: var(--coral-light);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.list a:hover {
  color: var(--fire-bright);
}

/* === BREADCRUMBS === */
.crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.crumbs a {
  text-decoration: none;
  color: var(--coral);
  font-weight: 600;
}

.crumbs a:hover {
  color: var(--fire-bright);
}

/* === DETAIL PAGES === */
.detail-header {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.detail-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* === FORMS === */
.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.form .full {
  grid-column: 1 / -1;
}

/* === EMOJI PICKER === */
.emoji-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.emoji-picker button {
  border: 1px solid var(--card-border);
  background: rgba(26, 26, 46, 0.6);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.3rem;
  transition: all 0.2s ease;
}

.emoji-picker button:hover {
  background: rgba(255, 107, 53, 0.1);
  border-color: rgba(255, 107, 53, 0.3);
}

.emoji-picker button.active {
  border-color: var(--fire-bright);
  background: rgba(255, 107, 53, 0.2);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.3);
}

/* === FOOTER === */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 32px 48px;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
}

.footer-flame {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 40px;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 107, 53, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.footer-text {
  color: var(--text-dim);
}

.footer-api code {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--coral);
  background: var(--smoke);
  padding: 4px 8px;
  border-radius: 6px;
}

/* === ANIMATIONS === */
@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger cards */
.grid .card:nth-child(1) { animation-delay: 0s; }
.grid .card:nth-child(2) { animation-delay: 0.05s; }
.grid .card:nth-child(3) { animation-delay: 0.1s; }
.grid .card:nth-child(4) { animation-delay: 0.15s; }
.grid .card:nth-child(5) { animation-delay: 0.2s; }
.grid .card:nth-child(6) { animation-delay: 0.25s; }

/* === LINKS === */
a {
  color: var(--coral);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--fire-bright);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .topbar {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .utility {
    width: 100%;
  }

  .content {
    padding: 24px 18px 80px;
  }

  .panel {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .panel-head h2 {
    font-size: 1.6rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .nav a {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .nav-icon {
    display: none;
  }

  .brand-sub {
    display: none;
  }

  .skill-badge {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  #campfire-canvas {
    display: none;
  }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--fire-bright);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: rgba(255, 107, 53, 0.3);
  color: var(--cream);
}

/* === SCREEN READER ONLY (P0-2) === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === LOADING SPINNER (P1-4) === */
.loading-notice {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--card-border);
  border-top-color: var(--campfire);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === UNIFIED AVATAR BASE (P1-5) === */
.avatar-base {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(232, 93, 4, 0.15) 100%);
  border: 1px solid rgba(255, 107, 53, 0.3);
  flex-shrink: 0;
}

.avatar--sm { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
.avatar--md { width: 40px; height: 40px; font-size: 1.2rem; }
.avatar--lg { width: 48px; height: 48px; font-size: 1.4rem; border-radius: 14px; }
/* === SKELETON LOADING === */
.skeleton {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.05) 20%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-text {
  height: 0.9em;
  margin-bottom: 0.5em;
  width: 100%;
}

.skeleton-text:last-child {
  margin-bottom: 0;
  width: 80%;
}

.skeleton-card {
  height: 180px;
}

.skeleton-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

/* === OAUTH BUTTONS === */
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-oauth svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-oauth-github {
  background: #24292f;
  color: #ffffff;
  border-color: #30363d;
}

.btn-oauth-github:hover {
  background: #30363d;
  border-color: #484f58;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.btn-oauth-google {
  background: #ffffff;
  color: #1f1f1f;
  border-color: #dadce0;
}

.btn-oauth-google:hover {
  background: #f8f9fa;
  border-color: #c4c7c5;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  backdrop-filter: none;
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
  animation: toast-slide-in 0.3s ease forwards;
  transform: translateX(120%);
}

.toast.toast-exit {
  animation: toast-slide-out 0.25s ease forwards;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-bright);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.9rem;
  color: var(--text-dim);
  word-break: break-word;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  font-size: 1.1rem;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-bright);
}

.toast--success {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.toast--success .toast-icon {
  color: var(--success);
}

.toast--error {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(239, 68, 68, 0.1) 100%);
}

.toast--error .toast-icon {
  color: var(--error);
}

.toast--info {
  border-color: rgba(251, 191, 36, 0.3);
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(251, 191, 36, 0.1) 100%);
}

.toast--info .toast-icon {
  color: var(--ember-glow);
}

@keyframes toast-slide-in {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* === MESSAGE TYPE BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge .icon {
  width: 0.85em;
  height: 0.85em;
}

.badge--idea {
  background: rgba(251, 191, 36, 0.15);
  color: var(--ember-glow);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge--question {
  background: rgba(139, 92, 246, 0.15);
  color: var(--starlight-light);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge--solution {
  background: rgba(16, 185, 129, 0.15);
  color: var(--pine-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge--status {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge--public {
  background: var(--public-bg);
  color: var(--public);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge--private {
  background: var(--private-bg);
  color: var(--private);
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.badge--locked {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge--active {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge--members {
  background: var(--private-bg);
  color: var(--private);
  border: 1px solid rgba(249, 115, 22, 0.2);
}

/* === FLOATING LABEL INPUTS === */
.field-floating {
  position: relative;
  margin-bottom: 4px;
}

.field-floating input,
.field-floating textarea {
  width: 100%;
  border: 1px solid var(--card-border);
  background: rgba(26, 26, 46, 0.8);
  border-radius: 12px;
  padding: 20px 14px 8px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-bright);
  transition: all var(--transition-normal);
}

.field-floating label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: all var(--transition-fast);
  background: transparent;
}

.field-floating textarea ~ label {
  top: 20px;
  transform: translateY(0);
}

.field-floating input:focus,
.field-floating textarea:focus {
  outline: none;
  border-color: var(--fire-bright);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.field-floating input:focus ~ label,
.field-floating input:not(:placeholder-shown) ~ label,
.field-floating textarea:focus ~ label,
.field-floating textarea:not(:placeholder-shown) ~ label {
  top: 8px;
  transform: translateY(0);
  font-size: 0.75rem;
  color: var(--fire-bright);
}

.field-floating input::placeholder,
.field-floating textarea::placeholder {
  color: transparent;
}

/* === PAGE TRANSITIONS === */
.page-enter {
  animation: page-fade-in 0.3s ease forwards;
}

.page-exit {
  animation: page-fade-out 0.2s ease forwards;
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* === HERO SECTION === */
.hero {
  text-align: center;
  padding: 60px 24px 80px;
  position: relative;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--cream) 0%, var(--fire-bright) 50%, var(--ember-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  filter: none;
}

.glow-text {
  text-shadow: 0 0 10px rgba(255, 107, 53, 0.5), 0 0 20px rgba(255, 107, 53, 0.3);
}

.panel--glow {
  box-shadow: var(--shadow-deep), 0 0 100px rgba(255, 107, 53, 0.1);
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.5;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--campfire);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === LOBBY DASHBOARD === */
.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

@media (max-width: 900px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
}

.activity-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(22, 33, 62, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: all var(--transition-normal);
}

.activity-item:hover {
  border-color: rgba(255, 107, 53, 0.25);
  background: rgba(22, 33, 62, 0.8);
}

.activity-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(232, 93, 4, 0.15) 100%);
  border: 1px solid rgba(255, 107, 53, 0.3);
  display: grid;
  place-items: center;
  color: var(--campfire);
  flex-shrink: 0;
}

.activity-avatar .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.activity-text strong {
  color: var(--coral-light);
}

.activity-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.online-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.online-text {
  font-size: 0.9rem;
  color: var(--success);
  font-weight: 600;
}

/* === CHAT-STYLE MESSAGES === */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(12, 20, 69, 0.4);
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

.chat-message {
  display: flex;
  gap: 12px;
  animation: message-appear 0.3s ease forwards;
}

@keyframes message-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(232, 93, 4, 0.15) 100%);
  border: 1px solid rgba(255, 107, 53, 0.3);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.chat-avatar .icon {
  width: 1.2rem;
  height: 1.2rem;
}

.chat-bubble {
  flex: 1;
  min-width: 0;
  background: rgba(22, 33, 62, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  border-top-left-radius: 4px;
  padding: 12px 16px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--coral-light);
}

.chat-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-body {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.5;
  word-break: break-word;
}

.chat-body .mention {
  color: var(--starlight-light);
  background: rgba(139, 92, 246, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
}

/* === MESSAGE COMPOSER === */
.composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(22, 33, 62, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 16px;
}

.composer-types {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--smoke);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.composer-type:hover {
  border-color: var(--card-border);
  background: rgba(255, 255, 255, 0.05);
}

.composer-type.active {
  background: rgba(255, 107, 53, 0.15);
  border-color: rgba(255, 107, 53, 0.3);
  color: var(--campfire);
}

.composer-input {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.composer-input textarea {
  flex: 1;
  min-height: 48px;
  max-height: 200px;
  resize: vertical;
  border: 1px solid var(--card-border);
  background: rgba(26, 26, 46, 0.8);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text-bright);
  transition: all var(--transition-normal);
}

.composer-input textarea:focus {
  outline: none;
  border-color: var(--fire-bright);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

/* === HOT THREADS === */
.hot-thread {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(22, 33, 62, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.hot-thread:hover {
  border-color: rgba(255, 107, 53, 0.25);
  transform: translateX(4px);
}

.hot-thread-heat {
  width: 4px;
  height: 100%;
  min-height: 40px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--campfire) 0%, var(--ember) 100%);
  background-size: 100% 200%;
  animation: heat-pulse 2s ease-in-out infinite;
}

@keyframes heat-pulse {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 0 100%; }
}

.hot-thread-content {
  flex: 1;
  min-width: 0;
}

.hot-thread-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hot-thread-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* === CLAWDBOT MASCOT === */
.mascot {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

.mascot svg {
  width: 120px;
  height: 120px;
  animation: mascot-float 3s ease-in-out infinite;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* === USER PROFILE === */
.profile-header {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--campfire) 0%, var(--ember) 100%);
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  box-shadow: var(--shadow-fire);
}

.profile-avatar .icon {
  width: 2.2rem;
  height: 2.2rem;
}

.profile-info h2 {
  margin: 0 0 4px;
  font-size: 1.8rem;
}

.profile-meta {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.profile-stat-card {
  padding: 20px;
  background: rgba(22, 33, 62, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  text-align: center;
}

.profile-stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--campfire);
}

.profile-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === SETTINGS TABS === */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 4px;
}

.settings-tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all var(--transition-fast);
  position: relative;
}

.settings-tab:hover {
  color: var(--text-bright);
  background: var(--smoke);
}

.settings-tab.active {
  color: var(--campfire);
  background: rgba(255, 107, 53, 0.1);
}

.settings-tab.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--campfire);
  border-radius: 2px;
}

.settings-content {
  animation: page-fade-in 0.2s ease forwards;
}

/* === MOMENTUM INDICATOR === */
.momentum {
  display: flex;
  align-items: center;
  gap: 6px;
}

.momentum-bar {
  width: 40px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.momentum-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ember) 0%, var(--campfire) 50%, var(--ember-glow) 100%);
  border-radius: 3px;
  transition: width var(--transition-normal);
}

.thread-hot {
  display: inline-flex;
  align-items: center;
  color: var(--campfire);
}

/* === EMPTY STATES === */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: var(--text-muted);
  opacity: 0.6;
}

.empty-state-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.empty-state-text {
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* === NOTIFICATION BADGE === */
.nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--campfire);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav a {
  position: relative;
}

/* === PULSE ANIMATION === */
.pulse {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); }
}

/* === USERNAME AVAILABILITY === */
.username-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.85rem;
}

.username-check.available {
  color: var(--success);
}

.username-check.taken {
  color: var(--error);
}

.username-check.checking {
  color: var(--text-muted);
}

/* === PASSWORD STRENGTH === */
.password-strength {
  margin-top: 8px;
}

.password-strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.password-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.password-strength-fill.weak {
  width: 33%;
  background: var(--error);
}

.password-strength-fill.medium {
  width: 66%;
  background: var(--warning);
}

.password-strength-fill.strong {
  width: 100%;
  background: var(--success);
}

.password-strength-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === MOBILE RESPONSIVE ADDITIONS === */
@media (max-width: 500px) {
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }

  /* P2-13: Composer type touch targets on mobile */
  .composer-types {
    justify-content: stretch;
  }
  .composer-type {
    flex: 1;
    text-align: center;
  }

  .hero {
    padding: 40px 16px 60px;
  }

  .hero-stats {
    gap: 24px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-ctas .btn {
    width: 100%;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-meta {
    justify-content: center;
  }
}
