:root {
  --ink: #141414;
  --ink-2: #4a3f38;
  --lime: #FF7A00;          /* accent (kept name for minimal churn): amber orange, distinct from Strava's #FC4C02 */
  --accent-soft: #FFE0BD;
  --paper: #FFF1E3;
  --card: #ffffff;
  --line: #F0D9C4;
  --muted: #6E625A;
  --coral: #F26B00;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(60, 30, 10, .06), 0 8px 24px rgba(60, 30, 10, .08);
  --display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--body); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px; background: rgba(255, 241, 227, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 22px/1 var(--display); letter-spacing: -.02em; }
#nav { display: flex; align-items: center; gap: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-weight: 700; object-fit: cover; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--ink); background: transparent;
  padding: 9px 16px; border-radius: 999px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: rgba(20, 61, 46, .06); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--ink-2); }
.btn.lime { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.liked { background: var(--coral); border-color: var(--coral); color: #fff; }

/* hero */
.hero { display: grid; gap: 14px; padding: 36px 0 10px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.hero h1 { margin: 0; font: 800 clamp(36px, 6.2vw, 68px)/0.98 var(--display); letter-spacing: -.035em; }
.hero h1 em { font-style: normal; background: var(--lime); color: var(--ink); padding: 0 .14em; border-radius: 10px; }
.lede { margin: 0; color: var(--muted); max-width: 54ch; font-size: 17px; }
.h2 { font: 700 28px/1.1 var(--display); letter-spacing: -.02em; margin: 0; }

/* search */
.searchbar { position: sticky; top: 57px; z-index: 900; margin: 22px -20px 0; padding: 12px 20px;
  background: rgba(255, 241, 227, .92); backdrop-filter: blur(10px); display: grid; gap: 10px; }
.search-input { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 0 16px; box-shadow: var(--shadow); color: var(--muted); }
.search-input:focus-within { border-color: var(--ink); outline: 3px solid rgba(255, 122, 0, .35); }
.search-input input { flex: 1; border: 0; background: transparent; padding: 14px 0; font-size: 16px; outline: none; color: var(--ink); min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* All filter controls share one height so the row reads as a single toolbar. */
.filters > * { height: 40px; box-sizing: border-box; }
.filters select, .filters .where { border: 1px solid var(--line); background-color: var(--card); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink); }
.filters select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding: 0 36px 0 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23141414' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
}
.filters select:hover, .chip-btn:hover { border-color: var(--ink-2); }
.filters select.active { background-color: var(--accent-soft); border-color: var(--lime); }
.filters .where { width: 130px; padding: 0 14px; font-weight: 500; }
.filters select:focus, .filters .where:focus { outline: 2px solid var(--lime); border-color: var(--ink); }
.seg { display: inline-flex; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 0 12px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip-btn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 0 14px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--lime); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 14px; }
.section-head h2 { margin: 0; font: 700 24px/1.1 var(--display); letter-spacing: -.02em; }

/* grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(60,30,10,.08), 0 16px 32px rgba(60,30,10,.14); }
.card:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
/* Posters are 4:5 with the title printed at the bottom; show the square top so the shape fills the tile. */
.thumb-wrap { aspect-ratio: 1; overflow: hidden; background: #f3e4d4; border-bottom: 1px solid var(--line); }
.card .thumb { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .3s ease; }
.card:hover .thumb { transform: scale(1.04); }
.card .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.card h3 { margin: 0; font: 700 17px/1.2 var(--display); letter-spacing: -.01em; }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 2px 6px; }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; font-size: 13px; }
.by { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.likes { font-weight: 600; color: var(--muted); }
.likes.on { color: var(--coral); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.skeleton { aspect-ratio: .78; background: linear-gradient(90deg, #f6e2cf 0%, #fff1e3 50%, #f6e2cf 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; box-shadow: none; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }
.more { display: flex; justify-content: center; margin-top: 24px; }

.foot { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 8px; color: var(--ink-2); font-size: 14px; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--ink); font-weight: 600; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.big-emoji { font-size: 44px; }
.back { display: block; width: fit-content; margin-bottom: 12px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.back:hover { color: var(--ink); }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { border-color: var(--line); }
.avatar-link { display: inline-flex; }

/* detail */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.detail h1 { margin: 0 0 6px; font: 800 clamp(30px, 4.5vw, 46px)/1.02 var(--display); letter-spacing: -.03em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stat { background: var(--card); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font: 700 22px/1.1 var(--display); }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.hero-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--card); border: 1px solid var(--line); }
.map { height: 380px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: 16px; }
.embed { margin-top: 16px; border-radius: var(--radius); overflow: hidden; }
.embed iframe { width: 100%; height: 560px; border: 0; }
.byline { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.desc { white-space: pre-wrap; }

/* upload */
.upload { max-width: 760px; margin: 0 auto; }
.upload h1 { font: 800 40px/1 var(--display); letter-spacing: -.03em; margin: 8px 0 18px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .label { font-weight: 600; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tabs { display: flex; gap: 6px; background: var(--paper); padding: 4px; border-radius: 999px; width: fit-content; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.preview-box { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; }
.preview-box canvas, .preview-box img { width: 200px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.pick-map { height: 280px; border-radius: 14px; overflow: hidden; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.login-box { text-align: center; display: grid; gap: 12px; justify-items: center; padding: 40px 20px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--ink); color: var(--paper);
  padding: 12px 18px; border-radius: 999px; font-weight: 600; transition: transform .25s ease; z-index: 2000; max-width: 90vw; }
#toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  main { padding: 16px 16px 80px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card h3 { font-size: 15px; }
  .card .body { padding: 10px 11px 12px; }
  .hero { padding-top: 20px; }
  .lede { font-size: 15px; }
  .searchbar { margin: 16px -16px 0; padding: 10px 16px; top: 53px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters > * { flex: none; }
  .two, .preview-box { grid-template-columns: 1fr; }
  .preview-box canvas, .preview-box img { width: 100%; max-width: 280px; }
  .top { padding: 10px 16px; }
}

#related { margin-top: 40px; }
.loader { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--lime); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
