/* ============================================================
   OpenClaw AI Tools — style.css
   ترتيب: متغيرات → reset → layout → typography → components → animations
   ============================================================ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────── */
:root {
  --primary: #0f172a;
  --accent-1: #6366f1;
  --accent-2: #06b6d4;
  --accent-3: #8b5cf6;
  --surface: #1e293b;
  --card-bg: #0f1e35;
  --text-primary: #f1f5f9;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(99, 102, 241, 0.4);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-hero: linear-gradient(
    135deg,
    #0f172a 0%,
    #1e1b4b 50%,
    #0c4a6e 100%
  );
  --gradient-text: linear-gradient(
    135deg,
    var(--accent-1),
    var(--accent-2),
    var(--accent-3)
  );
  --radius: 12px;
  --radius-lg: 20px;
  --nav-height: 72px;
}

/* ── 2. RESET & BASE ──────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-1) var(--surface);
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-1);
  border-radius: 3px;
}

body {
  background-color: var(--primary);
  color: var(--text-primary);
  font-family: "Tajawal", sans-serif;
  font-size: 1.0625rem; /* 17px — أوضح للقراءة */
  line-height: 1.85;
  direction: rtl;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}
ul,
ol {
  list-style: none;
}

/* ── 3. TYPOGRAPHY ───────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6,
.nav-link,
.btn {
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}
h3 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}
p {
  line-height: 1.85;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: gradientShift 4s linear infinite;
}

/* ── 4. LAYOUT UTILITIES ─────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0.75rem auto 0;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* skip link */
.skip-link {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-1);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 9999;
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  transition: 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ── 5. SCROLL PROGRESS BAR ──────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-text);
  transform-origin: right;
  transform: scaleX(0);
  z-index: 10000;
  transition: transform 0.1s linear;
}

/* ── 6. CURSOR GLOW ──────────────────────────────────────── */
#cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.08) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

/* ── 7. NAVBAR ───────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

#navbar.scrolled {
  height: 60px;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "Cairo", sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
}

.nav-logo svg {
  width: 36px;
  height: 36px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  transition: var(--transition);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 1rem;
  left: 1rem;
  height: 2px;
  background: var(--gradient-text);
  transform: scaleX(0);
  transition: var(--transition);
  border-radius: 2px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}
.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

/* hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 30px;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* mobile nav */
.nav-mobile {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  left: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 999;
  transform: translateX(100%);
  transition: var(--transition);
}
.nav-mobile.open {
  transform: translateX(0);
}
.nav-mobile .nav-link {
  font-size: 1.5rem;
}

/* ── 8. BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  font-family: "Cairo", sans-serif;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  border: 2px solid var(--accent-2);
  color: var(--accent-2);
  background: transparent;
}
.btn-secondary:hover {
  background: rgba(6, 182, 212, 0.1);
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.3);
}

/* ripple */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}

/* ── 9. HERO SECTION ─────────────────────────────────────── */
#hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gradient-hero);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.4;
}

.hero-orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-1);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}
.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-2);
  bottom: 10%;
  left: 5%;
  animation-delay: -3s;
}
.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--accent-3);
  top: 40%;
  left: 30%;
  animation-delay: -6s;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 2rem 1.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--accent-2);
  margin-bottom: 1.5rem;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 2s ease-in-out infinite;
}

.hero-headline {
  margin-bottom: 1rem;
}

.hero-subline {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

#typewriter-line {
  font-family: "Cairo", sans-serif;
  font-size: 1.1rem;
  color: var(--accent-2);
  margin-bottom: 2rem;
  min-height: 1.7em;
}

#typewriter-line .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent-2);
  margin-right: 2px;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.scroll-indicator .arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  animation: bounceDown 1.5s ease-in-out infinite;
}

/* floating shapes */
.hero-shapes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.shape {
  position: absolute;
  opacity: 0.08;
  animation: shapeFloat 10s ease-in-out infinite;
}
.shape-hex {
  width: 80px;
  height: 80px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--accent-1);
}
.shape-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--accent-2);
}

/* ── 10. TOOLS GRID ──────────────────────────────────────── */
#tools {
  background: var(--primary);
}

.tool-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(12px);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
  opacity: 0;
  transition: var(--transition);
}

.tool-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(99, 102, 241, 0.2);
}
.tool-card:hover::before {
  opacity: 1;
}

.tool-card__icon {
  width: 52px;
  height: 52px;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-card__icon svg {
  width: 100%;
  height: 100%;
  color: #fff;
}

.tool-card__name {
  font-family: "Cairo", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tool-card__desc {
  font-size: 0.95rem;
  color: #b8c8d8;
  margin-bottom: 1rem;
  line-height: 1.8;
}

.tool-card__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

/* رابط GitHub داخل البطاقة */
.tool-card__github {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.tool-card__github svg {
  flex-shrink: 0;
  color: var(--text-muted);
}
.tool-card__github a {
  font-size: 0.78rem;
  color: var(--accent-2);
  font-family: "Courier New", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}
.tool-card__github a:hover {
  color: #fff;
}

/* زر التفاصيل */
.btn-detail {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Cairo", sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-1);
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
  transition: var(--transition);
}
.btn-detail:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
  border-color: var(--accent-1);
  gap: 0.65rem;
}
.tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-2);
}

.tool-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ── 11. STATS BAR ───────────────────────────────────────── */
#stats {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(6, 182, 212, 0.1)
  );
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  gap: 2rem;
}

.stat-item {
  padding: 2rem 1rem;
}
.stat-number {
  font-family: "Cairo", sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 0.25rem;
}
.stat-label {
  color: #b8c8d8;
  font-size: 1rem;
  font-weight: 500;
}

/* ── 12. USE-CASES CAROUSEL ──────────────────────────────── */
#use-cases-preview {
  overflow: hidden;
}

.carousel-wrapper {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 1.5rem;
  display: flex;
  padding: 1rem 0.5rem 2rem;
}
.carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.carousel-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
}
.carousel-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}
.carousel-card__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.carousel-card__title {
  font-family: "Cairo", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.carousel-card__desc {
  font-size: 0.92rem;
  color: #b0c0d0;
  margin-bottom: 1rem;
  line-height: 1.8;
}
.carousel-card a {
  font-family: "Cairo", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}
.carousel-card a:hover {
  gap: 0.6rem;
}

/* ── 13. WHY SECTION ─────────────────────────────────────── */
#why {
  background: var(--surface);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.why-card {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.why-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.why-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2),
    rgba(6, 182, 212, 0.2)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: iconPulse 3s ease-in-out infinite;
}

/* ── 14. NEWSLETTER ──────────────────────────────────────── */
#newsletter {
  background: linear-gradient(135deg, #1e1b4b, #0c4a6e);
  position: relative;
  overflow: hidden;
}
#newsletter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(99, 102, 241, 0.2),
    transparent 70%
  );
}
.newsletter-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 1.5rem;
}
.newsletter-inner h2 {
  margin-bottom: 0.5rem;
}
.newsletter-inner p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 500px;
  margin: 0 auto;
}
.newsletter-form input {
  flex: 1;
  min-width: 220px;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: "Tajawal", sans-serif;
  font-size: 1rem;
  direction: rtl;
  outline: none;
  transition: var(--transition);
}
.newsletter-form input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}
.newsletter-form input::placeholder {
  color: var(--text-muted);
}

/* ── 15. FOOTER ──────────────────────────────────────────── */
#footer {
  background: rgba(10, 15, 28, 0.98);
  border-top: 1px solid var(--border);
  position: relative;
}

.footer-wave {
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  overflow: hidden;
  line-height: 0;
}
.footer-wave svg {
  width: 100%;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding: 4rem 0 2rem;
}

.footer-brand {
}
.footer-brand .nav-logo {
  margin-bottom: 1rem;
}
.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.footer-col h4 {
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.footer-col ul li {
  margin-bottom: 0.5rem;
}
.footer-col ul li a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: var(--transition);
}
.footer-col ul li a:hover {
  color: var(--accent-2);
}

.footer-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.footer-social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.footer-social-btn:hover {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
  transform: translateY(-3px);
}
.footer-social-btn svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── 16. BACK TO TOP ─────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 900;
}
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
#back-to-top:hover {
  transform: scale(1.1) translateY(-2px);
}
#back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ── 17. SCROLL ANIMATIONS ───────────────────────────────── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}
.animate-on-scroll.slide-right {
  transform: translateX(-30px);
}
.animate-on-scroll.slide-left {
  transform: translateX(30px);
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* stagger delays */
.delay-1 {
  transition-delay: 0.1s;
}
.delay-2 {
  transition-delay: 0.2s;
}
.delay-3 {
  transition-delay: 0.3s;
}
.delay-4 {
  transition-delay: 0.4s;
}
.delay-5 {
  transition-delay: 0.5s;
}
.delay-6 {
  transition-delay: 0.6s;
}

/* page fade-in */
body {
  animation: pageFadeIn 0.5s ease;
}

/* ── 18. COMPARISON PAGE ─────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}
.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-family: "Cairo", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
}
.filter-btn:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}
.filter-btn.active {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.comparison-table thead tr {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}
.comparison-table th {
  padding: 1rem 1.25rem;
  text-align: right;
  font-family: "Cairo", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}
.comparison-table th:hover {
  color: var(--accent-2);
}
.comparison-table th .sort-icon {
  margin-right: 0.3rem;
  opacity: 0.4;
}
.comparison-table th.sorted .sort-icon {
  opacity: 1;
  color: var(--accent-2);
}

.comparison-table tbody tr {
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}
.comparison-table tbody tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.3);
}
.comparison-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.08);
}
.comparison-table tbody tr.hidden {
  display: none;
}

.comparison-table td {
  padding: 0.9rem 1.25rem;
  font-size: 0.9rem;
  vertical-align: middle;
  white-space: nowrap;
}

.td-tool {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 160px;
}
.td-tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.td-tool-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}
.td-tool-name {
  font-family: "Cairo", sans-serif;
  font-weight: 700;
}

.stars {
  color: #fbbf24;
  letter-spacing: 2px;
}

.cpu-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}
.cpu-badge.low {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.cpu-badge.medium {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.cpu-badge.high {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.score-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
}
.score-badge.gold {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}
.score-badge.silver {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.score-badge.bronze {
  background: rgba(180, 83, 9, 0.2);
  color: #d97706;
  border: 1px solid rgba(180, 83, 9, 0.3);
}

.best-cell {
  position: relative;
}
.best-cell::after {
  content: "⭐";
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  font-size: 0.75rem;
}

/* ── 19. INSTALLATION PAGE ───────────────────────────────── */
.tabs-wrapper {
  overflow-x: auto;
}
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  min-width: max-content;
  justify-content: center;
}
.tab-btn {
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-family: "Cairo", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface);
}
.tab-btn.active {
  color: var(--accent-2);
  border-color: var(--accent-2);
  background: rgba(6, 182, 212, 0.1);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: tabFadeIn 0.4s ease;
}

.install-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 2rem;
}

.install-header {
  background: var(--surface);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
}

.install-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.install-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.install-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.platform-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.time-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-1);
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.github-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--accent-2);
  font-weight: 600;
  transition: var(--transition);
}
.github-link:hover {
  color: var(--accent-3);
}

.install-body {
  padding: 2rem;
}

.prereq-section {
  margin-bottom: 2rem;
}
.prereq-section h3 {
  margin-bottom: 1rem;
  color: var(--accent-2);
}
.prereq-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.prereq-item {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.steps-section h3 {
  margin-bottom: 1.5rem;
}
.step {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cairo", sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
}
.step-content h4 {
  font-family: "Cairo", sans-serif;
  margin-bottom: 0.5rem;
}
.step-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* code blocks */
.code-block {
  position: relative;
  background: #0d1117;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
}
.code-block pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #e6edf3;
  font-family: "Courier New", monospace;
}
.copy-btn {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: "Cairo", sans-serif;
  font-weight: 600;
  transition: var(--transition);
}
.copy-btn:hover {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
}
.copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

.tips-section {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
}
.tips-section h3 {
  color: var(--accent-3);
  margin-bottom: 1rem;
}
.tips-section ul li {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.3rem 0;
  padding-right: 1.25rem;
  position: relative;
}
.tips-section ul li::before {
  content: "→";
  position: absolute;
  right: 0;
  color: var(--accent-2);
}

/* ── 20. USE-CASES PAGE ──────────────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.use-case-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.use-case-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(
    circle at top right,
    rgba(99, 102, 241, 0.1),
    transparent
  );
}
.use-case-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.use-case-card.featured {
  grid-column: span 2;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(6, 182, 212, 0.05)
  );
  border-color: rgba(99, 102, 241, 0.3);
}

.uc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}
.uc-icon {
  font-size: 2.5rem;
  line-height: 1;
}
.uc-badge {
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: "Cairo", sans-serif;
  white-space: nowrap;
}
.badge-commerce {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.badge-finance {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.badge-health {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-tech {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.badge-marketing {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.badge-hr {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.badge-industry {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.badge-social {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.uc-title {
  font-family: "Cairo", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.uc-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.uc-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.uc-tool-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent-2);
  font-family: "Cairo", sans-serif;
  font-weight: 600;
}

.uc-roi {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  color: #4ade80;
  font-family: "Cairo", sans-serif;
  font-weight: 600;
}

/* ── 21. PAGE HEADER ─────────────────────────────────────── */
.page-header {
  padding: 8rem 0 4rem;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(30, 27, 75, 0.8) 0%,
    transparent 100%
  );
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(99, 102, 241, 0.15),
    transparent 60%
  );
}
.page-header > * {
  position: relative;
  z-index: 1;
}
.page-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0.75rem auto 0;
  font-size: 1.1rem;
}

/* ── 22. KEYFRAMES ───────────────────────────────────────── */
@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes orbFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-20px, -30px) scale(1.05);
  }
  66% {
    transform: translate(20px, 15px) scale(0.97);
  }
}

@keyframes shapeFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(15deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

@keyframes iconPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0.1);
  }
}

@keyframes bounceDown {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
  }
  50% {
    transform: translateY(8px) rotate(45deg);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 23. RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .bento-grid {
    grid-template-columns: 1fr 1fr;
  }
  .use-case-card.featured {
    grid-column: span 1;
  }
  .why-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }
  .nav-links {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .why-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .tabs-nav {
    justify-content: flex-start;
  }
  h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  .newsletter-form {
    flex-direction: column;
  }
  .newsletter-form input {
    min-width: 100%;
  }
  .container {
    padding: 0 1rem;
  }
  .install-header {
    flex-direction: column;
  }
}

@media (min-width: 1440px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* focus-visible for keyboard nav */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}
