/* ========================================
   App Landing Page — Premium Tool Hub
   v2 — Marketing-focused redesign
   ======================================== */

/* ---- Hero ---- */
.appl-hero {
  position: relative;
  padding: 140px 0 80px;
  overflow: hidden;
  background: linear-gradient(160deg, #1d1729 0%, #2d1f4e 40%, #1d1729 100%);
  color: #fff;
}

.appl-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(114, 67, 242, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(114, 67, 242, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* Hero layout — text left, brain right */
.appl-hero__layout {
  display: flex;
  align-items: center;
  gap: 40px;
  position: relative;
  z-index: 1;
}

.appl-hero__content {
  flex: 1;
  min-width: 0;
  max-width: 600px;
}

.appl-hero__label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
}

.appl-hero__title {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  font-family: var(--ff-heading, 'Montserrat', sans-serif);
}

.appl-hero__accent {
  background: linear-gradient(135deg, #a78bfa, #7243f2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.appl-hero__sub {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 40px;
  max-width: 500px;
}

/* Stats bar */
.appl-hero__stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.appl-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.appl-stat__num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--ff-heading, 'Montserrat', sans-serif);
}

.appl-stat__label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  margin-top: 2px;
}

.appl-stat__divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.15);
}

/* ---- Sections ---- */
.appl-section {
  padding: 72px 0;
  background: #fff;
}

.appl-section--alt {
  background: #fafbfc;
  padding: 48px 0;
}

.appl-section__header {
  margin-bottom: 40px;
}

.appl-section__tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--color-accent-purple, #7243f2);
  margin-bottom: 8px;
}

.appl-section__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #1d1729;
  margin: 0;
  font-family: var(--ff-heading, 'Montserrat', sans-serif);
}

/* ---- Primary Grid (Calculators + AI) ---- */
.appl-primary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

/* ---- Feature Card ---- */
.appl-feature-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 32px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  position: relative;
  overflow: hidden;
}

.appl-feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent-purple, #7243f2), #a78bfa);
  opacity: 0;
  transition: opacity 0.35s;
}

.appl-feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(114, 67, 242, 0.12);
  border-color: rgba(114, 67, 242, 0.3);
}

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

.appl-feature-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.appl-feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-accent-purple, #7243f2), #9b6dff);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.appl-feature-card__icon--ai {
  background: linear-gradient(135deg, #1d1729, #4c2ea0);
}

.appl-feature-card__badges {
  display: flex;
  gap: 6px;
}

.appl-feature-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1d1729;
  margin: 0 0 8px;
}

.appl-feature-card__desc {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.55;
  margin: 0 0 20px;
}

/* Feature list */
.appl-feature-card__list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appl-feature-card__list li {
  font-size: 0.8125rem;
  color: #4b5563;
  padding-left: 20px;
  position: relative;
  line-height: 1.4;
}

.appl-feature-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(114, 67, 242, 0.15);
  border: 2px solid var(--color-accent-purple, #7243f2);
}

/* Formula chips */
.appl-feature-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.appl-feature-card__chips span {
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  color: var(--color-accent-purple, #7243f2);
  background: rgba(114, 67, 242, 0.06);
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

/* AI Flow visual */
.appl-feature-card__flow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 16px 12px;
  background: linear-gradient(135deg, #f9fafb, #f3f0ff);
  border-radius: 12px;
  border: 1px solid rgba(114, 67, 242, 0.08);
}

.appl-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.appl-flow-step__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(114, 67, 242, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-purple, #7243f2);
}

.appl-flow-step__icon--active {
  background: rgba(114, 67, 242, 0.15);
  color: var(--color-accent-purple, #7243f2);
}

.appl-flow-step__icon--success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.appl-flow-step span {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
}

.appl-flow-arrow {
  color: #d1d5db;
  flex-shrink: 0;
  display: flex;
}

/* Card CTA */
.appl-feature-card__cta {
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-accent-purple, #7243f2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.3s;
}

.appl-feature-card:hover .appl-feature-card__cta {
  gap: 10px;
}

/* ---- Badges ---- */
.appl-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1.2;
}

.appl-badge--free {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), rgba(5, 150, 105, 0.05));
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.appl-badge--pro {
  background: linear-gradient(135deg, #1d1729, #111);
  color: #fff;
}

.appl-badge--new {
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
  animation: applBadgePulse 2.4s ease-in-out infinite;
}
@keyframes applBadgePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* ---- Secondary Card (Diagram) ---- */
.appl-secondary-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px 32px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  max-width: 700px;
}

.appl-secondary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  border-color: rgba(114, 67, 242, 0.25);
}

.appl-secondary-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(114, 67, 242, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.appl-secondary-card__body {
  flex: 1;
  min-width: 0;
}

.appl-secondary-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.appl-secondary-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1d1729;
  margin: 0;
}

.appl-secondary-card__desc {
  font-size: 0.8125rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.5;
}

.appl-secondary-card__cta {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-accent-purple, #7243f2);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.3s;
}

.appl-secondary-card:hover .appl-secondary-card__cta {
  gap: 8px;
}

/* ---- Why Grid ---- */
.appl-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.appl-why-item {
  text-align: center;
  padding: 24px 16px;
}

.appl-why-item__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(114, 67, 242, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.appl-why-item h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1d1729;
  margin: 0 0 6px;
}

.appl-why-item p {
  font-size: 0.8125rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.5;
}

/* ---- Premium Pricing Section ---- */
.appl-pricing-section {
  position: relative;
  padding: 80px 0;
  background: linear-gradient(160deg, #1d1729 0%, #2d1f4e 50%, #1d1729 100%);
  overflow: hidden;
}

.appl-pricing-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 60% at 80% 20%, rgba(114, 67, 242, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 10% 80%, rgba(114, 67, 242, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* Trust bar under pricing */
.appl-pricing-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* Social proof avatars */
.appl-pricing-social {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}

.appl-pricing-social strong {
  color: rgba(255, 255, 255, 0.8);
}

.appl-pricing-social__avatars {
  display: flex;
}

.appl-pricing-social__avatars span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-purple, #7243f2), #9b6dff);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1d1729;
  margin-left: -6px;
}

.appl-pricing-social__avatars span:first-child {
  margin-left: 0;
}

/* ---- Sticky PRO CTA (shown on tool pages) ---- */
.sticky-pro-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--color-accent-purple, #7243f2), #9b6dff);
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(114, 67, 242, 0.35);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: stickySlideUp 0.5s ease-out;
}

.sticky-pro-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(114, 67, 242, 0.45);
}

.sticky-pro-cta svg {
  stroke: #fbbf24;
  flex-shrink: 0;
}

.sticky-pro-cta__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.sticky-pro-cta__text small {
  font-weight: 400;
  font-size: 0.6875rem;
  opacity: 0.75;
}

@keyframes stickySlideUp {
  from { transform: translateY(80px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ========================================
   AI Brain Neural Network Animation
   ======================================== */
.appl-hero__brain {
  flex-shrink: 0;
  width: 340px;
  height: 340px;
  position: relative;
}

.brain-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 30px rgba(114, 67, 242, 0.15));
}

/* ---- Connection Lines ---- */
.brain-line {
  stroke: rgba(167, 139, 250, 0.12);
  stroke-width: 1;
  transition: stroke 0.3s;
}

/* Staggered line fade-in with breathing */
.brain-line--1,  .brain-line--5,  .brain-line--10, .brain-line--16 { animation: lineBreathe 4s ease-in-out infinite; }
.brain-line--2,  .brain-line--6,  .brain-line--11, .brain-line--17 { animation: lineBreathe 4s ease-in-out 0.5s infinite; }
.brain-line--3,  .brain-line--7,  .brain-line--12, .brain-line--18 { animation: lineBreathe 4s ease-in-out 1s infinite; }
.brain-line--4,  .brain-line--8,  .brain-line--13, .brain-line--19 { animation: lineBreathe 4s ease-in-out 1.5s infinite; }
.brain-line--9,  .brain-line--14, .brain-line--20               { animation: lineBreathe 4s ease-in-out 2s infinite; }
.brain-line--15, .brain-line--21                                 { animation: lineBreathe 4s ease-in-out 2.5s infinite; }

@keyframes lineBreathe {
  0%, 100% { stroke: rgba(167, 139, 250, 0.08); stroke-width: 1; }
  50%      { stroke: rgba(167, 139, 250, 0.3);  stroke-width: 1.5; }
}

/* ---- Nodes ---- */
.brain-node {
  transition: r 0.6s ease, opacity 0.6s;
}

.brain-node--core {
  fill: #7243f2;
  animation: nodeCorePulse 3s ease-in-out infinite;
}

.brain-node--mid {
  fill: rgba(167, 139, 250, 0.7);
  animation: nodeMidPulse 3.5s ease-in-out infinite;
}

.brain-node--inner {
  fill: rgba(167, 139, 250, 0.45);
  animation: nodeInnerPulse 4s ease-in-out infinite;
}

.brain-node--out {
  fill: rgba(114, 67, 242, 0.35);
  animation: nodeOutPulse 4.5s ease-in-out infinite;
}

@keyframes nodeCorePulse {
  0%, 100% { r: 12; fill: #7243f2; }
  50%      { r: 15; fill: #9b6dff; }
}

@keyframes nodeMidPulse {
  0%, 100% { r: 9; opacity: 0.7; }
  40%      { r: 11; opacity: 1; }
}

@keyframes nodeInnerPulse {
  0%, 100% { r: 7; opacity: 0.45; }
  50%      { r: 9; opacity: 0.8; }
}

@keyframes nodeOutPulse {
  0%, 100% { r: 6; opacity: 0.35; }
  60%      { r: 8; opacity: 0.7; }
}

/* ---- Glow rings on core ---- */
.brain-ring {
  fill: none;
  stroke: rgba(114, 67, 242, 0.3);
  stroke-width: 1;
}

.brain-ring--1 {
  animation: ringExpand1 3s ease-in-out infinite;
}

.brain-ring--2 {
  animation: ringExpand2 3s ease-in-out 1.5s infinite;
}

@keyframes ringExpand1 {
  0%   { r: 16; opacity: 0.6; stroke-width: 1.5; }
  100% { r: 40; opacity: 0;   stroke-width: 0.5; }
}

@keyframes ringExpand2 {
  0%   { r: 16; opacity: 0.4; stroke-width: 1; }
  100% { r: 50; opacity: 0;   stroke-width: 0.3; }
}

/* ---- Signal pulses traveling along paths ---- */
.brain-pulse {
  fill: #a78bfa;
  opacity: 0;
}

.brain-pulse--1 {
  animation: pulse1 3s ease-in-out 0s infinite;
}
.brain-pulse--2 {
  animation: pulse2 3.5s ease-in-out 0.7s infinite;
}
.brain-pulse--3 {
  animation: pulse3 4s ease-in-out 1.4s infinite;
}
.brain-pulse--4 {
  animation: pulse4 3.2s ease-in-out 2.1s infinite;
}
.brain-pulse--5 {
  animation: pulse5 3.8s ease-in-out 2.8s infinite;
}

/* Pulse 1: top → left-mid → bottom-left */
@keyframes pulse1 {
  0%   { cx: 200; cy: 80;  opacity: 0; r: 2; }
  5%   { opacity: 1; r: 4; }
  40%  { cx: 120; cy: 160; opacity: 1; r: 3; }
  80%  { cx: 80;  cy: 260; opacity: 0.5; r: 2; }
  100% { cx: 140; cy: 340; opacity: 0; r: 2; }
}

/* Pulse 2: top → right-mid → bottom-right */
@keyframes pulse2 {
  0%   { cx: 200; cy: 80;  opacity: 0; r: 2; }
  5%   { opacity: 1; r: 4; }
  40%  { cx: 280; cy: 160; opacity: 1; r: 3; }
  80%  { cx: 320; cy: 260; opacity: 0.5; r: 2; }
  100% { cx: 260; cy: 340; opacity: 0; r: 2; }
}

/* Pulse 3: top → center → bottom-center */
@keyframes pulse3 {
  0%   { cx: 200; cy: 80;  opacity: 0; r: 2; }
  5%   { opacity: 0.8; r: 3; }
  35%  { cx: 200; cy: 180; opacity: 1; r: 4; }
  70%  { cx: 240; cy: 260; opacity: 0.6; r: 3; }
  100% { cx: 200; cy: 340; opacity: 0; r: 2; }
}

/* Pulse 4: left-mid → cross to right-inner */
@keyframes pulse4 {
  0%   { cx: 120; cy: 160; opacity: 0; r: 2; }
  10%  { opacity: 1; r: 3; }
  60%  { cx: 240; cy: 260; opacity: 0.8; r: 3; }
  100% { cx: 260; cy: 340; opacity: 0; r: 2; }
}

/* Pulse 5: right-mid → cross to left-inner */
@keyframes pulse5 {
  0%   { cx: 280; cy: 160; opacity: 0; r: 2; }
  10%  { opacity: 0.9; r: 3; }
  60%  { cx: 160; cy: 260; opacity: 0.7; r: 3; }
  100% { cx: 140; cy: 340; opacity: 0; r: 2; }
}

/* Whole brain gentle breathing scale */
.brain-svg {
  animation: brainBreathe 6s ease-in-out infinite;
}

@keyframes brainBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
  .appl-hero {
    padding: 120px 0 60px;
  }

  .appl-hero__brain {
    width: 260px;
    height: 260px;
  }

  .appl-why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .appl-hero {
    padding: 100px 0 50px;
  }

  .appl-hero__layout {
    flex-direction: column;
  }

  .appl-hero__brain {
    display: none;
  }

  .appl-hero__title {
    font-size: 1.75rem;
  }

  .appl-primary-grid {
    grid-template-columns: 1fr;
  }

  .appl-feature-card {
    padding: 24px;
  }

  .appl-section {
    padding: 48px 0;
  }

  .appl-section--alt {
    padding: 32px 0;
  }

  .appl-secondary-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
  }

  .appl-why-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .appl-why-item {
    padding: 16px 8px;
  }

  .appl-hero__stats {
    gap: 16px;
  }

  .appl-cta {
    padding: 32px 24px;
  }

  .appl-cta-section {
    padding: 0 0 48px;
  }
}

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

  .appl-feature-card__flow {
    padding: 12px 8px;
    gap: 4px;
  }
}
