/* ================================================================
   home-v3.css — Visual design refresh for FinCalculators homepage
   ================================================================ */

/* ── Design Tokens ── */
:root {
  --bg: #f5f8ff;
  --surface: #ffffff;
  --surface-alt: #eff4ff;
  --text: #17223b;
  --text-soft: #45526f;
  --primary: #0f6fff;
  --primary-deep: #0a50bc;
  --accent: #f5a524;
  --border: #d8e3fb;
  --shadow: 0 18px 42px -28px rgba(18, 50, 106, 0.45);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --pill-accent: var(--primary);
  --pill-accent-rgb: 15, 111, 255;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(circle at 85% -10%, #dfe9ff 0, transparent 45%),
    radial-gradient(circle at -10% 10%, #d2ffe9 0, transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: "Public Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ── Global transitions for interactive elements ── */
a, .btn, .group-card, .story-card, .content-card, .faq-item {
  transition: all 0.2s var(--ease);
}

/* ── Scroll fade-in animation ── */
.fade-section.fade-ready {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.fade-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   HERO
   ================================================================ */
.hero {
  margin-top: 1rem;
  padding: 2.5rem 2rem 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(125deg, #fdfefe, #edf3ff 50%, #e5f8ff);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #e6edff;
  color: #163f93;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0.9rem 0 0.6rem;
  max-width: 22ch;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero-copy {
  margin: 0;
  max-width: 60ch;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ── Hero stats strip ── */
.hero-stats {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.stat-number {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 0.72rem 1.15rem;
  font-weight: 700;
  min-height: 44px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(15, 111, 255, 0.4);
}

.btn-primary:hover {
  background: var(--primary-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -4px rgba(15, 111, 255, 0.5);
}

/* ================================================================
   APP PROMO
   ================================================================ */
.app-promo {
  margin-top: 1.2rem;
  background: linear-gradient(135deg, #0f6fff, #0f4eba 65%, #123471);
  color: #fff;
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.app-promo-content h2 {
  margin: 0.16rem 0 0.35rem;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1rem, 2.3vw, 1.25rem);
  line-height: 1.32;
}

.app-promo-content p {
  margin: 0;
  max-width: 58ch;
  color: #e6eeff;
  font-size: 0.92rem;
  line-height: 1.62;
}

.app-promo-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #bcd2ff;
}

/* Play Store badge image */
.app-promo-badge {
  display: inline-flex;
  flex-shrink: 0;
}

.app-promo-badge img {
  display: block;
  height: 54px;
  width: auto;
}

.app-promo-badge:hover {
  opacity: 0.88;
}

/* ================================================================
   TOOL GRID — Category cards with pill links
   ================================================================ */
.tool-grid-section {
  margin-top: 3rem;
}

.tool-grid-section h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.section-copy {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.6;
  max-width: 68ch;
}

.group-grid {
  margin-top: 1.8rem;
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ── Category card ── */
.group-card {
  --group-accent: var(--primary);
  --group-accent-rgb: 15, 111, 255;
  --pill-accent: var(--text);
  --pill-accent-rgb: 33, 37, 41;
  background: white;
  border: 1px solid #e1e5e9;
  border-radius: 18px;
  padding: 1.75rem 1.6rem 1.55rem;
  cursor: default;
  box-shadow: 0 4px 12px -8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.group-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--group-accent), var(--accent));
  opacity: 0.9;
}

.group-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px -18px rgba(18, 50, 106, 0.5);
  border-color: rgba(var(--group-accent-rgb), 0.45);
}

.group-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.group-icon {
  width: 2.7rem;
  height: 2.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(var(--group-accent-rgb), 0.14);
  color: var(--group-accent);
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.group-card h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.group-desc {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ── Calculator pill links ── */
.group-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.calc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
  line-height: 1.2;
  min-height: 2.1rem;
}

.calc-pill:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(15, 111, 255, 0.4);
}

/* Removing multi-color groups for a unified, professional look */

/* ================================================================
   STORIES
   ================================================================ */
.stories-section {
  margin-top: 3rem;
}

.stories-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.stories-heading h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.25rem, 2.7vw, 1.85rem);
}

.stories-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1rem;
}

.story-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px -18px rgba(18, 50, 106, 0.28);
  border-color: #b7caf3;
}

.story-date {
  margin: 0;
  font-size: 0.8rem;
  color: #5a6b8f;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.story-card h3 {
  margin: 0.4rem 0 0;
  font-size: 1.02rem;
  line-height: 1.38;
}

.story-card h3 a {
  color: #123f8c;
  text-decoration: none;
}

.story-card h3 a:hover {
  text-decoration: underline;
}

.story-card p {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
  font-size: 0.93rem;
  line-height: 1.55;
}

.story-link {
  display: inline-block;
  margin-top: 0.55rem;
  text-decoration: none;
  color: #035ba7;
  font-weight: 700;
}

.story-link:hover {
  text-decoration: underline;
}

.story-empty {
  grid-column: 1 / -1;
}

/* ================================================================
   CONTENT HUB
   ================================================================ */
.content-hub {
  margin-top: 3rem;
}

.content-hub h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.25rem, 2.7vw, 1.85rem);
}

.content-grid {
  margin-top: 1rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -16px rgba(18, 50, 106, 0.22);
  border-color: #b7caf3;
}

.content-card h3 {
  margin: 0;
  font-size: 1.02rem;
  color: #123471;
  line-height: 1.35;
}

.content-card p {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* ================================================================
   FAQ — Custom chevron with animated rotation
   ================================================================ */
.faq-section {
  margin-top: 3rem;
}

.faq-section h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.25rem, 2.7vw, 1.85rem);
}

.faq-list {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.7rem;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.faq-item:hover {
  border-color: #b7c9f0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.97rem;
  color: #16386f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  list-style: none;
  line-height: 1.4;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::marker {
  display: none;
  content: "";
}

.faq-chevron {
  flex-shrink: 0;
  transition: transform 0.25s var(--ease);
  color: var(--primary);
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-item p {
  margin: 0.6rem 0 0;
  color: var(--text-soft);
  animation: faqReveal 0.25s var(--ease);
}

@keyframes faqReveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================================
   TRUST BLOCK
   ================================================================ */
.trust-block {
  margin-top: 3rem;
  padding: 1.15rem 1.2rem;
  border-left: 4px solid var(--accent);
  background: #fffaf0;
  border-radius: 10px;
}

.trust-block h2 {
  margin: 0;
  font-size: 1.2rem;
}

.trust-block p {
  margin: 0.5rem 0 0;
  color: var(--text-soft);
}

.text-link {
  display: inline-block;
  margin-top: 0.55rem;
  color: #035ba7;
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* Footer styles are in footer.css — single source of truth */

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 840px) {
  .app-promo {
    flex-direction: column;
    align-items: flex-start;
  }

  .group-grid {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .stories-grid {
    grid-template-columns: 1fr;
  }

  .stories-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-stats {
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 0.9rem;
    border-radius: 14px;
  }
}

@media (max-width: 520px) {
  .hero-stats {
    gap: 0.8rem;
  }

  .stat-divider {
    display: none;
  }

  .hero-stats {
    justify-content: space-between;
  }

  .calc-pill {
    font-size: 0.74rem;
    padding: 0.3rem 0.6rem;
    min-height: 1.9rem;
  }
}
