/* Evan's store.
   Grid + type: physical.evanapplegate.com (masonry columns, Optima, #7D7C7B).
   Background + side margins: evanapplegate.com/map-gifts (paper texture, 50px / 25px gutters). */

@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/eb-garamond-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/eb-garamond-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400 800; font-display: swap;
  src: url(fonts/eb-garamond-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg-color: #fefaf6;
  --bg-image: url(background.webp);
  --parallax: 0.15;
  --font: Optima, 'EB Garamond', Georgia, serif;
  --ink: #696464;
  --ink-dark: #5f5e5d;
  --accent: #6e5950;
  --rule: #d1ccc1;
  --panel: #f9f9f8;
  --gutter: 50px;
}
@media (max-width: 767px) {
  :root { --bg-image: url(background-1200.webp); --gutter: 25px; }
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { background-color: var(--bg-color); font-size: 12px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  position: relative;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  font-size: 11.25px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
/* paper texture on its own layer so it can drift (same as evanapplegate.com) */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg-image) top left / 100% auto repeat;
  image-rendering: pixelated;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    body::before { animation: bg-parallax 1ms linear both; animation-timeline: scroll(root block); }
  }
}
@keyframes bg-parallax {
  from { transform: translateY(calc(var(--parallax) * (100vh - 100%))); }
  to { transform: translateY(0); }
}

a { color: inherit; text-decoration-thickness: 0.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 1px; }
img { display: block; max-width: 100%; height: auto; }
button, select { font: inherit; color: inherit; }

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-image) top left / 100vw auto repeat var(--bg-color);
  image-rendering: pixelated;
  border-bottom: 1px solid transparent;
}
.site-head.stuck { border-bottom-color: var(--ink); }
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem var(--gutter) 1.5rem;
}
.site-header h1 { color: var(--ink); font-weight: normal; font-size: 1.2rem; line-height: 1.3; }
.site-header h1 a { text-decoration: underline; }
.chop { display: inline-block; height: 1em; vertical-align: middle; filter: brightness(0) invert(1) brightness(0.49); image-rendering: auto; }
.cart-toggle {
  background: none; border: none; cursor: pointer; font-size: 1rem; white-space: nowrap;
  text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 3px;
}
.cart-toggle svg { width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin-right: 5px; }
.cart-toggle:hover { text-decoration-thickness: 1px; }
.cart-toggle [data-cart-count] {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px;
  border-radius: 9px; background: var(--ink); color: var(--bg-color);
  font-size: .72rem; line-height: 1; vertical-align: 2px;
}
.cart-toggle [data-cart-count]:empty { display: none; }

/* ---------- category nav (same chips as work.evanapplegate.com) ---------- */
.filters { display: flex; flex-wrap: nowrap; gap: 1.5rem; padding: 0 var(--gutter) 1rem; }
.filters button {
  background: none; border: none; font-family: inherit; font-size: 1.2rem; color: var(--ink);
  cursor: pointer; padding: 0; opacity: 0.35; white-space: nowrap;
  transition: opacity .1s ease;
}
.filters button:hover { opacity: 0.75; }
.filters button.active {
  opacity: 1;
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 3px;
}
.filter-note { font-size: 2.618rem; letter-spacing: -0.035em; line-height: 1.15; color: var(--ink); padding: 0 var(--gutter) 1rem; }
.filter-note:empty { display: none; }
@media (max-width: 767px) {
  .filters { flex-wrap: wrap; gap: 0.5rem 0.75rem; }
  .filter-note { font-size: 1.68rem; }
}

/* ---------- contact form ---------- */
.contact-sec { padding: 3px var(--gutter) 80px; max-width: 560px; }
.contact-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%; font: inherit; color: inherit;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 2px;
  padding: 8px 10px;
}
.contact-form textarea { resize: vertical; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--ink); opacity: .55; }
.contact-form .form-note { font-style: italic; }

/* ---------- masonry grid (3 cols desktop, 2 phone) ---------- */
.gallery {
  column-count: 4;
  column-gap: 6px;
  padding: 3px var(--gutter) 60px;
  max-width: 2000px;
  margin: 0 auto;
}
@media (max-width: 767px) { .gallery { column-count: 2; } }
/* JS masonry (assets/masonry.js): row-ish order so DOM-first tiles sit at the top */
.gallery.js-masonry { column-count: auto; display: flex; gap: 6px; align-items: flex-start; }
.gcol { flex: 1; min-width: 0; }

/* tile: full-width media, text and buttons below */
.tile { break-inside: avoid; margin-bottom: 18px; }
.tile-media { display: block; }
.tile img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  transition: filter .2s;
  background: #ece8e2;
}
.tile:hover img { filter: brightness(.8); }
.tile .video-wrap video { transition: filter .2s; }
.tile:hover .video-wrap:not(.playing) video { filter: brightness(.8); }
.tile-box { padding-top: 6px; }
.tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: .75rem;
  row-gap: 2px;
}
.tile-title { font-size: .95rem; line-height: 1.3; }
.tile-title a { text-decoration: none; }
.tile-title a:hover { text-decoration: underline; }
.tile-title a::after { content: ' ▷'; font-size: .85em; }
.tile-title a:hover::after { content: ' ▶'; }
.price { white-space: nowrap; font-size: .95rem; }
.tile-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 2px; }
.tile-actions .opt { max-width: 100%; }

.opt {
  appearance: none;
  -webkit-appearance: none;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237D7C7B'/%3E%3C/svg%3E") right 8px center / 9px no-repeat;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 4px 24px 4px 8px;
  font-size: .85rem;
  max-width: 100%;
  cursor: pointer;
}

.btn {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 4px 10px;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--bg-color); }
.btn.added { background: var(--ink); border-color: var(--ink); color: var(--bg-color); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.solid { background: var(--ink); border-color: var(--ink); color: var(--bg-color); }
.btn.solid:hover { background: var(--ink-dark); border-color: var(--ink-dark); }

/* ---------- product page ---------- */
.product {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 30px;
  padding: 3px var(--gutter) 80px;
  max-width: 2000px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 900px) {
  .product { grid-template-columns: 1fr; }
  /* stacked: product info reads first, pics below */
  .product-info { order: -1; }
}
.product-images { column-count: 2; column-gap: 6px; }
.product-images.js-masonry { column-count: auto; display: flex; gap: 6px; align-items: flex-start; }
.product-images img { border-radius: 2px; margin-bottom: 6px; break-inside: avoid; width: 100%; cursor: zoom-in; transition: filter .2s; }
.product-images a:hover img { filter: brightness(.8); }
.product-images video { transition: filter .2s; }
.product-images .video-wrap:not(.playing):hover video { filter: brightness(.8); }
.video-wrap { position: relative; margin-bottom: 6px; break-inside: avoid; }
.video-wrap video { border-radius: 2px; width: 100%; height: auto; display: block; }
.play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; padding: 0; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .75); background: rgba(20, 15, 10, .35); backdrop-filter: blur(2px); cursor: pointer; transition: background .2s; }
.play-btn:hover { background: rgba(20, 15, 10, .55); }
.play-btn::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-38%, -50%); border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent rgba(255, 255, 255, .9); }
/* once the native UI is on, the cute button steps aside */
.video-wrap video[controls] + .play-btn { display: none; }
.tile .video-wrap { margin-bottom: 0; }
.tile .video-wrap video { background: #ece8e2; }
.tile .play-btn { width: 52px; height: 52px; }
.tile .play-btn::after { border-width: 10px 0 10px 17px; }
@media (max-width: 767px) { .product-images { column-count: 1; } }
.product-info { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 901px) { .product-info { position: sticky; top: 20px; } }
.product-info h2 { font-weight: normal; font-size: 1.35rem; line-height: 1.25; color: var(--ink); }
.product-info .price { font-size: .95rem; }
.product-info .opts { display: flex; flex-direction: column; gap: 8px; }
.product-info label { display: flex; flex-direction: column; gap: 3px; font-size: .95rem; }
.product-info .opt { font-size: .95rem; padding: 6px 28px 6px 10px; }
.product-info .btn { font-size: .95rem; padding: 8px 14px; align-self: flex-start; }
.product-info .extra { font-size: .95rem; }
.desc { white-space: pre-line; font-size: .95rem; line-height: 1.5; border-top: 1px solid var(--rule); padding-top: 14px; }
.desc ul { list-style: none; margin: 10px 0; }
.desc li { position: relative; padding-left: 1em; }
.desc li::before { content: '◦'; position: absolute; left: 0; }
.desc ol { list-style: decimal; margin: 4px 0 2px; padding-left: 1.5em; }
.desc ol li { padding-left: 0; text-indent: 0; }
.desc ol li::before { content: none; }
.back { padding: 0 var(--gutter) 1rem; font-size: 1.2rem; }

/* ---------- cart drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(60, 55, 50, .25); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.cart {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(400px, 100vw);
  background: var(--bg-color) var(--bg-image) top left / 1200px auto repeat;
  border-left: 1px solid var(--rule);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 11;
  display: flex;
  flex-direction: column;
}
body.cart-open .cart { transform: none; }
body.cart-open .scrim { opacity: 1; pointer-events: auto; }
.cart-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2rem 25px 1rem; border-bottom: 1px solid var(--rule); }
.cart-head h2 { font-weight: normal; font-size: 1.2rem; }
.cart-close { background: none; border: none; cursor: pointer; font-size: 1rem; text-decoration: underline; text-decoration-thickness: .5px; text-underline-offset: 3px; }
.cart-items { flex: 1; overflow-y: auto; padding: 0 25px; list-style: none; }
.cart-items li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.cart-items img { width: 64px; height: 64px; object-fit: cover; border-radius: 2px; }
.cart-items .ci-title { font-size: .9rem; line-height: 1.3; }
.cart-items .ci-var { font-size: .8rem; opacity: .8; }
.cart-items .ci-qty { display: flex; gap: 8px; align-items: center; font-size: .85rem; margin-top: 4px; }
.cart-items .ci-qty button { background: none; border: 1px solid var(--rule); border-radius: 2px; width: 22px; height: 22px; cursor: pointer; line-height: 1; }
.cart-items .ci-remove { background: none; border: none; cursor: pointer; font-size: .8rem; text-decoration: underline; text-decoration-thickness: .5px; text-underline-offset: 2px; margin-left: 4px; }
.cart-items .ci-qty .ci-remove { border: none; width: auto; height: auto; }
.cart-empty { padding: 20px 0; font-style: italic; }
@media (max-width: 767px) {
  .tile-meta { flex-direction: column; }
  .tile-title, .tile .price { font-size: .9rem; }
  .tile .opt { font-size: .8rem; }
}
.cart-foot { padding: 16px 25px 28px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.05rem; }
.cart-note { font-size: .8rem; opacity: .8; }

.site-footer { padding: 0 var(--gutter) 40px; font-size: .85rem; }

/* TEMP: purchase UI hidden on the masonry grid only. Delete this block to restore. */
.tile .opt,
.tile button[data-add] { display: none !important; }
