/* ============================================================
   SATR — EXPERIENCE LAYER (polish.css)
   Loaded LAST on every page, after tokens/base/components/
   layout/page styles/responsive. It upgrades the visual system
   and adds engagement surfaces without redefining page layout.
   Requires: styles/tokens.css
   ============================================================ */

/* ============================================================
   1. AMBIENT CANVAS
   ============================================================ */
body {
  position: relative;
  isolation: isolate;
  background-color: var(--bg-base);
  padding-bottom: 0;
}

/* Soft aurora + vignette behind every page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  top: 0;
  right: 0;
  background:
    radial-gradient(58% 48% at 88% -6%, rgba(0, 214, 143, 0.13) 0%, transparent 62%),
    radial-gradient(48% 42% at 6% 2%, rgba(56, 189, 248, 0.11) 0%, transparent 62%),
    radial-gradient(55% 50% at 48% 108%, rgba(167, 139, 250, 0.08) 0%, transparent 65%),
    linear-gradient(180deg, #08101d 0%, #070d18 55%, #050a13 100%);
  pointer-events: none;
  z-index: -2;
}

/* Fine dot grid — adds texture without noise */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 10%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% 10%, #000 30%, transparent 78%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.55;
}

::selection {
  background: rgba(0, 214, 143, 0.32);
  color: #fff;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 214, 143, 0.45);
  background-clip: padding-box;
}

/* ============================================================
   2. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, .feed-header h1, .section-title h2 {
}

.feed-header h1,
.page-title,
.dashboard-title {
  background: linear-gradient(180deg, #ffffff 20%, #b9cbe4 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient,
.logo-text {
  background-image: var(--accent-gradient);
  background-size: 160% 160%;
  animation: satr-gradient-shift 7s ease infinite;
}

@keyframes satr-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ============================================================
   3. SURFACES
   ============================================================ */
:is(.card, .widget-card, .composer, .glass-panel, .auth-card, .modal-card):not(.skeleton) {
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 18px 40px -28px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
}

.post-card:not(.skeleton) {
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 44px -32px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.24s ease,
    box-shadow 0.24s ease;
}

.post-card:not(.skeleton):hover {
  transform: translateY(-2px);
  border-color: rgba(0, 214, 143, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 26px 54px -30px rgba(0, 0, 0, 1),
    0 0 0 1px rgba(0, 214, 143, 0.06);
}

/* Thin accent line on hover */
.post-card:not(.skeleton)::before {
  content: '';
  position: absolute;
  inset-inline: 18px;
  top: -1px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-gradient);
  opacity: 0;
  transform: scaleX(0.55);
  transition: opacity 0.25s ease, transform 0.35s ease;
  pointer-events: none;
}
.post-card:not(.skeleton):hover::before {
  opacity: 0.9;
  transform: scaleX(1);
}

.widget-card {
  position: relative;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.widget-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 22px 46px -30px rgba(0, 0, 0, 1);
}

.widget-title {
  font-size: 0.98rem;
}
.widget-title > i,
.widget-title > span > i {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Project / group / lesson / snippet / dev cards share one hover language */
:is(.project-card, .group-card, .tech-card, .snippet-card, .dev-card-large, .developer-card):hover {
  border-color: rgba(0, 214, 143, 0.24) !important;
  box-shadow:
    0 26px 50px -30px rgba(0, 0, 0, 1),
    0 0 0 1px rgba(0, 214, 143, 0.05) !important;
}

/* ============================================================
   4. BUTTONS + INTERACTIONS
   ============================================================ */
.btn {
  position: relative;
  overflow: hidden;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}
.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn-primary {
  background: var(--accent-gradient);
  background-size: 150% 150%;
  color: #04140e;
  border-color: transparent;
  box-shadow:
    0 10px 24px -12px rgba(0, 214, 143, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary:hover {
  background-color: transparent;
  background-position: 100% 50%;
  transform: translateY(-2px);
  box-shadow:
    0 16px 34px -12px rgba(0, 214, 143, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: -40%;
  bottom: -40%;
  width: 46%;
  left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  transition: left 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.btn-primary:hover::after {
  left: 125%;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 214, 143, 0.28);
}

.btn-outline {
  border-color: rgba(0, 214, 143, 0.5);
  background: rgba(0, 214, 143, 0.03);
}
.btn-outline:hover {
  background: rgba(0, 214, 143, 0.12);
  box-shadow: 0 0 0 1px rgba(0, 214, 143, 0.18);
}

/* Material-style ripple injected by js/ux.js */
.satr-ripple-host {
  position: relative;
  overflow: hidden;
}
.satr-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  animation: satr-ripple 0.55s ease-out forwards;
  z-index: 0;
}
@keyframes satr-ripple {
  to { transform: scale(2.6); opacity: 0; }
}

/* ============================================================
   5. NAVIGATION — DESKTOP SIDEBAR
   ============================================================ */
.sidebar {
  background: linear-gradient(180deg, rgba(12, 20, 34, 0.94) 0%, rgba(8, 13, 24, 0.98) 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  scrollbar-width: none;
}
.sidebar > * { flex-shrink: 0; }
.sidebar::-webkit-scrollbar { display: none; }

.logo {
  padding-bottom: 22px;
}
.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  background-size: 160% 160%;
  animation: satr-gradient-shift 7s ease infinite;
  border-radius: 13px;
  box-shadow:
    0 8px 22px -8px rgba(0, 214, 143, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.logo-text {
  font-size: 1.7rem;
}

.nav-item {
  position: relative;
  overflow: hidden;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.nav-item > i {
  transition: transform 0.2s ease, color 0.2s ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(-2px);
}
.nav-item:hover > i {
  transform: scale(1.1);
  color: var(--primary);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 214, 143, 0.16), rgba(0, 214, 143, 0.035));
  color: var(--primary-bright);
  border-color: rgba(0, 214, 143, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(0, 214, 143, 0.08),
    0 8px 24px -18px rgba(0, 214, 143, 0.8);
}
.nav-item.active::after {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  top: 50%;
  width: 3px;
  height: 20px;
  border-radius: 3px;
  background: var(--primary);
  transform: translateY(-50%);
  box-shadow: 0 0 12px rgba(0, 214, 143, 0.9);
}

/* Quick compose CTA generated by js/navigation.js */
.sidebar-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 14px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(0, 214, 143, 0.14), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(0, 214, 143, 0.26);
  color: var(--primary-bright);
  font-weight: 800;
  font-size: 0.94rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.sidebar-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 214, 143, 0.45);
  box-shadow: 0 12px 28px -18px rgba(0, 214, 143, 0.9);
}
.sidebar-cta i {
  font-size: 1.15rem;
}
.sidebar-cta kbd {
  margin-inline-start: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.user-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.075);
}
.user-card:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(0, 214, 143, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -22px rgba(0, 0, 0, 1);
}
.user-avatar-sm {
  box-shadow: 0 0 0 2px rgba(0, 214, 143, 0.22);
}

/* ============================================================
   6. NAVIGATION — MOBILE
   ============================================================ */
.satr-mobile-header {
  height: 62px;
  background: rgba(7, 12, 22, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 12px 30px -24px rgba(0, 0, 0, 1);
}
.satr-mobile-logo-icon {
  background: var(--accent-gradient);
  box-shadow: 0 6px 18px -8px rgba(0, 214, 143, 0.8);
}

.satr-mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.satr-mobile-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 1.25rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.satr-mobile-icon-btn:hover,
.satr-mobile-icon-btn:active {
  background: rgba(0, 214, 143, 0.12);
  color: var(--primary);
  transform: translateY(-1px);
}
.satr-mobile-icon-btn .nav-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  min-width: 18px;
  height: 18px;
  font-size: 0.62rem;
  border: 2px solid #0a1220;
}

.satr-mobile-menu-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.07);
}

.satr-drawer-sidebar {
  background: linear-gradient(180deg, #0d1626 0%, #080e1a 100%);
  border-left-color: rgba(255, 255, 255, 0.08);
}

/* Floating glass dock on phones */
@media (max-width: 768px) {
  .satr-bottom-nav {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: 66px;
    padding: 7px;
    border-radius: 21px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 17, 30, 0.86);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    box-shadow:
      0 22px 45px -18px rgba(0, 0, 0, 0.95),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: visible;
  }

  body[data-satr-nav-mobile-bottom-nav="true"] {
    padding-bottom: calc(102px + env(safe-area-inset-bottom, 0px));
  }

  .satr-bottom-nav-item {
    position: relative;
    border-radius: 15px;
    gap: 2px;
    padding: 8px 4px;
    color: var(--text-muted);
    transition: color 0.18s ease, background 0.18s ease, transform 0.12s ease;
  }
  .satr-bottom-nav-item i {
    font-size: 1.3rem;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .satr-bottom-nav-item.active {
    color: var(--primary-bright);
    background: rgba(0, 214, 143, 0.11);
    box-shadow: inset 0 0 0 1px rgba(0, 214, 143, 0.14);
  }
  .satr-bottom-nav-item.active i {
    transform: translateY(-1px) scale(1.06);
    filter: drop-shadow(0 0 8px rgba(0, 214, 143, 0.45));
  }
  .satr-bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    width: 16px;
    height: 3px;
    border-radius: 99px;
    background: var(--primary);
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 214, 143, 0.85);
  }
  .satr-bottom-nav-item:active {
    transform: scale(0.92);
  }
}

/* ============================================================
   7. FORMS
   ============================================================ */
.form-input,
.form-textarea,
.form-select,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: rgba(255, 255, 255, 0.16);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: rgba(0, 214, 143, 0.55);
  box-shadow: var(--ring-primary);
  background: rgba(0, 0, 0, 0.36);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

/* ============================================================
   8. FEED HEADER + TABS
   ============================================================ */
.feed-header {
  position: relative;
  z-index: 25;
}
.feed-heading-block {
  min-width: 0;
}
.feed-subtitle {
  margin-top: 3px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.feed-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 214, 143, 0.1);
  border: 1px solid rgba(0, 214, 143, 0.2);
  border-radius: 999px;
  padding: 3px 9px;
  margin-top: 7px;
}
.feed-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0 rgba(0, 214, 143, 0.6);
  animation: satr-pulse 2s ease-out infinite;
}
@keyframes satr-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 214, 143, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(0, 214, 143, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 214, 143, 0); }
}

.feed-tabs {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  gap: 2px;
}
.feed-tab {
  position: relative;
  border-radius: 9px;
  font-size: 0.84rem;
  padding: 7px 13px;
}
.feed-tab:hover {
  background: rgba(255, 255, 255, 0.05);
}
.feed-tab.active {
  background: var(--accent-gradient);
  color: #04140e;
  box-shadow:
    0 6px 16px -8px rgba(0, 214, 143, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Sticky feed header on desktop only (keeps phones uncluttered) */
@media (min-width: 901px) {
  .feed-header {
    position: sticky;
    top: 0;
    margin-inline: -10px;
    padding: 10px 10px 12px;
    background: linear-gradient(180deg, rgba(8, 14, 26, 0.94) 62%, rgba(8, 14, 26, 0.74));
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
}

/* ============================================================
   9. COMPOSER
   ============================================================ */
.composer {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.085);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 22px 50px -34px rgba(0, 0, 0, 1);
  border-radius: var(--radius-xl);
}
.composer::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 214, 143, 0.4), transparent 38%, transparent 62%, rgba(56, 189, 248, 0.35));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.composer:focus-within::before {
  opacity: 1;
}
.composer:focus-within {
  border-color: rgba(0, 214, 143, 0.35);
  box-shadow:
    0 0 0 4px rgba(0, 214, 143, 0.06),
    0 26px 58px -34px rgba(0, 0, 0, 1);
}

.composer-avatar {
  width: 44px;
  height: 44px;
  box-shadow:
    0 0 0 2px rgba(8, 14, 26, 1),
    0 0 0 4px rgba(0, 214, 143, 0.28);
}
.composer-textarea {
  font-size: 1.02rem;
}
.composer-textarea::placeholder {
  color: #6b819e;
}

.composer-topics {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
  margin-bottom: 4px;
}
.composer-topics-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-inline-end: 2px;
}
.composer-topic {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  line-height: 1.2;
  transition: all 0.18s ease;
}
.composer-topic:hover {
  color: var(--primary-bright);
  border-color: rgba(0, 214, 143, 0.35);
  background: rgba(0, 214, 143, 0.1);
  transform: translateY(-1px);
}

.composer-footer {
  border-top-color: rgba(255, 255, 255, 0.05);
}
.composer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-inline-start: auto;
  margin-inline-end: 10px;
}
.composer-counter {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}
.composer-counter.is-warning {
  color: var(--orange);
}
.composer-counter.is-over {
  color: var(--red);
}
.composer-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.composer-shortcut kbd {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-secondary);
}

.tool-btn {
  border-radius: 10px;
}
.tool-btn:hover {
  background: rgba(0, 214, 143, 0.08);
  border-color: rgba(0, 214, 143, 0.22);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ============================================================
   10. POST CARDS
   ============================================================ */
.post-header {
  gap: 12px;
}
.post-avatar {
  width: 44px;
  height: 44px;
  border: none;
  box-shadow:
    0 0 0 2px rgba(8, 14, 26, 1),
    0 0 0 3px rgba(255, 255, 255, 0.09);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
a:hover > .post-avatar {
  box-shadow:
    0 0 0 2px rgba(8, 14, 26, 1),
    0 0 0 3px rgba(0, 214, 143, 0.45);
  transform: scale(1.03);
}
.post-author-name {
  font-weight: 800;
}
.post-badge {
}

.post-actions {
  gap: 4px;
  border-top-color: rgba(255, 255, 255, 0.05);
}
.action-btn {
  font-size: 0.82rem;
  padding: 7px 11px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.action-btn:hover {
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}
.action-btn:active {
  transform: scale(0.96);
}
.action-btn.upvoted {
  box-shadow: inset 0 0 0 1px rgba(0, 214, 143, 0.22);
}
.post-card.is-highlighted {
  animation: satr-highlight 2.2s ease;
}
@keyframes satr-highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 214, 143, 0); }
  18% { box-shadow: 0 0 0 2px rgba(0, 214, 143, 0.6), 0 0 34px -8px rgba(0, 214, 143, 0.5); }
  60% { box-shadow: 0 0 0 2px rgba(0, 214, 143, 0.25); }
}

.code-block {
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.code-block-header {
  background: rgba(255, 255, 255, 0.035);
}
.copy-btn:hover {
  background: rgba(0, 214, 143, 0.1);
  color: var(--primary);
}

/* Comment box */
.post-comments {
  animation: fadeInUp 0.25s ease both;
}
.comment-item {
  border-top-color: rgba(255, 255, 255, 0.05) !important;
}

/* ============================================================
   11. WIDGETS
   ============================================================ */
.trending-item {
  margin-inline: -8px;
  padding: 8px;
  border-radius: 10px;
  border-bottom: none;
  transition: background 0.18s ease, transform 0.18s ease;
}
.trending-item:hover {
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(-2px);
}
.trending-item + .trending-item {
  margin-top: 2px;
}
.trending-num {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.72rem;
  flex-shrink: 0;
}
.trending-item:nth-child(1) .trending-num {
  background: rgba(251, 146, 60, 0.16);
  color: var(--orange);
}
.trending-item:nth-child(2) .trending-num {
  background: rgba(56, 189, 248, 0.14);
  color: var(--blue);
}
.trending-item:nth-child(3) .trending-num {
  background: rgba(167, 139, 250, 0.14);
  color: var(--violet);
}
.trending-tag {
  font-size: 0.87rem;
}
.trending-count {
  font-size: 0.73rem;
}

.dev-card {
  margin-inline: -6px;
  padding: 8px 6px;
  border-radius: 10px;
  border-bottom: none;
  transition: background 0.18s ease;
}
.dev-card:hover {
  background: rgba(255, 255, 255, 0.04);
}
.dev-avatar {
  border: none;
  box-shadow: 0 0 0 2px rgba(8, 14, 26, 1), 0 0 0 3px rgba(255, 255, 255, 0.09);
}
.follow-btn {
  border-color: rgba(0, 214, 143, 0.4);
  background: rgba(0, 214, 143, 0.05);
  transition: all 0.18s ease;
}
.follow-btn:hover {
  background: var(--primary);
  color: #04140e;
  box-shadow: 0 6px 16px -8px rgba(0, 214, 143, 0.9);
}

.stat-card-sm {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border-color: rgba(255, 255, 255, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.stat-card-sm:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 214, 143, 0.22);
}
.stat-card-sm .stat-num {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   12. ENGAGEMENT SURFACES (homepage + reusable)
   ============================================================ */

/* Guest welcome banner */
.welcome-banner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  overflow: hidden;
  margin-bottom: 20px;
  padding: 24px 26px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 214, 143, 0.2);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(0, 214, 143, 0.18) 0%, transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(56, 189, 248, 0.12) 0%, transparent 60%),
    linear-gradient(135deg, rgba(17, 28, 45, 0.94), rgba(11, 18, 31, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 26px 54px -36px rgba(0, 0, 0, 1);
}
.welcome-banner[hidden] { display: none; }
.welcome-banner::after {
  content: '';
  position: absolute;
  top: -60%;
  inset-inline-start: -10%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 214, 143, 0.22), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
}
.welcome-copy { position: relative; z-index: 1; }
.welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-bright);
  background: rgba(0, 214, 143, 0.1);
  border: 1px solid rgba(0, 214, 143, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}
.welcome-banner h2 {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 6px;
}
.welcome-banner p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 46ch;
  margin-bottom: 16px;
}
.welcome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.welcome-actions .btn {
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.86rem;
}
.welcome-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 132px;
}
.welcome-code-card {
  width: 100%;
  max-width: 250px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 9, 17, 0.78);
  box-shadow: 0 22px 40px -24px rgba(0, 0, 0, 1);
  transform: rotate(-3deg);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.welcome-code-dots {
  display: flex;
  gap: 5px;
  padding: 9px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}
.welcome-code-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.welcome-code-dots span:first-child { background: #ff6b6b; }
.welcome-code-dots span:nth-child(2) { background: #ffd166; }
.welcome-code-dots span:nth-child(3) { background: var(--primary); }
.welcome-code-card pre {
  direction: ltr;
  text-align: left;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.75;
  color: #9fb4cf;
  overflow: hidden;
}
.welcome-code-card .tok-k { color: #c084fc; }
.welcome-code-card .tok-f { color: #38bdf8; }
.welcome-code-card .tok-s { color: #6ee7b7; }
.welcome-code-card .tok-c { color: #52678a; }

/* Daily challenge + join cards */
.challenge-card {
  background:
    radial-gradient(100% 120% at 100% 0%, rgba(251, 146, 60, 0.12), transparent 60%),
    var(--surface-glass) !important;
  border-color: rgba(251, 146, 60, 0.2) !important;
}
.challenge-card .widget-title i {
  color: var(--orange);
  background: rgba(251, 146, 60, 0.12);
}
.challenge-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.challenge-code {
  direction: ltr;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #9fb4cf;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 8px 10px;
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.challenge-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.challenge-meta .tag {
  font-size: 0.68rem;
  padding: 2px 8px;
}
.challenge-cta {
  width: 100%;
  font-size: 0.8rem;
  padding: 8px 12px;
}

.join-card {
  padding: 18px !important;
  background:
    radial-gradient(110% 100% at 0% 0%, rgba(167, 139, 250, 0.16), transparent 62%),
    var(--surface-glass) !important;
  border-color: rgba(167, 139, 250, 0.22) !important;
}
.join-card[hidden] { display: none; }
.join-card h3 {
  font-size: 1rem;
  font-weight: 900;
  margin-bottom: 5px;
}
.join-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 12px;
}
.join-card ul {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.join-card li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.join-card li i {
  color: var(--primary);
  font-size: 0.95rem;
}
.join-card .btn {
  width: 100%;
  font-size: 0.84rem;
  padding: 9px 12px;
}

/* ============================================================
   13. EMPTY STATES
   ============================================================ */
.empty-state {
  padding: 44px 24px 40px;
  text-align: center;
  background: var(--surface-glass);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
.empty-state::before {
  content: '';
  position: absolute;
  top: -70px;
  left: 50%;
  width: 240px;
  height: 180px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0, 214, 143, 0.14), transparent 70%);
  pointer-events: none;
}
.empty-orb {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  color: var(--primary);
  background:
    linear-gradient(135deg, rgba(0, 214, 143, 0.18), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(0, 214, 143, 0.28);
  box-shadow:
    0 14px 30px -18px rgba(0, 214, 143, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.empty-state h3 {
  position: relative;
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 6px;
}
.empty-state p {
  position: relative;
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 42ch;
  margin: 0 auto 18px;
  line-height: 1.7;
}
.empty-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.empty-suggestions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.empty-suggestions-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}
.empty-chip {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  transition: all 0.18s ease;
}
.empty-chip:hover {
  color: var(--primary-bright);
  border-color: rgba(0, 214, 143, 0.32);
  background: rgba(0, 214, 143, 0.09);
  transform: translateY(-1px);
}

/* ============================================================
   14. FLOATING UI (progress, back-to-top, reveal)
   ============================================================ */
.satr-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: right center;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  box-shadow: 0 0 12px rgba(0, 214, 143, 0.7);
  z-index: 1200;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.satr-back-to-top {
  position: fixed;
  left: 20px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(13, 21, 35, 0.88);
  color: var(--text-secondary);
  font-size: 1.2rem;
  z-index: 950;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, color 0.2s, border-color 0.2s;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 1);
}
.satr-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.satr-back-to-top:hover {
  color: var(--primary);
  border-color: rgba(0, 214, 143, 0.35);
  transform: translateY(-2px);
}

.satr-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.satr-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Page enter / leave transitions */
@keyframes satr-page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
body:not(.satr-no-page-transition) .layout,
body:not(.satr-no-page-transition) .auth-wrapper,
body:not(.satr-no-page-transition) .admin-layout {
  animation: satr-page-in 0.4s ease both;
}
body.satr-leaving {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.satr-no-page-transition .layout {
  animation: none;
}

/* Skip-link for keyboard users */
.satr-skip-link {
  position: fixed;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 3000;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--primary);
  color: #04140e;
  font-weight: 800;
  font-size: 0.85rem;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.satr-skip-link:focus {
  transform: translateY(0);
}

/* ============================================================
   15. TOAST / MODAL
   ============================================================ */
.toast {
  border-width: 1px;
  background: rgba(13, 21, 35, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 18px 44px -20px rgba(0, 0, 0, 1),
    0 0 0 1px rgba(0, 214, 143, 0.16);
  border-radius: 13px;
  font-size: 0.88rem;
}
.modal-backdrop.open {
  animation: satr-fade-in 0.2s ease both;
}
.modal-card {
  animation: satr-modal-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes satr-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes satr-modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   16. PAGE-SPECIFIC LIGHT TOUCHES
   ============================================================ */
.learn-hero,
.projects-hero,
.continue-section,
.dash-hero,
.guest-cta {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 26px 60px -40px rgba(0, 0, 0, 1);
}
.auth-card {
  border-radius: var(--radius-xl);
  padding: 38px 34px;
}
.auth-heading {
  font-size: 1.62rem;
}
.auth-card .btn {
  margin-top: 4px;
  padding-block: 13px;
}
.input-icon-wrap .form-input {
  background: rgba(0, 0, 0, 0.28);
}

.search-results {
  background: rgba(13, 21, 35, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 1);
}
.search-result-item:hover {
  background: rgba(0, 214, 143, 0.08);
}

.page-header,
.dashboard-header,
.admin-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   17. RESPONSIVE REFINEMENTS
   ============================================================ */
@media (max-width: 900px) {
  .feed-header h1 { font-size: 1.22rem; }
  .feed-tabs {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .feed-tabs::-webkit-scrollbar { display: none; }
  .feed-tab {
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .welcome-banner {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .welcome-art { display: none; }
  .welcome-banner h2 { font-size: 1.25rem; }
  .composer { padding: 14px; border-radius: var(--radius-lg); }
  .composer-shortcut { display: none; }
  .post-card { padding: 16px; border-radius: var(--radius-lg); }
  .post-actions { gap: 2px; }
  .action-btn { padding: 7px 9px; }
  .satr-back-to-top {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .feed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .feed-header .feed-tabs { align-self: stretch; }
  .welcome-banner { padding: 18px; }
  .welcome-actions .btn { flex: 1; }
  .empty-state { padding: 34px 18px 30px; }
  .satr-bottom-nav-item span { font-size: 0.66rem; }
}

/* ============================================================
   18. MOTION SAFETY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .satr-reveal {
    opacity: 1;
    transform: none;
  }
  body::before,
  .logo-text,
  .logo-icon {
    animation: none !important;
  }
  .satr-back-to-top,
  .post-card,
  .btn,
  .nav-item {
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   19. UNIFIED PAGE SYSTEM
   One visual language for every page: shared hero surfaces,
   filter bars, tabs, content cards, rows, headings and forms.
   ============================================================ */

/* ── 19.1 Page heroes ───────────────────────────────────────── */
:is(.learn-hero, .projects-hero, .groups-hero, .discovery-hero, .code-hero,
    .notif-hero, .saved-hero, .dash-hero, .project-header-card) {
  --hero-accent-rgb: 0, 214, 143;
  position: relative;
  overflow: hidden;
  padding: 30px 32px;
  margin-bottom: 24px;
  border: 1px solid rgba(var(--hero-accent-rgb), 0.18);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(115% 160% at 100% -15%, rgba(var(--hero-accent-rgb), 0.17) 0%, transparent 56%),
    radial-gradient(95% 130% at 0% 115%, rgba(56, 189, 248, 0.1) 0%, transparent 60%),
    linear-gradient(160deg, rgba(23, 33, 53, 0.92) 0%, rgba(12, 19, 33, 0.97) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 60px -42px rgba(0, 0, 0, 1);
}

.groups-hero { --hero-accent-rgb: 167, 139, 250; }
.saved-hero { --hero-accent-rgb: 56, 189, 248; }
.dash-hero { --hero-accent-rgb: 167, 139, 250; }

/* Compact utility-page heroes keep the same surface, smaller rhythm */
:is(.notif-hero, .saved-hero) {
  padding: 22px 26px;
  margin-bottom: 18px;
}

/* Hero titles: one type scale and one white→cool gradient */
:is(.learn-hero, .projects-hero, .groups-hero, .discovery-hero, .code-hero,
    .notif-hero, .saved-hero) :is(h1, .hero-title, .hero-headline) {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 2.7vw, 2.2rem);
  font-weight: 900;
  line-height: 1.25;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 22%, #b9cbe4 140%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

:is(.notif-hero, .saved-hero) h1 {
  font-size: clamp(1.45rem, 2vw, 1.7rem);
}

/* Icons inside gradient titles must keep their own colour */
:is(.learn-hero, .projects-hero, .groups-hero, .discovery-hero, .code-hero,
    .notif-hero, .saved-hero) :is(h1, .hero-title, .hero-headline) i {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
  background: none;
}

:is(.learn-hero, .projects-hero, .groups-hero, .discovery-hero, .code-hero,
    .notif-hero, .saved-hero) :is(p, .hero-desc, .hero-subtitle) {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.7;
  max-width: 68ch;
}

/* Hero meta pills share one shape on every page */
:is(.hero-stat-pill, .metric-badge, .tech-meta-pill) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(4, 9, 17, 0.32);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
:is(.hero-stat-pill, .metric-badge, .tech-meta-pill) i {
  color: var(--primary);
  font-size: 1rem;
}

:is(.hero-actions, .tech-hero-actions, .notif-hero-actions) {
  gap: 10px;
}

/* Learn-technology hero: same card language, full-width content */
.tech-hero {
  margin: 24px 24px 0;
  padding: 30px 32px;
  border: 1px solid rgba(var(--tech-rgb), 0.2);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(110% 160% at 100% -10%, rgba(var(--tech-rgb), 0.16) 0%, transparent 55%),
    radial-gradient(90% 130% at 0% 110%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    linear-gradient(160deg, rgba(23, 33, 53, 0.92), rgba(12, 19, 33, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 28px 60px -44px rgba(0, 0, 0, 1);
}
.tech-hero-title {
  font-size: clamp(1.7rem, 2.6vw, 2.1rem);
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 22%, #b9cbe4 140%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tech-hero-desc {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-secondary);
}
.tech-progress-overview {
  margin: 18px 24px 28px;
  border-radius: var(--radius-xl);
}

/* Lesson header becomes a readable content card */
.lesson-header {
  padding: 26px 28px;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius-xl);
  background: var(--surface-glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 20px 46px -34px rgba(0, 0, 0, 0.95);
}
.lesson-title {
  font-size: clamp(1.65rem, 2.5vw, 2rem);
  font-weight: 900;
  line-height: 1.25;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 22%, #b9cbe4 140%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Group header banner */
.group-header-banner {
  border-color: rgba(167, 139, 250, 0.2) !important;
  background: var(--surface-glass) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 26px 56px -40px rgba(0, 0, 0, 1);
}
.group-banner-cover::after {
  background: linear-gradient(to bottom, rgba(8, 14, 26, 0.15) 20%, rgba(12, 19, 33, 0.97) 100%) !important;
}
.group-title-main { font-size: 1.75rem; }

/* ── 19.2 Shared content surfaces ───────────────────────────── */
:is(.stat-card, .admin-card, .stat-box, .dev-card, .group-card, .group-composer,
    .right-panel-widget, .member-card, .profile-info, .stat, .xp-section,
    .notif-item, .saved-row, .tech-card, .tech-progress-overview,
    .curriculum-section-card, .feedback-section, .project-card,
    .studio-card, .code-editor-box, .code-runner-pane, .code-discussion-box,
    .snippet-card, .projects-empty-state) {
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 18px 40px -30px rgba(0, 0, 0, 0.9);
}

:is(.stat-card, .stat-box, .tech-card, .group-card, .dev-card, .snippet-card,
    .project-card, .studio-card, .curriculum-section-card) {
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.24s ease,
    box-shadow 0.24s ease;
}
:is(.stat-card, .stat-box, .tech-card, .group-card, .dev-card, .snippet-card,
    .project-card, .curriculum-section-card):hover {
  transform: translateY(-3px);
  border-color: rgba(0, 214, 143, 0.26) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 56px -32px rgba(0, 0, 0, 1),
    0 0 0 1px rgba(0, 214, 143, 0.06) !important;
}

/* Staggered rows used on dashboard widgets */
:is(.badge-item, .achievement-item, .leader-item, .project-mini-item) {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
:is(.badge-item, .achievement-item, .leader-item, .project-mini-item):hover {
  border-color: rgba(0, 214, 143, 0.22);
  background: rgba(255, 255, 255, 0.045);
}

/* ── 19.3 Filter bars + chips ───────────────────────────────── */
:is(.projects-filter-bar, .groups-controls, .discovery-controls) {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.028);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  margin-bottom: 22px;
}

:is(.filter-chip, .cat-btn) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
:is(.filter-chip, .cat-btn):hover {
  color: var(--primary-bright);
  border-color: rgba(0, 214, 143, 0.32);
  background: rgba(0, 214, 143, 0.08);
  transform: translateY(-1px);
}
:is(.filter-chip, .cat-btn).active {
  color: #04140e;
  border-color: transparent;
  background: var(--accent-gradient);
  box-shadow:
    0 7px 18px -9px rgba(0, 214, 143, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.categories-chips-bar,
.specialty-chips-wrapper {
  padding-bottom: 2px;
  scrollbar-width: none;
}
.categories-chips-bar::-webkit-scrollbar,
.specialty-chips-wrapper::-webkit-scrollbar {
  display: none;
}

/* ── 19.4 Tabs / segmented controls ─────────────────────────── */
:is(.profile-tabs, .runner-tabs, .group-tabs-nav) {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  overflow-x: auto;
  scrollbar-width: none;
}
:is(.profile-tabs, .runner-tabs, .group-tabs-nav)::-webkit-scrollbar {
  display: none;
}

:is(.profile-tab, .runner-tab, .group-nav-tab) {
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
:is(.profile-tab, .runner-tab, .group-nav-tab):hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
:is(.profile-tab, .runner-tab, .group-nav-tab).active {
  color: #04140e;
  border-bottom-color: transparent;
  background: var(--accent-gradient);
  box-shadow:
    0 6px 16px -8px rgba(0, 214, 143, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ── 19.5 Section headings ──────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 0;
  border: 0;
}
.section-title h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.2rem;
  font-weight: 900;
}
.section-title h2 i {
  color: var(--primary);
}

/* ── 19.6 List rows (saved / notifications) ─────────────────── */
:is(.notif-item, .saved-row) {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 9px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
:is(.notif-item, .saved-row):hover {
  transform: translateY(-1px);
  border-color: rgba(0, 214, 143, 0.26) !important;
  background: rgba(255, 255, 255, 0.05);
}
:is(.notif-item, .saved-row).unread {
  border-color: rgba(0, 214, 143, 0.32) !important;
  background:
    linear-gradient(90deg, rgba(0, 214, 143, 0.09), rgba(255, 255, 255, 0.025) 70%);
}
.notif-icon {
  border-radius: 12px;
  background: rgba(0, 214, 143, 0.1) !important;
  border: 1px solid rgba(0, 214, 143, 0.18);
  color: var(--primary);
}
.saved-row img {
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* ── 19.7 Empty states (including inline ones) ──────────────── */
.projects-empty-state,
.devs-empty-state,
.groups-empty-state {
  padding: 54px 24px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% -20%, rgba(0, 214, 143, 0.12), transparent 65%),
    var(--surface-glass);
  text-align: center;
}
.projects-empty-state h3,
.devs-empty-state h3,
.groups-empty-state h3 {
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 6px;
}
.projects-empty-state p,
.devs-empty-state p,
.groups-empty-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Dashboard guest call-to-action gets the same empty-state language */
.guest-cta {
  min-height: 52vh;
  max-width: 720px;
  margin: 8px auto 24px;
  padding: 46px 32px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 50% -15%, rgba(0, 214, 143, 0.13), transparent 62%),
    var(--surface-glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 24px 56px -40px rgba(0, 0, 0, 1);
}
.guest-cta-icon {
  width: 86px;
  height: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: rgba(0, 214, 143, 0.1);
  border: 1px solid rgba(0, 214, 143, 0.24);
  box-shadow: 0 18px 40px -24px rgba(0, 214, 143, 0.65);
}
.guest-cta h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 900;
}
.guest-cta p {
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.75;
}

/* Inline error / empty cards written in page scripts */
[style*="background: var(--bg-surface)"][style*="border-radius: var(--radius-xl)"],
[style*="background:var(--bg-surface)"][style*="border-radius:var(--radius-xl)"],
[style*="background: var(--bg-surface)"][style*="border-radius: var(--radius-lg)"],
[style*="background:var(--bg-surface)"][style*="border-radius:var(--radius-lg)"] {
  background: var(--surface-glass) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 40px -30px rgba(0, 0, 0, 0.9) !important;
}

/* ── 19.8 Forms ─────────────────────────────────────────────── */
:is(.form-input, .form-select, .form-textarea, .learn-search,
    .search-wrapper input, .search-input-wrapper input,
    .admin-filter-input, .admin-filter-select, .editor-lang-select) {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  background-color: rgba(0, 0, 0, 0.26);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
:is(.form-input, .form-select, .form-textarea, .learn-search,
    .search-wrapper input, .search-input-wrapper input,
    .admin-filter-input, .admin-filter-select, .editor-lang-select):focus {
  outline: none;
  border-color: rgba(0, 214, 143, 0.55);
  background-color: rgba(0, 0, 0, 0.34);
  box-shadow: var(--ring-primary);
}
:is(.form-input, .form-select, .form-textarea, .learn-search,
    .search-wrapper input, .search-input-wrapper input):hover {
  border-color: rgba(255, 255, 255, 0.16);
}

/* ── 19.9 Buttons: one radius + one size scale ──────────────── */
.btn:not(.btn-sm):not(.btn-lg) {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
}
.btn-sm {
  padding: 0.4rem 0.85rem;
  border-radius: 9px;
}
.btn-lg {
  padding: 0.85rem 1.6rem;
  border-radius: 14px;
}

/* ── 19.10 Page shells + secondary navigation ───────────────── */
.dashboard-main {
  padding: 24px 28px;
  background: transparent;
}

.admin-sidebar {
  background: linear-gradient(180deg, rgba(12, 20, 34, 0.94) 0%, rgba(8, 13, 24, 0.98) 100%);
  border-left-color: rgba(255, 255, 255, 0.06);
}
.admin-header {
  background: rgba(7, 12, 22, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.admin-nav-item {
  border-radius: 10px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(-2px);
}
.admin-nav-item.active {
  background: linear-gradient(90deg, rgba(0, 214, 143, 0.16), rgba(0, 214, 143, 0.03));
  color: var(--primary-bright);
}
.admin-table th {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  font-weight: 800;
}
.admin-table td {
  border-color: rgba(255, 255, 255, 0.05);
}
.admin-table tr:hover td {
  background: rgba(0, 214, 143, 0.04);
}

.lesson-topbar {
  background: rgba(7, 12, 22, 0.82);
  border-bottom-color: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.lesson-sidebar,
.curriculum-sidebar {
  background: linear-gradient(180deg, rgba(12, 20, 34, 0.96) 0%, rgba(8, 13, 24, 0.98) 100%);
  border-left-color: rgba(255, 255, 255, 0.06);
}
.sidebar-header {
  background: rgba(12, 20, 34, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Profile cover matches the hero family */
.cover-photo {
  border-radius: var(--radius-xl);
  border-color: rgba(0, 214, 143, 0.14);
  background:
    radial-gradient(110% 150% at 85% 10%, rgba(0, 214, 143, 0.18), transparent 55%),
    radial-gradient(90% 130% at 10% 100%, rgba(56, 189, 248, 0.14), transparent 60%),
    linear-gradient(135deg, #0d281e, #0a1f38 55%, #1a0f30) !important;
}

/* Auth card is part of the same surface family */
.auth-wrapper {
  margin-inline: auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  position: relative;
  padding: 40px 34px;
  border-radius: var(--radius-xl);
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 30px 70px -42px rgba(0, 0, 0, 1);
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  inset-inline: 34px;
  top: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-gradient);
  opacity: 0.8;
}
.auth-heading {
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
}

/* Shared modal shells used by page scripts */
.modal-box {
  background: var(--surface-glass) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-float);
}
.modal-overlay {
  background: rgba(3, 7, 13, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── 19.11 Studio (code.html) surfaces ──────────────────────── */
.code-mode-switcher {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.075);
  padding: 4px;
}
.code-mode-btn.active {
  background: var(--accent-gradient);
  color: #04140e;
  box-shadow: 0 6px 16px -8px rgba(0, 214, 143, 0.85);
}
.code-editor-header,
.runner-pane-header {
  background: rgba(255, 255, 255, 0.035);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.code-editor-box,
.code-runner-pane,
.code-discussion-box,
.snippet-card,
.studio-card {
  border-radius: var(--radius-lg);
}
.code-preview-frame {
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.08);
}

/* ── 19.12 Responsive alignment ─────────────────────────────── */
@media (max-width: 1024px) {
  .tech-hero {
    margin: 16px 16px 0;
    padding: 24px 20px;
  }
  .tech-progress-overview {
    margin: 14px 16px 24px;
  }

  /* Code studio: let the single-column grid shrink to the viewport.
     Without min-width:0 the editor's intrinsic width pushed it off-screen. */
  .code-studio-grid,
  .code-studio-grid > *,
  .code-editor-box,
  .code-runner-pane,
  .code-editor-header,
  .code-editor-tools,
  .editor-quick-templates,
  .code-editor-wrapper {
    min-width: 0;
    max-width: 100%;
  }
  .code-editor-wrapper {
    min-height: 300px;
    max-height: 460px;
  }
  .code-textarea {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  /* The desktop sidebar is display:none inside this wrapper, but the
     wrapper still occupied the first grid row and pushed every mobile
     page down by ~180–270px. Remove the wrapper itself from layout. */
  #satr-sidebar-container {
    display: none !important;
  }
}

@media (max-width: 900px) {
  /* The curriculum and lesson sidebars double as mobile drawers. Show
     them above the overlay when the shared header menu opens them. */
  .curriculum-sidebar.active,
  .lesson-sidebar.active {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    height: 100vh;
    z-index: 1150;
    box-shadow: -24px 0 60px -24px rgba(0, 0, 0, 0.9);
  }
}

@media (max-width: 768px) {
  :is(.learn-hero, .projects-hero, .groups-hero, .discovery-hero, .code-hero,
      .dash-hero, .project-header-card) {
    padding: 22px 20px;
    margin-bottom: 18px;
  }
  :is(.notif-hero, .saved-hero) {
    padding: 18px 16px;
  }
  :is(.learn-hero, .projects-hero, .groups-hero, .discovery-hero, .code-hero,
      .notif-hero, .saved-hero) :is(h1, .hero-title, .hero-headline) {
    font-size: 1.55rem;
  }
  :is(.notif-hero, .saved-hero) h1 {
    font-size: 1.35rem;
  }
  .lesson-header {
    padding: 20px 18px;
    margin-bottom: 22px;
  }
  .lesson-title {
    font-size: 1.45rem;
  }
  .tech-hero-title {
    font-size: 1.55rem;
  }
  .dashboard-main {
    padding: 16px 14px 90px;
  }
  :is(.profile-tabs, .runner-tabs, .group-tabs-nav) {
    margin-bottom: 16px;
  }

  /* Lesson/technology shells are not .layout, so give them room for
     the fixed bottom navigation as well. */
  .tech-layout,
  .lesson-layout {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  :is(.learn-hero, .projects-hero, .groups-hero, .discovery-hero, .code-hero,
      .dash-hero, .project-header-card) {
    padding: 18px 16px;
  }
  :is(.hero-actions, .tech-hero-actions, .notif-hero-actions) {
    width: 100%;
  }
  :is(.hero-actions, .tech-hero-actions, .notif-hero-actions) .btn {
    flex: 1;
  }
}
