/* ============================================
   TOOLSSIFY  -  Homepage Styles
   Hero, search, tool grids, categories,
   why section, stats, FAQ, newsletter, footer.
   ============================================ */

/* ============================================
   HEADER
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-primary);
  z-index: var(--z-sticky);
  transition: all var(--transition-base);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* The supplied logo includes generous white artwork padding. Crop it in CSS
   so the original file stays untouched while the visible mark keeps a stable
   size and anchor at every browser zoom level. */
.brand-logo-mark {
  position: relative;
  display: block;
  width: 152px;
  height: 42px;
  flex: 0 0 152px;
  overflow: hidden;
  background: #fff;
}

.brand-logo-mark img {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%) scale(2.15);
  transform-origin: center;
}

.brand-logo-mark--footer {
  border-radius: var(--radius-md);
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  background: #0080ff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-950);
}

.header-logo-text {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  letter-spacing: var(--tracking-tight);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Keep the generated Categories control self-contained. These critical
   dimensions live with the header so an older component stylesheet can never
   turn the inline SVG into its browser-default 300x150 box. */
.header-nav > .dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.header-nav > .dropdown > .header-nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.header-nav .header-dropdown-chevron {
  width: 14px;
  height: 14px;
  margin-left: 0;
  flex: 0 0 14px;
}

.header-nav-link {
  padding: 8px 14px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.header-nav-link:hover {
  color: var(--color-primary-800);
  background: var(--color-primary-50);
}

.header-nav-link.active {
  color: var(--color-primary-800);
  background: var(--color-primary-100);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-search-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.header-search-btn:hover {
  background: var(--color-primary-50);
  color: #0080ff;
}

.header-search-btn svg {
  width: 20px;
  height: 20px;
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: var(--color-primary-50);
  color: #0080ff;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.mobile-menu.active {
  pointer-events: auto;
  opacity: 1;
}

.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.5);
}

.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--color-white);
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

.mobile-menu.active .mobile-menu-panel {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 14px;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.mobile-menu-link:hover {
  background: var(--color-primary-50);
  color: var(--color-primary-800);
}

.mobile-menu-link svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .header-nav { display: none; }
  .mobile-menu-btn { display: flex; }

  .header-inner {
    padding: 0 var(--space-4);
  }
}


/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  padding: var(--space-24) 0 var(--space-16);
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-gray-25) 0%, var(--color-white) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 100%;
  background: radial-gradient(ellipse at center, var(--color-primary-50) 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.hero-illustration {
  position: absolute;
  z-index: 0;
  width: 230px;
  pointer-events: none;
  filter: drop-shadow(0 18px 24px rgba(16, 24, 40, 0.09));
  animation: pastelArtFloat 6s ease-in-out infinite;
}

.hero-illustration svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero-illustration-calculator {
  top: 54px;
  left: max(18px, calc(50% - 790px));
  transform: rotate(-3deg);
}

.hero-illustration-text {
  top: 82px;
  right: max(18px, calc(50% - 780px));
  transform: rotate(3deg);
  animation-delay: -2.8s;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px;
  background: var(--color-gray-100);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success-500);
  animation: pulse 2s ease-in-out infinite;
}

.hero h1 {
  font-size: var(--text-6xl);
  font-weight: var(--font-extrabold);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-6);
  color: var(--text-primary);
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-10);
  line-height: var(--leading-relaxed);
}

/* Hero search bar */
.hero-search {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
}

.hero-search-input {
  width: 100%;
  padding: 16px 56px 16px 24px;
  font-size: var(--text-base);
  background: var(--color-white);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  outline: none;
  transition: all var(--transition-base);
}

.hero-search-input:focus {
  border-color: var(--color-primary-400);
  box-shadow: var(--shadow-lg), 0 0 0 3px var(--color-primary-100);
}

.hero-search-input::placeholder {
  color: var(--text-quaternary);
}

.hero-search-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: #0080ff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-950);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.hero-search-icon:hover {
  background: var(--color-primary-700);
}

.hero-search-icon svg {
  width: 18px;
  height: 18px;
}

/* Hero stats strip */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  margin-top: var(--space-10);
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.hero-stat-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-16) 0 var(--space-12);
  }

  .hero h1 {
    font-size: var(--text-4xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  .hero-stats {
    gap: var(--space-5);
  }
}

@media (max-width: 1180px) {
  .hero-illustration {
    width: 165px;
    opacity: 0.58;
  }
}

@media (max-width: 960px) {
  .hero-illustration {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }
}


/* ============================================
   TOOLS GRID SECTIONS
   ============================================ */

.tools-section {
  padding: var(--space-16) 0;
}

.tools-section:nth-child(even) {
  background: var(--color-gray-25);
}

.tools-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.tools-section-header h2 {
  font-size: var(--text-2xl);
}

.tools-section-header .btn {
  flex-shrink: 0;
}

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

@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================
   CATEGORIES SECTION
   ============================================ */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-5);
}

#featured-categories {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-gray-25) 0%, #f8fbff 100%);
}

#featured-categories > .container {
  position: relative;
  z-index: 1;
}

.categories-section-art {
  position: absolute;
  top: 20px;
  right: max(8px, calc(50% - 720px));
  width: 230px;
  opacity: 0.82;
  pointer-events: none;
  transform: rotate(2deg);
}

.categories-section-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.categories-grid .category-card:nth-child(4n + 1) .category-card-icon {
  background: #dceeff;
  color: #0066cc;
}

.categories-grid .category-card:nth-child(4n + 2) .category-card-icon {
  background: #ffe2d1;
  color: #ad4f28;
}

.categories-grid .category-card:nth-child(4n + 3) .category-card-icon {
  background: #ddf5e8;
  color: #147552;
}

.categories-grid .category-card:nth-child(4n + 4) .category-card-icon {
  background: #e9e3ff;
  color: #654bb2;
}

@media (max-width: 1100px) {
  .categories-section-art {
    display: none;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ============================================
   WHY TOOLSSIFY SECTION
   ============================================ */

.why-section {
  padding: var(--space-20) 0;
  background: var(--color-gray-25);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-6);
}

.why-card {
  --card-pastel: var(--color-primary-50);
  --card-ink: var(--color-primary-700);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--color-white);
  border: 1px solid var(--border-primary);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.why-card::after {
  content: '';
  position: absolute;
  width: 82px;
  height: 82px;
  right: -32px;
  bottom: -38px;
  border-radius: 50%;
  background: var(--card-pastel);
  opacity: 0.65;
}

.why-card > * {
  position: relative;
  z-index: 1;
}

.why-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-ink) 28%, white);
  box-shadow: var(--shadow-lg);
}

.why-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--card-pastel);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--card-ink);
}

.why-card-sun { --card-pastel: #fff0bd; --card-ink: #8a5b00; }
.why-card-peach { --card-pastel: #ffe2d1; --card-ink: #a74724; }
.why-card-lavender { --card-pastel: #e9e3ff; --card-ink: #5d46a0; }
.why-card-mint { --card-pastel: #ddf5e8; --card-ink: #126b4a; }
.why-card-blue { --card-pastel: #dceeff; --card-ink: #005ebc; }
.why-card-rose { --card-pastel: #ffe2eb; --card-ink: #a83c62; }

.why-card-icon svg {
  width: 24px;
  height: 24px;
}

.why-card h4 {
  margin-bottom: var(--space-2);
  font-size: var(--text-base);
}

.why-card p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}


/* ============================================
   STATISTICS SECTION
   ============================================ */

.stats-section {
  padding: var(--space-20) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.stats-grid .stat-card {
  position: relative;
  overflow: hidden;
}

.stats-grid .stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: #b9ddff;
}

.stats-grid .stat-card:nth-child(2)::before { background: #c6eed9; }
.stats-grid .stat-card:nth-child(3)::before { background: #e0d6ff; }
.stats-grid .stat-card:nth-child(4)::before { background: #ffd9c7; }

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ============================================
   FAQ SECTION
   ============================================ */

.faq-section {
  padding: var(--space-20) 0;
  background: var(--color-gray-25);
}

.faq-container {
  min-width: 0;
}

.faq-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-10);
  max-width: 1060px;
  margin: 0 auto;
}

.faq-illustration {
  width: 100%;
  margin-top: var(--space-6);
  filter: drop-shadow(0 20px 28px rgba(16, 24, 40, 0.08));
}

.faq-illustration svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 820px) {
  .faq-layout {
    grid-template-columns: 1fr;
  }

  .faq-illustration {
    width: 190px;
    margin: 0 auto -10px;
  }
}


/* ============================================
   NEWSLETTER SECTION
   ============================================ */

.newsletter-section {
  padding: var(--space-20) 0;
}

.newsletter-box {
  max-width: 940px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: center;
  gap: var(--space-8);
  text-align: left;
  padding: var(--space-12);
  background: linear-gradient(135deg, #101828 0%, #17243a 100%);
  border-radius: var(--radius-2xl);
  color: var(--color-white);
  overflow: hidden;
  position: relative;
}

.newsletter-box::before {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  top: -100px;
  border: 36px solid rgba(0, 128, 255, 0.12);
  border-radius: 50%;
}

.newsletter-copy,
.newsletter-illustration {
  position: relative;
  z-index: 1;
}

.newsletter-kicker {
  display: block;
  margin-bottom: var(--space-3);
  color: #8fc9ff;
  font-size: 11px;
  font-weight: var(--font-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.newsletter-box h3 {
  color: var(--color-white);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

.newsletter-box p {
  color: var(--color-gray-400);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  max-width: 470px;
}

.newsletter-illustration {
  width: 100%;
}

.newsletter-illustration svg {
  display: block;
  width: 100%;
  height: auto;
}

.newsletter-form {
  display: flex;
  gap: var(--space-3);
  max-width: 440px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--color-gray-700);
  border-radius: var(--radius-md);
  background: var(--color-gray-800);
  color: var(--color-white);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

.newsletter-form input:focus {
  border-color: var(--color-primary-500);
}

.newsletter-form input::placeholder {
  color: var(--color-gray-500);
}

.newsletter-form .btn {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .newsletter-form {
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .newsletter-box {
    grid-template-columns: 1fr;
    gap: var(--space-5);
    padding: var(--space-8) var(--space-6);
    text-align: center;
  }

  .newsletter-box p {
    margin-left: auto;
    margin-right: auto;
  }

  .newsletter-illustration {
    width: 230px;
    margin: 0 auto;
  }
}

@keyframes pastelArtFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-illustration {
    animation: none;
  }
}


/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background: var(--color-gray-900);
  color: var(--color-gray-300);
  padding: var(--space-16) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  margin-top: var(--space-4);
  max-width: 280px;
  line-height: var(--leading-relaxed);
}

.footer-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

@media (max-width: 480px) {
  .brand-logo-mark {
    width: 132px;
    height: 38px;
    flex-basis: 132px;
  }
}

.footer-logo-icon {
  width: 36px;
  height: 36px;
  background: #0080ff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-950);
}

.footer-logo-text {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-white);
}

.footer-column h5 {
  color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-5);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-gray-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-gray-800);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-400);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--color-gray-700);
  color: var(--color-white);
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  border-top: 1px solid var(--color-gray-800);
  padding: var(--space-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-bottom-text {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-6);
}

.footer-bottom-links a {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link-button {
  padding: 0;
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  transition: color var(--transition-fast);
}

.footer-link-button:hover,
.footer-link-button:focus-visible {
  color: var(--color-gray-300);
}

.footer-bottom-links a:hover {
  color: var(--color-gray-300);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-brand {
    grid-column: span 2;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: span 1;
  }
}
