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

:root {
  --bg: #fff;
  --bg-2: #f8f8f8;
  --text: #111;
  --text-2: #444;
  --text-3: #888;
  --border: #e5e5e5;
  --accent: #2563eb;
  --font: system-ui, -apple-system, sans-serif;
  --mono: 'Menlo', 'Monaco', monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

nav {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
}
nav a {
  font-size: 0.8125rem;
  color: var(--text-3);
  text-decoration: none;
}
nav a:hover { color: var(--text); }

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* Hero */
.hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
}
.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 20px;
}
h1 {
  font-size: 2.75rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.7;
}

/* Demo sections */
.demo-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.demo-section:last-child { border-bottom: none; }

h2 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.section-desc {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 620px;
}
code {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Section 1: Draggable Cards ── */
.drag-arena {
  width: 100%;
  height: 300px;
  background: #111;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.drag-card {
  position: absolute;
  width: 120px;
  height: 80px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: grab;
  touch-action: none;
  transition: box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.drag-card:active { cursor: grabbing; }
.drag-card.is-dragging {
  cursor: grabbing;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  transform: scale(1.04);
  z-index: 10;
}

.card-red   { background: #ef4444; top: 30px;  left: 30px; }
.card-green { background: #22c55e; top: 30px;  left: 200px; }
.card-blue  { background: #3b82f6; top: 30px;  left: 370px; }

.card-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.04em;
}
.card-hint {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.5);
}

/* ── Section 2: Custom Cursor ── */
.cursor-stage {
  width: 100%;
  height: 300px;
  background: #111;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: none;
  overflow: hidden;
}

.cursor-ring {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s, background 0.2s;
  mix-blend-mode: normal;
  z-index: 10;
  left: 50%;
  top: 50%;
}
.cursor-ring.is-magnetic {
  width: 40px;
  height: 40px;
  background: #fff;
  mix-blend-mode: difference;
}

.cursor-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.magnetic {
  padding: 12px 24px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: rgba(255,255,255,0.8);
  font-family: var(--font);
  font-size: 0.875rem;
  border-radius: 6px;
  cursor: none;
  transition: border-color 0.2s;
}
.magnetic:hover {
  border-color: rgba(255,255,255,0.6);
}

/* ── Section 3: IntersectionObserver Reveal ── */
.reveal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.reveal-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-2);

  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal-item:last-child { border-bottom: none; }
.reveal-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.item-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
  width: 28px;
}

/* stagger delays */
.reveal-item:nth-child(1) { transition-delay: 0s; }
.reveal-item:nth-child(2) { transition-delay: 0.05s; }
.reveal-item:nth-child(3) { transition-delay: 0.1s; }
.reveal-item:nth-child(4) { transition-delay: 0.15s; }
.reveal-item:nth-child(5) { transition-delay: 0.2s; }
.reveal-item:nth-child(6) { transition-delay: 0.25s; }
.reveal-item:nth-child(7) { transition-delay: 0.3s; }
.reveal-item:nth-child(8) { transition-delay: 0.35s; }

@media (max-width: 640px) {
  nav { padding: 16px 20px; }
  main { padding: 0 20px 60px; }
  h1 { font-size: 2rem; }
  .card-green { left: 170px; }
  .card-blue  { left: 310px; }
  .drag-arena { height: 260px; }
}
