/* ==========================================================================
   אפו – מפלגת האפו-קליפסה
   ========================================================================== */

:root {
  --rust: #C1440E;
  --toxic: #E8B923;
  --blood: #8B0000;
  --void: #1A1410;
  --void-2: #241b15;
  --sand: #f1e2c4;
  --ash: #b9a891;
  --metal-1: #3b332c;
  --metal-2: #2a231e;
  --rivet: #8d7d6c;

  --font-display: "Karantina", "Secular One", system-ui, sans-serif;
  --font-head: "Secular One", "Heebo", system-ui, sans-serif;
  --font-body: "Heebo", "Assistant", system-ui, sans-serif;

  --gutter: 16px;
  --max: 1120px;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--sand);
  background-color: var(--void);
  background-image:
    linear-gradient(rgba(26, 20, 16, .88), rgba(26, 20, 16, .93)),
    url("../images/texture.png");
  background-size: auto, 600px;
  overflow-x: hidden;
}

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

a { color: var(--toxic); }

:focus-visible {
  outline: 3px dashed var(--toxic);
  outline-offset: 4px;
}

/* ---------- Dust canvas ---------- */
.dust {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  padding: .55em 1.4em;
  border: 3px solid var(--void);
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 1.25rem;
  line-height: 1.2;
  text-decoration: none;
  color: var(--void);
  background:
    repeating-linear-gradient(-45deg, transparent 0 10px, rgba(0,0,0,.08) 10px 20px),
    linear-gradient(var(--toxic), #c9981a);
  box-shadow: 0 5px 0 var(--void), 0 8px 18px rgba(0,0,0,.5);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--void), 0 3px 8px rgba(0,0,0,.5); }

.btn--vote {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 3rem);
  padding: .15em 1.1em .1em;
  color: var(--sand);
  background:
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(0,0,0,.12) 12px 24px),
    linear-gradient(#d4561c, var(--rust) 55%, #8e300a);
  text-shadow: 2px 2px 0 var(--void);
}

.btn--ghost {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--sand);
  background: transparent;
  border-color: var(--ash);
  box-shadow: none;
}

.btn--whatsapp {
  color: #fff;
  background: linear-gradient(#2fd36f, #1da851);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 72px var(--gutter) 88px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(26,20,16,.1), rgba(26,20,16,.6) 80%),
    linear-gradient(to bottom, rgba(26,20,16,.2), transparent 40%, var(--void) 98%),
    url("../images/hero.png") 72% center / cover no-repeat,
    var(--void);
  isolation: isolate;
}

.hero__inner {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__logo {
  width: clamp(120px, 34vw, 190px);
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.7)) drop-shadow(0 0 22px rgba(193,68,14,.45));
  animation: logo-sway 7s ease-in-out infinite;
}

.hero__kicker {
  margin: 14px 0 0;
  padding: 2px 12px;
  font-size: .85rem;
  font-weight: 700;
  text-wrap: balance;
  color: var(--void);
  background: var(--toxic);
  transform: rotate(-1.5deg);
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(7.5rem, 38vw, 14rem);
  line-height: .85;
  color: var(--toxic);
  text-shadow:
    0 0 18px rgba(232,185,35,.55),
    4px 4px 0 var(--blood),
    8px 8px 0 var(--void);
  animation: flicker 6s infinite;
}

.hero__subtitle {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  line-height: 1.1;
  color: var(--sand);
  text-shadow: 3px 3px 0 var(--void), 0 0 14px rgba(0,0,0,.8);
}

.haiku {
  margin: 22px 0 26px;
  padding: 14px 26px;
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 5.4vw, 1.75rem);
  line-height: 1.45;
  color: var(--sand);
  background: rgba(26,20,16,.72);
  border-inline: 6px solid var(--rust);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  transform: rotate(-1deg);
}
.haiku span { display: block; }
.haiku span:last-child {
  color: var(--toxic);
  font-size: 1.25em;
}

.hero__pun {
  max-width: 34ch;
  margin: 22px 0 0;
  font-size: .9rem;
  color: var(--ash);
  text-shadow: 0 1px 6px #000;
}

.hero__scroll {
  position: absolute;
  bottom: 18px;
  inset-inline: 0;
  margin-inline: auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--toxic);
  text-decoration: none;
  font-size: 1.4rem;
  animation: bob 2s ease-in-out infinite;
}

.hero.is-shaking { animation: screen-shake .35s linear infinite; }

/* ---------- Sections ---------- */
.section {
  max-width: var(--max);
  margin-inline: auto;
  padding: 64px var(--gutter);
}

.section__title {
  margin: 0 0 8px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 14vw, 5rem);
  line-height: 1;
  color: var(--toxic);
  text-shadow: 3px 3px 0 var(--blood), 6px 6px 0 #000;
}
.section__title::after {
  content: "";
  display: block;
  width: min(240px, 60%);
  height: 12px;
  margin: 10px auto 0;
  background: repeating-linear-gradient(-45deg, var(--toxic) 0 12px, var(--void) 12px 24px);
  border: 2px solid var(--void);
}

.section__intro {
  max-width: 46ch;
  margin: 12px auto 36px;
  text-align: center;
  color: var(--ash);
}

/* ---------- Video ---------- */
.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-top: 28px;
  border: 10px solid var(--metal-2);
  border-radius: 14px;
  background: #000;
  box-shadow: 0 0 0 3px var(--rust), 0 18px 40px rgba(0,0,0,.6);
  overflow: hidden;
}
.screen__video { width: 100%; height: 100%; display: block; background: #000; }
.screen__video[hidden] { display: none; }
.screen__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--gutter);
  text-align: center;
  color: var(--sand);
  overflow: hidden;
}
.screen__placeholder[hidden] { display: none; }
.screen__placeholder strong {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 4rem);
  line-height: 1;
  color: var(--toxic);
  animation: flicker 4s infinite;
}
.screen__placeholder span:not(.screen__static) { position: relative; max-width: 32ch; color: var(--ash); }
.screen__static {
  position: absolute;
  inset: -50%;
  opacity: .22;
  background:
    repeating-radial-gradient(circle at 17% 32%, #fff 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 73% 61%, #888 0 1px, transparent 1px 4px);
  animation: static-noise .25s steps(3) infinite;
}

/* ---------- Metal plates (shared) ---------- */
.plate {
  position: relative;
  padding: 26px 22px;
  border-radius: var(--radius);
  border: 2px solid #120d0a;
  background:
    /* rivets */
    radial-gradient(circle at 14px 14px, var(--rivet) 0 3px, #2b2219 4px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) 14px, var(--rivet) 0 3px, #2b2219 4px, transparent 5px),
    radial-gradient(circle at 14px calc(100% - 14px), var(--rivet) 0 3px, #2b2219 4px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), var(--rivet) 0 3px, #2b2219 4px, transparent 5px),
    /* scratches */
    repeating-linear-gradient(-28deg, transparent 0 37px, rgba(255,255,255,.05) 37px 38px, transparent 38px 71px),
    repeating-linear-gradient(64deg, transparent 0 53px, rgba(0,0,0,.25) 53px 54px, transparent 54px 97px),
    /* rust bloom */
    radial-gradient(ellipse at 85% 10%, rgba(193,68,14,.35), transparent 45%),
    radial-gradient(ellipse at 10% 95%, rgba(139,0,0,.3), transparent 40%),
    /* brushed steel */
    repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 2px, transparent 2px 5px),
    linear-gradient(160deg, var(--metal-1), var(--metal-2));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -3px 0 rgba(0,0,0,.4),
    0 12px 28px rgba(0,0,0,.55);
}

/* ---------- Platform cards ---------- */
.plates {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

.plates .plate {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 26px;
  transition: transform .25s ease;
}
.plates .plate:nth-child(odd) { transform: rotate(-.6deg); }
.plates .plate:nth-child(even) { transform: rotate(.6deg); }
.plates .plate:hover { transform: rotate(0) translateY(-4px); }

.plate__img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  border: 3px solid #120d0a;
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(193,68,14,.6);
}

.plate__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 6px;
}
.plate__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--void);
  background: var(--toxic);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.plate__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--toxic);
}
.plate__text { margin: 0; color: var(--sand); }

/* ---------- Candidate ---------- */
.candidate {
  display: grid;
  gap: 32px;
  margin-top: 32px;
  align-items: start;
}
.candidate__poster {
  position: relative;
  margin: 0;
  padding: 10px;
  background: var(--sand);
  box-shadow: 0 16px 36px rgba(0,0,0,.6);
  transform: rotate(1.5deg);
}
.candidate__poster::before,
.candidate__poster::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 90px;
  height: 26px;
  background: rgba(232,185,35,.75);
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.candidate__poster::before { inset-inline-start: 14px; transform: rotate(-8deg); }
.candidate__poster::after { inset-inline-end: 14px; transform: rotate(7deg); }

.candidate__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: 1;
  color: var(--toxic);
}
.candidate__role { margin: 4px 0 16px; font-weight: 700; color: var(--rust); }
.candidate__lines { margin: 0 0 18px; padding-inline-start: 1.4em; }
.candidate__lines li { margin-bottom: 8px; }
.candidate__lines li::marker { content: "☢  "; color: var(--toxic); }
.candidate__stats {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.candidate__stats li {
  padding: 3px 10px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--void);
  background: var(--ash);
  border-radius: 3px;
}
.candidate__quote {
  margin: 0;
  padding-inline-start: 14px;
  border-inline-start: 4px solid var(--blood);
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--sand);
}

/* Rotating quote: every quote sits invisibly in the same grid cell,
   so the block always reserves the height of the longest one. */
.quote-rotator__stage { display: grid; }
.quote-rotator__sizers { display: contents; }
.quote-rotator__sizers > *,
.quote-rotator__text { grid-area: 1 / 1; }
.quote-rotator__sizers > * { visibility: hidden; }
.quote-rotator__text.is-glitching { animation: quote-glitch-out .38s linear forwards; }
.quote-rotator__text.is-entering { animation: quote-fade-in .32s ease-out; }

.quote-rotator__dots {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  padding-inline-start: 6px;
}
.quote-rotator__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.quote-rotator__dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--ash);
  transition: background-color .2s ease, transform .2s ease;
}
.quote-rotator__dot[aria-current="true"]::before {
  background: var(--toxic);
  border-color: var(--toxic);
  transform: scale(1.2);
}

/* ---------- Ballot ---------- */
.ballot-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ballot-slip {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  container-type: inline-size;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,.6);
  overflow: hidden;
}
.ballot-slip img { width: 100%; }
.ballot-slip:disabled { cursor: default; }

.ballot-stage__hint {
  margin: 4px 0 0;
  font-size: .95rem;
  color: var(--ash);
}

/* Rusty barrel */
.barrel {
  position: relative;
  width: 170px;
  height: 200px;
  margin-top: 10px;
}
.barrel__rim {
  position: absolute;
  z-index: 0;
  top: 0;
  inset-inline: 0;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 55%, #050302 0 45%, #3a1e10 60%, #7a3410 75%, #4a220e);
  border: 3px solid #1d0f08;
}
.barrel__body {
  position: absolute;
  z-index: 2;
  top: 19px;
  bottom: 0;
  inset-inline: 0;
  display: grid;
  place-items: center;
  border-radius: 0 0 50% 50% / 0 0 22px 22px;
  border: 3px solid #1d0f08;
  border-top: 0;
  background:
    linear-gradient(transparent 22%, #3c1a09 22% 26%, transparent 26% 70%, #3c1a09 70% 74%, transparent 74%),
    radial-gradient(ellipse at 30% 40%, rgba(232,185,35,.25), transparent 30%),
    radial-gradient(ellipse at 75% 70%, rgba(26,20,16,.6), transparent 35%),
    linear-gradient(90deg, #4a1f0b, #a4400f 30%, #c45a1d 45%, #8e340d 70%, #3d1909);
}
.barrel__label {
  padding: 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1.1;
  color: var(--toxic);
  background: var(--void);
  transform: rotate(-4deg);
}
.barrel.is-hit { animation: barrel-hit .5s ease-out; }

.dust-burst {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.dust-burst span {
  position: absolute;
  width: var(--size, 14px);
  height: var(--size, 14px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214,170,110,.95), rgba(160,100,50,.4) 60%, transparent 70%);
  animation: dust-puff .9s ease-out forwards;
}

.ballot-slip.is-dropping { animation: slip-drop .9s cubic-bezier(.5,0,.75,0) forwards; }
.ballot-slip.is-gone { visibility: hidden; }

.ballot-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  text-align: center;
}
.ballot-result {
  min-height: 1.2em;
  margin: 0;
  max-width: 20ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 10vw, 3.6rem);
  line-height: 1.05;
  color: var(--toxic);
  text-shadow: 3px 3px 0 var(--blood), 0 0 24px rgba(232,185,35,.45);
}
.ballot-result:empty { min-height: 0; }
.ballot-result.is-visible { animation: result-in .8s ease-out both, flicker 6s 1s infinite; }
.btn[hidden] { display: none; }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 56px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  text-align: center;
  border-top: 12px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--toxic) 0 14px, var(--void) 14px 28px) 12;
  background: linear-gradient(var(--void-2), #0e0b08);
}
.footer__logo { width: 84px; opacity: .9; }
.footer__disclaimer { max-width: 40ch; margin: 0; font-size: .9rem; color: var(--ash); }
.footer__copy { margin: 0; font-size: .8rem; color: #7d6e5d; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .plates { grid-template-columns: repeat(2, 1fr); }
  .barrel { width: 200px; height: 230px; }
}

@media (min-width: 900px) {
  .hero { background-position: center, center, center, center; }
  .candidate { grid-template-columns: 5fr 6fr; gap: 44px; }
  .candidate__bio { padding: 34px 36px; }
}

@media (min-width: 1040px) {
  .plates { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Keyframes ---------- */
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: .55; }
}

@keyframes logo-sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@keyframes screen-shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, -2px); }
  100% { transform: translate(1px, 2px); }
}

@keyframes static-noise {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-3%, 2%); }
  66% { transform: translate(2%, -3%); }
}

@keyframes quote-glitch-out {
  0% { opacity: 1; transform: none; clip-path: inset(0); }
  15% { opacity: .3; transform: translateX(-4px) skewX(8deg); text-shadow: 3px 0 var(--blood), -3px 0 var(--toxic); }
  30% { opacity: 1; transform: translateX(3px); clip-path: inset(30% 0 40% 0); }
  45% { opacity: .15; transform: none; clip-path: inset(0); }
  60% { opacity: .8; transform: translateX(-2px) skewX(-6deg); clip-path: inset(55% 0 10% 0); text-shadow: -3px 0 var(--blood), 3px 0 var(--toxic); }
  100% { opacity: 0; transform: translateX(2px); clip-path: inset(0); }
}

@keyframes quote-fade-in {
  0% { opacity: 0; filter: blur(3px); }
  100% { opacity: 1; filter: blur(0); }
}

@keyframes slip-drop {
  0% { transform: translateY(0) rotate(0) scale(1); }
  18% { transform: translateY(-24px) rotate(-5deg) scale(1.02); }
  85% { opacity: 1; }
  100% { transform: translateY(var(--drop, 300px)) rotate(10deg) scale(.18); opacity: 0; }
}

@keyframes barrel-hit {
  0% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(6px) rotate(-3deg); }
  50% { transform: translateY(-2px) rotate(2deg); }
  75% { transform: translateY(1px) rotate(-1deg); }
  100% { transform: translateY(0) rotate(0); }
}

@keyframes dust-puff {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(2.6); opacity: 0; }
}

@keyframes result-in {
  0% { opacity: 0; transform: scale(1.6) rotate(-4deg); filter: blur(6px); }
  100% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .dust { display: none; }
  .hero.is-shaking { animation: none; }
  .plates .plate:hover { transform: none; }
}
