/* Base */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f7;
  color: #111;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* Layout */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* NAVBAR */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 245, 247, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e2e5;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 0.9rem;
}

.nav-links a {
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  border-bottom-color: #111;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */

.btn-primary,
.btn-ghost,
.btn-primary-small,
.btn-ghost-small {
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  padding: 10px 20px;
  background: transparent;
}

.btn-primary {
  background: #111;
  color: #fff;
}

.btn-primary:hover {
  background: #000;
}

.btn-ghost {
  border: 1px solid #ccc;
  background: transparent;
}

.btn-ghost:hover {
  border-color: #111;
}

.btn-primary-small {
  background: #111;
  color: #fff;
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn-primary-small:hover {
  background: #000;
}

.btn-ghost-small {
  border: 1px solid #ccc;
  background: transparent;
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn-ghost-small:hover {
  border-color: #111;
}

.full-width {
  width: 100%;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 40px;
  padding: 32px 0 40px;
  align-items: center;
}

.hero-left {
  max-width: 520px;
}

.hero-title {
  font-size: 2.6rem;
  line-height: 1.1;
  margin-bottom: 14px;
}

.hero-sub {
  color: #555;
  margin-bottom: 22px;
  font-size: 0.97rem;
}

.hero-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.hero-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid #ddd;
  background: #fff;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hero-note {
  font-size: 0.78rem;
  color: #777;
}

/* Hero right */

.hero-media {
  background: #111;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.hero-product {
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.hero-product img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.78rem;
  color: #ddd;
}

.hero-tag {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 2px 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Sections */

.section {
  margin-top: 8px;
}

.section-header {
  margin: 40px 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.section-header h2 {
  font-size: 1.1rem;
}

.section-header span {
  font-size: 0.8rem;
  color: #777;
}

.section-placeholder {
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e5e8;
  padding: 18px 16px;
  font-size: 0.9rem;
  color: #555;
}

/* Footer */

.footer {
  border-top: 1px solid #e2e2e5;
  padding: 18px 16px;
  font-size: 0.75rem;
  color: #777;
  text-align: center;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
  z-index: 100;
}

.modal-backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 380px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e5e5e8;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  padding: 18px 18px 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 1.1rem;
}

.modal-close:hover {
  color: #111;
}

.modal-body {
  font-size: 0.9rem;
}

.modal-copy {
  color: #555;
  margin-top: 0;
  margin-bottom: 12px;
}

.modal-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 0.8rem;
  color: #999;
}

.modal-divider::before,
.modal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e2e5;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
}

.field span {
  color: #555;
}

.field input {
  border-radius: 10px;
  border: 1px solid #d0d0d4;
  background: #fff;
  color: #111;
  padding: 7px 10px;
  font-size: 0.85rem;
  outline: none;
}

.field input:focus {
  border-color: #111;
}

.modal-small {
  margin-top: 8px;
  font-size: 0.75rem;
  color: #888;
}

/* Auth nav when signed in */

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.nav-username {
  font-size: 0.85rem;
}

/* Modal mode: show extra fields only in sign-up */

.modal[data-mode="signin"] .field-username,
.modal[data-mode="signin"] .field-profile-image {
  display: none;
}

/* Responsive */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-media {
    order: -1;
  }
}

@media (max-width: 600px) {
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-left {
    width: 100%;
    justify-content: space-between;
  }

  .nav-right {
    width: 100%;
    justify-content: flex-end;
  }

  .hero-title {
    font-size: 2.1rem;
  }
}
