/* ============================================================
   Reset & Base — Single viewport, NO SCROLL
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold: #f5c842;
  --gold-dark: #c9a020;
  --red: #cc1f2d;
  --blue: #003f87;
  --bg: #080c14;
  --card-bg: rgba(255, 255, 255, 0.045);
  --card-border: rgba(245, 200, 66, 0.2);
  --text: #f0e8d0;
  --muted: rgba(240, 232, 208, 0.5);
  --pull-distance: 0px;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden; /* ← zero scroll ever */
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ============================================================
   Animated gradient background
   ============================================================ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(
      ellipse 90% 70% at 50% -5%,
      rgba(0, 63, 135, 0.5) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 55% 45% at 90% 100%,
      rgba(204, 31, 45, 0.28) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse 40% 40% at 10% 90%,
      rgba(245, 200, 66, 0.08) 0%,
      transparent 65%
    );
  animation: bgPulse 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes bgPulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.75;
  }
}

/* ============================================================
   Floating particles
   ============================================================ */
.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% {
    transform: translateY(105vh) scale(0);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-5vh) scale(1);
    opacity: 0;
  }
}

/* ============================================================
   Main split layout
   ============================================================ */
.layout {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 42% 1fr;
  width: 100vw;
  height: 100vh;
  transform: translateY(var(--pull-distance));
  transition: transform 0.22s ease;
}

.pull-refresh {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 20;
  background: rgba(8, 12, 20, 0.75);
  border: 1px solid rgba(245, 200, 66, 0.28);
  border-radius: 999px;
  padding: 8px 14px;
  color: rgba(240, 232, 208, 0.9);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    border-color 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

body.is-pulling .pull-refresh,
body.is-refreshing .pull-refresh {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

body.is-pull-ready .pull-refresh {
  border-color: rgba(245, 200, 66, 0.7);
}

body.is-refreshing .pull-refresh {
  animation: refreshPulse 0.7s ease-in-out infinite alternate;
}

@keyframes refreshPulse {
  from {
    box-shadow: 0 0 0 rgba(245, 200, 66, 0);
  }
  to {
    box-shadow: 0 0 18px rgba(245, 200, 66, 0.45);
  }
}

/* ============================================================
   LEFT — Photo panel
   ============================================================ */
.photo-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

/* Portrait fills the panel */
.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  animation: portraitReveal 1.2s ease both;
}
@keyframes portraitReveal {
  from {
    opacity: 0;
    transform: scale(1.06);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Dark gradient overlay so text stays readable on mobile */
.photo-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent 55%, var(--bg) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.65) 100%);
  z-index: 1;
}

/* Prison bars overlay */
.prison-bars {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  gap: 0;
  pointer-events: none;
}
.pbar {
  flex: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(30, 30, 40, 0.12) 15%,
    rgba(30, 30, 40, 0.18) 50%,
    rgba(30, 30, 40, 0.12) 85%,
    rgba(0, 0, 0, 0) 100%
  );
  border-right: 1.5px solid rgba(255, 255, 255, 0.04);
  animation: barPulse 5s ease-in-out infinite alternate;
}
.pbar:nth-child(even) {
  animation-delay: 0.8s;
}
.pbar:nth-child(3n) {
  animation-delay: 1.6s;
}
@keyframes barPulse {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}

/* Tricolor flag strip at bottom of photo */
.flag-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  height: 5px;
}
.flag-blue {
  flex: 1;
  background: var(--blue);
}
.flag-yellow {
  flex: 1;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(245, 200, 66, 0.8);
}
.flag-red {
  flex: 1;
  background: var(--red);
}

/* Name shown on photo (mobile only) */
.photo-name-mobile {
  display: none;
}

/* ============================================================
   RIGHT — Info panel
   ============================================================ */
.info-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(20px, 4vw, 56px) clamp(20px, 4vw, 52px) clamp(16px, 3vw, 40px);
  gap: clamp(10px, 2vh, 22px);
  animation: slideIn 0.9s ease 0.1s both;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Header */
.hero-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.label-republic {
  font-size: clamp(0.6rem, 1.2vw, 0.78rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
}

.name-title {
  font-size: clamp(1.8rem, 4.5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}

.gold {
  background: linear-gradient(130deg, var(--gold), #fff9c0, var(--gold-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(245, 200, 66, 0.55));
}

.arrest-date {
  font-size: clamp(0.72rem, 1.3vw, 0.88rem);
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.arrest-date strong {
  color: var(--gold);
  font-weight: 600;
}

/* ─── Counter card ─────────────────────────────────────────── */
.counter-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: clamp(16px, 2.5vw, 24px);
  padding: clamp(14px, 2.5vh, 28px) clamp(18px, 2.8vw, 36px);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(245, 200, 66, 0.07),
    0 20px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-glow {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 80%;
  background: radial-gradient(
    ellipse,
    rgba(245, 200, 66, 0.11),
    transparent 70%
  );
  animation: glowPulse 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.12);
  }
}

.label-jours {
  font-size: clamp(0.6rem, 1.1vw, 0.74rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(4px, 1vh, 10px);
  text-align: center;
}

/* Big number */
.days-wrap {
  text-align: center;
  line-height: 1;
  margin-bottom: clamp(8px, 1.5vh, 18px);
  width: 100%;
}

.days-num {
  display: inline-block;
  font-size: clamp(3.8rem, 10vw, 8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(155deg, #fff 5%, var(--gold) 50%, #ffe97a 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 28px rgba(245, 200, 66, 0.5));
  animation: numGlow 3s ease-in-out infinite;
}
@keyframes numGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 18px rgba(245, 200, 66, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 44px rgba(245, 200, 66, 0.85));
  }
}

.days-unit {
  font-size: clamp(0.9rem, 2vw, 1.4rem);
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.08em;
  vertical-align: baseline;
  margin-left: 8px;
}

/* Stats row */
.stats-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding-top: clamp(8px, 1.4vh, 16px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: clamp(8px, 1.4vh, 16px);
}
.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: transform 0.3s;
}
.stat:hover {
  transform: scale(1.06);
}

.stat-val {
  font-size: clamp(1.15rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  transition: color 0.3s;
}
.stat:hover .stat-val {
  color: var(--gold);
}

.stat-lbl {
  font-size: clamp(0.55rem, 0.9vw, 0.68rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
}

.stat-sep {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
}

/* Progress bar */
.prog-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}
.prog-track {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  height: 5px;
  overflow: hidden;
}
.prog-bar {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--blue), var(--gold), var(--red));
  box-shadow: 0 0 10px rgba(245, 200, 66, 0.5);
  transition: width 1.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.prog-labels {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.5rem, 0.8vw, 0.64rem);
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ─── Footer ───────────────────────────────────────────────── */
.page-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: clamp(8px, 1.6vh, 18px);
}

.mlk-quote {
  background: rgba(245, 200, 66, 0.05);
  border-left: 2px solid var(--gold);
  border-radius: 8px;
  padding: 8px 12px;
}
.mlk-quote em {
  font-family: "Playfair Display", serif;
  font-size: clamp(0.65rem, 1.1vw, 0.8rem);
  font-style: italic;
  color: var(--text);
  line-height: 1.5;
  display: block;
  margin-bottom: 3px;
}
.mlk-quote cite {
  font-size: clamp(0.55rem, 0.85vw, 0.68rem);
  color: var(--gold);
  font-style: normal;
  letter-spacing: 0.1em;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px;
}
.today-line {
  font-size: clamp(0.6rem, 1vw, 0.74rem);
  color: var(--muted);
  letter-spacing: 0.05em;
}

.update-line {
  font-size: clamp(0.56rem, 0.9vw, 0.7rem);
  color: rgba(240, 232, 208, 0.62);
  letter-spacing: 0.05em;
}

.hashtag {
  font-size: clamp(0.65rem, 1.1vw, 0.8rem);
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.footer-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.views-line,
.copyright-line {
  font-size: clamp(0.54rem, 0.85vw, 0.68rem);
  color: rgba(240, 232, 208, 0.56);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.copyright-line a {
  color: rgba(245, 200, 66, 0.9);
  text-decoration: none;
  border-bottom: 1px dotted rgba(245, 200, 66, 0.45);
}

.copyright-line a:hover,
.copyright-line a:focus-visible {
  color: var(--gold);
  border-bottom-color: rgba(245, 200, 66, 0.9);
}

.views-badge {
  height: 18px;
  width: auto;
  vertical-align: middle;
  border-radius: 3px;
}

/* ============================================================
   RESPONSIVE — Tablet (portrait)  ≤ 900px
   ============================================================ */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 48vh 1fr;
  }

  .photo-panel {
    width: 100%;
    height: 100%;
  }

  /* On tiny screens the right-edge fade isn't needed */
  .photo-panel::after {
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.05) 0%,
      rgba(8, 12, 20, 0.85) 100%
    );
  }

  .prison-bars {
    display: none;
  }

  /* Show name on top of photo (mobile) */
  .photo-name-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
    z-index: 4;
    padding-bottom: clamp(12px, 3vw, 20px);
    width: 100%;
    text-align: center;
  }
  .photo-name-mobile h1 {
    font-size: clamp(1.8rem, 7vw, 3rem);
    font-weight: 900;
    line-height: 1.05;
  }

  /* Hide the desktop header in info panel */
  .hero-header {
    display: none;
  }

  .info-panel {
    justify-content: flex-start;
    padding: clamp(12px, 3vw, 24px) clamp(16px, 5vw, 32px)
      clamp(10px, 2vw, 20px);
    gap: clamp(8px, 1.8vh, 16px);
  }

  .days-num {
    font-size: clamp(3rem, 12vw, 6rem);
  }
}

/* ============================================================
   RESPONSIVE — Small phones  ≤ 500px
   ============================================================ */
@media (max-width: 500px) {
  .layout {
    grid-template-rows: 42vh 1fr;
  }

  .days-num {
    font-size: clamp(2.8rem, 14vw, 4.5rem);
  }
  .days-unit {
    font-size: 0.85rem;
  }

  .stat-val {
    font-size: 1.1rem;
  }
  .stat-lbl {
    font-size: 0.52rem;
  }
}
