/* ============================================
   EL MILLOR ALIAT — web satírica
   Estètica: pòster de propaganda pla
   ============================================ */

:root {
  --lime: #EDFA60;
  --coral: #FA5046;
  --ink: #1B1813;
  --paper: #FAF7EC;
  --white: #FFFEF8;
  --font-display: 'Anton', 'Archivo', sans-serif;
  --font-body: 'Archivo', system-ui, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --border: 3px solid var(--ink);
  --shadow-hard: 8px 8px 0 var(--ink);
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

::selection { background: var(--coral); color: var(--white); }

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; line-height: 0.95; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Botons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 26px;
  border: var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease-out, box-shadow 160ms ease-out, background-color 160ms ease-out, color 160ms ease-out;
  min-height: 44px;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn-coral { background: var(--coral); color: var(--white); }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; }
.btn-outline { background: var(--paper); }
.btn-big { font-size: 18px; padding: 18px 34px; }

/* ---------- Marquesines ---------- */
.marquee {
  overflow: hidden;
  border-top: var(--border);
  border-bottom: var(--border);
  padding: 10px 0;
  user-select: none;
}
.marquee-coral { background: var(--coral); color: var(--white); }
.marquee-lime { background: var(--lime); color: var(--ink); }
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 22s linear infinite;
}
.marquee-track.reverse { animation-direction: reverse; }
.marquee-track span {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding-right: 24px;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Capçalera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--paper);
  border-bottom: var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.05em;
  text-decoration: none;
}
.brand-seal { width: 40px; height: 40px; object-fit: contain; transition: transform 200ms ease-out; }
.brand:hover .brand-seal { transform: rotate(-12deg) scale(1.08); }
.main-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.main-nav a {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  padding: 6px 2px;
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 3px;
  background: var(--coral);
  transition: width 200ms ease-out;
}
.main-nav a:hover::after { width: 100%; }
.lang-switcher { display: flex; border: var(--border); border-radius: 999px; overflow: hidden; background: var(--white); }
.lang-btn {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.lang-btn:hover { background: var(--lime); }
.lang-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- Hero ---------- */
.hero { padding: 64px 24px 80px; }
.hero-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.kicker {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--coral);
}
.hero-title {
  font-size: clamp(72px, 14vw, 170px);
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 6px 6px 0 var(--lime);
  margin-bottom: 24px;
}
.hero-sub { font-size: clamp(19px, 2.4vw, 26px); font-weight: 600; max-width: 55ch; margin-bottom: 32px; }
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-art { position: relative; }
.poster-frame {
  border: var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  transform: rotate(2deg);
}
.poster-frame img { width: 100%; }
.poster-caption {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
  border-top: var(--border);
  background: var(--lime);
}
.float-sticker {
  position: absolute;
  cursor: grab;
  filter: drop-shadow(4px 4px 0 rgba(27, 24, 19, 0.35));
  transition: transform 600ms cubic-bezier(0.19, 1, 0.22, 1);
  touch-action: none;
}
.float-sticker:active { cursor: grabbing; }
.float-sticker.seal { width: 30%; top: -8%; right: -6%; }
.float-sticker.trophy { width: 34%; bottom: -10%; left: -8%; }

.sticker { opacity: 0; transform: scale(0) rotate(0deg); }
.sticker.sticker-in { opacity: 1; transform: scale(1) rotate(var(--rot, 0deg)); transition: opacity 500ms ease-out, transform 700ms cubic-bezier(0.19, 1, 0.22, 1); }
.float-sticker.sticker-in { animation: floaty 4s ease-in-out infinite alternate; }
@keyframes floaty {
  from { translate: 0 0; }
  to { translate: 0 -14px; }
}

/* ---------- Seccions ---------- */
.section-paper { background: var(--paper); }
.section-lime { background: var(--lime); }
.section-coral { background: var(--coral); color: var(--ink); }
.section-ink { background: var(--ink); color: var(--paper); }
.section-inner { max-width: 1100px; margin: 0 auto; padding: 88px 24px; }
.section-inner.narrow { max-width: 780px; }
.section-inner.center { text-align: center; }
.section-title { font-size: clamp(40px, 6.5vw, 76px); text-transform: uppercase; margin-bottom: 18px; }
.section-sub { font-size: 18px; max-width: 65ch; margin-bottom: 48px; }
.section-inner.center .section-sub { margin-left: auto; margin-right: auto; }
.section-sub.inverted { color: var(--lime); }
.section-title.inverted { color: var(--paper); text-shadow: 5px 5px 0 var(--coral); }

/* ---------- Certificat ---------- */
.certificat { padding: 88px 24px; }
.cert-frame {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  background: var(--white);
  border: 4px double var(--ink);
  outline: var(--border);
  outline-offset: 10px;
  border-radius: 6px;
  padding: 56px 48px;
  text-align: center;
  box-shadow: var(--shadow-hard);
}
.cert-org { font-family: var(--font-mono); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 18px; }
.cert-frame h2 { font-size: clamp(30px, 4.5vw, 48px); margin-bottom: 22px; }
.cert-body { font-size: 19px; max-width: 60ch; margin: 0 auto 22px; }
.cert-sign { font-family: var(--font-mono); font-size: 13px; opacity: 0.75; }
.cert-seal { position: absolute; width: 110px; right: 24px; bottom: -28px; transform: rotate(12deg); }

/* ---------- Èxits ---------- */
.exits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.exit-card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}
.exit-card:hover { transform: translate(-3px, -3px) rotate(-0.4deg); box-shadow: var(--shadow-hard); }
.exit-num {
  font-family: var(--font-display);
  font-size: 52px;
  color: var(--coral);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  display: block;
  margin-bottom: 8px;
}
.exit-card h3 { font-size: 28px; text-transform: uppercase; margin-bottom: 12px; }
.exit-card p { margin-bottom: 18px; }
.exit-source {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 3px solid var(--coral);
  padding-bottom: 2px;
}
.exit-source:hover { background: var(--coral); color: var(--white); }
.exit-source.no-source { border-bottom-style: dashed; opacity: 0.7; }

/* ---------- Bajòmetre ---------- */
.bajo-display { margin: 8px 0 36px; }
.bajo-count {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(90px, 16vw, 190px);
  line-height: 1;
  color: var(--lime);
  text-shadow: 6px 6px 0 var(--coral);
  font-variant-numeric: tabular-nums;
}
.bajo-label { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 15px; }
.bajo-note { margin-top: 24px; font-size: 13px; font-family: var(--font-mono); opacity: 0.7; }
#bajoBtn.bump { animation: bump 300ms ease-out; }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.12) rotate(-2deg); }
  100% { transform: scale(1); }
}

/* ---------- Meme destacat ---------- */
.section-inner.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.meme-figure img {
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  transform: rotate(-1.2deg);
}
.meme-copy p { font-size: 18px; }

/* ---------- Testimonis ---------- */
.testi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.testi-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  transition: transform 180ms ease-out;
}
.testi-card::before {
  content: '“';
  position: absolute;
  top: -22px; left: 20px;
  font-family: var(--font-display);
  font-size: 84px;
  color: var(--coral);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  line-height: 1;
}
.testi-card:hover { transform: rotate(0.6deg) scale(1.015); }
.testi-card p { font-size: 19px; font-weight: 600; margin-bottom: 16px; }
.testi-card footer { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.75; }

/* ---------- Manual / decrets ---------- */
.decret-list { list-style: none; display: flex; flex-direction: column; gap: 20px; counter-reset: decret; }
.decret {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  align-items: center;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}
.decret:hover { transform: translateX(6px); box-shadow: 6px 6px 0 var(--ink); }
.decret-num {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--white);
  background: var(--ink);
  border-radius: 12px;
  text-align: center;
  padding: 10px 6px;
  transform: rotate(-2deg);
}
.decret p { font-size: 18px; font-weight: 600; }

/* ---------- Memes ---------- */
.meme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.meme-item {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  padding: 0;
  text-align: left;
  font-family: var(--font-mono);
  transition: transform 180ms ease-out, box-shadow 180ms ease-out;
}
.meme-item:hover { transform: translate(-3px, -3px) rotate(-0.5deg); box-shadow: var(--shadow-hard); }
.meme-item img {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--lime);
}
.meme-item span {
  display: block;
  flex-shrink: 0;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  border-top: var(--border);
  background: var(--paper);
}

/* ---------- FAQ ---------- */
.faq-item {
  border: var(--border);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: 18px;
  overflow: hidden;
}
.faq-item summary {
  font-family: var(--font-display);
  font-size: 22px;
  text-transform: uppercase;
  padding: 22px 28px;
  cursor: pointer;
  list-style: none;
  position: relative;
  transition: background-color 150ms ease-out;
}
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 24px;
  font-size: 30px;
  color: var(--coral);
  transition: transform 200ms ease-out;
}
.faq-item[open] summary { background: var(--lime); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: var(--lime); }
.faq-item p { padding: 20px 28px 26px; border-top: var(--border); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 64px 24px 40px;
}
.footer-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.footer-disclaimer { font-size: 15px; opacity: 0.85; margin-bottom: 28px; max-width: 70ch; margin-left: auto; margin-right: auto; }
.footer-legal { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.footer-legal a {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--lime);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 150ms ease-out;
}
.footer-legal a:hover { border-color: var(--lime); }
.footer-copy { font-family: var(--font-mono); font-size: 13px; opacity: 0.6; }

/* ---------- Cookie banner ---------- */
.cookie-banner[hidden] { display: none; }
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.cookie-inner {
  pointer-events: auto;
  max-width: 760px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cookie-text { font-size: 15px; }
.cookie-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(27, 24, 19, 0.75); }
.modal-box {
  position: relative;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  max-width: 560px;
  width: 100%;
  padding: 36px;
  max-height: 85dvh;
  overflow: auto;
}
.modal-box h2 { font-size: 30px; text-transform: uppercase; margin-bottom: 14px; }
.modal-box > p { margin-bottom: 20px; }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 44px; height: 44px;
  border: var(--border);
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease-out;
  z-index: 2;
}
.modal-close:hover { transform: rotate(90deg); }
.cookie-option {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.cookie-option p { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.cookie-option input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--coral); flex-shrink: 0; margin-top: 4px; }
#cookieSave { width: 100%; justify-content: center; }

/* ---------- Lightbox ---------- */
.lightbox-box {
  position: relative;
  max-width: min(860px, 92vw);
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}
.lightbox-box img { width: 100%; max-height: 70dvh; object-fit: contain; background: var(--lime); }
.lightbox-box figcaption {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
  text-align: center;
  padding: 16px;
  border-top: var(--border);
  background: var(--paper);
}

/* ---------- Pàgines legals ---------- */
.legal-body { background: var(--paper); }
.legal-main { max-width: 780px; margin: 0 auto; padding: 72px 24px 96px; }
.legal-main h1 { font-size: clamp(38px, 6vw, 60px); text-transform: uppercase; margin-bottom: 32px; text-shadow: 4px 4px 0 var(--lime); }
.legal-main h2 { font-size: 24px; text-transform: uppercase; margin: 40px 0 12px; }
.legal-main p { margin-bottom: 14px; }
.legal-main ul { margin: 0 0 14px 22px; }
.legal-box {
  border: var(--border);
  border-radius: var(--radius);
  background: var(--white);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.legal-box.highlight { background: var(--lime); }
.btn-cookie-revoke { margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .section-inner.split { grid-template-columns: 1fr; }
  .hero-art { max-width: 480px; margin: 0 auto; }
  .exits-grid, .testi-grid, .meme-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
}
@media (max-width: 520px) {
  .decret { grid-template-columns: 1fr; gap: 12px; }
  .cookie-actions .btn { flex: 1 1 100%; justify-content: center; }
  .cert-frame { padding: 40px 24px; }
  .cert-seal { width: 80px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .float-sticker.sticker-in { animation: none; }
  .sticker { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
