/* ═══════════════════════════════════════════════════════════════════
   MoonCal — app.css
   Design adapted from the Aurora / Lichtblick design system.
   Palette shifted from warm-dawn to deep-night / moonlight.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Fonts ────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'URW Classico';
  font-style: normal;
  font-weight: normal;
  src: url('../fonts/URWClassico-Regular.woff') format('woff');
  font-display: swap;
}
@font-face {
  font-family: 'Inter Display';
  font-style: normal;
  font-weight: normal;
  src: url('../fonts/InterDisplay-Regular.woff2') format('woff2');
  font-display: swap;
}

/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter Display', -apple-system, BlinkMacSystemFont,
               'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #2d2d3e;
  background: #f8f7f5;
}
a { color: inherit; }

/* ── Shared ───────────────────────────────────────────────────────── */
.section-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(
    160deg,
    #06060e 0%,
    #0a0a1c 18%,
    #0f0f2a 38%,
    #161438 58%,
    #1c1648 76%,
    #1f1752 88%,
    #221856 100%
  );
}

/* Subtle noise grain overlay */
.hero::before {
  content: '';
  position: absolute;
  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.035'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 1;
}

/* Faint moon-glow radial behind the icon */
.hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(200, 185, 240, 0.07) 0%,
    rgba(140, 120, 200, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding: 0 1.5rem;
}

/* Moon icon */
.hero-moon {
  width: 72px;
  height: 72px;
  margin: 0 auto 2rem;
  opacity: 0.88;
  animation: moonPulse 5s ease-in-out infinite;
}
.hero-moon svg {
  width: 100%;
  height: 100%;
}
@keyframes moonPulse {
  0%, 100% { transform: scale(1);    opacity: 0.88; }
  50%       { transform: scale(1.05); opacity: 1;   }
}

.hero-eyebrow {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(200, 185, 240, 0.45);
  margin-bottom: 1.4rem;
}
.hero-headline {
  font-family: 'URW Classico', Optima, 'Optima Nova LT', Candara,
               Georgia, 'Times New Roman', serif;
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 20px rgba(140, 120, 200, 0.30);
}
.hero-sub {
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: rgba(255, 255, 255, 0.52);
  margin-bottom: 2.8rem;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

/* ── Feed URL box ─────────────────────────────────────────────────── */
.feed-box {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(200, 185, 240, 0.18);
  border-radius: 12px;
  overflow: hidden;
  max-width: 560px;
  margin: 0 auto 1.5rem;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.feed-url {
  flex: 1;
  padding: 0.8rem 1rem;
  font-family: 'SF Mono', 'Fira Mono', 'Consolas', monospace;
  font-size: 0.80rem;
  color: rgba(200, 185, 240, 0.80);
  background: transparent;
  border: none;
  outline: none;
  user-select: all;
  cursor: text;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  flex-shrink: 0;
  padding: 0.8rem 1.1rem;
  background: rgba(160, 140, 220, 0.15);
  border: none;
  border-left: 1px solid rgba(200, 185, 240, 0.15);
  color: rgba(200, 185, 240, 0.70);
  font-size: 0.78rem;
  font-family: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.copy-btn:hover {
  background: rgba(160, 140, 220, 0.28);
  color: rgba(220, 210, 255, 0.95);
}
.copy-btn.copied {
  color: rgba(140, 220, 160, 0.90);
}

/* ── Quick-subscribe buttons ──────────────────────────────────────── */
.subscribe-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.3rem;
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}
.subscribe-btn:hover {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.42);
  transform: translateY(-2px);
}
.subscribe-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: currentColor;
}

/* ── Scroll hint ──────────────────────────────────────────────────── */
.scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.22);
  font-size: 0.65rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  animation: fadeInUp 1.2s ease 1.5s both;
}
.scroll-hint svg {
  width: 18px;
  height: 18px;
  stroke: rgba(255, 255, 255, 0.22);
  animation: bounce 1.8s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── What you get section ─────────────────────────────────────────── */
.what-section {
  background: #f8f7f5;
  padding: 6rem 2rem 5rem;
}
.section-intro {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-intro h2 {
  font-family: 'URW Classico', Optima, 'Optima Nova LT', Candara,
               Georgia, 'Times New Roman', serif;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 400;
  color: #1a1a2e;
  letter-spacing: -0.01em;
  margin-bottom: 0.7rem;
}
.section-intro p {
  font-size: 0.95rem;
  color: #7a7a90;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.65;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
  max-width: 800px;
  margin: 0 auto;
}
@media (max-width: 580px) {
  .features-grid { grid-template-columns: 1fr; }
}

.feature-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  padding: 1.9rem 2rem;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.feature-card:hover {
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.feature-icon {
  width: 42px;
  height: 42px;
  background: rgba(140, 120, 200, 0.10);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  font-size: 1.3rem;
  line-height: 1;
}
.feature-icon svg {
  width: 20px;
  height: 20px;
  stroke: rgba(120, 100, 180, 0.80);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature-card h3 {
  font-family: 'URW Classico', Optima, 'Optima Nova LT', Candara,
               Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
  letter-spacing: -0.005em;
}
.feature-card p {
  font-size: 0.875rem;
  color: #5e5e76;
  line-height: 1.7;
}

/* ── How it works section ─────────────────────────────────────────── */
.how-section {
  background: linear-gradient(160deg, #10101e 0%, #080810 100%);
  padding: 6rem 2rem;
}
.how-section .section-intro h2 { color: rgba(255, 255, 255, 0.90); }
.how-section .section-intro p  { color: rgba(255, 255, 255, 0.42); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  max-width: 800px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .steps-grid { grid-template-columns: 1fr; }
}

.step-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(200, 185, 240, 0.10);
  border-radius: 18px;
  padding: 1.9rem 1.6rem;
  text-align: center;
}
.step-number {
  font-family: 'URW Classico', Optima, Georgia, serif;
  font-size: 2rem;
  color: rgba(160, 140, 220, 0.35);
  margin-bottom: 0.8rem;
  line-height: 1;
}
.step-card h3 {
  font-family: 'URW Classico', Optima, 'Optima Nova LT', Candara,
               Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0.5rem;
}
.step-card p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.65;
}

/* ── Instructions section ─────────────────────────────────────────── */
.instructions-section {
  background: #f8f7f5;
  padding: 6rem 2rem;
}
.instructions-section .section-intro h2 { color: #1a1a2e; }

.instructions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  max-width: 960px;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .instructions-grid { grid-template-columns: 1fr; }
}

.instruction-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  padding: 1.9rem 1.8rem;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}
.instruction-card .app-icon {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  display: block;
  line-height: 1;
}
.instruction-card h3 {
  font-family: 'URW Classico', Optima, 'Optima Nova LT', Candara,
               Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: #1a1a2e;
  margin-bottom: 1rem;
  letter-spacing: -0.005em;
}
.instruction-card ol {
  list-style: none;
  padding: 0;
  counter-reset: step-counter;
}
.instruction-card ol li {
  counter-increment: step-counter;
  font-size: 0.85rem;
  color: #5e5e76;
  line-height: 1.65;
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: 0.5rem;
}
.instruction-card ol li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: rgba(120, 100, 180, 0.12);
  color: rgba(100, 80, 160, 0.80);
  font-size: 0.68rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1rem;
}
.instruction-card .note {
  margin-top: 1rem;
  padding: 0.65rem 0.8rem;
  background: rgba(120, 100, 180, 0.06);
  border-radius: 8px;
  font-size: 0.78rem;
  color: #7a7a90;
  line-height: 1.55;
}

/* ── CTA ──────────────────────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(
    155deg,
    #06060e  0%,
    #100e2a 30%,
    #1c1448 55%,
    #221652 78%,
    #261858 100%
  );
  padding: 6rem 2rem;
  text-align: center;
}
.cta-section h2 {
  font-family: 'URW Classico', Optima, 'Optima Nova LT', Candara,
               Georgia, 'Times New Roman', serif;
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0.9rem;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 16px rgba(140, 120, 200, 0.25);
}
.cta-sub {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 2.5rem;
  letter-spacing: 0.01em;
}
.cta-feed-box {
  max-width: 480px;
  margin: 0 auto;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.page-footer {
  padding: 1.6rem 2rem;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.20);
  background: #04040a;
  letter-spacing: 0.01em;
}
.page-footer a {
  color: rgba(255, 255, 255, 0.30);
  text-decoration: none;
  transition: color 0.18s;
}
.page-footer a:hover { color: rgba(255, 255, 255, 0.60); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .feed-box { flex-direction: column; border-radius: 14px; }
  .feed-url { width: 100%; white-space: normal; word-break: break-all; }
  .copy-btn { width: 100%; border-left: none; border-top: 1px solid rgba(200, 185, 240, 0.15); justify-content: center; display: flex; }
  .subscribe-buttons { flex-direction: column; align-items: center; }
  .subscribe-btn { width: 100%; max-width: 280px; justify-content: center; }
}

/* ── Accessibility: reduce motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-moon, .scroll-hint, .scroll-hint svg { animation: none; }
  .feature-card, .subscribe-btn { transition: none; }
}

/* ── Focus styles (WCAG AA) ───────────────────────────────────────── */
:focus-visible {
  outline: 2px solid rgba(160, 140, 220, 0.80);
  outline-offset: 3px;
  border-radius: 4px;
}
