/* Shop the World — expedition atlas */

:root {
  --ink-0: #070d17;
  --ink-1: #0a1220;
  --ink-2: #0d1724;
  --ink-3: #122031;
  --ink-4: #1a2c42;
  --parch: #e9e2d0;
  --parch-dim: #b9b2a0;
  --parch-faint: #837d6e;
  --brass: #c9a86c;
  --brass-bright: #e5c98f;
  --glow: #6fb3c9;
  --sale: #d94f30;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Karla", "Helvetica Neue", sans-serif;
  --hairline: 1px solid rgba(201, 168, 108, 0.18);
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 700px at 70% -10%, #12233a 0%, transparent 60%),
    radial-gradient(900px 600px at 8% 30%, #0e1d30 0%, transparent 55%),
    var(--ink-1);
  color: var(--parch);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--brass); color: var(--ink-0); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* film grain */
.grain {
  position: fixed; inset: -50%; z-index: 40; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain-shift 9s steps(6) infinite;
}
@keyframes grain-shift {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-2%,3%); }
  40% { transform: translate(3%,-2%); } 60% { transform: translate(-3%,-3%); }
  80% { transform: translate(2%,2%); }
}

/* ------------------------------------------------------------- masthead */

.masthead {
  text-align: center;
  padding: clamp(3.5rem, 8vh, 6rem) 1.5rem 2.5rem;
  position: relative;
}
.masthead-rule {
  width: 1px; height: clamp(2rem, 6vh, 4rem);
  margin: 0 auto 1.6rem;
  background: linear-gradient(to bottom, transparent, var(--brass));
}
.masthead-kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass);
  animation: rise 0.9s 0.1s cubic-bezier(.2,.7,.2,1) both;
}
.masthead-title {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(3rem, 10vw, 7.5rem);
  font-weight: 380;
  letter-spacing: -0.015em;
  line-height: 1.02;
  margin: 0.35em 0 0.3em;
  color: var(--parch);
  text-wrap: balance;
  animation: rise 0.9s 0.22s cubic-bezier(.2,.7,.2,1) both;
}
.masthead-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--brass-bright);
  font-size: 0.62em;
  vertical-align: 6%;
  padding: 0 0.06em;
}
.masthead-sub {
  color: var(--parch-dim);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  animation: rise 0.9s 0.34s cubic-bezier(.2,.7,.2,1) both;
}
.masthead-coords {
  margin-top: 1.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--parch-faint);
  font-variant-numeric: tabular-nums;
  animation: rise 0.9s 0.46s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- atlas */

.atlas { padding: 0 clamp(0.75rem, 3vw, 3rem); }

.atlas-frame {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  border: var(--hairline);
  background:
    radial-gradient(80% 90% at 50% 40%, rgba(23, 42, 66, 0.55) 0%, transparent 75%),
    var(--ink-2);
  padding: clamp(1rem, 3vw, 2.5rem);
  animation: rise 1s 0.55s cubic-bezier(.2,.7,.2,1) both;
}
.atlas-corner {
  position: absolute; width: 22px; height: 22px;
  border-color: var(--brass); border-style: solid; border-width: 0;
  opacity: 0.8;
}
.atlas-corner.tl { top: 7px; left: 7px; border-top-width: 1.5px; border-left-width: 1.5px; }
.atlas-corner.tr { top: 7px; right: 7px; border-top-width: 1.5px; border-right-width: 1.5px; }
.atlas-corner.bl { bottom: 7px; left: 7px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.atlas-corner.br { bottom: 7px; right: 7px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.map-stage { position: relative; }
.map-stage svg { display: block; width: 100%; height: auto; }
.map-loading {
  text-align: center; padding: 18vh 0;
  color: var(--parch-faint); font-style: italic; font-family: var(--serif);
}

/* country paths */
.map-stage svg path {
  fill: #1b2b40;
  stroke: var(--ink-1);
  stroke-width: 0.5;
  transition: fill 0.35s ease, filter 0.35s ease;
}
.map-stage svg .has-data {
  fill: #3d5d80;
  cursor: pointer;
  filter: drop-shadow(0 0 3px rgba(111, 179, 201, 0.35));
  animation: beacon 4s ease-in-out infinite;
}
.map-stage svg .has-data:hover,
.map-stage svg .has-data:focus-visible {
  fill: var(--brass);
  filter: drop-shadow(0 0 10px rgba(229, 201, 143, 0.75));
  animation-play-state: paused;
  outline: none;
}
.map-stage svg .has-data.is-selected {
  fill: var(--brass-bright);
  filter: drop-shadow(0 0 12px rgba(229, 201, 143, 0.9));
  animation: none;
}
.map-stage svg .no-data:hover { fill: #223650; }
@keyframes beacon {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(111, 179, 201, 0.25)); }
  50% { filter: drop-shadow(0 0 8px rgba(111, 179, 201, 0.6)); }
}

.map-tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--ink-0);
  border: 1px solid var(--brass);
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.45;
  max-width: 240px;
  transform: translate(-50%, calc(-100% - 14px));
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}
.map-tooltip .tt-name { font-family: var(--serif); font-size: 1rem; color: var(--brass-bright); display: block; }
.map-tooltip .tt-note { color: var(--parch-dim); }

.atlas-legend {
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--parch-faint);
}
.legend-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  vertical-align: -1px; margin-right: 2px;
}
.legend-dot.charted { background: #3d5d80; box-shadow: 0 0 6px rgba(111,179,201,.6); }
.legend-dot.uncharted { background: #1b2b40; border: 1px solid #2b405c; }

/* ------------------------------------------------------- index of territories */

.index-section {
  max-width: 1180px;
  margin: clamp(3rem, 7vh, 5rem) auto 0;
  padding: 0 clamp(0.75rem, 3vw, 3rem);
}
.section-heading {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
  display: flex; align-items: center; gap: 1.2rem;
  margin-bottom: 1.6rem;
}
.section-heading::before, .section-heading::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(to right, transparent, rgba(201,168,108,.35), transparent);
}

.atlas-index {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: rgba(201, 168, 108, 0.14);
  border: var(--hairline);
}
.index-item a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "code name count" "code tag count";
  align-items: baseline;
  column-gap: 0.8rem;
  padding: 0.9rem 1.1rem;
  background: var(--ink-2);
  color: inherit;
  text-decoration: none;
  transition: background 0.25s ease;
  height: 100%;
}
.index-item a:hover, .index-item a:focus-visible { background: var(--ink-4); outline: none; }
.index-item a:hover .index-name { color: var(--brass-bright); }
.index-code {
  grid-area: code;
  font-size: 0.68rem; letter-spacing: 0.12em;
  color: var(--brass); align-self: center;
  border: 1px solid rgba(201,168,108,.4);
  padding: 0.2rem 0.35rem;
}
.index-name { grid-area: name; font-family: var(--serif); font-size: 1.05rem; transition: color .25s; }
.index-tag { grid-area: tag; font-size: 0.74rem; color: var(--parch-faint); line-height: 1.35; }
.index-count { grid-area: count; font-size: 0.7rem; color: var(--parch-dim); align-self: center; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ collection */

.collection {
  max-width: 1180px;
  margin: clamp(3.5rem, 9vh, 6rem) auto 0;
  padding: 0 clamp(0.75rem, 3vw, 3rem);
  scroll-margin-top: 2rem;
}
.collection-head { margin-bottom: 2rem; }
.collection-kicker {
  font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--brass);
}
.collection-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 340;
  line-height: 1.05;
  margin: 0.12em 0 0.15em;
}
.collection-tagline { color: var(--parch-dim); font-style: italic; font-family: var(--serif); font-size: 1.05rem; }

/* filters */
.filters { border-top: var(--hairline); border-bottom: var(--hairline); padding: 1rem 0; margin-bottom: 2.2rem; display: grid; gap: 0.9rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--parch-dim);
  background: transparent;
  border: 1px solid rgba(201, 168, 108, 0.3);
  border-radius: 999px;
  padding: 0.38rem 0.95rem;
  cursor: pointer;
  transition: all 0.22s ease;
}
.chip:hover { color: var(--parch); border-color: var(--brass); }
.chip.is-active {
  background: var(--brass); color: var(--ink-0);
  border-color: var(--brass); font-weight: 600;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }
.search-field {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid rgba(201, 168, 108, 0.3);
  padding: 0.42rem 0.9rem;
  color: var(--parch-faint);
  flex: 1 1 220px; max-width: 320px;
}
.search-field:focus-within { border-color: var(--brass); color: var(--brass); }
.search-field input {
  background: none; border: none; outline: none;
  color: var(--parch); font-family: var(--sans); font-size: 0.88rem;
  width: 100%;
}
.search-field input::placeholder { color: var(--parch-faint); }
.avail-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.78rem; letter-spacing: 0.06em; color: var(--parch-dim);
  cursor: pointer; user-select: none;
}
.avail-toggle input { accent-color: var(--brass); width: 15px; height: 15px; cursor: pointer; }

/* product grid — grid-breaking: feature cards span 2 columns */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.4rem 1.2rem;
}
.product-card {
  grid-column: span 1;
  border: 1px solid rgba(201, 168, 108, 0.16);
  background: var(--ink-2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  transition: transform 0.3s cubic-bezier(.2,.7,.2,1), border-color 0.3s, box-shadow 0.3s;
  opacity: 0;
  animation: card-in 0.6s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--i) * 65ms);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.product-card:hover, .product-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(201, 168, 108, 0.55);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  outline: none;
}
.product-card.is-feature { grid-column: span 2; flex-direction: row; }
.product-card.is-feature .card-media { flex: 1 1 52%; border-bottom: none; border-right: 1px solid rgba(201,168,108,.14); }
.product-card.is-feature .card-body { flex: 1 1 48%; justify-content: center; }
.product-card.is-feature .card-title { font-size: 1.5rem; }
.product-card.is-feature .card-desc { display: block; }

.card-media {
  position: relative;
  border-bottom: 1px solid rgba(201, 168, 108, 0.14);
  overflow: hidden;
}
.card-media img { display: block; width: 100%; height: auto; transition: transform 0.5s cubic-bezier(.2,.7,.2,1); }
.product-card:hover .card-media img { transform: scale(1.035); }
.card-flag {
  position: absolute; top: 0.7rem; left: 0.7rem;
  font-size: 0.62rem; letter-spacing: 0.14em;
  color: var(--brass-bright);
  background: rgba(7, 13, 23, 0.82);
  border: 1px solid rgba(201, 168, 108, 0.4);
  padding: 0.18rem 0.45rem;
}
.card-soldout {
  position: absolute; top: 0.7rem; right: 0.7rem;
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sale);
  background: rgba(7, 13, 23, 0.85);
  border: 1px solid rgba(217, 79, 48, 0.55);
  padding: 0.18rem 0.45rem;
}
.card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.card-title { font-family: var(--serif); font-size: 1.12rem; font-weight: 420; line-height: 1.25; color: var(--parch); }
.card-seller { font-size: 0.76rem; color: var(--parch-faint); letter-spacing: 0.04em; }
.card-desc { display: none; font-size: 0.85rem; color: var(--parch-dim); margin-top: 0.35rem; line-height: 1.5; }
.card-foot { margin-top: auto; padding-top: 0.65rem; display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.card-price { font-family: var(--serif); font-size: 1.15rem; color: var(--brass-bright); font-variant-numeric: tabular-nums; }
.card-price .from { font-size: 0.7rem; font-family: var(--sans); color: var(--parch-faint); letter-spacing: 0.08em; }
.card-rating { font-size: 0.76rem; color: var(--parch-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-rating .star { color: var(--brass); }

.empty-state {
  text-align: center; padding: 4rem 1rem; color: var(--parch-dim);
  border: 1px dashed rgba(201, 168, 108, 0.25);
}
.empty-glyph { font-size: 2rem; color: var(--brass); margin-bottom: 0.6rem; }
.empty-state .chip { margin-top: 1.2rem; }

/* ------------------------------------------------------------- colophon */

.colophon {
  max-width: 1180px;
  margin: clamp(4rem, 10vh, 7rem) auto 0;
  padding: 2rem clamp(0.75rem, 3vw, 3rem) 3rem;
  border-top: var(--hairline);
  color: var(--parch-faint);
  font-size: 0.78rem;
  line-height: 1.7;
}
.colophon a { color: var(--parch-dim); }

/* --------------------------------------------------------------- mobile */

@media (max-width: 680px) {
  .atlas { display: none; }               /* map degrades to the index list */
  .index-section { margin-top: 1rem; }
  .atlas-index { grid-template-columns: 1fr; }
  .product-card.is-feature { grid-column: span 1; flex-direction: column; }
  .product-card.is-feature .card-media { border-right: none; border-bottom: 1px solid rgba(201,168,108,.14); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.9rem 0.8rem; }
  .card-body { padding: 0.75rem 0.8rem 0.9rem; }
  .card-title { font-size: 0.98rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
