/* ============================================
   LIBAROO LANDING — "The Reading Room"
   Warm literary aesthetic, modern execution
   ============================================ */

:root {
  --gold: #D4943A;
  --gold-light: #E8B06A;
  --gold-glow: rgba(212, 148, 58, 0.15);
  --teal: #5CBCCA;
  --teal-dim: rgba(92, 188, 202, 0.08);

  --night: #141210;
  --night-warm: #1E1B17;
  --night-surface: #272320;
  --cream: #F0E6D6;
  --cream-light: #FAF5ED;
  --parchment: #E8DDD0;
  --ink: #1A1612;
  --text-on-dark: #E8E0D4;
  --text-muted-dark: #9A8E80;
  --text-muted-light: #7A7068;

  --success: #6B9E6B;
  --error: #C25050;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Figtree', system-ui, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;

  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- RESET ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ---- GRAIN OVERLAY ---- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
  mix-blend-mode: overlay;
}

/* ---- CONTAINER ---- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ---- TOP BAR ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
}

.topbar-logo { height: 40px; width: auto; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 6px 18px;
  border: 1px solid rgba(232, 224, 212, 0.15);
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-muted-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: var(--transition);
}

.lang-switch:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  text-decoration: none;
}

/* ---- HERO ---- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(170deg, var(--night) 0%, var(--night-warm) 50%, #1F1914 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 70vw;
  height: 70vw;
  max-width: 800px;
  max-height: 800px;
  background: radial-gradient(ellipse, var(--gold-glow) 0%, transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(ellipse, var(--teal-dim) 0%, transparent 65%);
  pointer-events: none;
}

/* Decorative book spines */
.hero-decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.book-spine {
  position: absolute;
  border-radius: 3px;
  opacity: 0.05;
}

.book-spine--1 { width: 18px; height: 130px; background: var(--gold); top: 12%; right: 7%; transform: rotate(11deg); }
.book-spine--2 { width: 14px; height: 95px; background: var(--teal); top: 18%; right: 11%; transform: rotate(7deg); }
.book-spine--3 { width: 22px; height: 150px; background: var(--gold-light); bottom: 20%; left: 4%; transform: rotate(-5deg); }
.book-spine--4 { width: 12px; height: 85px; background: var(--teal); bottom: 28%; left: 9%; transform: rotate(-14deg); }
.book-spine--5 { width: 16px; height: 110px; background: var(--gold); top: 45%; right: 3%; transform: rotate(2deg); }
.book-spine--6 { width: 20px; height: 70px; background: var(--gold-light); top: 65%; left: 7%; transform: rotate(8deg); }

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-lg) 0 var(--space-2xl);
  position: relative;
  z-index: 1;
}

/* Decorative ornament */
.hero-ornament {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--space-lg);
  color: var(--gold);
  opacity: 0;
  animation: fadeIn 0.8s var(--ease) 0.2s forwards;
}

.hero-ornament::before,
.hero-ornament::after {
  content: '';
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.hero-ornament::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero-ornament svg { width: 14px; height: 14px; }

/* Hero typography */
.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  line-height: 1.08;
  color: var(--text-on-dark);
  margin-bottom: var(--space-md);
  max-width: 700px;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: slideUp 0.9s var(--ease) 0.35s forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--gold-light);
}

.hero-subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 400;
  color: var(--text-muted-dark);
  max-width: 480px;
  margin-bottom: var(--space-xl);
  line-height: 1.75;
  opacity: 0;
  animation: slideUp 0.9s var(--ease) 0.55s forwards;
}

/* ---- NEWSLETTER FORM ---- */
.newsletter-form {
  width: 100%;
  max-width: 440px;
  background: rgba(39, 35, 32, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(232, 224, 212, 0.07);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  opacity: 0;
  animation: slideUp 0.9s var(--ease) 0.75s forwards;
}

.newsletter-form input[type="email"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 14px 18px;
  border: 1px solid rgba(232, 224, 212, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-on-dark);
  outline: none;
  transition: var(--transition);
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--text-muted-dark);
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: var(--space-sm) 0;
}

.consent-row input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.consent-row label {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-muted-dark);
  cursor: pointer;
}

.btn-primary {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--night);
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(212, 148, 58, 0.3);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.form-message {
  margin-top: var(--space-sm);
  font-size: 0.88rem;
  font-weight: 600;
  display: none;
  text-align: center;
}

.form-message--success { color: var(--success); }
.form-message--error { color: var(--error); }

[aria-invalid="true"] { border-color: var(--error) !important; }

/* ---- HERO TAGS ---- */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: var(--space-xl);
  opacity: 0;
  animation: fadeIn 0.8s var(--ease) 1.1s forwards;
}

.hero-tag {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid rgba(232, 224, 212, 0.08);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted-dark);
  letter-spacing: 0.02em;
  transition: var(--transition);
}

.hero-tag:hover {
  border-color: rgba(212, 148, 58, 0.3);
  color: var(--gold-light);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted-dark);
  opacity: 0;
  animation: fadeIn 0.8s var(--ease) 1.6s forwards;
}

.scroll-hint span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.scroll-hint svg {
  width: 18px;
  height: 18px;
  animation: bobble 2s ease-in-out infinite;
}

/* ---- FEATURES (LIGHT) ---- */
.section-light {
  background: var(--cream);
  position: relative;
}

.section-header {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-xl);
}

.section-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  color: var(--ink);
  line-height: 1.2;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  padding-bottom: var(--space-3xl);
}

.feature-card {
  background: var(--cream-light);
  border: 1px solid var(--parchment);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  /* scroll reveal */
  opacity: 0;
  transform: translateY(32px);
}

.feature-card.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold);
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(26, 22, 18, 0.1);
  border-color: transparent;
}

.feature-card.revealed:hover {
  transform: translateY(-6px);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--gold-glow);
  color: var(--gold);
  margin-bottom: var(--space-md);
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  background: var(--gold);
  color: var(--night);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-muted-light);
  line-height: 1.65;
}

/* ---- CTA (DARK) ---- */
.section-dark {
  background: linear-gradient(170deg, var(--night-warm) 0%, var(--night) 100%);
  position: relative;
  overflow: hidden;
}

.section-dark::before {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -10%;
  width: 55vw;
  height: 55vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(ellipse, var(--teal-dim) 0%, transparent 60%);
  pointer-events: none;
}

.cta-content {
  text-align: center;
  padding: var(--space-3xl) 0;
  position: relative;
  z-index: 1;
}

.cta-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  color: var(--text-on-dark);
  margin-bottom: var(--space-xs);
  line-height: 1.2;
}

.cta-subtitle {
  color: var(--text-muted-dark);
  margin-bottom: var(--space-lg);
  font-size: 1rem;
}

.cta-content .newsletter-form {
  margin: 0 auto;
  animation: none;
  opacity: 1;
}

/* ---- FOOTER ---- */
.footer {
  background: var(--night);
  border-top: 1px solid rgba(232, 224, 212, 0.05);
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer-logo { height: 28px; width: auto; opacity: 0.6; }

.footer-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-muted-dark);
  transition: var(--transition);
}

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

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted-dark);
  opacity: 0.5;
}

/* ---- ANIMATIONS ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bobble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---- RESPONSIVE ---- */
@media (min-width: 640px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .features-grid { gap: var(--space-lg); }
  .feature-card { padding: var(--space-lg) var(--space-lg); }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .hero-tags { gap: 8px; }
  .hero-tag { padding: 6px 14px; font-size: 0.78rem; }
  .scroll-hint { display: none; }
}

/* ---- UTILITIES ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .feature-card { opacity: 1; transform: none; }
}
