@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/*
 * The page is the gallery wall: --bg matches the plaster backdrop baked into
 * every product photo, so images sit borderless on the page.
 * Shape rule: photos are sharp-cornered; interactive controls are rounded.
 */
:root {
  --bg: #f0e9dc;
  --surface: #e6ddcc;
  --ink: #201f1a;
  --muted: #6d675a;
  --line: #d9cfba;
  --accent: #2f5d43;
  --accent-ink: #f0e9dc;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; }
h1, h2 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin: 0 0 1.25rem; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.brand {
  letter-spacing: 0.22em;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}
.controls { display: flex; align-items: center; gap: 0.25rem; }
.controls button {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
}
.controls button.active { color: var(--ink); font-weight: 600; background: var(--surface); }
.controls .sep { width: 1px; height: 1rem; background: var(--line); margin: 0 0.5rem; }

/* Hero: oversized type overlapping the floating bag */
.hero { overflow: hidden; }
.hero-inner {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vh, 3.5rem) clamp(1rem, 4vw, 2.5rem) 0;
  min-height: min(86dvh, 820px);
}
.hero h1 {
  grid-column: 1 / 9;
  grid-row: 1;
  z-index: 2;
  margin: 0;
  font-size: clamp(3rem, 8.5vw, 7.2rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.hero h1 span {
  display: block;
  font-size: 0.4em;
  font-weight: 300;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
  color: var(--muted);
}
.hero-bag {
  grid-column: 7 / 13;
  grid-row: 1 / 3;
  z-index: 1;
  width: 100%;
  max-height: min(76dvh, 700px);
  object-fit: contain;
  justify-self: center;
}
.hero-side {
  grid-column: 1 / 6;
  grid-row: 2;
  z-index: 2;
  padding: 2rem 0 3rem;
}
.tagline {
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  margin: 0 0 1.75rem;
  max-width: 30ch;
}
.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.cta:hover { filter: brightness(1.08); }
.cta:active { transform: scale(0.98); }

/* Catalog: borderless bags on the wall, staggered */
.catalog-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 6rem) clamp(1rem, 4vw, 2.5rem) 0;
}
.group-title {
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 3rem 0 1.75rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3.5vw, 3rem);
  align-items: start;
}
.card {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font-size: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.card .img-wrap { aspect-ratio: 4 / 5; overflow: hidden; position: relative; }
.quick-add {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.quick-add:hover { transform: scale(1.08); border-color: var(--accent); color: var(--accent); }
.quick-add:active { transform: scale(0.95); }
.quick-add.added {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-size: 1rem;
}
.card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover .img-wrap img { transform: translateY(-8px) scale(1.015); }
.card h3 { margin: 0.9rem 0 0.1rem; font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; }
.card .meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* Quote: manifesto beat between shop and story */
.quote {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 8rem) clamp(1rem, 4vw, 2.5rem) 0;
}
.quote p {
  margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  max-width: 18ch;
}

/* Colors: full-bleed strip */
.colors { padding: clamp(3.5rem, 10vh, 7rem) 0 0; }
.colors-text {
  max-width: 1280px;
  margin: 0 auto 2.25rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}
.colors-text p { color: var(--muted); margin: 0; max-width: 56ch; }
.colors > img {
  width: 100%;
  height: min(72dvh, 640px);
  object-fit: cover;
}

/* Story: asymmetric split */
.story {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(3.5rem, 10vh, 7rem) clamp(1rem, 4vw, 2.5rem);
}
.story img { width: 100%; height: auto; }
.story-text p { color: var(--muted); margin: 0; max-width: 52ch; }

footer {
  padding: 2rem 0 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  overflow: hidden;
}
.foot-brand {
  font-size: clamp(3rem, 11vw, 9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  color: var(--line);
  user-select: none;
  margin-bottom: 1.5rem;
}
footer p { margin: 0.4rem 0; }
footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
.foot-sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--line); vertical-align: middle; margin: 0 0.6rem; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 21, 15, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg);
  max-width: 920px;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  border-radius: var(--radius);
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.modal .close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: 0;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem;
}
.modal-body { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; }
.gallery .main { aspect-ratio: 4 / 5; overflow: hidden; margin-bottom: 0.6rem; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: 0.5rem; }
.gallery .thumbs button {
  width: 60px;
  aspect-ratio: 1;
  border: 2px solid transparent;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  opacity: 0.6;
  background: var(--surface);
}
.gallery .thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs button.active { opacity: 1; border-color: var(--accent); }

/* Selection tray */
.tray[hidden] { display: none; }
/* Reserve room so the floating tray never covers content or the footer. */
body.has-tray { padding-bottom: 5.5rem; }
.tray {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 0.6rem 0.6rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(32, 31, 26, 0.25);
  font-size: 0.9rem;
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
}
#trayCount { overflow: hidden; text-overflow: ellipsis; }
.tray-btn { flex-shrink: 0; }
.tray-btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.tray-btn:hover { filter: brightness(1.1); }
.tray-btn:active { transform: scale(0.97); }

/* Selection modal */
.selection-side h2 { margin: 0 0 1.25rem; font-size: 1.8rem; }
.selection-list { display: grid; gap: 0.9rem; }
.selection-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 0.9rem;
  align-items: center;
}
.selection-row .thumb { width: 56px; aspect-ratio: 1; overflow: hidden; }
.selection-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.selection-row .info { display: grid; line-height: 1.35; }
.selection-row .info span { color: var(--muted); font-size: 0.85rem; }
.selection-row .row-price { font-weight: 600; font-size: 0.95rem; }
.selection-row .row-remove {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}
.selection-row .row-remove:hover { color: var(--ink); }
.selection-total {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 1.15rem;
  text-align: right;
}

.form-lead { color: var(--ink); font-weight: 500; margin: 0 0 1rem; }
.add-select {
  margin-top: 0.9rem;
  width: 100%;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.add-select:hover { border-color: var(--accent); color: var(--accent); }
.add-select.added { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.detail h2 { margin: 0 0 0.25rem; font-size: 1.8rem; }
.detail .price { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.25rem; }
.detail .colorway { color: var(--muted); font-size: 0.95rem; margin: 0 0 1rem; }
.detail .lead { color: var(--accent); font-weight: 500; font-size: 0.9rem; margin-bottom: 1rem; }
.detail .desc { color: var(--muted); margin: 0 0 1.5rem; }
.detail form { display: grid; gap: 0.75rem; }
.detail label { font-size: 0.85rem; font-weight: 500; display: grid; gap: 0.3rem; }
.detail input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  background: #fbf8f2;
  color: var(--ink);
  border-radius: var(--radius);
}
.detail input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.detail button.reserve {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.detail button.reserve:hover { filter: brightness(1.08); }
.detail button.reserve:active { transform: scale(0.98); }
.detail .no-returns { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }
.detail .success { color: var(--accent); font-weight: 600; margin-top: 1rem; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.in { opacity: 1; transform: none; }
  .hero-bag { animation: settle 1s cubic-bezier(0.16, 1, 0.3, 1) both; }
  @keyframes settle {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }
  /* Stagger: middle column sits lower, gallery-wall rhythm */
  @media (min-width: 901px) {
    .grid > .card:nth-child(3n + 2) { margin-top: 3rem; }
  }
}

/* Mobile */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  /* Text and CTA before the photo on phones */
  .hero-inner { display: flex; flex-direction: column; padding-top: 1.5rem; min-height: 0; }
  .hero h1 { font-size: clamp(2.6rem, 12vw, 4rem); }
  .hero-bag { order: 3; max-height: 56dvh; margin: 1.5rem auto 0; }
  .hero-side { padding: 1.25rem 0 0; }
  .tray { left: 1rem; right: 1rem; transform: none; justify-content: space-between; }
  .story { grid-template-columns: 1fr; }
  .story img { order: -1; }
  .modal-body { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}
