:root {
  --bg: #eeeee4;
  --paper: #ece7d7;
  --card: #dfdbc9;
  --ink: #0f2a1e;
  --ink-soft: #3a4e43;
  --line: #c7c4b4;
  --green: #1f5438;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.42;
  background: #76a278;
}
.shape-a { width: 480px; height: 480px; top: 240px; left: -120px; }
.shape-b { width: 520px; height: 520px; top: 260px; right: -180px; }
.shape-c { width: 360px; height: 360px; top: 310px; left: 35%; opacity: 0.5; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 12px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 238, 228, 0.9);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Instrument Serif", serif;
  font-size: 50px;
  line-height: 0.8;
  white-space: nowrap;
}
.brand em { color: #326448; font-style: italic; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d3a54f 5%, #3e6f4c 64%);
}

.main-nav { display: flex; justify-content: center; gap: 34px; }
.main-nav a {
  font-size: 16px;
  color: #2c3f35;
  text-decoration: none;
  padding-bottom: 6px;
}
.main-nav a.active { border-bottom: 2px solid #2c3f35; }

.top-actions { display: flex; gap: 14px; align-items: center; }
.search-wrap {
  width: 360px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--paper);
}
.search-wrap input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
  font-size: 15px;
}
.search-icon { color: #6f8076; }

.cart-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--paper);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.count {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

.hero {
  max-width: 1360px;
  margin: 28px auto 14px;
  padding: 0 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}
.hero h1 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-size: clamp(62px, 8vw, 104px);
  line-height: 0.92;
  font-weight: 400;
}
.hero h1 em { color: #2f6a49; font-style: italic; }
.hero-right { text-align: right; color: var(--ink-soft); font-size: 23px; line-height: 1.35; }
.section-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
  letter-spacing: 0.16em;
  margin-bottom: 14px;
  color: #6f8076;
}

.habitats {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 26px;
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 16px;
}
.habitat-card {
  background: #dfdbc9;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 18px;
  min-height: 245px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}
.hab-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hab-icon {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #194d33;
  color: #f4f1e7;
  display: grid;
  place-items: center;
  font-size: 32px;
}
.hab-open {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #b6b39f;
  display: grid;
  place-items: center;
  color: #1e3428;
}
.hab-id {
  margin-top: 14px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.14em;
  font-size: 14px;
  color: #6e7e74;
}
.hab-title {
  align-self: end;
  font-family: "Instrument Serif", serif;
  font-size: 52px;
  line-height: 0.95;
}
.hab-sub { font-size: 17px; color: #607167; }

.shop {
  max-width: 1360px;
  margin: 26px auto 36px;
  padding: 0 26px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
}
.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  grid-column: 1 / -1;
}
.shop-head h2 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-size: 50px;
  font-weight: 400;
}
.cta {
  border: 0;
  background: #1f5438;
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.species h3 {
  margin: 20px 0 10px;
  font-family: "Instrument Serif", serif;
  font-size: 40px;
  font-weight: 400;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  padding: 12px;
}
.animal-image {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
}
.card h3 {
  margin: 10px 0 6px;
  font-family: "Instrument Serif", serif;
  font-size: 36px;
  font-weight: 400;
}
.meta { color: #607167; }
.price { font-weight: 700; margin: 8px 0; }
.btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: #1f5438;
  color: #fff;
  padding: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.cart-box {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  padding: 12px;
  position: sticky;
  top: 84px;
  height: fit-content;
}
.cart-header { display: flex; justify-content: space-between; align-items: center; }
.cart-header h3 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-size: 34px;
  font-weight: 400;
}
.clear-link {
  border: 0;
  background: transparent;
  color: #6a7b70;
  font-size: 14px;
}
.cart-items { list-style: none; margin: 8px 0; padding: 0; }
.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #c8c3b2;
}
.remove-btn {
  border: 0;
  background: #d6ccb0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  margin-top: 10px;
}

@media (max-width: 1280px) {
  .habitates { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
}

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr; }
  .main-nav { justify-content: flex-start; flex-wrap: wrap; gap: 18px; }
  .top-actions { width: 100%; }
  .search-wrap { flex: 1; width: auto; }
  .hero { grid-template-columns: 1fr; gap: 14px; }
  .hero-right { text-align: left; }
  .habitats { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
  .shop { grid-template-columns: 1fr; }
  .cart-box { position: static; }
}

@media (max-width: 760px) {
  .brand { font-size: 42px; }
  .hero h1 { font-size: 64px; }
  .habitats { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}
