/* ─── Reset & Base ─────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f5f0e8;
  --ink: #0a0a0a;
  --ink-muted: #444;
  --ink-faint: #999;
  --rule: #111;
  --rule-thin: rgba(10, 10, 10, 0.15);
  --font-serif: 'Playfair Display', 'IM Fell English', Georgia, serif;
  --font-sans: 'Inter', 'Helvetica Neue', sans-serif;
  --radius: 3px;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* ─── Paper grain texture ──────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
}

/* ─── Animated rule lines background ──────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.08;
}

/* ─── Noise overlay ────────────────────────────────── */
.noise {
  display: none;
}

/* ─── Main container ───────────────────────────────── */
.container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
  max-width: 640px;
  width: 100%;
  animation: fadeIn 0.8s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Masthead top rule ────────────────────────────── */
.container::before {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background: var(--rule);
  margin-bottom: 0.5rem;
}

/* ─── Badge ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule-thin);
  border-bottom: 1px solid var(--rule-thin);
  padding: 6px 0;
  width: 100%;
  justify-content: center;
  margin-bottom: 1.4rem;
}

.badge-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.15;
  }
}

/* ─── Headline ─────────────────────────────────────── */
.headline {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  color: var(--ink);
}

.gradient-text {
  font-style: italic;
  color: var(--ink);
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--ink);
  background-clip: unset;
}

/* ─── Thin rule below headline ─────────────────────── */
.headline::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--ink);
  margin: 0.9rem auto 0;
}

/* ─── Subtext ──────────────────────────────────────── */
.subtext {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.75;
  margin-bottom: 1.8rem;
  max-width: 400px;
  border-top: 1px solid var(--rule-thin);
  border-bottom: 1px solid var(--rule-thin);
  padding: 1rem 0;
}

/* ─── Social Buttons ───────────────────────────────── */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 2rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  border: 1.5px solid var(--ink);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.social-btn:hover {
  background: transparent;
  color: var(--ink);
  transform: translateY(-1px);
}

.social-btn:active {
  transform: translateY(0);
}

/* ─── Progress ─────────────────────────────────────── */
.progress-section {
  width: 100%;
  max-width: 380px;
  margin-bottom: 2rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 7px;
}

.progress-value {
  color: var(--ink);
}

.progress-track {
  height: 3px;
  background: rgba(10, 10, 10, 0.1);
  border-radius: 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--ink);
  transition: width 2.2s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: none;
}

/* ─── Meme Card ────────────────────────────────────── */
.meme-card {
  margin-bottom: 2rem;
  border-radius: 0;
  overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0px var(--ink);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  max-width: 320px;
  width: 100%;
}

.meme-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--ink);
}

.meme-img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(100%) contrast(1.1);
}

/* ─── Footer Note ──────────────────────────────────── */
.footer-note {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px solid var(--rule-thin);
  padding-top: 1rem;
  width: 100%;
}

/* ─── Mobile ───────────────────────────────────────── */
@media (max-width: 480px) {
  .headline {
    font-size: 2.6rem;
  }

  .socials {
    flex-direction: column;
    align-items: stretch;
  }

  .social-btn {
    justify-content: center;
  }
}