/* =============================================
   MATH-STYLE.CSS â€” PREMIUM MATH DESIGN
   ============================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-soft: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.2);
  --bg-color: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text-main: #0b1120;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #94a3b8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-focus: 0 0 0 4px var(--primary-glow);
  --shadow-card: 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 12px 16px -4px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease;
  --nav-height: 64px;
}

[data-theme="dark"] {
  --bg-color: #0a0d14;
  --surface: #161c2d;
  --surface-soft: #1d2540;
  --text-main: #f0f2f8;
  --text-muted: #8b95b8;
  --text-light: #5a6480;
  --border: rgba(99, 102, 241, 0.12);
  --border-focus: rgba(99, 102, 241, 0.22);
  --primary-glow: rgba(99, 102, 241, 0.15);
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb i {
  font-size: 0.75rem;
  opacity: 0.7;
}

.hero-breadcrumb {
  padding-bottom: 0;
  margin-bottom: -0.5rem;
}

/* Hero Section */
.hero-wrapper {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  padding: 3rem 0; /* Increased for better breathing room */
  width: 100%;
  max-width: 92%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  justify-items: center;
  gap: 3rem;
  min-height: auto; /* Removed fixed min-height to avoid merging issues */
}

.hero-content {
  max-width: 800px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  padding: 0.45rem 1.2rem;
  border-radius: 99px;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.hero-title-accent {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 600px;
}

/* Math Visual Composition */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1000px;
}

.math-visual-composition {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.math-circle-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  border: 2px solid rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  animation: pulseGlow 4s infinite ease-in-out;
}

.math-main-symbol {
  font-size: 8rem;
  color: var(--primary);
  filter: drop-shadow(0 0 30px var(--primary-glow));
  z-index: 2;
  animation: floatMain 6s infinite ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes floatMain {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-15px) rotate(5deg) scale(1.05); }
}

.floating-math-symbol {
  position: absolute;
  color: var(--primary-soft);
  opacity: 0.6;
  font-size: 2.2rem;
  z-index: 1;
  animation: orbit 8s infinite linear;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.s1 { top: 10%; left: 10%; animation-duration: 10s; font-size: 2.5rem; }
.s2 { top: 15%; right: 10%; animation-duration: 12s; font-size: 1.8rem; }
.s3 { bottom: 15%; left: 15%; animation-duration: 14s; font-size: 2rem; }
.s4 { bottom: 10%; right: 15%; animation-duration: 11s; font-size: 2.3rem; }

@keyframes orbit {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(15px, -15px) rotate(90deg); }
  50% { transform: translate(0, -30px) rotate(180deg); }
  75% { transform: translate(-15px, -15px) rotate(270deg); }
  100% { transform: translate(0, 0) rotate(360deg); }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.5; border-color: rgba(99, 102, 241, 0.1); }
  50% { transform: scale(1.1); opacity: 0.8; border-color: rgba(99, 102, 241, 0.3); }
}


/* Category Sections */
.category-title {
  display: flex;
  align-items: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  margin-top: 2rem;
  gap: 0.8rem;
  padding: 0.6rem 1.2rem;
  background: var(--surface);
  border-left: 6px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.calc-card:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.calc-card:hover .category-icon {
  transform: scale(1.1) translateX(5px);
  color: var(--primary-light);
}


.category-icon {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
  transition: var(--transition);
  display: inline-block;
}

.calc-card h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  margin: 0;
}

.calc-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Mobile Adjustments */
@media (max-width: 1200px) {
  .breadcrumb {
    justify-content: center;
  }
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 3.5rem 1.5rem;
    gap: 2rem;
  }
  .hero-content {
    margin: 0 auto;
    max-width: 800px;
  }
  .hero-eyebrow {
    justify-content: center;
  }
  .hero-visual {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 0.35rem 3rem !important;
  }

  .breadcrumb {
    width: 92%;
    max-width: 92%;
    margin: 0 auto;
    font-size: 0.7rem;
    padding-top: 1rem;
    text-align: left;
  }

  .hero {
    padding: 1.25rem 0;
    width: 92%;
    max-width: 92%;
    margin: 0 auto;
    text-align: left;
    min-height: auto;
  }

  .hero-content {
    margin: 0;
    width: 100%;
    max-width: 100%;
    text-align: left;
  }

  .hero-title {
    font-size: clamp(1.1rem, 5.5vw, 1.5rem);
    margin-bottom: 0.75rem;
    text-align: left;
  }

  .hero-title {
    font-size: clamp(1.1rem, 5.5vw, 1.5rem);
    margin-bottom: 0.75rem;
    text-align: left;
  }

  .hero-title br {
    display: none;
  }

  .hero-subtitle {
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 100%;
    text-align: left;
    margin: 0;
  }

  .hero-eyebrow {
    font-size: 0.6rem;
    padding: 0.35rem 0.8rem;
    justify-content: flex-start;
    width: fit-content;
    white-space: nowrap;
    max-width: none;
    margin-bottom: 1rem;
  }

  .calc-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .calc-card {
    padding: 1rem 1.25rem;
    display: grid !important;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "icon title"
      "desc desc";
    align-items: center;
    gap: 0.25rem 0.85rem;
    border-radius: 12px;
    position: relative;
  }

  .category-icon {
    grid-area: icon;
    width: 38px !important;
    height: 38px !important;
    font-size: 1rem !important;
    margin-bottom: 0 !important;
    border-radius: 10px;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .calc-card h3 {
    grid-area: title;
    font-size: 0.95rem;
    margin-bottom: 0 !important;
    color: var(--primary-light);
  }

  .calc-card p {
    grid-area: desc;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-top: 0.25rem;
    color: var(--text-secondary);
  }

  .calc-card .card-arrow {
    display: none;
  }

  .category-title {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    margin-top: 1rem;
    gap: 0.7rem;
    line-height: 1.2;
    background: var(--surface);
    border-left: 6px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.6rem 1.2rem;
    box-shadow: 0 2px 8px -4px var(--primary-glow);
  }
}

/* =============================================
   ULTRA-MOBILE OPTIMIZATION (STUNNING AESTHETICS)
   ============================================= */
@media (max-width: 546px) {
    /* HERO TITLE - Maximum Impact */
    h1, .hero-title, .card-title, .hero-title span { font-size: 2.1rem !important; letter-spacing: -0.03em !important; line-height: 1.1 !important; }
    .hero-subtitle { font-size: 1.05rem !important; line-height: 1.6 !important; opacity: 1; }
    .hero-eyebrow { font-size: 0.9rem !important; font-weight: 700 !important; }

    /* Other Typography (Balanced) */
    h2, .section-title, .category-title { font-size: 1.4rem !important; letter-spacing: -0.01em !important; }
    h3 { font-size: 1.2rem !important; }
    h4 { font-size: 1.05rem !important; }
    p, .footer-brand p, .calc-card p, .card-desc { font-size: 0.9rem !important; line-height: 1.6 !important; opacity: 1; }
    a, .nav-links a, .footer-col a, label, .input-label, .form-label, span, .breadcrumb { font-size: 0.85rem !important; }

    /* Spacing & Layout Optimization */
    .container, .navbar-inner, .hero, .footer-inner, .faq-section-wrap, .tool-container, .card {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .hero { padding-top: 2rem !important; padding-bottom: 2rem !important; min-height: auto !important; }
    .calc-grid, .grid, .calc-form { gap: 1rem !important; }
    .form-group { gap: 0.4rem !important; }
    
    /* Card & Component Refinement */
    .calc-card, .card, .tool-container, .result-box, .result-main, .result-item {
        padding: 1rem !important;
        border-radius: 14px !important;
        margin-bottom: 0.85rem !important;
    }
    
    .card-header { margin-bottom: 1.25rem !important; }
    .result-box { margin-top: 1.5rem !important; padding-top: 1.5rem !important; }

    /* Form Elements */
    .input-field, .search-bar, select {
        height: 44px !important;
        font-size: 0.95rem !important;
        padding: 0 0.85rem !important;
        border-radius: 10px !important;
    }

    .btn-primary, .btn-ghost, .btn-calculate, .btn-premium {
        height: 46px !important;
        padding: 0 1.25rem !important;
        font-size: 0.95rem !important;
        border-radius: 10px !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-top: 0.4rem !important;
    }

    /* Icon & Visual Scaling */
    .category-icon, .card-icon-wrap, .logo-icon, .divider-icon-box, .feature-icon-wrap, .step-num {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        font-size: 1rem !important;
    }
    
    .logo-text { font-size: 1.1rem !important; }
    
    /* Result Specifics */
    .result-value { font-size: 2.2rem !important; }
    .result-label, .res-label { font-size: 0.75rem !important; }
}

