/* ============================================================
   Estilo "Magnum": papel cálido, tinta #383838, tarjetas con
   borde marcado y sombra dura desplazada, botones píldora en
   azul real, acentos ámbar/cielo/lila/verde. Tipografía Sansation.
   ============================================================ */
:root {
  --bg: #f4efea;            /* papel cálido */
  --surface: #ffffff;
  --surface-2: #fff3e0;     /* crema */
  --surface-3: #ece4d9;
  --ink: #383838;           /* tinta: texto y bordes */
  --text: #383838;
  --text-2: #4d4a46;
  --muted: #8a8177;
  --muted-2: #b0a99e;
  --border: #383838;
  --border-strong: #383838;
  --accent: #262cd9;        /* azul real: acción principal */
  --accent-dark: #1b20ab;
  --accent-soft: #e6e7ff;
  --accent-text: #ffffff;
  --amber: #f2a100;
  --amber-soft: #fff3e0;
  --sky: #6fc2ff;
  --lilac: #c8a9f2;
  --link: #262cd9;
  --link-hover: #1b20ab;
  --danger: #d8032c;
  --danger-soft: #ffe3e8;
  --ok: #1e9a64;
  --ok-soft: #ddf3e9;
  --shadow-sm: 3px 3px 0 rgba(56, 56, 56, 0.18);
  --shadow: 5px 5px 0 rgba(56, 56, 56, 0.22);
  --shadow-ink: 4px 4px 0 var(--ink);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Sansation", "Trebuchet MS", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
h1, h2, h3, h4 { margin: 0 0 12px; color: var(--text); line-height: 1.22; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }
small { font-size: 12px; }
hr { border: 0; border-top: 2px solid var(--surface-3); margin: 20px 0; }

/* ---- Header ---- */
.topbar {
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-weight: 700;
  color: var(--text);
  font-size: 18px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand:hover { color: var(--text); }
.brand::before {
  content: "C";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--amber);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  transform: rotate(-4deg);
}
.brand-word { line-height: 1; }
.topbar nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.topbar nav a {
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
}
.topbar nav a:hover { background: var(--surface-2); color: var(--text); }
/* El botón "Crear cuenta" vive dentro de .topbar nav: recupera su estilo de
   botón (texto blanco sobre azul) que el selector de nav pisaba por especificidad. */
.topbar nav a.btn { color: var(--accent-text); background: var(--accent); }
.topbar nav a.btn:hover { color: var(--accent-text); background: var(--accent-dark); }
.topbar .user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--lilac);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.logout-form { display: inline; margin: 0; }
.logout-form button {
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 14px;
  border: 0;
  box-shadow: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.logout-form button:hover { color: var(--text); background: var(--surface-2); transform: none; box-shadow: none; }

/* ---- Main layout ---- */
main { max-width: 1100px; margin: 28px auto; padding: 0 20px; }
main.wide { max-width: 1240px; }
main.narrow { max-width: 520px; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-header h1 { margin: 0; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 6px; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-sm);
}
.card.narrow { max-width: 440px; margin: 40px auto; padding: 28px; }
.card.flush { padding: 0; overflow: hidden; }
.card-pad { padding: 18px; }
.muted-card { background: var(--surface-2); }
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.card-link:hover {
  box-shadow: var(--shadow-ink);
  transform: translate(-2px, -2px);
}

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.tight { gap: 12px; }
.grid.courses { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* ---- Forms ---- */
form label {
  display: block;
  margin: 14px 0 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}
form input, form textarea, form select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  transition: box-shadow .15s, transform .15s;
}
form input:focus, form textarea:focus, form select:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--amber);
}
form textarea { resize: vertical; min-height: 80px; }
form small { display: block; margin-top: 4px; color: var(--muted); }

/* ---- Buttons ---- */
button, .btn {
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  border: 2px solid var(--ink);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .1s, box-shadow .1s, background .15s;
}
button:hover, .btn:hover {
  background: var(--accent-dark);
  color: var(--accent-text);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
button:active, .btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--ink);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-link {
  background: transparent;
  color: var(--link);
  padding: 6px 8px;
  font-weight: 700;
  border: 0;
  box-shadow: none;
}
.btn-link:hover { background: transparent; color: var(--link-hover); text-decoration: underline; transform: none; box-shadow: none; }
.btn-sm { padding: 5px 12px; font-size: 13px; box-shadow: 2px 2px 0 var(--ink); }
.btn-sm:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ab0223; color: #fff; }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 0 0 16px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.alert-error { background: var(--danger-soft); }
.alert-info { background: #e3f1ff; }
.alert-success { background: var(--ok-soft); }

/* ---- Tags / badges ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}
.tag-accent { background: var(--amber-soft); }
.tag-ok { background: var(--ok-soft); }
.tag-live { background: var(--danger-soft); color: var(--danger); }
.tag-live::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%; background: var(--danger);
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---- Space shell (hero + tabs + two-column) ---- */
.space-hero {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
/* Banners planos con lunares suaves, estilo sticker */
.space-hero .banner {
  height: 140px;
  border-bottom: 2px solid var(--ink);
  background-color: var(--sky);
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 3px, transparent 3px);
  background-size: 26px 26px;
}
/* Cabecera pequeña de las tarjetas de "Mis espacios" */
.banner-mini {
  border-bottom: 2px solid var(--ink);
  background-color: var(--sky);
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 3px, transparent 3px);
  background-size: 26px 26px;
}
.banner-mini[data-gradient="1"], .space-hero .banner[data-gradient="1"] { background-color: var(--lilac); }
.banner-mini[data-gradient="2"], .space-hero .banner[data-gradient="2"] { background-color: var(--sky); }
.banner-mini[data-gradient="3"], .space-hero .banner[data-gradient="3"] { background-color: #59c99a; }
.banner-mini[data-gradient="4"], .space-hero .banner[data-gradient="4"] { background-color: #ff9d76; }
.banner-mini[data-gradient="5"], .space-hero .banner[data-gradient="5"] { background-color: #ffc94d; }
.banner-mini[data-gradient="6"], .space-hero .banner[data-gradient="6"] { background-color: #7ed0e0; }

.space-hero .hero-body {
  padding: 18px 22px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.space-hero .hero-ident {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: -40px;
}
/* El icono invade el banner 40px; el título y la descripción empiezan
   siempre por debajo del banner para no pisarlo. */
.space-hero .hero-text {
  padding-top: 44px;
  min-width: 0;
}
/* Base del icono de space: también se usa fuera del hero (discover, home,
   landing), así que solo el tamaño/borde grandes van scoped al hero. */
.space-icon {
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  background-color: var(--lilac);
}
.space-icon[data-gradient="1"] { background-color: var(--lilac); }
.space-icon[data-gradient="2"] { background-color: var(--sky); }
.space-icon[data-gradient="3"] { background-color: #59c99a; }
.space-icon[data-gradient="4"] { background-color: #ff9d76; }
.space-icon[data-gradient="5"] { background-color: #ffc94d; }
.space-icon[data-gradient="6"] { background-color: #7ed0e0; }
.space-hero .space-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 26px;
}
.space-hero h1 { font-size: 25px; margin: 2px 0 0; }
.space-hero .space-desc { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.space-hero .hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px 0;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.space-hero .hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }

.space-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  border-top: 2px solid var(--surface-3);
  margin-top: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.space-tabs::-webkit-scrollbar { display: none; }
.space-tabs a {
  padding: 7px 15px;
  color: var(--text-2);
  font-weight: 700;
  font-size: 14px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}
.space-tabs a:hover { color: var(--text); background: var(--surface-2); }
.space-tabs a.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.space-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .space-layout { grid-template-columns: 1fr; }
  .space-sidebar { order: 2; }
}
.space-sidebar .card { margin-bottom: 16px; }
.space-sidebar h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 10px;
}
.space-sidebar .stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.space-sidebar .stat strong { font-weight: 700; color: var(--text); }

/* ---- Feed / posts ---- */
.post-composer textarea {
  min-height: 60px;
  resize: vertical;
}
.post-item .post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post-item .post-head .meta { display: flex; flex-direction: column; }
.post-item .post-head .meta strong { font-weight: 700; font-size: 14px; }
.post-item .post-head .meta small { color: var(--muted); }
.post-item h3 { margin: 4px 0; font-size: 17px; }
.post-item .post-body {
  color: var(--text-2);
  word-wrap: break-word;
}
.post-item .post-actions {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--surface-3);
  font-size: 13px;
  color: var(--muted);
}
.post-item .post-actions a { color: var(--muted); font-weight: 700; }
.post-item .post-actions a:hover { color: var(--text); }

.btn-action {
  background: transparent;
  border: 1.5px solid transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms, color 120ms;
}
.btn-action:hover { background: var(--surface-2); color: var(--text); transform: none; box-shadow: none; }
.btn-action.is-active { color: var(--danger); }
.btn-action.is-active:hover { background: var(--danger-soft); }
.btn-action-sm { padding: 3px 8px; font-size: 12px; }

.comment-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

.comment-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.comment {
  display: flex;
  gap: 10px;
}
.comment .comment-body-wrap {
  background: var(--surface-2);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  flex: 1;
  min-width: 0;
}
.comment .comment-body-wrap strong { font-size: 13px; }
.comment .comment-body-wrap small { color: var(--muted); margin-left: 6px; }
.comment .comment-body { margin: 2px 0 0; word-wrap: break-word; color: var(--text); }
.comment-children { margin-left: 32px; margin-top: 10px; }

/* ---- Course cards ---- */
.course-card {
  display: block;
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
  color: inherit;
  text-decoration: none;
}
.course-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-ink);
}
.course-card .cover {
  height: 150px;
  border-bottom: 2px solid var(--ink);
  background-color: var(--lilac);
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 3px, transparent 3px);
  background-size: 26px 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 700;
  font-size: 22px;
  text-align: center;
  padding: 0 16px;
}
.course-card .cover[data-gradient="1"] { background-color: var(--lilac); }
.course-card .cover[data-gradient="2"] { background-color: var(--sky); }
.course-card .cover[data-gradient="3"] { background-color: #59c99a; }
.course-card .cover[data-gradient="4"] { background-color: #ff9d76; }
.course-card .cover[data-gradient="5"] { background-color: #ffc94d; }
.course-card .cover[data-gradient="6"] { background-color: #7ed0e0; }
.course-card .course-info { padding: 16px 18px; }
.course-card .course-info p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* ---- Course detail ---- */
.course-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) { .course-layout { grid-template-columns: 1fr; } }
.curriculum .module { margin-bottom: 18px; }
.curriculum .module > strong {
  display: block;
  padding: 0 2px 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.curriculum ul { list-style: none; padding: 0; margin: 0; }
.curriculum li a {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  color: var(--text-2);
  font-size: 14px;
  align-items: center;
}
.curriculum li a:hover { background: var(--surface-2); color: var(--text); }
.curriculum li a.active {
  background: var(--amber-soft);
  border-color: var(--ink);
  color: var(--text);
  font-weight: 700;
}
.curriculum li a .lesson-num {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  min-width: 22px;
}

/* ---- Members list ---- */
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--surface-3);
}
.member-row:last-child { border-bottom: 0; }
.member-row .meta { flex: 1; min-width: 0; }
.member-row .meta strong { font-size: 14px; }
.member-row .meta small { color: var(--muted); display: block; }

/* ---- Empty state ---- */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty h3 { color: var(--text); margin-bottom: 8px; }

/* ---- Notificaciones (topbar) ---- */
.nav-bell {
  position: relative;
  padding: 8px 10px !important;
  font-size: 16px;
  line-height: 1;
}
.nav-badge {
  position: absolute;
  top: 0;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--danger);
  color: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--surface-3);
}
.notif-row:last-child { border-bottom: 0; }
.notif-row .meta { flex: 1; min-width: 0; }
.notif-row .meta small { color: var(--muted); display: block; }
.notif-row .notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  flex: 0 0 auto;
}
.notif-row.is-unread { background: var(--amber-soft); }
.notif-row.is-unread .notif-dot { background: var(--amber); }

/* ---- Gamificación ---- */
.avatar-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.level-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 15px;
  height: 15px;
  background: var(--amber);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.level-card { background: var(--amber-soft); }
.level-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.lb-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.lb-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 12px;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 2px solid var(--surface-3);
}
.lb-row:last-child { border-bottom: 0; }
.lb-rank { min-width: 26px; font-weight: 700; color: var(--muted); text-align: center; }
.lb-name { flex: 1; min-width: 0; color: var(--text); font-weight: 700; font-size: 14px; }
.lb-points { color: var(--accent); font-weight: 700; }

/* ---- Chips (filtro de categorías) ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.chip {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 2px solid var(--ink);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---- Posts fijados ---- */
.post-item.is-pinned { box-shadow: 4px 4px 0 var(--amber); }

/* ---- Barras de progreso (aula) ---- */
.progress-wrap small { display: block; margin-top: 4px; }
.progress {
  height: 10px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: var(--radius-pill);
  transition: width .3s;
}
.curriculum li a.is-done .lesson-num { color: var(--ok); font-weight: 700; }

/* ---- Utility ---- */
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 8px; }
.text-right { text-align: right; }

/* ---- Fase 7: media e identidad visual ---- */
.avatar-img { object-fit: cover; display: inline-block; }
img.avatar { padding: 0; }
.banner-img { background-size: cover; background-position: center; }
.space-icon-img { object-fit: cover; }
.post-image {
  display: block;
  max-width: 100%;
  max-height: 480px;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  margin: 10px 0 4px;
}
.cover-img { background-size: cover; background-position: center; color: transparent; }
.md-body p { margin: 0 0 10px; }
.md-body p:last-child { margin-bottom: 0; }
.md-body h3, .md-body h4 { margin: 14px 0 6px; }
.md-body ul, .md-body ol { margin: 0 0 10px; padding-left: 22px; }
.md-body blockquote {
  margin: 0 0 10px;
  padding: 6px 12px;
  border-left: 4px solid var(--amber);
  color: var(--muted);
}
.md-body code {
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.92em;
}
.md-body a { text-decoration: underline; }
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 10px 0;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   Landing / home marketing (público) — Comunora
   ============================================================ */
.landing section { margin-bottom: 44px; }
.landing section:last-child { margin-bottom: 0; }

/* ---- Hero ---- */
.hero {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 56px 28px;
  text-align: center;
  overflow: hidden;
  background-image: radial-gradient(rgba(56, 56, 56, 0.045) 2.5px, transparent 2.5px);
  background-size: 24px 24px;
}
.hero > * { position: relative; }
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amber-soft);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: 46px;
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 760px;
  margin: 0 auto 18px;
}
.hero h1 .hl { color: var(--accent); }
.hero .lead {
  font-size: 18px;
  color: var(--text-2);
  max-width: 580px;
  margin: 0 auto 28px;
}
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: 12px 26px; font-size: 16px; box-shadow: 4px 4px 0 var(--ink); }
.btn-lg:hover { box-shadow: 5px 5px 0 var(--ink); }
.hero .trust { margin-top: 18px; font-size: 13px; color: var(--muted); }

.sticker-band {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}
.sticker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 2px 2px 0 var(--ink);
}
.sticker .ico { font-size: 16px; line-height: 1; }

/* ---- Section headings (landing) ---- */
.section-head { text-align: center; margin-bottom: 26px; }
.section-head h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 8px; }
.section-head p { color: var(--muted); margin: 0; }

/* ---- Feature grid ---- */
.feature-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.feature-card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.feature-card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-ink); }
.feature-ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
}
.feature-ico.c1 { background: var(--amber); }
.feature-ico.c2 { background: var(--sky); }
.feature-ico.c3 { background: var(--lilac); }
.feature-ico.c4 { background: #ff9d76; }
.feature-ico.c5 { background: #59c99a; }
.feature-ico.c6 { background: #ffc94d; }
.feature-card h3 { font-size: 17px; margin: 0 0 6px; }
.feature-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---- Steps (cómo funciona) ---- */
.steps {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.step {
  background: var(--surface-2);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.step .step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 14px;
}
.step h3 { font-size: 16px; margin: 0 0 6px; }
.step p { color: var(--text-2); font-size: 14px; margin: 0; }

/* ---- CTA band ---- */
.cta-band {
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 46px 28px;
  text-align: center;
}
.cta-band h2 { color: #fff; font-size: 30px; letter-spacing: -0.02em; margin: 0 0 10px; }
.cta-band p { color: #d9d4cd; margin: 0 0 24px; }

/* ---- Footer ---- */
.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--surface);
  margin-top: 48px;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer .brand { font-size: 16px; }
.site-footer .muted { font-size: 14px; }
.site-footer-copy { margin-left: auto; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 32px; }
  .hero .lead { font-size: 16px; }
  .cta-band h2 { font-size: 24px; }
  .site-footer-copy { margin-left: 0; }
}
