/* ============================================
   Sieve Calendar — Landing Page
   Warm editorial minimalism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Lexend:wght@400;500;600&display=swap');

:root {
  /* Sieve app palette — dark mode */
  --cream: #1F2329;
  --surface: #2D343D;
  --surface-elevated: #343C47;
  --text: #E9ECEF;
  --text-secondary: #A1A6AD;
  --text-tertiary: #6C737A;
  --accent: #6C8AA6;
  --accent-hover: #85A3BF;
  --sage: #87A96B;
  --amber: #D4A574;
  --coral: #D48585;
  --border: #3A4048;
  --border-strong: #4A5058;

  /* Typography */
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Lexend', system-ui, sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Radii */
  --radius: 12px;
  --radius-lg: 16px;

  /* Layout */
  --max-width: 1080px;
  --content-width: 680px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.4s;
}

/* ---- Reset & Base ---- */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Magnetic Scroll Config */
  scroll-snap-type: y mandatory;
  /* Accounts for the 72px sticky header height */
  scroll-padding-top: 72px;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

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

::selection {
  background: var(--accent);
  color: white;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

/* ---- Navigation ---- */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-mark {
  height: 1.4em;
  width: auto;
}

/* ---- Main Sections & Snapping ---- */

main {
  flex: 1;
}

.hero,
.how-it-works,
.features-strip {
  /* This aligns the section to the center of the scroll area */
  scroll-snap-align: center;
  /* Ensures we don't accidentally skip a section on a fast scroll */
  scroll-snap-stop: always;
}

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-4xl);
  text-align: center;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--space-lg);
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-body {
  font-size: 1.35rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color var(--duration) var(--ease),
              color var(--duration) var(--ease);
  letter-spacing: 0.01em;
}

.hero-cta:hover {
  border-color: var(--text-tertiary);
  color: var(--text);
}

/* ---- Divider ---- */

.divider {
  max-width: var(--content-width);
  margin: 0 auto;
  border: none;
  border-top: 1px solid var(--border);
}

/* ---- How It Works ---- */

.how-it-works {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-label {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: 1000px;
  margin: 0 auto;
}

.step {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.step h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.step p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Transformation Visual ---- */

.transformation {
  padding: var(--space-xl) 0 0;
}

.transform-card {
  max-width: none;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}

.phase {
  padding: var(--space-md) var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 160px;
}

.phase + .phase {
  border-left: 1px solid var(--border);
}

.source-types { display: flex; flex-direction: column; gap: 8px; align-items: center; }

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 14px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  width: fit-content;
  opacity: 0;
}

.source-pill svg { flex-shrink: 0; opacity: 0.6; }

.how-it-works.animate .source-pill {
  animation: fadeUp 0.5s var(--ease) both;
}

.how-it-works.animate .source-pill:nth-child(1) { animation-delay: 1.8s; }
.how-it-works.animate .source-pill:nth-child(2) { animation-delay: 2.1s; }
.how-it-works.animate .source-pill:nth-child(3) { animation-delay: 2.4s; }

.review-rows { display: flex; flex-direction: column; gap: 8px; }
.review-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
  opacity: 0;
}

.review-text { position: relative; z-index: 2; }

.review-check {
  margin-left: auto;
  color: var(--sage);
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: scale(0.5);
}

/* Review rows fade in */
.how-it-works.animate .review-row { animation: fadeUp 0.4s var(--ease) both; }
.how-it-works.animate .review-row:nth-child(1) { animation-delay: 3.8s; }
.how-it-works.animate .review-row:nth-child(2) { animation-delay: 4.0s; }
.how-it-works.animate .review-row:nth-child(3) { animation-delay: 4.2s; }

/* Highlight background sweeps through each row */
.review-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  border-radius: 6px;
  z-index: 0;
}

.how-it-works.animate .review-row:nth-child(1)::before { animation: highlightPulse 0.8s var(--ease) 4.6s both; }
.how-it-works.animate .review-row:nth-child(2)::before { animation: highlightPulse 0.8s var(--ease) 5.0s both; }
.how-it-works.animate .review-row:nth-child(3)::before { animation: highlightPulse 0.8s var(--ease) 5.4s both; }

/* Per-row shimmer */
.review-row::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    22deg,
    transparent 20%,
    rgba(108, 138, 166, 0.15) 40%,
    rgba(108, 138, 166, 0.25) 50%,
    rgba(108, 138, 166, 0.15) 60%,
    transparent 80%
  );
  transform: translateX(0);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}

.how-it-works.animate .review-row:nth-child(1)::after { animation: shimmerRow 0.6s ease-in-out 4.7s both; }
.how-it-works.animate .review-row:nth-child(2)::after { animation: shimmerRow 0.6s ease-in-out 5.1s both; }
.how-it-works.animate .review-row:nth-child(3)::after { animation: shimmerRow 0.6s ease-in-out 5.5s both; }

/* Checkmark pops after shimmer */
.how-it-works.animate .review-row:nth-child(1) .review-check { animation: checkPop 0.35s var(--ease) 5.1s both; }
.how-it-works.animate .review-row:nth-child(2) .review-check { animation: checkPop 0.35s var(--ease) 5.5s both; }
.how-it-works.animate .review-row:nth-child(3) .review-check { animation: checkPop 0.35s var(--ease) 5.9s both; }

.sync-feed { display: flex; flex-direction: column; gap: 8px; }
.sync-summary {
  padding: 6px 10px;
  background: var(--surface-elevated);
  border-radius: 6px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
}

.how-it-works.animate .sync-summary { animation: fadeUp 0.4s var(--ease) 7.2s both; }

.sync-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  opacity: 0;
}

.how-it-works.animate .sync-item:nth-child(2) { animation: slideInFromRight 0.4s var(--ease) 7.7s both; }
.how-it-works.animate .sync-item:nth-child(3) { animation: slideInFromRight 0.4s var(--ease) 8.0s both; }
.how-it-works.animate .sync-item:nth-child(4) { animation: slideInFromRight 0.4s var(--ease) 8.3s both; }

.sync-count--added { color: var(--sage); }
.sync-count--updated { color: var(--accent); }
.sync-count--removed { color: var(--coral); }
.sync-dot { color: var(--text-tertiary); margin: 0 4px; }

.sync-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sync-indicator--added { background: var(--sage); color: var(--sage); }
.sync-indicator--updated { background: var(--accent); color: var(--accent); }
.sync-indicator--removed { background: var(--coral); color: var(--coral); }

.how-it-works.animate .sync-item:nth-child(2) .sync-indicator {
  animation: dotPulse 0.6s var(--ease) 8.1s both;
}
.how-it-works.animate .sync-item:nth-child(3) .sync-indicator {
  animation: dotPulse 0.6s var(--ease) 8.4s both;
}
.how-it-works.animate .sync-item:nth-child(4) .sync-indicator {
  animation: dotPulse 0.6s var(--ease) 8.7s both;
}

.sync-label { color: var(--text); }
.sync-label--removed { color: var(--text-tertiary); text-decoration: line-through; }

.sync-detail { margin-left: auto; font-size: 0.8rem; color: var(--text-tertiary); font-weight: 400; white-space: nowrap; }
.sync-detail--added { color: var(--sage); font-weight: 500; }
.sync-detail--removed { color: var(--coral); font-weight: 500; }
.sync-arrow { color: var(--text-tertiary); margin: 0 2px; }

.sync-item { font-size: 0.875rem; font-weight: 500; border-radius: 6px; }

/* ---- Features Strip ---- */

.features-strip {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg) var(--space-4xl);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  padding: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration) var(--ease);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Prose (Privacy, etc.) ---- */

.prose {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-lg) var(--space-4xl);
  scroll-snap-align: start;
}

.prose h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  margin-bottom: var(--space-xs);
  line-height: 1.15;
}

.effective-date {
  color: var(--text-tertiary);
  font-size: 1rem;
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.prose h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.prose p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.prose ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.prose li {
  margin-bottom: var(--space-sm);
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration) var(--ease);
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

/* ---- Footer ---- */

footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) var(--space-lg);
  scroll-snap-align: end;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links { display: flex; gap: var(--space-lg); }
.footer-links a { color: var(--text-tertiary); font-size: 0.875rem; font-weight: 500; }
.copyright { font-size: 0.875rem; color: var(--text-tertiary); }

/* ---- Animations ---- */

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInFromRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes checkPop { 0% { opacity: 0; transform: scale(0.5); } 60% { opacity: 1; transform: scale(1.3); } 100% { opacity: 1; transform: scale(1); } }
@keyframes highlightPulse { 0% { opacity: 0; } 30% { opacity: 0.12; } 70% { opacity: 0.12; } 100% { opacity: 0; } }
@keyframes dotPulse { 0% { box-shadow: 0 0 0 0 currentColor; opacity: 0.4; } 50% { box-shadow: 0 0 0 4px transparent; opacity: 1; } 100% { box-shadow: 0 0 0 0 transparent; opacity: 1; } }
@keyframes shimmerRow { 0% { opacity: 1; transform: translateX(0); } 100% { opacity: 1; transform: translateX(500%); } }

/* Hero entry sequence */
.hero h1, .hero-body, .hero-cta { animation: fadeUp 0.6s var(--ease) both; }
.hero h1 { animation-delay: 0.05s; }
.hero-body { animation-delay: 0.15s; }
.hero-cta { animation-delay: 0.25s; }

/* ---- Responsive ---- */

@media (max-width: 768px) {
  /* Disable snapping on mobile so the user can scroll freely if content is tall */
  html {
    scroll-snap-type: none;
  }

  .hero, .how-it-works, .features-strip {
    min-height: auto;
    scroll-snap-align: none;
  }

  nav { padding: var(--space-md); }
  .hero { padding: var(--space-3xl) var(--space-md) var(--space-2xl); }
  .steps { grid-template-columns: 1fr; max-width: 400px; }
  .transformation { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .prose { padding: var(--space-2xl) var(--space-md) var(--space-3xl); }
  .footer-inner { flex-direction: column; gap: var(--space-md); text-align: center; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-snap-type: none; }
  * { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
  .review-row::before, .review-row::after { display: none !important; }
}
