/* ==========================================================================
   Paper Reflex / Gribouille - Showcase Website Stylesheet
   Aesthetic: Handcrafted Paper, Graphite & Terracotta
   ========================================================================== */

:root {
  --bg-paper: #FAF8F5;
  --bg-paper-warm: #F4EFEA;
  --bg-card: #FFFFFF;
  --text-primary: #1C1917;
  --text-secondary: #57534E;
  --text-muted: #8E8982;
  
  --pencil-dark: #23201D;
  --pencil-line: #E5E0D8;
  --pencil-line-strong: #D1C9BC;
  
  --terracotta: #BC4836;
  --terracotta-hover: #A33A2A;
  --terracotta-light: rgba(188, 72, 54, 0.08);
  
  --amber: #D97706;
  --amber-light: rgba(217, 119, 6, 0.1);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hand: 'Caveat', cursive, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(35, 32, 29, 0.04);
  --shadow-md: 0 8px 24px rgba(35, 32, 29, 0.08);
  --shadow-lg: 0 16px 36px rgba(35, 32, 29, 0.12);
  --shadow-paper: 2px 4px 12px rgba(28, 25, 23, 0.07), -1px -1px 0 rgba(255, 255, 255, 0.9);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-paper);
  background-image: 
    linear-gradient(rgba(215, 208, 196, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(215, 208, 196, 0.25) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Notebook margin guide line on wide screens */
@media (min-width: 1200px) {
  body::before {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    left: 80px;
    width: 2px;
    background-color: rgba(188, 72, 54, 0.25);
    z-index: 0;
    pointer-events: none;
  }
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: 860px;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--pencil-line);
  z-index: 100;
}

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--pencil-line);
  transition: transform 0.2s ease;
}

.brand-link:hover .brand-logo-img {
  transform: rotate(-3deg) scale(1.05);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-title-main {
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.1;
}

.brand-title-sub {
  font-family: var(--font-hand);
  font-size: 1.05rem;
  color: var(--terracotta);
  line-height: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-menu {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-menu a:hover {
  color: var(--terracotta);
}

.lang-select-wrapper {
  position: relative;
}

.lang-select {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--pencil-line-strong);
  border-radius: var(--radius-full);
  padding: 8px 32px 8px 14px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.lang-select:hover, .lang-select:focus {
  border-color: var(--terracotta);
  outline: none;
}

.lang-select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding: 60px 0 40px;
  text-align: center;
}

.badge-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--terracotta-light);
  border: 1px solid rgba(188, 72, 54, 0.2);
  color: var(--terracotta);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background-color: var(--terracotta);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--pencil-dark);
  margin-bottom: 16px;
}

.hero-title span.accent-hand {
  font-family: var(--font-hand);
  color: var(--terracotta);
  font-size: 1.15em;
  font-weight: normal;
  display: inline-block;
  transform: rotate(-2deg);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* Highlight Pills */
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
}

.pill-item {
  background: var(--bg-card);
  border: 1px solid var(--pencil-line);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

/* CTA */
.cta-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.play-store-btn {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.play-store-btn img {
  height: 60px;
  display: block;
}

.play-store-btn:hover {
  transform: translateY(-3px) scale(1.03);
}

/* Banner Feature Graphic */
.feature-graphic-wrapper {
  max-width: 960px;
  margin: 0 auto 60px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--pencil-line-strong);
  background: var(--bg-card);
  position: relative;
}

.feature-graphic-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Trailer Video Showcase
   ========================================================================== */

.trailer-wrapper {
  max-width: 960px;
  margin: 0 auto 60px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--pencil-line-strong);
  background: var(--bg-card);
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.trailer-wrapper:hover {
  box-shadow: 0 20px 42px rgba(35, 32, 29, 0.16);
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  background: #000;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.trailer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 18px;
  background: var(--bg-paper-warm);
  border-top: 1px solid var(--pencil-line);
}

.trailer-yt-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
}

.trailer-yt-link:hover {
  color: #c4302b;
  transform: translateY(-1px);
}

.trailer-yt-link .yt-icon {
  color: #ff0000;
  flex-shrink: 0;
  display: block;
}

.trailer-yt-link .external-arrow {
  font-size: 0.9em;
  opacity: 0.7;
}

/* ==========================================================================
   Screenshots Carousel & Lightbox
   ========================================================================== */

.showcase-section {
  padding: 20px 0 60px;
  text-align: center;
}

.section-header {
  margin-bottom: 32px;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pencil-dark);
  margin-bottom: 8px;
}

.section-subtitle {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--terracotta);
}

.carousel-container {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.carousel-viewport {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 20px 10px 30px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.carousel-viewport::-webkit-scrollbar {
  display: none;
}

.screenshot-card {
  flex: 0 0 auto;
  scroll-snap-align: center;
  cursor: zoom-in;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--pencil-line);
  background: var(--bg-card);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.screenshot-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.screenshot-card img {
  height: 480px;
  width: auto;
  display: block;
}

/* Foldable screenshots are landscape (16:9): same height would be too wide. */
.screenshot-card-wide img {
  height: 420px;
}

.carousel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--pencil-line-strong);
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.carousel-btn:hover {
  background: var(--pencil-dark);
  color: #FFFFFF;
  border-color: var(--pencil-dark);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pencil-line-strong);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dot.active {
  background: var(--terracotta);
  width: 24px;
  border-radius: var(--radius-full);
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--terracotta);
  color: white;
  border: 2px solid white;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Stats Strip
   ========================================================================== */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--pencil-line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin: 40px 0 70px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--terracotta);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   Features Grid
   ========================================================================== */

.features-section {
  padding: 40px 0 80px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--pencil-line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  transition: background-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--pencil-line-strong);
}

.feature-card:hover::before {
  background: var(--terracotta);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg-paper-warm);
  border: 1px solid var(--pencil-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.feature-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--pencil-dark);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

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

/* ==========================================================================
   Bottom Download Callout
   ========================================================================== */

.download-banner {
  background: linear-gradient(135deg, var(--pencil-dark) 0%, #2F2B28 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
  margin-bottom: 80px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.download-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(188, 72, 54, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.download-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.download-subtitle {
  color: #D6D3D1;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 32px;
}

/* ==========================================================================
   Legal & Privacy Pages
   ========================================================================== */

.legal-page {
  padding: 40px 0 80px;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--pencil-line);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-sm);
}

.legal-header {
  border-bottom: 2px solid var(--pencil-line);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.legal-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--pencil-dark);
  margin-bottom: 8px;
}

.legal-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.legal-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--pencil-dark);
  margin: 32px 0 12px;
}

.legal-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.legal-content ul {
  padding-left: 24px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.legal-content li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.highlight-box {
  background: var(--terracotta-light);
  border-left: 4px solid var(--terracotta);
  padding: 20px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
}

.highlight-box h3 {
  color: var(--terracotta);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.highlight-box p {
  margin-bottom: 0;
  color: var(--text-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  background: var(--bg-paper-warm);
  border-top: 1px solid var(--pencil-line);
  padding: 50px 0 30px;
  margin-top: auto;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--terracotta);
}

.copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .hero {
    padding: 40px 0 24px;
  }
  
  .screenshot-card img {
    height: 380px;
  }

  .screenshot-card-wide img {
    height: auto;
    width: 86vw;
  }
  
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 24px 16px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .legal-card {
    padding: 24px;
  }

  .trailer-wrapper {
    margin-bottom: 40px;
    border-radius: var(--radius-md);
  }

  .trailer-footer {
    padding: 8px 14px;
  }
}
