/* ────────────────────────────────────────────────────────────────────────────
   Where's Louie? — Stylesheet
   Palette: warm cream #f7f5f1, near-black #1a1a1a, teal #3b93a7
   Font: Inter
   ──────────────────────────────────────────────────────────────────────────── */

:root {
  --bg:            #f7f5f1;
  --bg-alt:        #edeae5;
  --bg-card:       #ffffff;
  --bg-card-hover: #f9f8f6;
  --teal:          #3b93a7;
  --teal-dark:     #2d7a8c;
  --teal-dim:      rgba(59, 147, 167, 0.1);
  --teal-border:   rgba(59, 147, 167, 0.25);
  --text:          #1a1a1a;
  --text-muted:    #6b6563;
  --border:        rgba(0, 0, 0, 0.08);
  --radius:        14px;
  --radius-sm:     8px;
  --shadow:        0 2px 16px rgba(0,0,0,0.07);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.10);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--teal); }

/* ── Navigation ─────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(247, 245, 241, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo svg { width: 28px; height: 22px; }
.nav-logo:hover { color: var(--teal-dark); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--text) !important;
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 24px;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  transition: background 0.2s, transform 0.15s !important;
  letter-spacing: -0.01em;
}
.nav-cta:hover {
  background: var(--teal) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 60px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Subtle dot-grid background like Miniflow */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(59,147,167,0.15) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.hero-content {
  max-width: 680px;
  position: relative;
  z-index: 1;
}

.hero-duck {
  display: block;
  width: 110px;
  height: 88px;
  margin: 0 auto 28px;
  animation: bob 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(59,147,167,0.25));
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%       { transform: translateY(-12px) rotate(1deg); }
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 20px;
  color: var(--text);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 18px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  box-shadow: var(--shadow);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-dot.live {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
  animation: pulse 2s infinite;
}
.status-dot.stale  { background: #f59e0b; }
.status-dot.offline { background: #ef4444; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 26px;
  border-radius: 32px;
  font-weight: 600;
  font-size: 0.925rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}
.btn-primary:hover {
  background: var(--teal-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59,147,167,0.35);
}

.btn-secondary {
  background: var(--text);
  color: #fff;
}
.btn-secondary:hover {
  background: #333;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ── Stats bar ───────────────────────────────────────────────────────────── */

.stats-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.stats-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 48px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--teal);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 5px;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

@media (max-width: 600px) {
  .stat { padding: 8px 20px; }
  .stat-value { font-size: 1.4rem; }
  .stat-divider { height: 24px; }
}

/* ── Sections ────────────────────────────────────────────────────────────── */

.section { padding: 88px 24px; }
.section--alt { background: var(--bg-alt); }

.section-inner { max-width: 1140px; margin: 0 auto; }

.section-header {
  text-align: center;
  margin-bottom: 52px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--text);
}

.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Map ─────────────────────────────────────────────────────────────────── */

.map-wrapper {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

#leaflet-map {
  height: 520px;
  width: 100%;
  background: #e8e4dc;
}

.map-legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot--start   { background: #22c55e; }
.legend-dot--current { background: var(--teal); }
.legend-dot--stop    { background: #f59e0b; }

.map-no-data {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* OSM tiles look great on a light theme — no filter needed */
.leaflet-tile { filter: none; }

/* Light-theme Leaflet popup */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border) !important;
}
.leaflet-popup-content {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: 0.875rem !important;
  color: var(--text) !important;
  line-height: 1.6 !important;
}
.leaflet-popup-tip { background: white !important; }

/* ── Post cards ──────────────────────────────────────────────────────────── */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-card-photo {
  position: relative;
  height: 220px;
  background: var(--bg-alt);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.18;
}
.post-photo-placeholder svg { width: 80px; height: 64px; }

.post-photo-img.loaded + .post-photo-placeholder { display: none; }

.post-card-body { padding: 22px; }

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.post-number {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--teal-dim);
  color: var(--teal-dark);
  border: 1px solid var(--teal-border);
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.05em;
}

.post-location {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-story {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.post-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-dark);
}

.post-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Empty / loading states ──────────────────────────────────────────────── */

.posts-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.posts-empty-duck {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  opacity: 0.4;
}
.posts-empty-duck svg { width: 72px; height: 58px; }

.posts-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Submit CTA ──────────────────────────────────────────────────────────── */

.submit-cta {
  text-align: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 52px 24px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}

.submit-cta h3 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  color: var(--text);
}

.submit-cta p {
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* ── About section ───────────────────────────────────────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-image { order: -1; }
}

.about-text h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text);
}

.about-text p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-text strong { color: var(--text); font-weight: 600; }

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tech-tag {
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 0.01em;
}

.about-duck-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.duck-big {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.duck-big svg { width: 100px; height: 80px; }

.duck-info { text-align: left; }

.duck-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.duck-info-row:last-child { border-bottom: none; }

.duck-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  flex-shrink: 0;
  font-weight: 500;
}

.duck-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer {
  background: var(--text);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 52px 24px;
  text-align: center;
  color: rgba(255,255,255,0.6);
}

.footer-inner { max-width: 560px; margin: 0 auto; }

.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.footer-logo svg { width: 32px; height: 26px; filter: brightness(0) invert(1); }

.footer-sub {
  font-size: 0.875rem;
  line-height: 1.75;
  margin-bottom: 24px;
}
.footer-sub a { color: rgba(255,255,255,0.7); }
.footer-sub a:hover { color: #fff; }

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.footer-links a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
}
.footer-links a:hover { color: #fff; }

/* ── Leaflet custom markers ──────────────────────────────────────────────── */

.city-pin {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.city-pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.city-pin-dot--start { background: #22c55e; }

.city-pin-label {
  background: rgba(26, 26, 26, 0.80);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  line-height: 1.5;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  pointer-events: none;
}

.city-pin-label--current {
  background: rgba(59, 147, 167, 0.92);
  color: #fff;
}

.duck-pin {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.duck-marker {
  width: 36px;
  height: 29px;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.3));
  animation: bob 3s ease-in-out infinite;
}

.start-marker {
  width: 14px; height: 14px;
  background: #22c55e;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.25);
}

/* ── Responsive tweaks ───────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .section { padding: 60px 16px; }
  .hero { padding: 60px 16px 40px; }
  #leaflet-map { height: 380px; }
  .posts-grid { grid-template-columns: 1fr; }
}
