/* ============================================
   賴貝貝 Landing Page — Scrapbook Dreamland
   Warm, bubbly, paper-textured, polaroid frames
   ============================================ */

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

:root {
  /* Warm palette */
  --cream:        #FFF8F0;
  --cream-deep:   #FFF0E6;
  --peach:        #FFDAB3;
  --blush:        #FFE4E1;
  --mint:         #E8F9EE;
  --baby-blue:    #D6EEFF;
  --brown:        #3D2C1E;
  --brown-mid:    #7A6B5D;
  --brown-light:  #B8A89A;
  --green:        #06C755;
  --green-dark:   #05A849;
  --green-glow:   rgba(6, 199, 85, 0.25);
  --card-bg:      #FFFFFF;
  --footer-bg:    #F5EDE4;
  --border:       #E8E0D8;

  /* Type */
  --font-display: 'Fredoka', sans-serif;
  --font-body:    'Noto Sans TC', sans-serif;

  /* Spacing */
  --section-pad:  80px;
  --content-max:  1080px;
  --radius:       16px;
  --radius-sm:    12px;
}

@media (max-width: 768px) {
  :root { --section-pad: 48px; }
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--brown);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
  /* Paper grain texture */
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ===================
   HEADER / NAV
   =================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 248, 240, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s, box-shadow 0.3s;
}
.site-header.scrolled {
  background: rgba(255, 248, 240, 0.95);
  box-shadow: 0 2px 16px rgba(61, 44, 30, 0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--brown);
}
.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--peach);
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-menu a {
  text-decoration: none;
  color: var(--brown-mid);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-menu a:hover { color: var(--green); }

.nav-cta {
  background: var(--green);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s, transform 0.2s;
}
.nav-cta:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--brown);
  margin: 6px 0;
  border-radius: 2px;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(255, 248, 240, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 24px;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav-menu.open { display: flex; }
}

/* ===================
   HERO
   =================== */
.hero {
  background: url('/images/hero-banner.jpg') center center / cover no-repeat;
  padding: 80px 24px 40px; /* 80px = header height offset */
  max-width: none;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.hero > * {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-text {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 48px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  text-align: center;
  max-width: 700px;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--brown);
}
.hero-text h1 .brand { color: var(--green); }

.hero-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0;
  align-items: center;
  max-width: 100%;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hero-text .tagline {
  font-size: 18px;
  color: var(--brown-mid);
  margin-bottom: 0;
  line-height: 1.7;
  text-align: left;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #fff;
  padding: 16px 36px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px var(--green-glow);
  animation: pulse-glow 2.5s ease-in-out infinite;
}
.cta-button:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--green-glow);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 16px var(--green-glow); }
  50% { box-shadow: 0 4px 28px rgba(6, 199, 85, 0.4); }
}

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

/* Mascot + floating polaroids inside banner */

.mascot-frame {
  position: relative;
  z-index: 2;
}
.mascot-frame img {
  width: 340px;
  height: 340px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #fff;
  box-shadow: 0 8px 32px rgba(61, 44, 30, 0.12);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.polaroid {
  position: absolute;
  background: #fff;
  padding: 6px 6px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-radius: 4px;
  z-index: 1;
  animation: drift 6s ease-in-out infinite;
}
.polaroid-inner {
  width: 60px;
  height: 60px;
  border-radius: 2px;
}
.polaroid:nth-child(1) {
  top: 10%; left: -10%;
  transform: rotate(-12deg);
  animation-delay: 0s;
}
.polaroid:nth-child(1) .polaroid-inner { background: var(--blush); }
.polaroid:nth-child(2) {
  top: 5%; right: -5%;
  transform: rotate(8deg);
  animation-delay: 1s;
}
.polaroid:nth-child(2) .polaroid-inner { background: var(--baby-blue); }
.polaroid:nth-child(3) {
  bottom: 15%; left: -15%;
  transform: rotate(6deg);
  animation-delay: 2s;
}
.polaroid:nth-child(3) .polaroid-inner { background: var(--mint); }
.polaroid:nth-child(4) {
  bottom: 10%; right: -10%;
  transform: rotate(-8deg);
  animation-delay: 0.5s;
}
.polaroid:nth-child(4) .polaroid-inner { background: var(--peach); }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-8px) rotate(var(--r, 0deg)); }
}

.qr-float img {
  width: 128px;
  height: 128px;
  border-radius: 4px;
}

/* Floating QR — always visible at bottom-right */
.qr-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.qr-float span {
  font-size: 13px;
  color: var(--brown-mid);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .qr-float { bottom: 16px; right: 16px; }
  .qr-float img { width: 96px; height: 96px; }
  .hero { padding-top: calc(64px + 24px); min-height: auto; }
  .hero-text { padding: 28px 20px; }
  .hero-text h1 { font-size: 30px; }
  .hero-row { grid-template-columns: 1fr; gap: 16px; }
  .hero-text .tagline { font-size: 16px; text-align: center; }
  .hero-cta { align-items: center; }
  .mascot-frame img { width: 220px; height: 220px; }
  .polaroid { display: none; }
}

/* ===================
   SECTION COMMON
   =================== */
section { padding: var(--section-pad) 24px; }

.section-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
  color: var(--brown);
}
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--green);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================
   HOW IT WORKS
   =================== */
.steps-section { background: var(--cream-deep); }

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

.step-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.step-icon {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.step-badge {
  width: 48px;
  height: 48px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  margin: 0 auto 20px;
}

.step-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}
.step-card p {
  font-size: 15px;
  color: var(--brown-mid);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .steps-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ===================
   FEATURES
   =================== */
.features-grid {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  transition: box-shadow 0.3s, transform 0.3s;
}
.feature-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-card:nth-child(1) .feature-icon { background: var(--mint); }
.feature-card:nth-child(2) .feature-icon { background: var(--baby-blue); }
.feature-card:nth-child(3) .feature-icon { background: var(--blush); }
.feature-card:nth-child(4) .feature-icon { background: var(--peach); }

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 14px;
  color: var(--brown-mid);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ===================
   USE CASES
   =================== */
.usecases-section { background: var(--cream-deep); }

.usecases-grid {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.usecase-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  border-top: 4px solid transparent;
  transition: border-color 0.3s, transform 0.3s;
}
.usecase-card:hover { transform: translateY(-2px); }
.usecase-card:nth-child(1) { border-top-color: var(--blush); }
.usecase-card:nth-child(2) { border-top-color: var(--baby-blue); }
.usecase-card:nth-child(3) { border-top-color: var(--mint); }

.usecase-emoji {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}
.usecase-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}
.usecase-card p {
  font-size: 14px;
  color: var(--brown-mid);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .usecases-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ===================
   PRIVACY
   =================== */
.privacy-section { background: var(--mint); }

.privacy-list {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.privacy-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.privacy-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.privacy-item p {
  font-size: 15px;
  color: var(--brown);
  line-height: 1.7;
}

/* ===================
   FAQ
   =================== */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
}
.faq-list details {
  border-bottom: 1px solid var(--border);
}
.faq-list summary {
  padding: 20px 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--brown);
  transition: color 0.2s;
}
.faq-list summary:hover { color: var(--green); }
.faq-list summary::after {
  content: '+';
  font-size: 24px;
  font-weight: 400;
  color: var(--brown-light);
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-left: 16px;
}
.faq-list details[open] summary::after {
  content: '−';
  color: var(--green);
}
/* Remove default marker in webkit */
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list details p {
  padding: 0 0 20px;
  font-size: 15px;
  color: var(--brown-mid);
  line-height: 1.7;
}

/* ===================
   FINAL CTA
   =================== */
.final-cta {
  background: linear-gradient(135deg, var(--cream-deep), var(--peach));
  text-align: center;
}
.final-cta h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}
.final-cta .subtext {
  font-size: 17px;
  color: var(--brown-mid);
  margin-bottom: 32px;
}

/* ===================
   FOOTER
   =================== */
.site-footer {
  background: var(--footer-bg);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--brown-mid);
}
.footer-links { margin-bottom: 8px; }
.footer-links a {
  color: var(--brown-mid);
  text-decoration: none;
  margin: 0 12px;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--green); }

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

/* ===================
   LEGAL PAGES (privacy, terms)
   =================== */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(80px + 32px) 24px var(--section-pad);
}

.legal-page h1,
.legal-page h2,
.legal-page h3 {
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  letter-spacing: -0.01em;
}

.legal-page h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--brown);
}

.legal-page .effective-date {
  color: var(--brown-mid);
  font-size: 14px;
  margin-bottom: 32px;
}

.legal-page p {
  color: var(--brown);
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.legal-page h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--brown);
}

.legal-page h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--brown);
}

.legal-page ul {
  margin: 0 0 16px 24px;
  color: var(--brown);
  line-height: 1.8;
}

.legal-page li { margin-bottom: 6px; }

.legal-page strong { color: var(--brown); font-weight: 600; }

.legal-page a {
  color: var(--green-dark);
  text-decoration: underline;
}

/* Language toggle pills (floating on legal pages, inline in landing nav) */
.lang-toggle,
.nav-lang {
  display: inline-flex;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-toggle {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 90;
  padding: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.nav-lang {
  padding: 2px;
  list-style: none;
}
.lang-toggle button,
.nav-lang button {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--brown-mid);
  transition: background 0.2s, color 0.2s;
}
.lang-toggle button { padding: 6px 14px; }
.nav-lang button { padding: 4px 12px; }
.lang-toggle button.active,
.nav-lang button.active {
  background: var(--green);
  color: #fff;
}

/* Show/hide content based on <html data-lang> */
html[data-lang="zh"] [data-lang="en"],
html[data-lang="en"] [data-lang="zh"] {
  display: none;
}

@media (max-width: 768px) {
  .legal-page { padding-top: calc(64px + 24px); }
  .legal-page h1 { font-size: 28px; }
  .lang-toggle { top: 64px; right: 16px; }
}
