/* Project page (projecte.html): what triCatial is, why it exists and how to help.
   Same brand as the game (brand/README.md): paper, ink, senyera red and gold, Outfit, rajoles. */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../brand/fonts/Outfit-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: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../brand/fonts/Outfit-latin-ext.woff2) format('woff2'); 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f6efe4; --surface: #fffaf2; --surface-2: #efe5d5; --text: #2a211b; --muted: #6b5d51; --border: #dccdb8;
  --red: #c8102e; --gold: #f2b705; --ink: #2a211b; --accent: #c8102e; --accent-text: #fff;
  --ok: #1d7a46; --ok-bg: #dff3e6; --panot: rgba(60, 40, 20, .055);
  --shadow: 0 2px 0 rgba(60, 40, 20, .1), 0 12px 28px rgba(60, 40, 20, .1);
  --radius: 22px; --display: 'Outfit', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f; --surface: #231d17; --surface-2: #30271f; --text: #f5ece0; --muted: #bcab97; --border: #45392d;
    --accent: #ff5a6e; --accent-text: #1a0f0b; --ok: #6fd89a; --ok-bg: #173524; --panot: rgba(255, 240, 220, .04);
    --shadow: 0 2px 0 rgba(0, 0, 0, .4), 0 12px 28px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17130f; --surface: #231d17; --surface-2: #30271f; --text: #f5ece0; --muted: #bcab97; --border: #45392d;
  --accent: #ff5a6e; --accent-text: #1a0f0b; --ok: #6fd89a; --ok-bg: #173524; --panot: rgba(255, 240, 220, .04);
  --shadow: 0 2px 0 rgba(0, 0, 0, .4), 0 12px 28px rgba(0, 0, 0, .35); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0; min-height: 100dvh; color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Barcelona's flower paving tile ("panot"), as in the game. */
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 16px 32px, transparent 9px, var(--panot) 9.5px, var(--panot) 11px, transparent 11.5px),
    radial-gradient(circle at 48px 32px, transparent 9px, var(--panot) 9.5px, var(--panot) 11px, transparent 11.5px),
    radial-gradient(circle at 32px 16px, transparent 9px, var(--panot) 9.5px, var(--panot) 11px, transparent 11.5px),
    radial-gradient(circle at 32px 48px, transparent 9px, var(--panot) 9.5px, var(--panot) 11px, transparent 11.5px),
    radial-gradient(circle at 32px 32px, var(--panot) 4px, transparent 4.5px),
    linear-gradient(var(--panot) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--panot) 1.5px, transparent 1.5px);
  background-size: 64px 64px;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.08; text-wrap: balance; }
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }

/* ---------- Top bar ---------- */
.topbar, main, .foot { max-width: 1080px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 8px; }
.brand { display: block; padding: 4px; border-radius: 10px; }
.brand-logo { display: block; height: 36px; width: auto; color: var(--text); }
.brand-logo .brand-cat { stroke: var(--accent); }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { padding: 9px 12px; border-radius: 12px; color: var(--text); font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.topnav a:hover { background: var(--surface-2); }
.topnav .pill { margin-left: 6px; padding: 9px 18px; background: var(--text); color: var(--bg); border-radius: 999px; }
.topnav .pill:hover { background: var(--accent); color: var(--accent-text); }
@media (max-width: 720px) { .topnav a:not(.pill) { display: none; } }

/* ---------- Shared pieces ---------- */
.eyebrow { font-weight: 750; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; padding: 12px 26px;
  border: 0; border-radius: 18px; background: var(--accent); color: var(--accent-text); text-decoration: none; text-align: center;
  font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; line-height: 1.15;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .25); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.secondary { background: var(--surface-2); color: var(--text); box-shadow: 0 5px 0 var(--border); }
.btn.secondary:active { box-shadow: 0 1px 0 var(--border); }
.btn.gold { background: var(--gold); color: var(--ink); width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.center { text-align: center; }
.card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }

/* Rajola (category tile), as in the game. */
.rajola {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; flex: none; overflow: hidden;
  background: var(--cat, var(--red)); color: #fff; border-radius: 22%;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .28);
}
.rajola svg { width: 66%; height: 66%; fill: currentColor; position: relative; }
.rajola::before {
  content: ""; position: absolute; inset: 0; opacity: .22;
  background:
    linear-gradient(115deg, transparent 47%, #fff 47.5%, #fff 49.5%, transparent 50%),
    linear-gradient(28deg, transparent 61%, #fff 61.5%, #fff 63.5%, transparent 64%),
    linear-gradient(160deg, transparent 27%, #fff 27.5%, #fff 29.5%, transparent 30%);
}

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; padding: 40px 0 56px; }
.hero h1 { margin-top: 14px; font-size: clamp(2.7rem, 7.4vw, 4.9rem); font-weight: 850; line-height: .98; }
.senyera { position: relative; color: var(--accent); white-space: nowrap; }
.senyera::after {
  /* four bars under the word, as under "Cat" in the logo */
  content: ""; position: absolute; left: 1%; right: 1%; bottom: -.12em; height: .11em; border-radius: 99px;
  background: repeating-linear-gradient(90deg, var(--red) 0 16%, var(--gold) 16% 28%);
  transform-origin: left; animation: bars-in .7s .25s cubic-bezier(.2, .8, .2, 1) both;
}
.lead { margin-top: 26px; max-width: 46ch; font-size: 1.16rem; color: var(--muted); }
.hero .actions { margin-top: 28px; }

.hero-card { position: relative; padding: 14px 6px 0 0; }
.hero-card::before { content: ""; position: absolute; inset: 0 0 14px 20px; border-radius: 28px; background: var(--gold); transform: rotate(3deg); }
.q-card { position: relative; --cat: #7048c0; background: var(--surface); border: 1.5px solid var(--border); border-radius: 26px; padding: 20px; box-shadow: var(--shadow); transform: rotate(-1.5deg); animation: card-in .7s cubic-bezier(.2, .9, .2, 1) both; }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q-cat { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; font-size: .92rem; }
.q-cat .rajola { width: 34px; }
.q-dif { padding: 4px 11px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .8rem; }
.q-text { margin: 16px 0 14px; font-family: var(--display); font-weight: 700; font-size: clamp(1.2rem, 2.3vw, 1.45rem); line-height: 1.22; letter-spacing: -.01em; }
.answers { display: grid; gap: 8px; }
.answers li { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 7px 14px 7px 8px; background: var(--surface-2); border: 2px solid transparent; border-radius: 16px; font-weight: 700; }
.answers b { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--surface); font-family: var(--display); font-weight: 800; }
.answers .ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.answers .ok b { background: var(--ok); color: var(--ok-bg); }
.tick { margin-left: auto; font-weight: 900; font-size: 1.2rem; }
.q-fact { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: .93rem; color: var(--muted); }
.q-fact strong { color: var(--text); }

/* The four bars of the senyera, between the hero and the rest. */
.bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bars i { height: 10px; border-radius: 99px; background: var(--red); }
.bars i:nth-child(even) { background: var(--gold); }

/* ---------- Sections ---------- */
.block { padding: 72px 0 8px; }
.block h2 { margin-top: 10px; font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 820; }
.intro { margin-top: 18px; max-width: 62ch; font-size: 1.1rem; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.cards h3 { margin: 14px 0 8px; font-size: 1.35rem; font-weight: 780; }
.cards p { color: var(--muted); }
.num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--gold); color: var(--ink); font-family: var(--display); font-weight: 850; font-size: 1.3rem; transform: rotate(-6deg); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 32px; }
.stats div { padding: 18px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 20px; }
.stats dt { font-family: var(--display); font-weight: 850; font-size: clamp(2.2rem, 5vw, 3.1rem); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stats dd { margin-top: 8px; color: var(--muted); font-size: .95rem; line-height: 1.35; }

.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 28px 0 32px; }
.cats li { display: grid; justify-items: center; gap: 8px; padding: 14px 8px 12px; background: var(--surface); border: 2px solid transparent; border-bottom-color: var(--cat); border-radius: 18px; text-align: center; font-weight: 700; font-size: .92rem; line-height: 1.15; box-shadow: 0 3px 0 var(--cat); transition: transform .2s cubic-bezier(.2, 1.6, .4, 1); }
.cats li:hover { transform: translateY(-4px) rotate(-1.5deg); }
.cats .rajola { width: 58px; }
.btn.inline { min-width: min(100%, 320px); }

/* ---------- Contribution ---------- */
.donate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 40px; align-items: center; padding: 44px; border-radius: 32px; color: #fff; background-color: var(--red); box-shadow: var(--shadow);
  background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 22px, transparent 22px 66px); }
.eyebrow.on-red { color: var(--gold); }
.donate h2 { color: #fff; }
.donate-text > p:not(.eyebrow) { margin-top: 18px; font-size: 1.1rem; max-width: 48ch; }
.uses { display: grid; gap: 10px; margin-top: 22px; font-weight: 650; }
.uses li { display: flex; align-items: flex-start; gap: 12px; }
.uses li::before { content: ""; flex: none; width: 12px; height: 12px; margin-top: .42em; border-radius: 4px; background: var(--gold); transform: rotate(-6deg); }

.donate-form { padding: 24px; border-radius: 24px; background: #fffaf2; color: #2a211b; box-shadow: 0 6px 0 rgba(0, 0, 0, .22); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .other { padding: 0; font-weight: 750; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: #6b5d51; }
legend { margin-bottom: 10px; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amounts label { position: relative; display: block; }
.amounts input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.amounts span { display: grid; place-items: center; min-height: 54px; border-radius: 14px; background: #efe5d5; border: 2px solid transparent; font-family: var(--display); font-weight: 800; font-size: 1.15rem; transition: background .15s, color .15s, transform .1s; }
.amounts input:checked + span { background: #2a211b; color: #fffaf2; }
.custom .amounts input:checked + span { background: #efe5d5; color: inherit; }
.amounts input:active + span { transform: scale(.96); }
.amounts input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.other { display: block; margin-top: 16px; }
.other-box { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 0 16px; min-height: 54px; background: #efe5d5; border: 2px solid #dccdb8; border-radius: 14px; font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: 0; text-transform: none; color: #2a211b; }
.other-box:focus-within { border-color: #2a211b; background: #fffaf2; }
.other-box input { flex: 1; min-width: 0; height: 50px; padding: 0; border: 0; background: none; outline: none; color: #2a211b; }
.other-box input::placeholder { color: #8d7f72; font-weight: 600; }
.donate-form .btn { margin-top: 18px; }
.msg { min-height: 1.5em; margin-top: 10px; color: #b3261e; font-weight: 650; font-size: .95rem; text-align: center; }
.small { margin-top: 6px; color: #6b5d51; font-size: .82rem; line-height: 1.45; }

/* ---------- Questions ---------- */
.faq { display: grid; gap: 12px; margin-top: 28px; max-width: 820px; }
.faq details { padding: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; cursor: pointer; list-style: none; font-family: var(--display); font-weight: 750; font-size: 1.15rem; border-radius: var(--radius); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { content: "–"; background: var(--gold); color: var(--ink); }
.faq details p { padding: 0 22px 20px; color: var(--muted); max-width: 68ch; }

/* Thanks, back from Stripe. */
.thanks { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(20, 12, 6, .6); animation: fade .25s ease-out both; }
.thanks-card { display: grid; justify-items: center; gap: 14px; max-width: 460px; padding: 30px 26px; background: var(--surface); border-radius: 28px; text-align: center; box-shadow: var(--shadow); animation: card-in .5s cubic-bezier(.2, 1.3, .3, 1) both; }
.thanks-card h2 { font-size: 2.1rem; font-weight: 850; }
.thanks-card p { color: var(--muted); }
.thanks-card .actions { justify-content: center; margin-top: 6px; }
.thanks-mark { width: 76px; height: 76px; border-radius: 22%; background: var(--gold); transform: rotate(-6deg); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16);
  background-image: repeating-linear-gradient(90deg, transparent 0 11px, var(--red) 11px 21px, transparent 21px 22px); background-size: 44px 44px; background-position: center; background-repeat: no-repeat; }

/* ---------- Footer ---------- */
.foot { display: grid; gap: 6px; padding-top: 64px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: .92rem; }
.foot a { color: inherit; font-weight: 650; }

@keyframes bars-in { from { transform: scaleX(0); } }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) rotate(0) scale(.96); } }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 24px 0 44px; }
  .hero-card { max-width: 460px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .donate { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px 20px; border-radius: 26px; }
  .block { padding-top: 56px; }
}
@media (max-width: 620px) {
  .cats { grid-template-columns: repeat(2, 1fr); }
  .actions .btn { flex: 1 1 100%; }
  .donate-form { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
