/* ---- Fonts ---- */

@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("fonts/NotoNastaliqUrdu.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Baloo 2";
  src: url("fonts/Baloo2.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Mukta";
  src: url("fonts/Mukta-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Mukta";
  src: url("fonts/Mukta-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Mukta";
  src: url("fonts/Mukta-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Mukta";
  src: url("fonts/Mukta-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

/* ---- Tokens ---- */

:root {
  --ivory: #fdf6e8;
  --marigold: #f2a71b;
  --maroon: #7a1e2e;
  --peacock: #0e6e6b;
  --pink: #e14876;
  --ink: #2b1b12;

  --radius: 22px;
}

/* ---- Base ---- */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: "Mukta", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Site header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--ivory);
  border-bottom: 3px dashed rgba(43, 27, 18, 0.15);
}

.home-btn,
.quiz-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 999px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.home-btn {
  color: var(--maroon);
  background: rgba(122, 30, 46, 0.08);
}

.quiz-link {
  color: #fff;
  background: var(--peacock);
}

.quiz-link.is-current {
  background: var(--maroon);
}

/* ---- Layout ---- */

main {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
}

.slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: calc(100vh - 68px);
  min-height: calc(100dvh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem;
}

/* ---- Card (scalloped, like a sweet-box border) ---- */

.card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem 1.5rem 1.75rem;
  text-align: center;
  box-shadow: 0 12px 0 -4px rgba(122, 30, 46, 0.08), 0 2px 10px rgba(43, 27, 18, 0.12);
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  height: 14px;
  background-image: radial-gradient(circle at 7px 7px, var(--ivory) 7px, transparent 7.5px);
  background-size: 14px 14px;
  background-repeat: repeat-x;
}

.card::before { top: -7px; }
.card::after { bottom: -7px; transform: scaleY(-1); }

.card-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--marigold);
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--peacock);
  margin-bottom: 1rem;
}

.card-title {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: var(--maroon);
  margin: 0 0 0.5rem;
}

.urdu {
  font-family: "Noto Nastaliq Urdu", serif;
  font-size: 2.75rem;
  line-height: 1.6;
  margin: 0.25rem 0 0.75rem;
}

.chip {
  display: inline-block;
  background: var(--peacock);
  color: #fff;
  font-family: "Mukta", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  margin: 0 0 1.25rem;
}

.ticket {
  position: relative;
  background: var(--ivory);
  border-radius: 12px;
  border: 2px dashed rgba(122, 30, 46, 0.3);
  padding: 1rem 1.1rem;
  margin-bottom: 1.1rem;
  text-align: left;
}

.example {
  margin: 0 0 0.5rem;
  font-style: italic;
  color: var(--maroon);
  font-weight: 500;
}

.joke {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(43, 27, 18, 0.8);
}

.tags {
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.tag {
  background: rgba(225, 72, 118, 0.12);
  color: var(--pink);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.permalink,
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  text-decoration: none;
  color: var(--maroon);
}

/* ---- Quiz page ---- */

.quiz-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.quiz-page h1 {
  font-family: "Baloo 2", sans-serif;
  color: var(--maroon);
  text-align: center;
}

#quiz-form.card {
  text-align: left;
  max-width: none;
}

#quiz-form label[for="question-count"] {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

#quiz-form select {
  width: 100%;
  min-height: 44px;
  font-size: 1rem;
  padding: 0.5rem;
  border-radius: 10px;
  border: 2px solid rgba(43, 27, 18, 0.2);
  margin-bottom: 1.25rem;
  background: #fff;
}

fieldset {
  border: 2px solid rgba(43, 27, 18, 0.15);
  border-radius: 12px;
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem 1rem;
}

legend {
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
  color: var(--peacock);
  padding: 0 0.4rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-weight: 500;
}

.option input {
  width: 20px;
  height: 20px;
  accent-color: var(--pink);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-outline {
  background: transparent;
  color: var(--maroon);
  box-shadow: inset 0 0 0 2px var(--maroon);
}

/* ---- Landing page ---- */

.landing {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.landing-hero {
  max-width: 440px;
  text-align: center;
}

.landing-eyebrow {
  font-family: "Mukta", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--peacock);
  margin: 0 0 0.5rem;
}

.landing-hero h1 {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 2.6rem;
  color: var(--maroon);
  margin: 0 0 1rem;
  line-height: 1.1;
}

.landing-tagline {
  font-size: 1.05rem;
  color: rgba(43, 27, 18, 0.85);
  margin: 0 0 2rem;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.landing-count {
  margin: 1.5rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--peacock);
}

.quiz-question {
  border: 2px solid rgba(43, 27, 18, 0.15);
  border-radius: 12px;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem 1.1rem;
}

.quiz-question legend {
  color: var(--maroon);
}

.quiz-question label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-weight: 500;
}

.quiz-question input {
  width: 20px;
  height: 20px;
  accent-color: var(--peacock);
}

#quiz-questions > button,
#quiz-results button {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 0.5rem;
  background: var(--peacock);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}

#quiz-results {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(43, 27, 18, 0.12);
}

#quiz-results p {
  font-family: "Baloo 2", sans-serif;
  font-size: 1.2rem;
  color: var(--maroon);
}

#quiz-results ul {
  padding-left: 1.2rem;
}

#quiz-results li {
  margin-bottom: 0.4rem;
}

/* ---- Back to top ---- */

.back-to-top[hidden] {
  display: none;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--maroon);
  color: #fff;
  font-size: 1.3rem;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(43, 27, 18, 0.25);
}

/* ---- Larger screens ---- */

@media (min-width: 640px) {
  body { font-size: 18px; }
  .card-title { font-size: 2.4rem; }
  .urdu { font-size: 3.25rem; }
  .landing-hero h1 { font-size: 3.4rem; }
  .landing-actions { flex-direction: row; justify-content: center; }
  .landing-actions .btn { width: auto; padding: 0 1.75rem; }
}
