* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #111;
  background: #fff;
}
a { color: inherit; text-decoration: none; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  color: #cc1e2c;
  flex-shrink: 0;
}
.pill-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex-shrink: 0;
}
.pill {
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}
.pill:hover { background: #f0f0f0; }
.pill.active { background: #111; color: #fff; }

.search-wrap { flex: 1; }
.search {
  width: 100%;
  padding: 12px 18px;
  border-radius: 24px;
  border: none;
  background: #f2f2f2;
  font-size: 0.95rem;
}
.search:focus { outline: 2px solid #cc1e2c; background: #fff; }

.auth-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.btn {
  border: none;
  border-radius: 24px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-ghost { background: #f0f0f0; color: #111; }
.btn-ghost:hover { background: #e2e2e2; }
.btn-primary { background: #cc1e2c; color: #fff; }
.btn-primary:hover { background: #a8121e; }
.btn-full { width: 100%; margin-top: 8px; }

/* Hero */
.hero {
  text-align: center;
  padding: 48px 20px 32px;
  max-width: 720px;
  margin: 0 auto;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 12px; letter-spacing: -0.5px; }
.hero p { color: #555; font-size: 1.05rem; line-height: 1.5; }

/* Masonry grid */
.masonry {
  column-count: 6;
  column-gap: 16px;
  padding: 8px 20px 60px;
  max-width: 1600px;
  margin: 0 auto;
}
@media (max-width: 1400px) { .masonry { column-count: 5; } }
@media (max-width: 1100px) { .masonry { column-count: 4; } }

@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 10px; padding: 10px 16px; }
  .logo { order: 1; }
  .auth-buttons { order: 2; margin-left: auto; }
  .pill-nav {
    order: 3;
    flex: 1 1 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .pill-nav::-webkit-scrollbar { display: none; }
  .search-wrap { order: 4; flex: 1 1 100%; }
  .masonry { column-count: 3; padding: 8px 12px 60px; }
  .hero { padding: 32px 16px 24px; }
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.95rem; }
}

@media (max-width: 560px) {
  .masonry { column-count: 2; column-gap: 10px; padding: 8px 10px 48px; }
  .pin { margin-bottom: 10px; }
  .auth-buttons .btn { padding: 8px 12px; font-size: 0.82rem; }
  .logo { font-size: 1.3rem; }
  .modal { padding: 24px 20px; }
}

@media (max-width: 380px) {
  .masonry { column-count: 1; }
}

.pin {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: #eee;
  cursor: pointer;
}
.pin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pin-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, rgba(0,0,0,0.55) 100%);
  opacity: 0;
  transition: opacity .15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
}
.pin:hover .pin-overlay { opacity: 1; }
.pin-save {
  align-self: flex-end;
  background: #cc1e2c;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.pin-caption {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Footer */
.footer { border-top: 1px solid #eee; padding: 40px 24px 20px; margin-top: 20px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto 24px;
}
.footer-col { min-width: 160px; display: flex; flex-direction: column; gap: 8px; }
.footer-title { font-weight: 700; margin-bottom: 6px; }
.footer-col p, .footer-col a { color: #666; font-size: 0.9rem; }
.footer-col a:hover { color: #111; text-decoration: underline; }
.footer-bottom {
  text-align: center;
  color: #999;
  font-size: 0.85rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Auth modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  width: 380px;
  max-width: 90vw;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #666;
}
.modal h2 { margin-bottom: 20px; text-align: center; }
.modal form { display: flex; flex-direction: column; gap: 14px; }
.modal label { font-size: 0.85rem; font-weight: 600; color: #333; display: flex; flex-direction: column; gap: 6px; }
.modal input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 0.95rem;
}
.modal input:focus { outline: 2px solid #cc1e2c; }
.form-error {
  color: #cc1e2c;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 4px;
}
.modal-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 0.9rem;
  color: #555;
}
.modal-switch a { color: #cc1e2c; font-weight: 700; margin-left: 4px; }
