@font-face {
  font-family: 'Archivo';
  src: url(fonts/archivo-latin.woff2) format('woff2');
  font-weight: 100 900; font-stretch: 62% 125%; font-display: block;
  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: 'Archivo';
  src: url(fonts/archivo-latin-ext.woff2) format('woff2');
  font-weight: 100 900; font-stretch: 62% 125%; font-display: block;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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: 'Newsreader';
  src: url(fonts/newsreader-italic-latin.woff2) format('woff2');
  font-style: italic; font-weight: 300 700; font-display: block;
  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: 'Newsreader';
  src: url(fonts/newsreader-italic-latin-ext.woff2) format('woff2');
  font-style: italic; font-weight: 300 700; font-display: block;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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;
}

/* Inks from the Ordnance Survey map: water, motorway blue, woodland, the Landranger
   cover, the B-road, contours, heather. One per meaning. */
:root {
  --paper: #f3f1ea;
  --ink: #14120f;
  --c-river: #1e3eb4;
  --c-water: #18a3dc;
  --c-trees: #0d8746;
  --c-gods: #e4007c;
  --c-force: #f04c1d;
  --c-manners: #ffd200;
  --c-ireland: #6c3a98;
  --c-english: #b4511b;
  --sans: 'Archivo', 'Arial Narrow', sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  --bar-h: 52px;
}

.g-river   { --bg: var(--c-river);   --fg: var(--c-manners); }
.g-water   { --bg: var(--c-water);   --fg: var(--ink); }
.g-dark    { --bg: var(--ink);       --fg: var(--paper); }
.g-trees   { --bg: var(--c-trees);   --fg: var(--paper); }
.g-gods    { --bg: var(--c-gods);    --fg: var(--paper); }
.g-force   { --bg: var(--c-force);   --fg: var(--ink); }
.g-manners { --bg: var(--c-manners); --fg: var(--c-river); }
.g-ireland { --bg: var(--c-ireland); --fg: var(--paper); }
.g-english { --bg: var(--c-english); --fg: var(--paper); }
.g-unknown { --bg: var(--paper);     --fg: var(--ink); }

* { box-sizing: border-box; }
html { scroll-padding-top: var(--bar-h); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--c-manners); outline-offset: 2px; }

/* ---------- the bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  min-height: var(--bar-h);
  padding: 8px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px; font-weight: 600; font-stretch: 85%;
  text-transform: uppercase; letter-spacing: .06em;
}
.bar-title { color: inherit; text-decoration: none; font-weight: 900; font-stretch: 62%; font-size: 26px; letter-spacing: 0; line-height: 1; }
.bar-sort, .bar-filter { display: flex; align-items: center; gap: 14px; }
.bar-label { opacity: .55; }
.bar-sort button { opacity: .6; padding: 6px 0; }
.bar-sort button[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.bar-sort button:hover { opacity: 1; }
.bar-filter { margin-left: auto; gap: 0; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 7px 10px 6px;
  background: var(--bg); color: var(--fg);
  transition: opacity .2s, filter .2s;
}
.chip b { font-weight: 800; font-stretch: 62%; font-size: 14px; }
.chip .n { opacity: .7; font-variant-numeric: tabular-nums; }
.bar.is-filtered .chip[aria-pressed="false"] { opacity: .28; filter: saturate(.5); }
.chip:hover { opacity: 1 !important; filter: none !important; }

/* ---------- the wall ---------- */
.wall {
  --cols: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
}
.cards { display: contents; }
@media (min-width: 640px)  { .wall { --cols: 2; } }
@media (min-width: 1100px) { .wall { --cols: 3; } }
@media (min-width: 1600px) { .wall { --cols: 4; } }

.intro {
  grid-column: 1 / -1;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  padding: clamp(20px, 4vw, 56px) clamp(16px, 4vw, 56px);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 18px;
  container-type: inline-size;
}
@media (min-width: 640px) { .intro { aspect-ratio: 8 / 5; padding: 4.2cqw 5cqw; gap: 1.9cqw; } }
@media (min-width: 1100px) { .intro { grid-column: span 2; } }
.intro-title {
  margin: 0;
  font-size: 34cqw; font-weight: 900; font-stretch: 62%;
  flex: none;
  line-height: .74; letter-spacing: -.02em; text-transform: uppercase;
  margin-left: -.03em;
}
.intro-thesis {
  margin: 0; max-width: 18ch;
  font-size: clamp(28px, 6.4cqw, 64px); font-weight: 800; font-stretch: 100%;
  line-height: 1.02; letter-spacing: -.02em;
}
.word {
  display: inline-block; padding: 0 .16em .04em; margin: 0 -.02em;
  background: var(--bg); color: var(--fg);
  font-weight: 800; font-stretch: 125%;
  transition: transform .2s;
}
.word:hover { transform: rotate(-2deg) scale(1.04); }
.intro-text { margin: 0; max-width: 46ch; font-size: clamp(16px, 1.6cqw, 19px); line-height: 1.4; }
@media (min-width: 640px) {
  .intro-title { font-size: 25cqw; }
  .intro-thesis { font-size: 4.7cqw; max-width: 24ch; }
  .intro-text { font-size: max(14px, 1.65cqw); max-width: 52ch; }
}
.intro-key { margin: 0; font-size: 14px; opacity: .75; }
.intro-key em { font-family: var(--serif); font-size: 17px; }

/* ---------- a card ---------- */
.card {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg); color: var(--fg);
  cursor: pointer;
  outline-offset: -6px;
}
.card[hidden] { display: none; }
.face { position: absolute; inset: 0; background: var(--bg); color: var(--fg); overflow: hidden; }
.art { position: absolute; inset: 0; container-type: inline-size; }
.art svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.net path { fill: none; stroke: color-mix(in srgb, var(--fg) 30%, var(--bg)); stroke-linecap: round; stroke-linejoin: round; }
.stem, .stem-water { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stem { stroke: var(--fg); }
.stem-water { stroke: var(--c-water); }
.g-water .stem-water { stroke: var(--paper); }

.name {
  position: absolute; left: 4cqw; top: 4.2cqw; margin: 0;
  font-size: calc(var(--nf, 28) * 1cqw);
  font-stretch: calc(var(--ns, 80) * 1%);
  font-weight: 900; line-height: .76; letter-spacing: -.005em;
  text-transform: uppercase; white-space: nowrap;
}
.sub {
  position: absolute; left: 4.4cqw; top: calc(4.2cqw + var(--nf, 28) * .76cqw + 2.2cqw);
  margin: 0;
  font-size: max(11px, 2.7cqw); font-weight: 700; font-stretch: 90%;
  text-transform: uppercase; letter-spacing: .07em;
}
.sub .native { font-family: var(--serif); font-style: italic; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 1.32em; }

.text {
  position: absolute; left: 4cqw; right: 4cqw; bottom: 4cqw;
  container-type: inline-size;
  display: flex; flex-direction: column; gap: 4.5cqw;
}
.hook { margin: 0; }
.qual { display: block; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 7cqw; line-height: 1.05; }
.says {
  display: block;
  font-size: calc(var(--hf, 14) * 1cqw);
  font-stretch: calc(var(--hs, 110) * 1%);
  font-weight: 850; line-height: .92; letter-spacing: -.025em;
  white-space: nowrap;
}
.stats {
  margin: 0;
  display: grid; grid-template-columns: .62fr 1fr 1fr; column-gap: 4cqw;
}
.stats div { min-width: 0; }
.stats dt {
  font-size: max(10px, 2.5cqw); font-weight: 700; font-stretch: 90%;
  text-transform: uppercase; letter-spacing: .09em;
  opacity: .72; margin-bottom: .5em;
}
.stats dd { margin: 0; font-size: max(12px, 3.3cqw); font-weight: 560; line-height: 1.18; }
.stats .km { font-size: max(20px, 7.4cqw); font-weight: 850; font-stretch: 75%; line-height: .9; letter-spacing: -.01em; }
.stats .km small { font-size: .5em; font-weight: 700; margin-left: .12em; }
.more { display: none; }

.card:hover .net path { stroke: color-mix(in srgb, var(--fg) 44%, var(--bg)); }
.card .net path { transition: stroke .3s; }

/* ---------- the full-screen view ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 50;
  background: var(--ink);
  overscroll-behavior: contain;
}
.viewer[hidden] { display: none; }
.viewer-stage { position: absolute; inset: 0; perspective: 2200px; overflow: hidden; }
.viewer-card { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.viewer-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.viewer-face[data-face="b"] { transform: rotateY(180deg); }

.viewer-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 22px;
  padding: 14px 20px 18px;
  color: var(--fg);
  font-size: 13px; font-weight: 700; font-stretch: 85%; text-transform: uppercase; letter-spacing: .08em;
  pointer-events: none;
}
.viewer-nav > * { pointer-events: auto; }
.vbtn { font-size: 30px; line-height: 1; font-weight: 500; padding: 4px 6px; letter-spacing: 0; font-stretch: 100%; }
.vbtn:hover { transform: translateY(-1px); }
.vclose { margin-left: auto; font-size: 13px; letter-spacing: .08em; font-weight: 700; font-stretch: 85%; }
.viewer-count { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: center; }
.viewer.is-reel .viewer-nav { display: none; }
.viewer.is-reel .face.full .text { bottom: 7cqw; gap: 5cqw; }
.viewer.is-reel .face.full .more { display: none; }

/* full card: portrait */
.face.full .text { bottom: max(64px, 15cqw); gap: 3.6cqw; }
.face.full .more { display: flex; flex-direction: column; gap: 2.6cqw; }
.face.full .story { margin: 0; font-size: max(15px, 3.9cqw); line-height: 1.36; font-weight: 450; max-width: 60ch; }
.face.full .first { margin: 0; font-family: var(--serif); font-style: italic; font-size: max(16px, 4.3cqw); line-height: 1.2; }
.face.full .first span { font-family: var(--sans); font-style: normal; font-size: max(10px, 2.5cqw); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; opacity: .72; margin-right: .6em; }
.face.full .doubt { margin: 0; font-size: max(13px, 3.2cqw); line-height: 1.35; opacity: .86; }
.face.full .doubt b { font-weight: 800; }
.face.full .source { margin: 0; font-size: max(11px, 2.6cqw); line-height: 1.35; opacity: .72; }

/* full card: landscape, art on the left and the words on the right */
@media (min-aspect-ratio: 1/1) {
  .face.full .art { right: 44%; }
  .face.full .text {
    left: 56%; right: 0; top: 0; bottom: 0;
    padding: 4.5vw 4.5vw 90px 2vw;
    justify-content: center; gap: 2.2cqw;
  }
  .face.full .more { gap: 2.4cqw; }
  .face.full .story { font-size: clamp(16px, 3.6cqw, 23px); }
  .face.full .first { font-size: clamp(17px, 4cqw, 26px); }
  .face.full .doubt { font-size: clamp(14px, 2.9cqw, 18px); }
  .face.full .source { font-size: clamp(12px, 2.3cqw, 14px); }
  .face.full .stats dd { font-size: clamp(13px, 2.9cqw, 18px); }
  .face.full .stats dd.km { font-size: clamp(28px, 7cqw, 52px); }
  .face.full .stats dt { font-size: clamp(10px, 2.1cqw, 12px); }
  .face.full .qual { font-size: clamp(22px, 5.6cqw, 40px); }
}

.foot {
  padding: 40px 16px 56px;
  display: grid; gap: 14px; max-width: 980px;
  font-size: 14px; line-height: 1.5; color: color-mix(in srgb, var(--paper) 78%, var(--ink));
}
.foot p { margin: 0; }
.foot strong { color: var(--paper); }

@media (max-width: 900px) {
  .bar { flex-wrap: wrap; row-gap: 6px; gap: 16px; }
  .bar-filter { margin-left: 0; width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 2px; }
  .bar-filter::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}
@media (max-width: 520px) {
  .bar { padding: 8px 12px; gap: 12px; }
  .bar-label { display: none; }
  .bar-sort { gap: 12px; overflow-x: auto; scrollbar-width: none; }
  .bar-sort button { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .word, .chip, .card .net path { transition: none; }
}
