/* ── Heaps — zachbrown.xyz ── */

:root {
  --brand: #2D6A4F;
  --brand-light: #3d8b6a;
  --bg: #ffffff;
  --bg-secondary: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.06);
  --shadow-1: rgba(0, 0, 0, 0.10);
  --shadow-2: rgba(0, 0, 0, 0.04);
  --radius-card: 20px;
  --radius-btn: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-secondary: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --card-bg: #1c1c1e;
    --card-border: rgba(255, 255, 255, 0.08);
    --shadow-1: rgba(0, 0, 0, 0.3);
    --shadow-2: rgba(0, 0, 0, 0.15);
  }
}

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

html {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Layout ── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--card-border);
}

@media (prefers-color-scheme: dark) {
  nav {
    background: rgba(0, 0, 0, 0.72);
  }
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-style: italic;
  font-size: 20px;
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--brand);
}

/* ── Hero ── */
.hero {
  padding: 80px 0 64px;
  text-align: center;
}

.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 27px;
  box-shadow: 0 12px 40px var(--shadow-1), 0 2px 8px var(--shadow-2);
  margin: 0 auto 32px;
}

.hero h1 {
  font-size: clamp(40px, 8vw, 64px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero .tagline {
  font-size: clamp(18px, 3vw, 22px);
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 40px;
  line-height: 1.4;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  transition: background 0.2s;
}

.hero-cta:hover {
  background: var(--brand-light);
}

.hero-cta svg {
  width: 20px;
  height: 20px;
}

/* ── Phone mockup placeholder ── */
.phone-mockup {
  margin: 48px auto 0;
  max-width: 280px;
  aspect-ratio: 9 / 19.5;
  background: var(--bg-secondary);
  border-radius: 36px;
  border: 4px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
}

.phone-mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Features ── */
.features {
  padding: 64px 0;
}

.features h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  font-style: italic;
  margin-bottom: 48px;
}

/* ── Heap card stack (article-style) ── */
.heap-wrapper {
  max-width: 380px;
  margin: 0 auto;
}

.heap-stack {
  position: relative;
  width: 100%;
  height: 460px;
  -webkit-user-select: none;
  user-select: none;
}

.heap-card {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 12px 24px var(--shadow-1), 0 2px 4px var(--shadow-2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: grab;
  will-change: transform, opacity;
  touch-action: pan-y;
  color: var(--text);
}

.heap-card-top { cursor: grab; }
.heap-card-top:active { cursor: grabbing; }

.heap-card-done {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  cursor: pointer;
}

/* Source banner */
.heap-card-source {
  margin: 16px 16px 0;
  padding: 8px 0;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
}

/* Emoji as hero image */
.heap-card-emoji {
  font-size: 64px;
  text-align: center;
  padding: 24px 0 16px;
  line-height: 1;
}

/* Headline */
.heap-card-headline {
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.25;
  padding: 0 20px;
  color: var(--text);
}

/* Subtitle */
.heap-card-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 20px 0;
  line-height: 1.4;
}

/* Body / excerpt */
.heap-card-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: 12px 20px 20px;
  flex: 1;
  background: var(--bg-secondary);
  margin: 16px 16px 16px;
  border-radius: 12px;
}

/* Stamps */
.heap-card-stamp {
  position: absolute;
  top: 24px;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  border: 3.5px solid;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(255,255,255,0.2);
  transition: opacity 0.1s;
  z-index: 20;
}

.heap-card-stamp-save {
  right: 20px;
  transform: rotate(-14deg);
  color: #22C559;
  border-color: #22C559;
}

.heap-card-stamp-skip {
  left: 20px;
  transform: rotate(14deg);
  color: #EF4444;
  border-color: #EF4444;
}

@media (prefers-color-scheme: dark) {
  .heap-card-stamp-save { color: #34D399; border-color: #34D399; }
  .heap-card-stamp-skip { color: #FF6161; border-color: #FF6161; }
  .heap-card-stamp { background: rgba(0,0,0,0.25); }
}

/* Progress bar */
.heap-progress {
  height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  margin-top: 20px;
  overflow: hidden;
}

.heap-progress-bar {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0;
}

.heap-remaining {
  text-align: center;
  font-size: 13px;
  color: var(--brand);
  font-weight: 600;
  margin-top: 8px;
}

/* Action buttons */
.heap-actions {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  margin-top: 20px;
  padding-bottom: 8px;
}

.heap-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.15s, opacity 0.15s;
}

.heap-btn:active { transform: scale(0.9); }
.heap-btn:disabled { opacity: 0.35; cursor: default; }
.heap-btn:disabled:active { transform: none; }

.heap-btn svg {
  width: 48px;
  height: 48px;
  padding: 12px;
  border-radius: 50%;
  border: 2px solid;
}

.heap-btn span {
  font-size: 11px;
  font-weight: 600;
}

/* Undo */
.heap-btn-undo svg {
  border-color: var(--card-border);
  color: var(--text-secondary);
  width: 40px; height: 40px; padding: 9px;
}
.heap-btn-undo span { color: var(--text-secondary); }

/* Skip */
.heap-btn-skip svg {
  border-color: #EF4444;
  color: #EF4444;
  background: rgba(239,68,68,0.08);
  width: 56px; height: 56px; padding: 14px;
}
.heap-btn-skip span { color: #EF4444; }

/* Save */
.heap-btn-save svg {
  border-color: #22C559;
  color: #22C559;
  background: rgba(34,197,89,0.08);
  width: 56px; height: 56px; padding: 14px;
}
.heap-btn-save span { color: #22C559; }

/* Read */
.heap-btn-read svg {
  border-color: var(--card-border);
  color: var(--text-secondary);
  width: 40px; height: 40px; padding: 9px;
}
.heap-btn-read span { color: var(--text-secondary); }

/* ── Ben sprites ── */

/* CTA row with Ben pointing */
.hero-cta-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.ben-cta {
  width: 64px;
  height: auto;
  transform: scaleX(-1);
  animation: ben-bounce 2s ease-in-out infinite;
}

@keyframes ben-bounce {
  0%, 100% { transform: scaleX(-1) translateY(0); }
  50% { transform: scaleX(-1) translateY(-8px); }
}

/* Floating Ben wave between hero and features */
.ben-float {
  text-align: center;
  margin: -20px 0 0;
  pointer-events: none;
}

.ben-float img {
  width: 80px;
  display: inline-block;
  animation: ben-wobble 3s ease-in-out infinite;
}

@keyframes ben-wobble {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

/* ── Ben section ── */
.ben-section {
  padding: 48px 0 64px;
  text-align: center;
}

.ben-hero-img {
  width: 280px;
  margin: 0 auto 24px;
  border-radius: 16px;
}

.ben-section p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 440px;
  margin: 0 auto 32px;
}

/* Ben sprite gallery */
.ben-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.ben-gallery img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  transition: transform 0.2s ease;
  cursor: pointer;
  image-rendering: pixelated;
}

.ben-gallery img:hover {
  transform: scale(1.3) rotate(-5deg);
}

/* ── Color bar ── */
.color-bar {
  display: flex;
  height: 6px;
  overflow: hidden;
}

.color-bar span {
  flex: 1;
}

/* ── Footer ── */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--card-border);
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  list-style: none;
}

footer a:hover {
  color: var(--brand);
}

/* ── Privacy page ── */
.page-content {
  padding: 64px 0;
  max-width: 640px;
  margin: 0 auto;
}

.page-content h1 {
  font-size: 32px;
  font-weight: 900;
  font-style: italic;
  margin-bottom: 8px;
}

.page-content .subtitle {
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 15px;
}

.page-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 12px;
}

.page-content p,
.page-content ul {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.page-content ul {
  padding-left: 20px;
}

.page-content li {
  margin-bottom: 8px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  /* Nav */
  nav .container { height: 48px; }
  .nav-brand { font-size: 18px; gap: 8px; }
  .nav-brand img { width: 28px; height: 28px; border-radius: 7px; }
  .nav-links { gap: 16px; font-size: 13px; }

  /* Hero */
  .hero { padding: 40px 0 36px; }
  .hero-icon { width: 80px; height: 80px; border-radius: 18px; margin-bottom: 24px; }
  .hero h1 { font-size: 36px; margin-bottom: 12px; }
  .hero .tagline { font-size: 16px; margin-bottom: 28px; }
  .hero-cta {
    display: flex;
    width: 100%;
    justify-content: center;
    font-size: 16px;
    padding: 14px 24px;
    border-radius: 12px;
  }

  /* Phone mockup */
  .phone-mockup {
    margin-top: 32px;
    max-width: 220px;
    border-radius: 28px;
    border-width: 3px;
  }

  /* Features */
  .features { padding: 48px 0; }
  .features h2 { font-size: 26px; margin-bottom: 32px; }

  /* Card stack */
  .heap-wrapper { max-width: 100%; }
  .heap-stack { height: 380px; }
  .heap-card { border-radius: 16px; }
  .heap-card-source { margin: 12px 12px 0; padding: 6px 0; font-size: 12px; border-radius: 8px; }
  .heap-card-emoji { font-size: 48px; padding: 16px 0 12px; }
  .heap-card-headline { font-size: 19px; padding: 0 16px; }
  .heap-card-subtitle { font-size: 13px; padding: 4px 16px 0; }
  .heap-card-body { font-size: 13px; padding: 10px 16px 16px; margin: 12px 12px 12px; border-radius: 10px; }

  /* Stamps */
  .heap-card-stamp { font-size: 16px; padding: 5px 12px; top: 18px; }
  .heap-card-stamp-save { right: 16px; }
  .heap-card-stamp-skip { left: 16px; }

  /* Progress */
  .heap-progress { margin-top: 16px; }
  .heap-remaining { font-size: 12px; margin-top: 6px; }

  /* Action buttons */
  .heap-actions { gap: 12px; margin-top: 16px; padding-bottom: 4px; }
  .heap-btn svg { width: 44px; height: 44px; padding: 10px; }
  .heap-btn-undo svg { width: 36px; height: 36px; padding: 8px; }
  .heap-btn-skip svg { width: 50px; height: 50px; padding: 12px; }
  .heap-btn-save svg { width: 50px; height: 50px; padding: 12px; }
  .heap-btn-read svg { width: 36px; height: 36px; padding: 8px; }
  .heap-btn span { font-size: 10px; }

  /* Ben */
  .ben-section { padding: 32px 0 48px; }
  .ben-hero-img { width: 200px; margin-bottom: 16px; }
  .ben-section p { font-size: 16px; }
  .ben-gallery img { width: 56px; height: 56px; }
  .ben-gallery { gap: 12px; }
  .ben-cta { width: 48px; }
  .ben-float img { width: 60px; }
  .hero-cta-row { flex-direction: column; width: 100%; }
  .ben-cta { transform: scaleX(1); }
  @keyframes ben-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }

  /* Footer */
  footer { padding: 28px 0; font-size: 12px; }
  footer .footer-links { gap: 20px; margin-bottom: 10px; }

  /* Privacy page */
  .page-content { padding: 40px 0; }
  .page-content h1 { font-size: 26px; }
  .page-content h2 { font-size: 18px; margin: 24px 0 10px; }
  .page-content p, .page-content ul { font-size: 14px; }
}

/* Small phones (SE, etc.) */
@media (max-width: 375px) {
  .hero h1 { font-size: 32px; }
  .heap-stack { height: 350px; }
  .heap-card-emoji { font-size: 40px; padding: 12px 0 10px; }
  .heap-card-headline { font-size: 17px; }
  .heap-card-body { font-size: 12px; line-height: 1.5; }
}
