:root {
  /* Brand */
  --hat-blue: #3B7DD8;
  --hat-blue-dark: #2C5FA8;

  /* Pastel rainbow (sliders, accent bars) */
  --rb-red: #FFB3BA;
  --rb-orange: #FFCFA8;
  --rb-yellow: #FFE5A8;
  --rb-green: #C8E6B0;
  --rb-blue: #A8D4F0;
  --rb-purple: #C8B5E8;
  --rb-pink: #F0B5D0;

  /* Surfaces */
  --bg: #FAF7F2;
  --cream: #FFF9F2;
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.1);
  --soft-shadow: rgba(0, 0, 0, 0.06);

  /* Text */
  --ink: #1A1F2A;
  --ink-soft: #5A6472;
  --ink-light: #8A94A0;

  /* Fonts */
  --font-display: 'Nunito', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;
}

/* ============ RESET + BASE ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px circle at 10% 0%, rgba(255, 200, 220, 0.28), transparent 50%),
    radial-gradient(900px circle at 50% 110%, rgba(168, 230, 160, 0.32), transparent 55%),
    radial-gradient(800px circle at 90% 100%, rgba(180, 220, 255, 0.22), transparent 50%);
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, button { font-family: inherit; }

.icon { flex-shrink: 0; }

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(250, 247, 242, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--hat-blue-dark);
}

.ca-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line-strong);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  transition: border-color 0.15s ease, transform 0.15s ease;
  position: relative;
  z-index: 10;
}
.ca-pill:hover { border-color: var(--hat-blue); color: var(--hat-blue-dark); transform: translateY(-1px); }
.ca-pill-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav-socials { display: flex; gap: 8px; }
.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  position: relative;
  z-index: 10;
}
.social-btn:hover {
  transform: translateY(-1px);
  color: var(--hat-blue);
  border-color: var(--hat-blue);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  position: relative;
  z-index: 10;
  white-space: nowrap;
}
.btn-primary {
  background: var(--hat-blue);
  color: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px rgba(59, 125, 216, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--hat-blue-dark);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 8px 20px rgba(59, 125, 216, 0.35);
}
.btn-secondary {
  background: white;
  color: var(--hat-blue-dark);
  border: 1.5px solid var(--hat-blue);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-secondary:hover {
  transform: translateY(-1px);
  background: var(--cream);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 6px 16px rgba(59, 125, 216, 0.15);
}
.btn-block { width: 100%; }
.btn-emoji { font-size: 14px; line-height: 1; }
.btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--ink-light);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  transition: color 0.15s ease;
  position: relative;
  z-index: 10;
}
.btn-tertiary:hover { color: var(--hat-blue); }

/* ============ RAINBOW ACCENT BAR ============ */
.rainbow-bar {
  width: 80px;
  height: 4px;
  border-radius: 999px;
  margin: 18px auto 0;
  background: linear-gradient(90deg,
    var(--rb-red), var(--rb-orange), var(--rb-yellow),
    var(--rb-green), var(--rb-blue), var(--rb-purple));
}
.rainbow-bar-left { margin-left: 0; margin-right: auto; }

/* ============ HERO ============ */
.hero {
  padding: 80px 24px 100px;
  position: relative;
  z-index: 5;
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 40px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  background: white;
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  margin-bottom: 24px;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.hero-headline .line { display: block; }
.hero-headline .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(16px);
  animation: word-fade-in 0.5s ease forwards;
}
@keyframes word-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

.hero-subline {
  margin-top: 20px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink-soft);
}

.ca-box {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  position: relative;
  z-index: 10;
}
.ca-box .ca-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
}
.ca-box .icon { color: var(--ink-light); transition: color 0.15s ease; }
.ca-box:hover {
  border-color: var(--hat-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 125, 216, 0.1);
}
.ca-box:hover .icon { color: var(--hat-blue); }
.ca-box.bounce { animation: ca-bounce 0.4s ease; }
@keyframes ca-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.hero-ctas {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-hat {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.hat-rainbow {
  position: absolute;
  width: 540px;
  max-width: 115%;
  height: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0.85;
  pointer-events: none;
}
.hero-hat-img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  filter:
    drop-shadow(0 16px 40px rgba(59, 125, 216, 0.18))
    drop-shadow(0 28px 28px rgba(168, 230, 160, 0.28));
  animation: hat-float 6s ease-in-out infinite;
}
@keyframes hat-float {
  0%, 100% { transform: translateY(-6px); }
  50% { transform: translateY(6px); }
}

.scroll-indicator {
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-light);
  text-align: center;
  letter-spacing: -0.01em;
}
.scroll-indicator .chevron {
  font-size: 16px;
  animation: chevron-bounce 1.8s ease-in-out infinite;
}
@keyframes chevron-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* ============ SECTION HEADER ============ */
.section-header {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
  z-index: 5;
}
.section-header .eyebrow { margin-bottom: 16px; }
.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.section-sub {
  margin-top: 20px;
  font-size: 17px;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ============ PFP MAKER ============ */
.pfp-maker {
  padding: 100px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}
.pfp-card,
.donation-card {
  background: white;
  border-radius: var(--r-lg);
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 8px 24px rgba(0,0,0,0.06),
    0 24px 48px rgba(0,0,0,0.04);
  position: relative;
}
.pfp-card {
  padding: 48px;
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 40px;
  align-items: start;
}

.card-dots {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}
.card-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: block;
}
.card-dots span:nth-child(1) { background: var(--rb-red); }
.card-dots span:nth-child(2) { background: var(--rb-orange); }
.card-dots span:nth-child(3) { background: var(--rb-yellow); }
.card-dots span:nth-child(4) { background: var(--rb-green); }
.card-dots span:nth-child(5) { background: var(--rb-blue); }
.card-dots span:nth-child(6) { background: var(--rb-purple); }

.pfp-controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.control-group { display: flex; flex-direction: column; gap: 10px; }
.control-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: -0.01em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.slider-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  background: rgba(0,0,0,0.04);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: -0.01em;
}

.upload-btn {
  width: 100%;
  padding: 22px;
  background: var(--cream);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  position: relative;
  z-index: 10;
}
.upload-btn .icon { color: var(--ink-soft); transition: color 0.15s ease; }
.upload-btn:hover {
  transform: translateY(-1px);
  border-color: var(--hat-blue);
  background: white;
}
.upload-btn:hover .icon { color: var(--hat-blue); }
.upload-hint {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-light);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.preset-btn {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--cream);
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  z-index: 10;
  padding: 0;
}
.preset-btn img { width: 100%; height: 100%; object-fit: cover; }
.preset-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.preset-btn.selected { border-color: var(--hat-blue); }

.cap-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cap-pick {
  width: 56px;
  height: 56px;
  padding: 6px;
  border-radius: var(--r-sm);
  background: var(--cream);
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  z-index: 10;
}
.cap-pick img { width: 100%; height: 100%; object-fit: contain; }
.cap-pick:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.cap-pick.selected { border-color: var(--hat-blue); }

/* Rainbow slider */
.rainbow-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    #FFB3BA 0%,
    #FFCFA8 16%,
    #FFE5A8 33%,
    #C8E6B0 50%,
    #A8D4F0 66%,
    #C8B5E8 83%,
    #F0B5D0 100%);
  outline: none;
  cursor: pointer;
}
.rainbow-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #FFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rainbow-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.rainbow-slider::-webkit-slider-thumb:active { cursor: grabbing; }
.rainbow-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #FFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rainbow-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.reset-link {
  align-self: flex-start;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-light);
  padding: 4px 0;
  transition: color 0.15s ease;
  position: relative;
  z-index: 10;
}
.reset-link:hover { color: var(--hat-blue); }

.control-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.pfp-canvas-wrap { display: flex; justify-content: center; }
.pfp-canvas {
  aspect-ratio: 1/1;
  width: 100%;
  max-width: 600px;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--line-strong);
  background: var(--cream);
  position: relative;
  overflow: hidden;
}
.pfp-canvas.drag-over {
  border-color: var(--hat-blue);
  background: white;
}
.pfp-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-light);
  text-align: center;
  letter-spacing: -0.01em;
  pointer-events: none;
}
.pfp-placeholder svg { color: var(--ink-light); opacity: 0.5; }
.pfp-canvas.has-image .pfp-placeholder { display: none; }

/* ============ DONATION ============ */
.donation {
  padding: 100px 24px 120px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 5;
}
.donation-card { padding: 64px; }
.big-heart {
  font-size: 56px;
  display: inline-block;
  margin-bottom: 16px;
  line-height: 1;
}
.donation-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 4.5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.donation-card .rainbow-bar { margin: 20px auto 0; }
.donation-body {
  margin: 24px auto 0;
  max-width: 600px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.donation-ctas {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.disclaimer {
  margin-top: 28px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-light);
}

/* ============ FOOTER ============ */
.footer {
  padding: 56px 24px 40px;
  text-align: center;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.footer-socials { display: flex; gap: 10px; }
.footer-line {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: -0.01em;
}

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: toast-in 0.2s ease;
}
.toast.toast-out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(16px); }
}

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.reveal-in {
  opacity: 1;
  transform: translateY(0);
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1023px) {
  .pfp-card { padding: 32px; gap: 32px; }
  .donation-card { padding: 48px; }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero-text { order: 2; }
  .hero-hat { order: 1; }
  .hero-hat-img { max-width: 280px; }

  .pfp-card {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .pfp-controls { order: 2; }
  .pfp-canvas-wrap { order: 1; }
}

@media (max-width: 768px) {
  .nav { padding: 12px 16px; gap: 10px; }
  .ca-pill { display: none; }
  .social-btn { width: 32px; height: 32px; }

  .hero { padding: 48px 16px 64px; }
  .hero-ctas .btn { padding: 12px 20px; font-size: 14px; }
  .scroll-indicator { margin-top: 56px; }

  .pfp-maker { padding: 64px 16px 56px; }
  .pfp-card { padding: 24px; }
  .card-dots { top: 16px; right: 16px; }

  .donation { padding: 64px 16px 96px; }
  .donation-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .nav-logo { font-size: 18px; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}
