/* ============================================================
   Raha Tools – Style System
   Light green theme, modern SaaS aesthetic
   ============================================================ */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  --primary:       #22c55e;
  --primary-light: #dcfce7;
  --primary-dark:  #16a34a;
  --primary-glow:  rgba(34, 197, 94, 0.25);

  --white: #ffffff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --text:          var(--gray-800);
  --text-muted:    var(--gray-500);
  --text-light:    var(--gray-400);
  --bg:            #f8fffe;
  --surface:       var(--white);
  --border:        var(--gray-200);

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-pill: 9999px;

  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.10);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.12);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn--primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}
.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--outline:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-light);
}
.btn--white {
  background: var(--white) !important;
  color: var(--primary-dark) !important;
  border-color: transparent !important;
}
.btn--white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.btn--lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

/* === PILLS === */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}
.pill--green { background: var(--primary-light); color: var(--primary-dark); }
.pill--gray  { background: var(--gray-100); color: var(--gray-500); }
.pill--outline { border: 1.5px solid var(--border); color: var(--gray-500); background: transparent; }

/* === CHIP === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--green-50);
  color: var(--primary-dark);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--green-200);
}
.chip svg { flex-shrink: 0; color: var(--primary); }

/* === SECTION HEADER === */
.section-header { text-align: center; margin-bottom: 48px; }
.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}
.section-desc {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}
.text-gradient {
  background: linear-gradient(135deg, var(--green-600) 0%, var(--green-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(248, 255, 254, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: var(--shadow-md); }
.header__inner {
  display: flex;
  align-items: center;
  height: 70px;
  gap: 32px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.logo__icon {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.logo__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo:hover .logo__icon { transform: scale(1.05) rotate(-3deg); }
.logo__text { color: var(--gray-800); }
.logo__accent { color: var(--primary-dark); }

/* Nav */
.nav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.nav__link {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
}
.nav__link:hover, .nav__link.active {
  color: var(--primary-dark);
  background: var(--primary-light);
}

/* Header Actions */
.header__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 70px; left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
  flex-direction: column;
  gap: 4px;
  z-index: 99;
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
  opacity: 0;
  transition: all var(--transition);
}
.mobile-nav.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}
.mobile-nav__link {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}
.mobile-nav__link:hover { background: var(--primary-light); color: var(--primary-dark); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f0fdf4 0%, #f8fffe 60%, var(--bg) 100%);
}
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.hero__orb--1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(34,197,94,0.18) 0%, transparent 70%);
  top: -100px; right: -100px;
}
.hero__orb--2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(74,222,128,0.12) 0%, transparent 70%);
  bottom: -50px; left: -50px;
}
.hero__orb--3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(187,247,208,0.2) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%,-50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%,-50%) scale(1.2); }
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--green-200);
  border-radius: var(--radius-pill);
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-dark);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  animation: fadeDown 0.6s ease both;
}
.badge__dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero__title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--gray-900);
  margin-bottom: 20px;
  animation: fadeUp 0.7s ease 0.1s both;
}

.hero__subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeUp 0.7s ease 0.2s both;
}
.hero__subtitle strong { color: var(--primary-dark); font-weight: 600; }

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
  animation: fadeUp 0.7s ease 0.3s both;
}

/* Stats */
.hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  animation: fadeUp 0.7s ease 0.4s both;
}
.stat { text-align: center; }
.stat__num { display: block; font-size: 22px; font-weight: 800; color: var(--gray-900); }
.stat__label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat__divider { width: 1px; height: 36px; background: var(--border); }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FEATURED TOOL SECTION
   ============================================================ */
.featured { padding: 100px 0; background: var(--white); }

.featured-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transition: box-shadow var(--transition);
}
.featured-card:hover { box-shadow: 0 24px 80px rgba(34,197,94,0.12); }

.featured-card__header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
  border-bottom: 1.5px solid var(--border);
  background: linear-gradient(135deg, var(--green-50) 0%, var(--white) 100%);
  flex-wrap: wrap;
}

.featured-card__icon {
  width: 60px; height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.featured-card__icon img { width: 100%; height: 100%; }

.featured-card__title { font-size: 22px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.featured-card__desc { font-size: 14px; color: var(--text-muted); }

.featured-card__badges { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* Editor Workspace */
.editor-workspace {
  position: relative;
  width: 100%;
  height: 700px;
  background: var(--gray-50);
  overflow: hidden;
}

.editor-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--gray-50);
  z-index: 10;
  transition: opacity 0.5s ease;
}
.editor-loading.hidden { opacity: 0; pointer-events: none; }
.editor-loading p { font-size: 16px; font-weight: 600; color: var(--gray-700); }
.editor-loading__hint { font-size: 12px; color: var(--text-muted); }
.editor-loading__hint code {
  background: var(--gray-200);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Spinner */
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--green-100);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Feature Chips */
.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 32px;
  border-top: 1.5px solid var(--border);
  background: var(--green-50);
}

/* ============================================================
   QUICK UPLOAD SECTION
   ============================================================ */
.quick-upload { padding: 40px 0 80px; }
.upload-container {
  max-width: 600px; margin: 0 auto;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  background: var(--white);
  padding: 56px 32px;
  text-align: center;
  transition: all var(--transition);
  box-shadow: 0 10px 40px rgba(0,0,0,0.06);
}
.upload-container.dragover {
  border-color: var(--primary);
  background: var(--green-50);
  transform: scale(1.02);
}
.upload-icon {
  width: 64px; height: 64px;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  margin: 0 auto 20px;
  transition: all var(--transition);
}
.upload-container.dragover .upload-icon {
  background: var(--primary); color: var(--white);
}
.upload-title { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.upload-or { font-size: 15px; color: var(--text-muted); margin-bottom: 24px; }
.upload-btn { cursor: pointer; display: inline-flex; }
.upload-hint { font-size: 13px; color: var(--text-light); margin-top: 24px; }

/* ============================================================
   TOOLS GRID
   ============================================================ */
.tools-section { padding: 100px 0; background: var(--bg); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}
.tool-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.tool-card--active { border-color: var(--green-300); background: var(--green-50); }
.tool-card--active:hover { border-color: var(--primary); box-shadow: 0 8px 32px var(--primary-glow); }
.tool-card--soon { opacity: 0.72; cursor: default; }
.tool-card--soon:hover { transform: none; box-shadow: var(--shadow-sm); }

.tool-card__icon {
  width: 52px; height: 52px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  flex-shrink: 0;
}
.tool-card__icon--green {
  background: linear-gradient(135deg, var(--primary) 0%, var(--green-600) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.tool-card__name { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.tool-card__desc { font-size: 13px; color: var(--text-muted); flex: 1; line-height: 1.5; }

/* ============================================================
   WHY SECTION
   ============================================================ */
.why-section { padding: 100px 0; background: var(--white); }

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.why-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--white);
  transition: all var(--transition);
}
.why-card:hover {
  border-color: var(--green-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: var(--green-50);
}

.why-card__icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--green-50) 0%, var(--green-100) 100%);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-dark);
  margin-bottom: 20px;
}

.why-card__title { font-size: 17px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.why-card__text { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-banner {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--green-600) 0%, var(--green-500) 50%, var(--green-400) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}
.cta-banner__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.cta-banner__content { text-align: left; }
.cta-banner__content h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.cta-banner__content p { font-size: 16px; color: rgba(255,255,255,0.8); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding: 64px 0 40px;
  flex-wrap: wrap;
}

.footer__brand {
  max-width: 260px;
}
.footer__brand .logo__text { color: var(--white); }
.footer__tagline { font-size: 14px; color: var(--gray-500); margin-top: 12px; line-height: 1.5; }

.footer__links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer__col { display: flex; flex-direction: column; gap: 10px; }
.footer__col h5 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--white);
  margin-bottom: 4px;
}
.footer__col a {
  font-size: 14px;
  color: var(--gray-500);
  transition: color var(--transition);
}
.footer__col a:hover { color: var(--primary); }

.footer__bottom {
  border-top: 1px solid var(--gray-800);
  padding: 20px 0;
}
.footer__bottom .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav { display: none; }
  .hamburger { display: flex; }
  .header__actions .btn { display: none; }

  .hero { padding: 100px 0 60px; }
  .hero__stats { gap: 20px; flex-wrap: wrap; }

  .featured-card__header { flex-direction: column; align-items: flex-start; }
  .featured-card__badges { margin-left: 0; }
  .editor-workspace { height: 500px; }

  .cta-banner__inner { flex-direction: column; text-align: center; }
  .cta-banner__content { text-align: center; }

  .footer__inner { flex-direction: column; }
  .footer__links { gap: 32px; }
  .footer__bottom .container { flex-direction: column; text-align: center; }

  .why-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { justify-content: center; }
  .stat__divider { display: none; }
  .hero__stats { gap: 16px; justify-content: center; }
  .feature-chips { padding: 16px; }
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
