:root {
  --paper: #EDE3D1;
  --card: #FFFCF5;
  --sheet: #F8F1E3;
  --ink: #22180F;
  --ink-2: #4F4236;
  --ink-3: #8A7660;
  --brick: #A8361C;
  --ochre: #F2B544;
  --rule: #E3D6BE;
  --display: "Anton", Impact, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --hand: "Caveat", cursive;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 50; }
.skip:focus { top: 1rem; }

/* ---------- header / footer ---------- */
.bar { display: flex; align-items: center; gap: 2rem; padding: 1.75rem clamp(1.25rem, 5vw, 4rem); }
.logo { font-family: var(--mono); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; font-size: .9rem; }
.nav { display: flex; gap: 1.5rem; margin-left: auto; font-family: var(--mono); font-size: .85rem; letter-spacing: .06em; }
.nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { border-color: var(--ink); }
.lang { display: flex; border: 1.5px solid var(--ink); }
.lang button { background: none; border: 0; padding: .3rem .65rem; font-family: var(--mono); font-weight: 700; font-size: .8rem; color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding: 2.5rem clamp(1.25rem, 5vw, 4rem); margin-top: 3rem; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: .8rem; color: var(--ink-3); }
.foot a { color: var(--brick); }

/* ---------- shared ---------- */
.kicker { font-family: var(--mono); font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--brick); }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; }
.title { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.6rem, 1.5rem + 4vw, 4.6rem); line-height: .95; margin-bottom: .75rem; }
.btn { display: inline-block; background: var(--brick); color: #FFF5E6; border: 0; padding: .95rem 1.6rem; font-weight: 800; text-decoration: none; transition: background-color .2s; }
.btn:hover { background: #8C2B14; }
.btn.small { padding: .6rem 1rem; background: var(--ochre); color: var(--ink); }
.btn.small:hover { background: #F7C766; }
.link { font-weight: 700; border-bottom: 3px solid var(--ink); text-decoration: none; padding-bottom: 2px; }
.link-btn { background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; color: var(--ink-2); }
.page { padding: 1rem clamp(1.25rem, 5vw, 4rem) 2rem; max-width: 80rem; margin: 0 auto; }

/* ---------- stamps ---------- */
.stamp {
  position: relative; display: block; background: #fff; padding: 6px 6px 18px; aspect-ratio: 4 / 5; text-decoration: none; color: var(--ink);
  -webkit-mask: radial-gradient(circle 4px at 50% 0, #0000 97%, #000) 0 0 / 12px 51% repeat-x, radial-gradient(circle 4px at 50% 100%, #0000 97%, #000) 0 100% / 12px 51% repeat-x;
          mask: radial-gradient(circle 4px at 50% 0, #0000 97%, #000) 0 0 / 12px 51% repeat-x, radial-gradient(circle 4px at 50% 100%, #0000 97%, #000) 0 100% / 12px 51% repeat-x;
  filter: grayscale(1) opacity(.5); transition: filter .25s, transform .2s;
}
.stamp img { width: 100%; height: 76%; object-fit: cover; }
.stamp span { position: absolute; left: 2px; right: 2px; bottom: 3px; text-align: center; font-family: var(--mono); font-size: .5rem; letter-spacing: .03em; text-transform: uppercase; line-height: 1.1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stamp.got { filter: none; }
.stamp:hover { filter: none; transform: translateY(-3px) rotate(-1.5deg); }
.stamp.big span { font-size: .62rem; }
.stamp.solo { padding: 6px 6px 10px; width: 5.6rem; aspect-ratio: 5 / 4; filter: none; }
.stamp.solo img { height: 100%; }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 2rem clamp(2rem, 4vw, 4rem); padding: 1rem clamp(1.25rem, 5vw, 4rem) 2rem; align-items: start; }
.home-text { padding-top: 2rem; }
.mega { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(3.4rem, 1.5rem + 6vw, 6.8rem); line-height: .9; margin: .9rem 0 1.4rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.75rem; }
.count { display: flex; gap: 2rem; margin-top: 3.5rem; }
.count div { display: flex; flex-direction: column-reverse; }
.count dt { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.count dd { font-family: var(--display); font-size: 2.6rem; line-height: 1; }
.desk { position: relative; padding-bottom: 6rem; }
.sheet { background: var(--sheet); padding: 1.25rem; box-shadow: 0 30px 60px rgba(60,35,15,.22); }
.desk .sheet { transform: rotate(1.2deg); }
.sheet-head { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .9rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 7px; }
.pc { position: absolute; display: block; background: var(--card); padding: 10px 10px 40px; box-shadow: 0 22px 44px rgba(0,0,0,.32); text-decoration: none; transition: transform .25s; }
.pc img { width: 100%; height: 100%; object-fit: cover; }
.pc-cap { position: absolute; left: 14px; bottom: 6px; font-family: var(--hand); font-size: 1.45rem; color: #3A2A1A; }
.pc-0 { width: 46%; height: 13.5rem; left: 6%; bottom: 0; transform: rotate(-5deg); }
.pc-1 { width: 40%; height: 12rem; right: -2%; bottom: -1rem; transform: rotate(4deg); }
.pc:hover { transform: rotate(0) translateY(-6px); z-index: 2; }

/* postmark */
.postmark { position: absolute; display: grid; place-items: center; text-align: center; width: 6.2rem; height: 6.2rem; border-radius: 50%; border: 2.5px solid var(--brick); color: var(--brick); font-family: var(--mono); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; transform: rotate(-14deg); background: rgba(255,252,245,.55); line-height: 1.2; padding: .5rem; }
.postmark b { display: block; font-family: var(--display); font-weight: 400; font-size: .95rem; letter-spacing: 0; }
.pc .postmark { right: -1.4rem; top: -1.4rem; }

/* ---------- list ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin: 2rem 0 2.5rem; }
.search { font: inherit; padding: .7rem 1rem; border: 1.5px solid var(--ink); background: var(--card); min-width: 16rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips button { background: none; border: 1.5px solid var(--ink); padding: .4rem .8rem; font-weight: 700; font-size: .88rem; color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.region { margin-bottom: 2.5rem; }
.region h2 { font-family: var(--serif); font-weight: 700; font-size: 1.6rem; display: flex; align-items: baseline; gap: .75rem; border-bottom: 1px solid var(--rule); padding-bottom: .5rem; margin-bottom: 1.25rem; }
.region h2 small { font-family: var(--mono); font-size: .75rem; color: var(--ink-3); font-weight: 400; }
.stamp-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.8rem, 1fr)); gap: 1rem; }
.none { color: var(--ink-3); }

/* ---------- country postcard ---------- */
.post-wrap { padding: .5rem clamp(1.25rem, 5vw, 4rem) 2rem; max-width: 84rem; margin: 0 auto; }
.crumbs { font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; margin-bottom: 1.25rem; color: var(--ink-3); }
.crumbs a { text-decoration: none; }
.post { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--card); box-shadow: 0 30px 60px rgba(60,35,15,.22); min-height: 40rem; }
.post-photo { position: relative; display: flex; flex-direction: column; background: #1c140c; }
.post-photo .main { flex: 1; width: 100%; min-height: 26rem; object-fit: cover; }
.thumbs { display: flex; gap: 6px; padding: 8px; background: #1c140c; overflow-x: auto; }
.thumbs button { flex: none; }
.thumbs button { border: 2px solid transparent; padding: 0; background: none; width: 4.5rem; height: 3.2rem; opacity: .6; }
.thumbs button[aria-pressed="true"] { border-color: var(--ochre); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.big-mark { right: 1.25rem; top: 1.25rem; width: 7rem; height: 7rem; background: rgba(255,252,245,.85); }
.post-text { position: relative; padding: clamp(1.5rem, 3vw, 2.75rem); border-left: 2px dashed #D6C6AA; display: flex; flex-direction: column; }
.post-stamps { position: absolute; right: 1.5rem; top: 1.5rem; display: flex; align-items: flex-start; gap: .6rem; }
.post-stamps .map { width: 4.2rem; opacity: .85; }
.cname { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(2.6rem, 1.6rem + 3vw, 4.4rem); line-height: .95; margin: .5rem 10rem .3rem 0; }
.nick { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--ink-2); margin-right: 8rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.5rem 0 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.tabs a { text-decoration: none; font-weight: 700; font-size: .85rem; padding: .4rem .75rem; border: 1.5px solid var(--ink); }
.tabs a[aria-selected="true"] { background: var(--ink); color: var(--card); }
.soon { font-size: .85rem; color: var(--brick); margin-bottom: .75rem; }
.tab-body { color: var(--ink-2); max-width: 38em; }
.tab-body p + p, .tab-body ul + p, .tab-body p + ul { margin-top: .85rem; }
.sites { list-style: none; padding: 0; }
.sites li { padding: .6rem 0 .6rem 1.75rem; border-bottom: 1px solid var(--rule); position: relative; }
.sites li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: .7rem; height: .7rem; border: 2px solid var(--brick); border-radius: 50%; }
.sites b { color: var(--ink); }
.quiz-bar { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; background: var(--ink); color: var(--paper); padding: 1rem 1.25rem; }
.tab-body + .quiz-bar { margin-top: 2rem; }
.quiz-bar b { color: var(--ochre); }
.pn { display: flex; justify-content: space-between; margin-top: 1.5rem; font-family: var(--mono); font-size: .85rem; }
.pn a { text-decoration: none; border-bottom: 2px solid var(--ink); }

/* ---------- quiz dialog ---------- */
.quiz { border: 0; padding: clamp(1.5rem, 4vw, 2.5rem); max-width: min(92vw, 40rem); width: 100%; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.quiz::backdrop { background: rgba(34,24,15,.7); }
.quiz h2 { font-family: var(--serif); font-weight: 700; font-size: 1.6rem; line-height: 1.2; margin: .6rem 0 1.5rem; }
.opts { display: grid; gap: .7rem; }
.opts.flag { grid-template-columns: repeat(2, 1fr); }
.opt { background: #fff; border: 2px solid var(--rule); padding: .9rem 1rem; text-align: left; font-weight: 600; color: var(--ink); transition: border-color .15s; }
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opts.flag .opt { padding: .5rem; }
.opts.flag img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.opt.ok { border-color: #2E7D4F; background: #E9F5EC; }
.opt.bad { border-color: var(--brick); background: #FBEAE5; }
.q-feed { min-height: 1.6em; margin-top: 1rem; font-weight: 700; }
.q-actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 1rem; }
.q-end { text-align: center; position: relative; padding-top: .5rem; }
.q-end .stamp.solo { width: 9rem; margin: 0 auto 1rem; }
.q-end .postmark.live { position: absolute; left: 55%; top: 3.5rem; animation: thump .5s .35s both; }
.q-score { font-family: var(--display); font-size: 2.4rem; text-transform: uppercase; }
.q-msg { color: var(--ink-2); margin: .5rem auto 0; max-width: 28em; }
.q-end .q-actions { justify-content: center; }
.drop { animation: drop .45s both; }
@keyframes drop { from { transform: translateY(-30px) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes thump { from { transform: scale(1.8) rotate(-14deg); opacity: 0; } to { transform: scale(1) rotate(-14deg); opacity: 1; } }

/* ---------- passport ---------- */
.pass-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 2rem; }
.rank { min-width: 16rem; }
.rank b { display: block; font-family: var(--display); font-size: 3rem; line-height: 1; font-weight: 400; }
.rank span { font-family: var(--serif); font-style: italic; color: var(--ink-2); }
.bar-track { height: 10px; background: var(--rule); margin-top: .6rem; }
.bar-track i { display: block; height: 100%; background: var(--brick); }
.sheet-full .sheet-grid { grid-template-columns: repeat(auto-fill, minmax(5.8rem, 1fr)); gap: .8rem; }
.sheet-reg { font-family: var(--serif); font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
.sheet-reg:first-of-type { margin-top: .25rem; }
.reset-row { margin-top: 1.5rem; text-align: right; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 3rem; margin-top: 2rem; align-items: start; }
.about-grid p + p { margin-top: 1rem; }
.about-grid .nick { margin: 0 0 1.5rem; }
.book { aspect-ratio: 2 / 3; background: var(--brick); color: var(--paper); padding: 2rem 1.5rem; display: flex; flex-direction: column; justify-content: space-between; box-shadow: inset 12px 0 0 rgba(0,0,0,.18), 0 24px 48px rgba(60,35,15,.3); }
.book span { font-family: var(--display); text-transform: uppercase; font-size: 2.6rem; line-height: .95; }
.book small { font-family: var(--mono); letter-spacing: .15em; text-transform: uppercase; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-text { border-left: 0; border-top: 2px dashed #D6C6AA; }
  .post-photo .main { min-height: 18rem; max-height: 24rem; }
}
@media (max-width: 640px) {
  body { font-size: 16px; overflow-x: hidden; }
  .big-mark { width: 5.5rem; height: 5.5rem; right: .75rem; top: .75rem; }
  .bar { flex-wrap: wrap; gap: .75rem 1rem; }
  .nav { order: 3; width: 100%; margin: 0; gap: 1rem; font-size: .75rem; }
  .lang { margin-left: auto; }
  .sheet-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .count { gap: 1.25rem; }
  .pc-0 { width: 58%; height: 10rem; }
  .pc-1 { width: 50%; height: 9rem; }
  .cname { margin-right: 0; }
  .nick { margin-right: 0; }
  .post-stamps { position: static; margin-bottom: 1rem; }
  .opts.flag { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .book { max-width: 14rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
