:root {
  --bg: #0b0f14;
  --ink: #e8e3d8;
  --ink-soft: #a9a398;
  --ink-mute: #6c675f;
  --line: rgba(232, 227, 216, 0.12);
  --panel: rgba(11, 15, 20, 0.72);
  --live: #f2c879;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#map { position: fixed; inset: 0; }

.maplibregl-ctrl-attrib { display: none; }

.top {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  pointer-events: none;
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

.tagline {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.tools {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  display: flex;
  gap: 8px;
}

.pill {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pill:hover { border-color: var(--ink-mute); }

.birds {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(120px, calc(env(safe-area-inset-bottom) + 110px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

.bird {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: border-color 0.3s;
}

.bird:hover, .bird.active { border-color: var(--live); }

.glyph { width: 28px; height: 28px; color: var(--live); margin-top: 2px; }

.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.1;
}

.where { margin: 3px 0 0; color: var(--ink); }

.meta {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.meta .mono { font-family: var(--mono); font-size: 12px; }

.flow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.year {
  position: fixed;
  right: 16px;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 16px;
  text-align: right;
  pointer-events: none;
}

.year-date {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
}

.year-sub {
  margin: 6px 0 12px;
  color: var(--ink-soft);
  font-size: 13px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.year-bar {
  position: relative;
  height: 14px;
  margin-left: auto;
  width: min(420px, 100%);
  cursor: pointer;
  pointer-events: auto;
}

.year-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 1px;
  background: var(--line);
}

.year-today {
  position: absolute;
  top: 3px;
  width: 1px;
  height: 9px;
  background: var(--ink-soft);
}

.year-today::after {
  content: "hoy";
  position: absolute;
  top: -16px;
  left: -10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
}

html[lang="en"] .year-today::after { content: "today"; left: -14px; }

.year-head {
  position: absolute;
  top: 4px;
  width: 7px;
  height: 7px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px rgba(242, 200, 121, 0.8);
}

.stamp {
  position: fixed;
  right: 16px;
  bottom: max(10px, env(safe-area-inset-bottom));
  margin: 0;
  color: var(--ink-mute);
  font-size: 11px;
  font-family: var(--mono);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.marker {
  width: 18px;
  height: 18px;
  position: relative;
  cursor: pointer;
}

.marker .dot {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 10px rgba(242, 200, 121, 0.7);
}

.marker .halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--live);
  opacity: 0;
  animation: halo 4s ease-out infinite;
}

@keyframes halo {
  0% { transform: scale(0.5); opacity: 0.8; }
  70% { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

.sheet {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 20, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
}

.sheet[hidden] { display: none; }

.sheet-body {
  position: relative;
  width: min(560px, 100%);
  max-height: 80vh;
  overflow: auto;
  padding: 20px 20px max(24px, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: #10151c;
  font-size: 14px;
}

.sheet-body h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
}

.sheet-body p { margin: 0 0 12px; }

.sheet-body ul { margin: 0 0 12px; padding-left: 18px; }

.sheet-body li { margin-bottom: 8px; }

.sheet-body a { color: var(--live); text-decoration: none; }

.sheet-body a:hover { text-decoration: underline; }

.sheet-close { position: absolute; top: 14px; right: 14px; }

.muted { color: var(--ink-mute); }

@media (max-width: 719px) {
  .year-date { font-size: 30px; }
  .year-sub { display: none; }
  .year-bar { width: 100%; }
  .birds { bottom: 84px; }
  .bird { padding: 9px 12px; }
  .name { font-size: 18px; }
  .meta { display: none; }
}

@media (min-width: 720px) {
  .title { font-size: 44px; }
  .birds { bottom: 32px; left: 24px; max-width: 360px; }
  .year { right: 24px; bottom: 36px; left: auto; width: 480px; }
  .year-date { font-size: 56px; }
  .top { left: 24px; top: 24px; }
  .tools { right: 24px; top: 24px; }
  .stamp { right: 24px; bottom: 14px; }
  .sheet { align-items: center; }
  .sheet-body { border-bottom: 1px solid var(--line); border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .marker .halo { animation: none; }
}
