/* ============================================================
   Thrivve — مسابقة أبطال ثرايف
   Single-section contest landing page (AR / RTL, mobile-first)
   ============================================================ */

:root {
  --bg: #fbf8ff;
  --surface: #ffffff;
  --surface-soft: #f7efff;
  --surface-soft-2: #f3e8ff;
  --text: #231433;
  --text-soft: #6d607d;
  --text-on-dark: #f9f2ff;
  --brand: #6f2dbd;
  --brand-strong: #56208e;
  --brand-dark: #42136a;
  --brand-glow: rgba(160, 113, 230, 0.28);
  --border: rgba(95, 61, 150, 0.14);
  --shadow-soft: 0 18px 50px rgba(42, 21, 71, 0.08);
  --shadow-strong: 0 28px 80px rgba(33, 10, 63, 0.24);

  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 18px;

  --gold: #caa14a;
  --gold-soft: #f4e6c4;
  --silver: #9aa2ad;
  --silver-soft: #e7ebee;
  --bronze: #b3703f;
  --bronze-soft: #f0dcc9;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- load animation ---------- */
[data-load] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(10px);
  transition: opacity 720ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 720ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 720ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--load-delay, 0) * 90ms);
}
[data-load].is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ---------- top bar ---------- */
.top-bar {
  position: absolute;
  inset-inline: 0;
  top: 28px;
  display: flex;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}
.top-bar__logo {
  height: 38px;
  width: auto;
  /* logo asset is the dark/ink variant; rendered white so it reads directly on the hero, no pill behind it */
  filter: brightness(0) invert(1);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  padding: 120px 20px 90px;
  background: linear-gradient(130deg, #6e2db4 0%, #4e1a7b 52%, #34114f 100%);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  /* darker brand-purple wash so hero text stays legible over a bright photo */
  background: linear-gradient(
    180deg,
    rgba(41, 13, 64, 0.72) 0%,
    rgba(45, 15, 71, 0.8) 45%,
    rgba(26, 8, 43, 0.94) 100%
  );
}
/* fallback state: no photo yet, gradient background alone carries the hero */
.hero--no-photo .hero__scrim {
  background: radial-gradient(
      120% 90% at 50% 0%,
      rgba(255, 255, 255, 0.1),
      transparent 60%
    );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--brand-strong);
  background: var(--surface-soft-2);
  padding: 7px 18px;
  border-radius: 999px;
  display: inline-block;
}
.eyebrow--light {
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero__title {
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #ffffff;
}

.hero__lead {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--text-on-dark);
  opacity: 0.92;
  max-width: 46ch;
}

.hero__period {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
}
.hero__period strong {
  font-weight: 700;
}
.hero__period-icon {
  display: inline-flex;
  color: #ffffff;
}

.hero__hint {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  animation: hint-bounce 2.4s ease-in-out infinite;
}
@keyframes hint-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---------- single contest section ---------- */
.contest {
  padding: 64px 0 80px;
}

.panel__eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.panel__eyebrow--center {
  text-align: center;
}

.panel__title {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.section-desc {
  text-align: center;
  color: var(--text-soft);
  max-width: 46ch;
  margin: 0 auto 40px;
  font-size: 16px;
}

/* --- requirements grid --- */
.req-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (min-width: 800px) {
  .req-grid {
    grid-template-columns: 1fr 1.25fr;
    align-items: stretch;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-soft);
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 16px;
}
.check-list__icon {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-soft-2);
  color: var(--brand-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  margin-top: 2px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 480px) and (max-width: 799px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 800px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}

.stat-tile {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: right;
}
.stat-tile--wide {
  grid-column: span 2;
}
@media (min-width: 480px) {
  .stat-tile--wide { grid-column: span 1; }
}

.stat-tile__num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-dark);
  line-height: 1;
}
.stat-tile__unit {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
}
.stat-tile__label {
  font-size: 13.5px;
  color: var(--text-soft);
  margin-top: 6px;
  line-height: 1.5;
}

/* --- callout / extra hours formula --- */
.callout {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-strong));
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  color: var(--text-on-dark);
  box-shadow: var(--shadow-strong);
  margin-bottom: 24px;
}
@media (min-width: 760px) {
  .callout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
  }
}

.callout .panel__eyebrow {
  color: rgba(249, 242, 255, 0.75);
}
.callout__title {
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  font-weight: 700;
  margin-bottom: 10px;
}
.callout__desc {
  color: rgba(249, 242, 255, 0.85);
  font-size: 15.5px;
  max-width: 44ch;
}

.formula {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  justify-content: center;
}
.formula__chip {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 108px;
}
.formula__chip--result {
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-dark);
}
.formula__num {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}
.formula__label {
  font-size: 12.5px;
  margin-top: 6px;
  opacity: 0.85;
}
.formula__equals {
  font-size: 1.4rem;
  font-weight: 700;
  opacity: 0.7;
}

/* --- winners / podium --- */
.winners {
  padding-top: 12px;
}

.podium {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 30px;
  column-gap: 14px;
  max-width: 780px;
  margin: 0 auto 32px;
}
/* mobile: 1st place on top (full width), 2nd + 3rd side by side below it */
.prize-card--1 { grid-column: 1 / -1; order: 1; }
.prize-card--2 { order: 2; }
.prize-card--3 { order: 3; }

@media (min-width: 760px) {
  .podium {
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 22px;
  }
  .prize-card--1 { grid-column: auto; order: 2; }
  .prize-card--2 { order: 1; }
  .prize-card--3 { order: 3; }
}

.prize-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 22px 30px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* on mobile the 2nd/3rd cards sit side by side under 1st place — keep them compact */
@media (max-width: 759px) {
  .prize-card--2,
  .prize-card--3 {
    padding: 20px 12px 22px;
    gap: 6px;
  }
  .prize-card--2 .prize-card__medal,
  .prize-card--3 .prize-card__medal {
    width: 32px;
    height: 32px;
    font-size: 13px;
    top: -12px;
  }
  .prize-card--2 .prize-card__rank,
  .prize-card--3 .prize-card__rank {
    font-size: 12.5px;
  }
  .prize-card--2 .prize-card__prize,
  .prize-card--3 .prize-card__prize {
    font-size: 0.9rem;
  }
}

.prize-card--1 {
  border: 1px solid rgba(202, 161, 74, 0.4);
  box-shadow: 0 24px 60px rgba(202, 161, 74, 0.22);
}
@media (min-width: 760px) {
  .prize-card--1 {
    padding-top: 34px;
    padding-bottom: 40px;
    transform: translateY(-18px);
  }
}

.prize-card__medal {
  position: absolute;
  top: -16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}
.prize-card--1 .prize-card__medal {
  background: linear-gradient(135deg, var(--gold), #a97f2a);
  width: 46px;
  height: 46px;
  font-size: 18px;
}
.prize-card--2 .prize-card__medal {
  background: linear-gradient(135deg, var(--silver), #6d7580);
}
.prize-card--3 .prize-card__medal {
  background: linear-gradient(135deg, var(--bronze), #834f2b);
}

.prize-card__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  margin-top: 10px;
  background: var(--surface-soft);
}
.prize-card--1 .prize-card__photo {
  aspect-ratio: 4 / 5.3;
}
.prize-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
}
.prize-card__placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-soft);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(
    135deg,
    var(--surface-soft),
    var(--surface-soft) 10px,
    var(--surface-soft-2) 10px,
    var(--surface-soft-2) 20px
  );
}
.prize-card__placeholder span {
  display: inline-flex;
  color: var(--text-soft);
  opacity: 0.55;
}
.prize-card__placeholder p {
  font-size: 12.5px;
  padding: 0 12px;
  text-align: center;
}
.prize-card__photo.is-empty .prize-card__placeholder {
  display: flex;
}

.prize-card--1 .prize-card__medal ~ .prize-card__photo {
}

.prize-card__rank {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 6px;
}
.prize-card__prize {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dark);
}
.prize-card--1 .prize-card__prize {
  font-size: 1.2rem;
}

.winners__note {
  text-align: center;
  font-size: 14.5px;
  font-weight: 300;
  color: var(--text-soft);
  opacity: 0.85;
  max-width: 52ch;
  margin: 0 auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---------- responsive tuning ---------- */
@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .hero { min-height: 560px; padding: 110px 16px 80px; }
  .panel { padding: 26px 20px; }
  .callout { padding: 28px 22px; }
  .container { padding: 0 16px; }
}
