/* Toolspot4u Child Theme — Homepage styles (Paper & Ember)
   Loaded on front-page only via enqueue.php (is_front_page condition).
   Legacy Signal/Violet Dark System B code fully removed.
   All values reference tokens.css custom properties — no raw hex. */

/* ── Body background ─────────────────────────────────────────────────────── */

/* Elementor/Astra may inject white on page 88 — token override scoped to home */
body.home,
html body.home {
  background: var(--paper) !important;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.t4u-home { background: var(--paper); }

/* ── Section base ──────────────────────────────────────────────────────────── */

.home-section {
  padding:    clamp(72px, 10vh, 112px) 0;
  border-top: 1px solid var(--ink-12);
}

/* Section heading group */
.home-section-head {
  max-width:     720px;
  margin-bottom: clamp(40px, 6vh, 64px);
}

.home-section-head h2 {
  margin:    8px 0 16px;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
}

.home-section-head > p {
  color:     var(--ink-60);
  max-width: 560px;
}

/* ── Reveal animation ────────────────────────────────────────────────────── */

.reveal {
  opacity:    0;
  transform:  translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.reveal.in,
.reveal.is-visible {
  opacity:   1;
  transform: translateY(0);
}

/* Stagger via CSS custom property set on the element */
[style*="--stagger"] { transition-delay: calc(var(--stagger, 0) * 80ms); }

/* ── Stats bar ───────────────────────────────────────────────────────────── */

.home-stats-bar {
  background:    var(--linen);
  border-top:    1px solid var(--ink-12);
  border-bottom: 1px solid var(--ink-12);
  padding:       clamp(24px, 4vh, 40px) 0;
}

.home-stats-list {
  display:         flex;
  flex-wrap:       wrap;
  align-items:     center;
  justify-content: space-around;
  gap:             24px 48px;
  list-style:      none;
  padding:         0;
  margin:          0;
}

.home-stat {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            5px;
  text-align:     center;
}

.home-stat-n {
  font-family:    var(--disp);
  font-weight:    700;
  font-size:      clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
  color:          var(--ink);
  line-height:    1;
}

.home-stat-l {
  font-family:    var(--mono);
  font-size:      0.65rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color:          var(--ink-60);
}

/* ── Categories: bento grid ──────────────────────────────────────────────── */

/* Layout: 1 tall card left (spans 2 rows) + 2×2 grid right */
.home-cat-grid {
  display:               grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  grid-template-rows:    auto auto;
  gap:                   20px;
}

.home-cat-card:first-child {
  grid-row: 1 / 3;
}

.home-cat-card {
  display:         flex;
  flex-direction:  column;
  padding:         clamp(24px, 3vw, 32px);
  border-radius:   var(--r-2xl);
  background:      var(--linen);
  border:          1px solid var(--ink-12);
  text-decoration: none;
  color:           inherit;
  transition:      background var(--dur-std),
                   border-color var(--dur-std),
                   box-shadow var(--dur-std),
                   transform var(--dur-std) var(--ease-out);
}

.home-cat-card:hover {
  background:   var(--linen-deep);
  border-color: var(--ink-30);
  box-shadow:   var(--shadow-md);
  transform:    translateY(-2px);
}

.home-cat-icon {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           48px;
  height:          48px;
  border-radius:   var(--r-lg);
  background:      var(--paper);
  color:           var(--ink-60);
  flex-shrink:     0;
  margin-bottom:   16px;
  transition:      color var(--dur-std), background var(--dur-std);
}

.home-cat-card:hover .home-cat-icon {
  background: var(--ember);
  color:      var(--paper);
}

.home-cat-card h3 {
  font-size:   1.1rem;
  font-weight: 700;
  margin:      0 0 10px;
  line-height: 1.25;
}

.home-cat-card:first-child h3 {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
}

.home-cat-desc {
  flex:      1;
  color:     var(--ink-60);
  font-size: 0.9rem;
  margin:    0;
}

.home-cat-footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-top:      24px;
  padding-top:     16px;
  border-top:      1px solid var(--ink-12);
}

.home-cat-count {
  font-family:    var(--mono);
  font-size:      0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--ink-60);
}

.home-cat-cta {
  font-family:    var(--mono);
  font-size:      0.72rem;
  letter-spacing: 0.05em;
  color:          var(--ember);
  font-weight:    600;
  transition:     letter-spacing var(--dur-std);
}

.home-cat-card:hover .home-cat-cta { letter-spacing: 0.1em; }

.home-cat-ar {
  display:    inline-block;
  transition: transform var(--dur-std);
}
.home-cat-card:hover .home-cat-ar { transform: translateX(4px); }

/* ── Featured products: editorial magazine layout ────────────────────────── */

.home-editorial-section { background: var(--paper); }

.home-editorial-grid {
  display:               grid;
  grid-template-columns: 1.4fr 1fr;
  gap:                   24px;
  align-items:           start;
}

/* Lead card */
.home-ed-lead {
  display:         flex;
  flex-direction:  column;
  text-decoration: none;
  color:           inherit;
  border-radius:   var(--r-2xl);
  background:      var(--linen);
  border:          1px solid var(--ink-12);
  overflow:        hidden;
  transition:      box-shadow var(--dur-std),
                   transform var(--dur-std) var(--ease-out),
                   border-color var(--dur-std);
}

.home-ed-lead:hover {
  box-shadow:   var(--shadow-lg);
  transform:    translateY(-3px);
  border-color: var(--ink-30);
}

.home-ed-media {
  position:     relative;
  width:        100%;
  aspect-ratio: 16 / 9;
  background:   var(--linen-deep);
  overflow:     hidden;
  display:      flex;
  align-items:  center;
  justify-content: center;
}

/* Monogram fallback when no thumbnail */
.home-ed-media::before {
  content:        attr(data-mono);
  font-family:    var(--disp);
  font-weight:    700;
  font-size:      3.5rem;
  letter-spacing: -0.04em;
  color:          var(--ink-12);
}

.home-ed-img {
  position:   absolute;
  inset:      0;
  width:      100%;
  height:     100%;
  object-fit: cover;
  display:    block;
  transition: transform 0.6s cubic-bezier(.22,.61,.36,1);
}
.home-ed-lead:hover .home-ed-img { transform: scale(1.04); }

.home-ed-badge {
  position:       absolute;
  top:            16px;
  left:           16px;
  padding:        5px 12px;
  background:     var(--ember);
  color:          #fff;
  border-radius:  var(--r-pill);
  font-family:    var(--mono);
  font-size:      0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight:    600;
}

.home-ed-body {
  padding:        clamp(20px, 3vw, 28px);
  display:        flex;
  flex-direction: column;
  flex:           1;
}

.home-ed-cat {
  font-family:    var(--mono);
  font-size:      0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--ember);
  margin:         0 0 10px;
}

.home-ed-title {
  font-size:   clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 700;
  margin:      0 0 12px;
  line-height: 1.25;
}

.home-ed-blurb {
  color:     var(--ink-60);
  font-size: 0.92rem;
  flex:      1;
  margin:    0;
}

.home-ed-footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-top:      20px;
  padding-top:     16px;
  border-top:      1px solid var(--ink-12);
}

.home-ed-price {
  font-family:    var(--mono);
  font-size:      0.75rem;
  letter-spacing: 0.04em;
  color:          var(--ink-60);
}

.home-ed-cta {
  font-family:    var(--mono);
  font-size:      0.72rem;
  letter-spacing: 0.05em;
  color:          var(--ember);
  font-weight:    600;
  transition:     letter-spacing var(--dur-std);
}
.home-ed-lead:hover .home-ed-cta { letter-spacing: 0.1em; }

/* Secondary stacked cards */
.home-ed-stack {
  display:        flex;
  flex-direction: column;
  gap:            16px;
}

.home-ed-secondary {
  display:         flex;
  gap:             0;
  text-decoration: none;
  color:           inherit;
  border-radius:   var(--r-xl);
  background:      var(--linen);
  border:          1px solid var(--ink-12);
  overflow:        hidden;
  align-items:     stretch;
  transition:      background var(--dur-std),
                   border-color var(--dur-std),
                   box-shadow var(--dur-std),
                   transform var(--dur-std) var(--ease-out);
}

.home-ed-secondary:hover {
  background:   var(--linen-deep);
  border-color: var(--ink-30);
  box-shadow:   var(--shadow-sm);
  transform:    translateX(3px);
}

.home-ed-s-media {
  position:        relative;
  flex-shrink:     0;
  width:           88px;
  background:      var(--linen-deep);
  overflow:        hidden;
  display:         flex;
  align-items:     center;
  justify-content: center;
}

.home-ed-s-media::before {
  content:        attr(data-mono);
  font-family:    var(--disp);
  font-weight:    700;
  font-size:      1.4rem;
  letter-spacing: -0.03em;
  color:          var(--ink-12);
}

.home-ed-s-img {
  position:   absolute;
  inset:      0;
  width:      100%;
  height:     100%;
  object-fit: cover;
  display:    block;
}

.home-ed-s-body {
  padding:         16px;
  display:         flex;
  flex-direction:  column;
  flex:            1;
  justify-content: space-between;
}

.home-ed-s-title {
  font-size:   0.95rem;
  font-weight: 700;
  margin:      0 0 8px;
  line-height: 1.3;
}

.home-editorial-footer {
  display:     flex;
  margin-top:  clamp(32px, 4vh, 48px);
}

/* ── Why section ─────────────────────────────────────────────────────────── */

.home-why-section { background: var(--linen); }

.home-why-grid {
  display:               grid;
  grid-template-columns: 1fr 1.15fr;
  gap:                   clamp(40px, 6vw, 96px);
  align-items:           start;
}

.home-why-statement {
  position: sticky;
  top:      calc(var(--nav-height) + 32px);
}

.home-why-statement h2 {
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  margin:    8px 0 20px;
}

.home-why-lede {
  color:       var(--ink-60);
  margin:      0 0 28px;
  max-width:   480px;
  font-size:   0.97rem;
  line-height: 1.65;
}

.home-why-principles {
  list-style:     none;
  padding:        0;
  margin:         0;
  display:        flex;
  flex-direction: column;
}

.home-why-principle {
  display:      grid;
  grid-template-columns: 48px 1fr;
  gap:          20px;
  padding:      28px 0;
  border-bottom: 1px solid var(--ink-12);
}

.home-why-principle:first-child { border-top: 1px solid var(--ink-12); }

.home-why-n {
  font-family:    var(--mono);
  font-size:      0.65rem;
  letter-spacing: 0.1em;
  color:          var(--ember);
  font-weight:    600;
  text-transform: uppercase;
  padding-top:    4px;
}

.home-why-p-body h3 {
  font-size:   1rem;
  font-weight: 700;
  margin:      0 0 8px;
  line-height: 1.3;
}

.home-why-p-body p {
  color:     var(--ink-60);
  margin:    0;
  font-size: 0.9rem;
}

/* ── Final CTA — dark ink, full-bleed ────────────────────────────────────── */

.home-final-cta-section {
  background: var(--ink);
  padding:    clamp(80px, 12vh, 128px) 0;
}

.home-final-cta {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  text-align:     center;
  max-width:      720px;
  margin:         0 auto;
}

.home-final-cta-eyebrow {
  font-family:    var(--mono);
  font-size:      0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          rgba(242,239,233,.42);
  margin:         0 0 20px;
}

.home-final-cta h2 {
  font-size:   clamp(2.2rem, 4.2vw, 4rem);
  color:       var(--paper);
  margin:      0 0 20px;
  line-height: 1.1;
}

.home-final-cta-lede {
  color:     rgba(242,239,233,.60);
  margin:    0 0 40px;
  font-size: 1.05rem;
  max-width: 560px;
}

.home-final-cta-actions {
  display:         flex;
  align-items:     center;
  gap:             24px;
  flex-wrap:       wrap;
  justify-content: center;
}

.home-final-cta-btn.btn {
  background:  var(--ember);
  color:       #fff;
  border:      0;
  padding:     14px 32px;
  font-size:   1rem;
  box-shadow:  var(--shadow-ember);
  transition:  background var(--dur-std),
               transform 0.2s var(--ease-out),
               box-shadow 0.2s var(--ease-out);
}

.home-final-cta-btn.btn:hover {
  background: var(--ember-deep);
  transform:  translateY(-2px);
  box-shadow: 0 20px 48px -8px rgba(214,74,0,.55);
}

.home-final-cta-ghost {
  font-family:     var(--mono);
  font-size:       0.78rem;
  letter-spacing:  0.06em;
  text-transform:  uppercase;
  color:           rgba(242,239,233,.50);
  text-decoration: none;
  transition:      color var(--dur-std);
}

.home-final-cta-ghost:hover { color: var(--paper); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .home-cat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .home-cat-card:first-child {
    grid-row:    auto;
    grid-column: 1 / 3;
  }

  .home-editorial-grid { grid-template-columns: 1fr; }

  .home-ed-stack { flex-direction: row; flex-wrap: wrap; }
  .home-ed-secondary { flex: 1 1 260px; }

  .home-why-grid {
    grid-template-columns: 1fr;
    gap:                   40px;
  }
  .home-why-statement { position: static; }
}

@media (max-width: 680px) {
  .home-section { padding: clamp(48px, 8vh, 72px) 0; }

  .home-stats-list { justify-content: center; gap: 20px 32px; }

  .home-cat-grid        { grid-template-columns: 1fr; }
  .home-cat-card:first-child { grid-column: auto; }

  .home-ed-stack        { flex-direction: column; }

  .home-final-cta-actions { flex-direction: column; gap: 16px; }
}

@media (max-width: 420px) {
  .home-stat-n { font-size: 1.8rem; }
  .home-why-principle { grid-template-columns: 36px 1fr; gap: 12px; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity:    1;
    transform:  none;
    transition: none;
  }

  .home-cat-card,
  .home-ed-lead,
  .home-ed-secondary,
  .home-final-cta-btn {
    transition: none;
    transform:  none;
  }

  .home-ed-lead:hover .home-ed-img { transform: none; }
}
