/* =========================================================
   LectureSub for Udemy — Landing Page Style (Reading Room theme)
   Crafted with editorial elegance, high contrast, and responsive layout
   ========================================================= */

:root {
  --bg: #fbf9f5;
  --surface: #ffffff;
  --surface-alt: #f4f1ea;
  --surface-dark: #141513;
  --ink: #141413;
  --muted: #5e6457;
  --muted-light: #889081;
  --line: #e5e1d7;
  --line-dark: #2a2c28;
  --accent: #c6ed61;
  --accent-text: #283709;
  --accent-soft: rgba(198, 237, 97, 0.16);
  --shadow-sm: 0 2px 8px rgba(20, 20, 19, 0.04);
  --shadow-md: 0 8px 30px rgba(20, 20, 19, 0.08);
  --shadow-lg: 0 20px 50px rgba(20, 20, 19, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --max-w: 1180px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
}

main {
  position: relative;
  z-index: 2;
}

.site-footer {
  position: relative;
  z-index: 2;
}

/* ================= React Bits Background Effects Layer ================= */
.bg-effects-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Ambient Floating Aurora Blobs */
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  -webkit-filter: blur(95px);
  pointer-events: none;
  will-change: transform, opacity;
}

.aurora-blob.blob-1 {
  width: 580px;
  height: 580px;
  top: -120px;
  right: -5%;
  background: radial-gradient(circle, rgba(198, 237, 97, 0.40) 0%, rgba(198, 237, 97, 0.12) 50%, transparent 75%);
  animation: floatBlob1 22s ease-in-out infinite alternate;
}

.aurora-blob.blob-2 {
  width: 620px;
  height: 620px;
  top: 18%;
  left: -12%;
  background: radial-gradient(circle, rgba(250, 224, 138, 0.32) 0%, rgba(250, 224, 138, 0.08) 55%, transparent 75%);
  animation: floatBlob2 28s ease-in-out infinite alternate;
}

.aurora-blob.blob-3 {
  width: 540px;
  height: 540px;
  top: 60%;
  right: 8%;
  background: radial-gradient(circle, rgba(158, 230, 202, 0.28) 0%, rgba(158, 230, 202, 0.06) 50%, transparent 75%);
  animation: floatBlob3 24s ease-in-out infinite alternate;
}

@keyframes floatBlob1 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.85; }
  50% { transform: translate(-80px, 60px) scale(1.12); opacity: 1; }
  100% { transform: translate(-40px, 120px) scale(0.95); opacity: 0.8; }
}

@keyframes floatBlob2 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.75; }
  50% { transform: translate(90px, -50px) scale(1.15); opacity: 0.95; }
  100% { transform: translate(50px, 80px) scale(0.92); opacity: 0.7; }
}

@keyframes floatBlob3 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  50% { transform: translate(-70px, -70px) scale(1.1); opacity: 0.9; }
  100% { transform: translate(60px, -30px) scale(0.96); opacity: 0.75; }
}

/* React Bits Dot Grid Matrix */
.bg-grid-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(24, 28, 20, 0.075) 1.25px, transparent 1.25px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 90% 75% at 50% 35%, black 40%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 35%, black 40%, transparent 95%);
  opacity: 0.92;
}

/* React Bits Mouse Spotlight Flashlight */
.bg-mouse-spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(650px circle at var(--mouse-x, 50vw) var(--mouse-y, 30vh), rgba(198, 237, 97, 0.22), rgba(248, 220, 130, 0.08) 40%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: background;
}

body.has-mouse .bg-mouse-spotlight {
  opacity: 1;
}

/* Interactive Floating Particles Canvas */
#bg-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.75;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================= Header ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 249, 245, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.brand-logo {
  border-radius: 7px;
  display: block;
}

.brand-text strong {
  font-weight: 800;
}

.brand-text span {
  font-weight: 450;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  transition: color 150ms ease;
}

.nav-link:hover {
  color: var(--ink);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 99px;
  transition: transform 150ms ease, background 150ms ease;
}

.header-cta:hover {
  background: #2a2c28;
  transform: translateY(-1px);
}

/* Language Switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-alt);
  padding: 3px 6px;
  border-radius: 99px;
  border: 1px solid var(--line);
  margin-left: 12px;
}

.lang-btn {
  background: none;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 99px;
  transition: all 120ms ease;
  line-height: 1;
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 20, 19, 0.08);
}

.lang-sep {
  font-size: 10px;
  color: var(--muted-light);
}

/* ================= Hero Section ================= */
.hero {
  padding: 72px 24px 60px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  color: #384230;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #7aa119;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(122, 161, 25, 0.2);
}

.hero h1 {
  font-size: clamp(38px, 5.5vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 800;
  margin-bottom: 20px;
}

.hero h1 span.highlight {
  background: linear-gradient(180deg, transparent 65%, var(--accent) 65%);
  padding: 0 4px;
}

.hero p.lead {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--muted);
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 12px;
  transition: all 180ms ease;
  box-shadow: 0 4px 14px rgba(20, 20, 19, 0.15);
}

.btn-primary:hover {
  background: #2a2c28;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 20, 19, 0.22);
}

.btn-primary svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 12px;
  transition: all 180ms ease;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: #c4c0b4;
  background: #ffffff;
  transform: translateY(-2px);
}

/* ================= Interactive Demo Preview ================= */
.demo-wrapper {
  max-width: 1024px;
  margin: 0 auto 100px;
  padding: 0 24px;
}

.demo-container {
  background: #111211;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.demo-topbar {
  background: #1a1c18;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #282a25;
}

.demo-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-dots {
  display: flex;
  gap: 6px;
}

.demo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.demo-dot.red { background: #ef5350; }
.demo-dot.yellow { background: #fbc02d; }
.demo-dot.green { background: #66bb6a; }

.demo-course-title {
  font-size: 13px;
  color: #adb3a4;
  font-weight: 500;
}

.demo-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(198, 237, 97, 0.12);
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid rgba(198, 237, 97, 0.25);
}

.demo-video-stage {
  height: 480px;
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: #1a1c18;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  user-select: none;
}

.demo-overlay-toolbar {
  align-self: flex-start;
  background: rgba(20, 21, 19, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #f8f6f0;
}

.demo-pair {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.demo-mode-tag {
  color: #a7ad9e;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 10px;
}

.demo-caption-board {
  align-self: center;
  width: 100%;
  max-width: 780px;
  text-align: center;
  position: relative;
  margin-bottom: 20px;
}

.demo-interactive-hint {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.caption-box {
  background: rgba(18, 19, 17, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 24px;
  display: inline-block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.demo-source-line {
  font-size: 21px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.4;
}

.word-token {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 140ms ease;
  position: relative;
}

.word-token:hover {
  background: rgba(198, 237, 97, 0.25);
  color: var(--accent);
}

.word-token.selected {
  background: var(--accent);
  color: #141413;
  font-weight: 700;
}

.demo-target-line {
  font-size: 16px;
  color: #d1d8c7;
  font-weight: 450;
  line-height: 1.4;
}

/* Demo Context Card */
.demo-lookup-card {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  background: #ffffff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  text-align: left;
  animation: cardFadeIn 180ms ease;
  z-index: 20;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.card-word {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.card-tag {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.card-meaning {
  font-size: 13px;
  line-height: 1.45;
  color: #384033;
  margin-bottom: 10px;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.card-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: all 120ms ease;
}

.card-btn.primary {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.card-btn.primary:hover {
  background: #2f342b;
}

/* ================= Features Grid ================= */
.features-section {
  max-width: var(--max-w);
  margin: 0 auto 120px;
  padding: 0 24px;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-head h2 {
  font-size: 34px;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--muted);
  font-size: 16px;
}

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(380px circle at var(--card-x, -200px) var(--card-y, -200px), rgba(198, 237, 97, 0.22), transparent 70%);
  opacity: 0;
  transition: opacity 250ms ease;
  pointer-events: none;
  border-radius: inherit;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(122, 161, 25, 0.35);
}

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

.feature-icon-box {
  width: 48px;
  height: 48px;
  background: var(--surface-alt);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon-box svg {
  width: 24px;
  height: 24px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.feature-card p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ================= Steps Guide ================= */
.guide-section {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 90px 24px;
  margin-bottom: 120px;
}

.guide-container {
  max-width: var(--max-w);
  margin: 0 auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step-item {
  position: relative;
}

.step-num {
  font-size: 44px;
  font-weight: 900;
  color: #e6e2d8;
  letter-spacing: -0.05em;
  margin-bottom: 6px;
  line-height: 1;
}

.step-item h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-item p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ================= Footer ================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 48px 24px;
  font-size: 13.5px;
  color: var(--muted);
}

.footer-container {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

/* ================= Responsive & Mobile Optimization ================= */
@media (max-width: 900px) {
  .features-grid, .steps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .demo-video-stage {
    height: 400px;
    padding: 16px;
  }
  .demo-source-line {
    font-size: 17px;
  }
  .demo-target-line {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  /* Throttle expensive blur & animations on mobile to guarantee 95+ Mobile PageSpeed */
  .aurora-blob {
    animation: none !important;
    filter: blur(48px) !important;
    -webkit-filter: blur(48px) !important;
    opacity: 0.6 !important;
  }
  .aurora-blob.blob-1 {
    width: 320px;
    height: 320px;
    top: -50px;
    right: -10%;
  }
  .aurora-blob.blob-2 {
    width: 340px;
    height: 340px;
    top: 25%;
    left: -15%;
  }
  .aurora-blob.blob-3 {
    display: none;
  }
  .bg-grid-pattern {
    background-size: 24px 24px;
  }
  .lang-btn {
    padding: 6px 10px;
    min-height: 36px;
    font-size: 12px;
  }
  .footer-links a {
    padding: 6px 4px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .aurora-blob {
    animation: none !important;
  }
  #bg-particles-canvas {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .header-container {
    padding: 14px 16px;
  }
  .nav-links {
    display: none;
  }
  .hero {
    padding: 48px 16px 40px;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions a {
    width: 100%;
    justify-content: center;
  }
  .demo-lookup-card {
    width: 280px;
    top: -120px;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}
