:root {
  --bg: #1B1730;
  --card-bg: #241F3D;
  --ink: #F1EDE4;
  --ink-soft: #A79FC4;
  --accent: #E8B34C;
  --accent-dark: #D19A2F;
  --accent-soft: rgba(232, 179, 76, 0.16);
  --wine: #C4536B;
  --wine-soft: rgba(196, 83, 107, 0.16);
  --border: rgba(241, 237, 228, 0.12);
  --white: #F1EDE4;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 20px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.24), 0 10px 28px rgba(0, 0, 0, 0.34);
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Newsreader', 'Georgia', serif;
  --font-ui: 'Manrope', -apple-system, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

header.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(27, 23, 48, 0.85);
  backdrop-filter: blur(10px);
}

header.nav .logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

header.nav nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem 1rem;
}

header.nav nav a, header.nav nav button {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  padding: 0.3rem 0;
  transition: color 0.15s ease;
}

header.nav nav a:hover, header.nav nav button:hover {
  color: var(--accent);
}

header.nav nav a.button, header.nav nav button.button {
  background: var(--accent);
  color: #1B1730;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.lang-select {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}
.lang-select:hover { border-color: var(--accent); color: var(--ink); }

header.nav nav a.button:hover, header.nav nav button.button:hover {
  background: var(--accent-dark);
  color: #1B1730;
  transform: translateY(-1px);
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

h1 { font-family: var(--font-display); font-size: 1.8rem; line-height: 1.25; margin-top: 0; font-weight: 600; }
h2 { font-family: var(--font-display); font-weight: 600; }

form { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1.5rem; }

label { display: block; font-family: var(--font-ui); font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 0.4rem; letter-spacing: 0.01em; }

input, textarea, select {
  display: block;
  width: 100%;
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

textarea { resize: vertical; min-height: 160px; font-family: var(--font-body); font-size: 1.1rem; line-height: 1.75; }

button.primary {
  font-family: var(--font-ui);
  background: var(--accent);
  color: #1B1730;
  font-weight: 600;
  border: none;
  padding: 0.8rem 1.3rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

button.primary:active:not(:disabled) { transform: translateY(0); }

button.primary:disabled { opacity: 0.5; cursor: default; }

.error { color: var(--wine); font-size: 0.9rem; }
.hint { color: var(--ink-soft); font-size: 0.9rem; }

/* Poem cards — the "línea viva": a thin gold line at the left margin
   that stays subtly visible and brightens on hover/touch, evoking a
   spine of light next to the verse. */
.poem {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.75rem 1.6rem 2.1rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}
.poem::before {
  content: "";
  position: absolute;
  top: 1.4rem;
  bottom: 1.4rem;
  left: 0.85rem;
  width: 2px;
  background: var(--accent);
  opacity: 0.35;
  border-radius: 2px;
  transition: opacity 0.2s ease, box-shadow 0.2s ease, width 0.2s ease;
}
.poem:hover, .poem:focus-within {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.poem:hover::before, .poem:focus-within::before {
  opacity: 1;
  width: 3px;
  box-shadow: 0 0 12px 1px var(--accent);
}
.poem:last-child { margin-bottom: 0; }
.poem .author { font-family: var(--font-ui); font-size: 0.78rem; color: var(--ink-soft); margin: 0 0 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; }
.poem .title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin: 0 0 0.6rem; }
.poem .title a { text-decoration: none; color: var(--ink); transition: color 0.15s ease; }
.poem .title a:hover { color: var(--accent); }
.poem .body { font-family: var(--font-body); white-space: pre-wrap; font-size: 1.1rem; color: var(--ink); }

.poem-detail { position: relative; padding-left: 2.1rem; }
.poem-detail::before {
  content: "";
  position: absolute;
  top: 1.75rem;
  bottom: 1.75rem;
  left: 0.85rem;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 12px 1px var(--accent);
}
.poem-detail .title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.poem-detail .body { font-family: var(--font-body); font-size: 1.15rem; white-space: pre-wrap; }

a.link { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); transition: border-color 0.15s ease; }
a.link:hover { border-color: var(--accent); }

.back-btn {
  font-family: var(--font-ui);
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.25rem;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}
.back-btn:hover { color: var(--accent); }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tabs button {
  font-family: var(--font-ui);
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tabs button.active { background: var(--accent); border-color: var(--accent); color: #1B1730; font-weight: 600; }
.tabs button:hover:not(.active) { border-color: var(--accent); color: var(--ink); }

.avatar-sm {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #1B1730;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
  flex-shrink: 0;
}

.avatar-lg {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); color: #1B1730;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.9rem;
  margin-bottom: 1rem;
}

.avatar-xs {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #1B1730;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 0.7rem;
  vertical-align: -6px;
  margin-right: 0.4rem;
}

img.avatar-img {
  display: inline-block;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-upload { position: relative; display: inline-block; margin-bottom: 1rem; }
.avatar-upload-btn {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  background: var(--card-bg);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  display: block;
  margin-top: 0.5rem;
}
.avatar-upload-btn:hover { border-color: var(--accent); }

.paywall { text-align: center; }
.paywall .cta-row { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.cta-secondary {
  display: inline-block;
  padding: 0.75rem 1.2rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
}

.flag-badge {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-left: 0.4rem;
  white-space: nowrap;
}

.tag-chip {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.8rem; margin: 0 0.4rem 0.4rem 0;
}

.follow-btn {
  font-family: var(--font-ui);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #1B1730;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.follow-btn.following { background: none; color: var(--accent); }
.follow-btn:hover { transform: translateY(-1px); }

.report-btn {
  font-family: inherit;
  background: none;
  border: none;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
}

.menu-wrap { position: relative; display: inline-block; }
.menu-toggle {
  font-family: inherit;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.5rem 0.8rem;
}
.menu-toggle:hover { border-color: var(--accent); color: var(--ink); }
.dropdown-menu {
  position: fixed;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
  overflow: hidden;
}
.dropdown-menu button,
.dropdown-menu a {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: none;
  border: none;
  color: var(--ink);
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.dropdown-menu button:hover,
.dropdown-menu a:hover { background: var(--accent-soft); }
.dropdown-menu button + button,
.dropdown-menu a + button,
.dropdown-menu button + a {
  border-top: 1px solid var(--border);
}

.search-input { margin-bottom: 1.5rem; }

.poet-row {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.9rem 0; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--ink);
}
.poet-row:last-child { border-bottom: none; }
.poet-row:hover .poet-name { color: var(--accent); }
.poet-name { font-weight: 600; transition: color 0.15s ease; }
.poet-meta { color: var(--ink-soft); font-size: 0.85rem; }

.notif-item { padding: 1rem 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--ink); display: block; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { position: relative; padding-left: 1.1rem; }
.notif-item.unread::before {
  content: ""; position: absolute; left: 0; top: 1.3rem;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.badge {
  background: var(--wine); color: var(--white); font-size: 0.7rem;
  border-radius: 999px; padding: 0.1rem 0.45rem; margin-left: 0.3rem;
}

.install-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 460px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  padding: 1.1rem 1.35rem;
  z-index: 100;
  animation: install-banner-in 0.25s ease;
}
@keyframes install-banner-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.install-banner-close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.25rem;
  line-height: 1;
}
.install-banner-close:hover { color: var(--accent); }
.install-banner-content p {
  margin: 0 0 0.85rem;
  padding-right: 1.25rem;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.5;
}
.install-banner-content button.primary {
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
}

.beta-watermark {
  position: fixed;
  bottom: 0.7rem;
  right: 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: rgba(36, 31, 61, 0.65);
  border: 1px solid var(--border);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  pointer-events: none;
  z-index: 40;
  opacity: 0.85;
  backdrop-filter: blur(4px);
}

@media (max-width: 480px) {
  header.nav { padding: 0.85rem 1.25rem; }
  main { padding: 1.75rem 1rem 3rem; }
  .card { padding: 1.35rem; border-radius: 12px; }
  h1 { font-size: 1.5rem; }
  .poem { padding: 1.25rem 1.4rem 1.25rem 1.8rem; }
}
