/* ---------- Tokens: change these to restyle the whole site ---------- */
:root {
  --paper: #f4f1ea;
  --card: #fffdf9;
  --ink: #14161b;
  --ink-2: #4a4e57;
  --muted: #8a8d94;
  --line: #e2ddd2;
  --accent: #ff5a36;        /* CTA / highlights */
  --accent-ink: #ffffff;
  --board: #14161b;         /* departure board */
  --amber: #ffb547;
  --ok: #1f9d6b;
  --warn: #d98a00;
  --bad: #d23c3c;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(20,22,27,.04), 0 10px 30px -12px rgba(20,22,27,.18);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn, .btn-ghost, .btn-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: transform .15s ease, background .15s, box-shadow .15s;
}
.btn { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -8px var(--accent); }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--paper) 85%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 20px; letter-spacing: -.02em; }
.brand b { color: var(--accent); font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: var(--amber); font-family: var(--mono); font-weight: 700; }
.topbar nav { display: flex; align-items: center; gap: clamp(8px, 2vw, 24px); }
.topbar nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; }
.topbar nav a:hover { color: var(--ink); }
@media (max-width: 640px) { .topbar nav a { display: none; } }

/* ---------- Hero ---------- */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 40px) 32px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.eyebrow { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 12px; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 6.2vw, 76px); line-height: .98; letter-spacing: -.035em; margin: 0 0 20px; }
.hero h1 em { font-style: normal; color: var(--ink-2); font-weight: 500; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 52ch; margin: 0 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* Departure board */
.board { background: var(--board); color: #e9e6df; border-radius: 22px; padding: 22px; font-family: var(--mono); box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); position: relative; overflow: hidden; }
.board::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px); pointer-events: none; }
.board-head { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .2em; color: var(--amber); margin-bottom: 14px; }
.board-row { display: grid; grid-template-columns: 1.1fr 1.3fr .9fr 1.5fr; gap: 6px; }
.board-labels { font-size: 10px; letter-spacing: .15em; color: #7d8088; margin-bottom: 6px; }
.flap { background: #1f2229; border-radius: 6px; padding: 8px 8px; font-size: clamp(12px, 1.25vw, 14px); font-weight: 700; color: #f4f1ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.04); position: relative; }
.flap::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.55); }
.flap-status { color: var(--amber); }
.board-countdown { display: flex; align-items: flex-end; gap: 10px; margin: 22px 0 18px; flex-wrap: wrap; }
.board-countdown div { display: flex; flex-direction: column; align-items: center; background: #1f2229; border-radius: 10px; padding: 10px 14px; min-width: 70px; }
.board-countdown strong { font-size: clamp(28px, 3.5vw, 40px); line-height: 1; color: var(--amber); }
.board-countdown span { font-size: 11px; color: #9a9da4; letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.board-countdown p { margin: 0 0 6px 4px; color: #9a9da4; font-size: 13px; }
.board-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px dashed #333740; padding-top: 14px; }
.board-stats div { display: flex; flex-direction: column; }
.board-stats strong { font-size: 22px; color: #fff; }
.board-stats span { font-size: 11px; color: #8d9098; text-transform: uppercase; letter-spacing: .1em; }

/* ---------- How it works ---------- */
.how { max-width: var(--max); margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 24px; }
.how ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 860px) { .how ol { grid-template-columns: repeat(2, 1fr); } }
.how li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.how li span { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.how h3 { font-family: var(--display); margin: 6px 0 4px; font-size: 20px; letter-spacing: -.01em; }
.how p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

/* ---------- Shop ---------- */
.shop { max-width: var(--max); margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 48px; scroll-margin-top: 70px; }
.shop-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.shop-head h2 { font-family: var(--display); font-size: clamp(30px, 4vw, 44px); letter-spacing: -.03em; margin: 0; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search input { border: 0; outline: 0; background: transparent; padding: 10px 0; width: 180px; }
.tools select { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 18px; scrollbar-width: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; font-size: 15px; transition: all .15s; }
.chip small { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 500; }
.chip[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip[aria-selected="true"] small { color: var(--amber); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px 0; }

.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; text-align: left; padding: 0;
  display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.card:has(.wa-btn:focus-visible) { outline: none; }
.card-open { all: unset; cursor: pointer; }
.card-open:focus-visible { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wa-btn { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; padding: 9px 12px; border-radius: 12px;
  background: #e7f8ee; color: #128c4b; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, color .15s; }
.wa-btn svg { width: 18px; height: 18px; }
.wa-btn:hover { background: #25d366; color: #fff; }
.wa-btn:focus-visible { outline: 3px solid #25d366; outline-offset: 2px; }
.thumb { aspect-ratio: 4 / 3; background: #ebe6dc; position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 56px; background: var(--ph, #ebe6dc); }
.card.is-gone .thumb img, .card.is-gone .ph { filter: grayscale(.9) opacity(.6); }
.ribbon { position: absolute; top: 12px; left: 12px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; border-radius: 6px; }
.ribbon.reserved { background: var(--amber); color: var(--ink); }
.ribbon.sold { background: var(--ink); color: #fff; }
.ribbon.featured { background: var(--accent); color: #fff; }
.save { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.92); border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 700; color: var(--ok); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.card h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; padding-top: 6px; }
.price { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; }
.was { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.offers { margin-left: auto; font-size: 12px; color: var(--ink-2); background: #f1ece2; padding: 3px 8px; border-radius: 99px; }

/* ---------- Dialogs ---------- */
.dlg { border: 0; padding: 0; border-radius: 24px; width: min(940px, calc(100% - 24px)); max-height: calc(100dvh - 40px); background: var(--card); color: var(--ink); box-shadow: 0 40px 80px -20px rgba(0,0,0,.45); }
.dlg::backdrop { background: rgba(20,22,27,.55); backdrop-filter: blur(4px); }
.dlg[open] { animation: pop .22s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dlg-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.dlg-body { padding: 0; }
.drawer { width: min(480px, calc(100% - 24px)); }
.drawer .dlg-body { padding: 28px 24px; }
.drawer h2 { font-family: var(--display); margin: 0 0 4px; font-size: 28px; letter-spacing: -.02em; }

.item { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); max-height: calc(100dvh - 40px); }
.dlg:has(.item) { overflow: hidden; }
@media (max-width: 760px) { .item { grid-template-columns: 1fr; max-height: none; } .dlg:has(.item) { overflow: auto; } .gallery .main, .gallery .ph { aspect-ratio: 4/3 !important; } }
.gallery { background: #ebe6dc; position: relative; }
.gallery .main { aspect-ratio: 1; width: 100%; object-fit: cover; }
.gallery .ph { aspect-ratio: 1; height: auto; font-size: 120px; }
.gallery { align-self: stretch; }
.thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: #e6e0d4; }
.thumbs button { flex: none; width: 58px; height: 58px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.thumbs button[aria-current="true"] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.item-info { padding: 28px 26px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.item-info h2 { font-family: var(--display); font-size: 30px; letter-spacing: -.025em; line-height: 1.05; margin: 0; }
.item-info .price { font-size: 34px; }
.desc { color: var(--ink-2); white-space: pre-wrap; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: #f1ece2; color: var(--ink-2); }
.tag.cond-new, .tag.cond-like_new { background: #dff3ea; color: var(--ok); }

.offer-box { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.offer-box h4 { margin: 0; font-size: 15px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #f1ece2; border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.amount { display: flex; align-items: center; gap: 10px; }
.amount .cur { font-family: var(--display); font-size: 28px; font-weight: 800; }
.amount input[type=number] { width: 120px; font-family: var(--display); font-size: 28px; font-weight: 800; border: 0; border-bottom: 2px solid var(--ink); background: transparent; padding: 2px 0; outline: none; }
.amount input[type=range] { flex: 1; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin: -4px 0 0; }
.hint.err { color: var(--bad); }
.field { display: grid; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; outline: none; width: 100%; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }
.banner { padding: 14px 16px; border-radius: 14px; font-size: 15px; }
.banner.reserved { background: #fff3d6; border: 1px solid #f3d28a; }
.banner.sold { background: #ececec; }
.banner.ok { background: #e3f5ec; border: 1px solid #b6e2cc; }
.code { font-family: var(--mono); font-weight: 700; letter-spacing: .12em; background: var(--ink); color: var(--amber); padding: 2px 8px; border-radius: 6px; }

/* My offers */
.lookup { display: flex; gap: 8px; margin: 16px 0; }
.lookup input { flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 14px; font-family: var(--mono); text-transform: uppercase; }
.offer { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.offer h4 { margin: 0; font-size: 15px; }
.offer .st { justify-self: end; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 99px; height: fit-content; }
.st.pending { background: #f1ece2; color: var(--ink-2); }
.st.accepted { background: #dff3ea; color: var(--ok); }
.st.declined, .st.withdrawn { background: #f8e1e1; color: var(--bad); }
.offer .actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.offer .actions a, .offer .actions button { padding: 7px 14px; font-size: 14px; }

/* Footer, toast */
.foot { max-width: var(--max); margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 64px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--ink-2); font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; font-weight: 500; max-width: calc(100% - 32px); }
.toast.err { background: var(--bad); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 480px) { .board-row { grid-template-columns: 1fr 1.2fr .9fr 1.4fr; } .flap { font-size: 10.5px; padding: 7px 5px; } }

a.tag { text-decoration: none; } a.tag:hover { background: #e6dfd1; color: var(--ink); }
.how p a, .foot a { color: var(--ink); font-weight: 600; }
