:root {
  --bg: #dcdcdc;
  --ink: #0d0d0d;
  --blue: #1c00cc;
  --blue-soft: #8f86d8;
  --lav: #d2d0df;
  --gray: #8f8f8f;
}

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

html { scroll-behavior: smooth; }

img { max-width: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 64px 22px 72px;
}

/* ---------- Cabecera ---------- */
header.hero { text-align: center; margin-bottom: 56px; }

.hero .icon {
  width: 56px;
  height: 56px;
  color: var(--blue);
  margin-bottom: 26px;
}

.hero h1 {
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.35;
  text-transform: lowercase;
}

.hero h1 em { font-style: normal; color: var(--blue); }

.hero p.sub {
  margin: 14px auto 0;
  max-width: 300px;
  color: var(--gray);
  font-size: 0.85rem;
}

.presence {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
  color: var(--blue);
}

.presence[hidden] { display: none; }

.presence .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 30px; }

.entry {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s ease forwards;
}

@keyframes rise { to { opacity: 1; transform: none; } }

.card {
  background: var(--bg);
  border-radius: 28px;
  padding: 14px 14px 14px;
  box-shadow: 0 16px 28px -10px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: rotate(var(--r, -1.5deg));
}

.entry:nth-child(odd)  .card { --r: -1.6deg; }
.entry:nth-child(even) .card { --r: 1.3deg; }

.card .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2px 6px 12px;
  font-size: 0.75rem;
}

.card .date {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
}

.card .date svg { width: 18px; height: 18px; flex: none; }

.card .time { color: var(--blue-soft); padding-top: 14px; margin-left: auto; }

.card .quote {
  background: var(--lav);
  color: var(--blue);
  border-radius: 20px;
  padding: 18px 18px 22px;
  min-height: 110px;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty, .loading {
  text-align: center;
  color: var(--gray);
  padding: 40px 10px;
  font-size: 0.88rem;
}

footer.foot {
  margin-top: 56px;
  text-align: center;
  color: var(--gray);
  font-size: 0.8rem;
}

/* ---------- Admin ---------- */
.panel { max-width: 460px; margin: 0 auto; }

.panel .icon { width: 56px; height: 56px; color: var(--blue); margin-bottom: 22px; }

.panel h1 {
  font-weight: 500;
  font-size: 1.35rem;
  text-transform: lowercase;
  margin-bottom: 10px;
}

.panel h1 em { font-style: normal; color: var(--blue); }

.panel .lead { color: var(--gray); font-size: 0.85rem; margin-bottom: 30px; }

.panel.center { text-align: center; }

label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray);
  margin: 16px 6px 6px;
  text-transform: lowercase;
}

input, textarea {
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-radius: 16px;
  background: var(--lav);
  color: var(--blue);
  font: inherit;
  font-size: 0.95rem;
  outline: 2px solid transparent;
  transition: outline-color 0.2s;
}

input:focus, textarea:focus { outline-color: var(--blue); }

textarea { min-height: 170px; resize: vertical; line-height: 1.55; }

::placeholder { color: var(--blue-soft); }

.compose .card { transform: rotate(-1.2deg); margin-bottom: 12px; }
.compose .card textarea { background: var(--lav); border-radius: 20px; }

.row { display: flex; justify-content: flex-end; padding: 0 6px; }
.counter { font-size: 0.75rem; color: var(--blue-soft); }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.15s;
}

button.primary {
  width: 100%;
  margin-top: 22px;
  padding: 20px;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-size: 1.02rem;
  font-weight: 500;
  text-transform: lowercase;
}

button.primary:active { transform: scale(0.99); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  border-radius: 14px;
  background: var(--lav);
  color: var(--blue);
  font-size: 0.98rem;
  font-weight: 500;
  text-transform: lowercase;
}

button.google svg { width: 20px; height: 20px; }
button.google:active { transform: scale(0.99); }

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 4px;
  font-size: 0.75rem;
  color: var(--gray);
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
}

button.link {
  background: none;
  color: var(--gray);
  font-size: 0.88rem;
  padding: 6px 10px;
}

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

button.link.danger { color: #b3261e; font-size: 0.78rem; padding: 4px 0 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.msg { margin-top: 14px; font-size: 0.82rem; min-height: 1.3em; text-align: center; color: var(--blue); }
.msg.err { color: #b3261e; }

.admin-list { margin-top: 48px; }

.admin-list h2 {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gray);
  text-transform: lowercase;
  margin: 0 6px 14px;
}

.admin-item {
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--bg);
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.06);
}

.admin-item .meta { font-size: 0.72rem; color: var(--blue-soft); margin-bottom: 8px; }

.admin-item .txt {
  color: var(--blue);
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Fotos ---------- */
.photo {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 20px;
  background: var(--lav);
}

.photo + .quote { min-height: 0; margin-top: 8px; }

.photo-preview { position: relative; margin-bottom: 8px; }

.photo-preview img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 20px;
}

.photo-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(13, 13, 13, 0.6);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
}

.row.space { justify-content: space-between; align-items: center; }

button.link.blue { color: var(--blue); font-size: 0.85rem; padding: 6px 4px; }

.admin-thumb {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
}

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .entry { animation: none; opacity: 1; transform: none; }
  .presence .dot { animation: none; }
}
