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

:root {
  --color-bg: #f5f5f0;
  --color-surface: #ffffff;
  --color-text: #2c2c2c;
  --color-text-muted: #6b6b6b;
  --color-accent: #3a3a3a;
  --color-accent-hover: #555555;
  --color-border: #e0e0d8;
  --color-card-shadow: rgba(0, 0, 0, 0.06);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1100px;
  --radius: 10px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Navigation ---- */

.nav {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
  padding: 0.25rem 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* ---- Mobile menu toggle ---- */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: 0.3s;
}

/* ---- Main content ---- */

.main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  width: 100%;
}

/* ---- Hero section (home page) ---- */

.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 540px;
  margin: 0 auto 2.5rem;
}

.hero-cards {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 220px;
}

.hero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--color-card-shadow);
}

.hero-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.hero-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ---- Page header ---- */

.page-header {
  margin-bottom: 2.5rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.page-header p {
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* ---- Section toggle ---- */

.section-toggle {
  display: flex;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.section-toggle-btn {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
  position: relative;
}

.section-toggle-btn:not(:last-child) {
  border-right: 2px solid var(--color-accent);
}

.section-toggle-btn:hover {
  background: #ededea;
}

.section-toggle-btn.active {
  background: var(--color-accent);
  color: #fff;
}

.section-toggle-btn .section-count {
  display: inline-block;
  margin-left: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.section-toggle-btn:not(.active) .section-count {
  background: var(--color-bg);
  color: var(--color-text-muted);
}

/* ---- Filter bar ---- */

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ---- Item groups ---- */

.item-group {
  margin-bottom: 2.5rem;
}

.item-group:last-child {
  margin-bottom: 0;
}

.item-group-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
  color: var(--color-text);
}

/* ---- Item grid ---- */

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

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

.item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--color-card-shadow);
}

.item-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eaeae5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-card-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #e8e8e3 0%, #d8d8d3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.item-card-body {
  padding: 1rem 1.15rem;
}

.item-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.item-card-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.item-card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.item-card-owner {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-bg);
  color: var(--color-text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.item-card-edition {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--color-accent);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* ---- Footer ---- */

.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

/* ---- Empty state ---- */

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-muted);
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-cards {
    flex-direction: column;
    align-items: center;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}
