/*
 * Home page ONLY — scoped to .toolkit-home (main).
 * Loads after styles.css (page-toolkit-labs chrome). Does not load labs-common.css — one less request.
 * Catalog: /t uses labs-common + labs-page.
 */

@keyframes toolkit-home-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.page-toolkit-labs .toolkit-home {
  text-align: left;
}

/* Same horizontal rhythm as .tools-container */
.toolkit-home {
  position: relative;
  z-index: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.75rem) 20px max(3.25rem, env(safe-area-inset-bottom, 0px));
  background: transparent;
}

/* Warm gold wash behind main content only (not the chrome) */
.toolkit-home::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: min(560px, 62vh);
  z-index: -1;
  pointer-events: none;
  border-radius: 0 0 clamp(20px, 4vw, 36px) clamp(20px, 4vw, 36px);
  background: radial-gradient(ellipse 95% 80% at 50% -5%, rgba(185, 139, 59, 0.16) 0%, transparent 58%);
}

/* ——— Hero — matches .tools-hero ——— */
.toolkit-home__hero {
  position: relative;
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: clamp(18px, 2.5vw, 24px);
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(145, 103, 48, 0.22);
  background: linear-gradient(165deg, rgba(255, 252, 246, 0.99) 0%, rgba(248, 236, 214, 0.95) 52%, rgba(238, 222, 196, 0.97) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 22px 52px -34px rgba(94, 65, 30, 0.4);
}

/* Left gold rail — same as .tools-hero__rail */
.toolkit-home__hero::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  z-index: 1;
  pointer-events: none;
  border-radius: clamp(18px, 2.5vw, 24px) 0 0 clamp(18px, 2.5vw, 24px);
  background: linear-gradient(180deg, #d4a85c 0%, #b98b3b 38%, #8a6228 100%);
  box-shadow: 3px 0 18px -6px rgba(94, 65, 30, 0.45);
}

.toolkit-home__hero-mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(145, 103, 48, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145, 103, 48, 0.04) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 95% 75% at 18% 12%, black 18%, transparent 68%);
}

.toolkit-home__hero-sheen {
  position: absolute;
  inset: -35% -25% auto -35%;
  height: 78%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(185, 139, 59, 0.12) 50%, transparent 62%);
  transform: rotate(-2deg);
}

.toolkit-home__hero-inner {
  position: relative;
  z-index: 2;
  padding: clamp(1.1rem, 3vw, 1.75rem) clamp(1.1rem, 3.4vw, 2.35rem) clamp(1.2rem, 3.2vw, 1.9rem);
  padding-left: calc(clamp(1.1rem, 3.4vw, 2.35rem) + 12px);
  display: grid;
  gap: clamp(1.2rem, 3vw, 1.85rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: end;
}

@media (max-width: 880px) {
  .toolkit-home__hero-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

.toolkit-home__hero-copy {
  min-width: 0;
}

/*
 * Hero title + eyebrow share one font-size context so the kicker stays ~47% of the headline
 * at every breakpoint (fixes mobile where fixed rem/px eyebrow matched the h1 visually).
 */
.toolkit-home__hero-heading {
  margin: 0 0 0.95rem;
  font-size: clamp(1.32rem, 2.95vw, 1.88rem);
  line-height: 1.12;
}

.toolkit-home__hero-heading .toolkit-home__kicker {
  margin: 0 0 0.45rem;
  /* ~47% of headline, but never larger than the old fixed eyebrow cap */
  font-size: min(0.62rem, 0.47em);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(94, 67, 41, 0.88);
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.toolkit-home__hero-heading .toolkit-home__title {
  margin: 0;
  font-size: 1em;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.028em;
  color: #2f2114;
}

.toolkit-home__title-accent {
  display: block;
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: 0.86em;
  letter-spacing: -0.02em;
  color: #9f742f;
  line-height: 1.35;
}

.toolkit-home__lede {
  margin: 0;
  max-width: 40rem;
  font-size: 0.9rem;
  line-height: 1.68;
  color: rgba(88, 64, 38, 0.88);
}

.toolkit-home__lede a {
  color: #9f742f;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toolkit-home__lede a:hover {
  color: #7a5526;
}

.toolkit-home__lede--narrow {
  margin: 0;
  max-width: 62ch;
}

.toolkit-home__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 1.15rem;
}

/* Primary — same spirit as .tool-btn (not position:absolute here) */
.toolkit-home__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, transform 0.18s ease, color 0.2s ease;
}

.toolkit-home__btn--primary {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  color: #fff8ef;
  border: 1px solid rgba(121, 85, 40, 0.45);
  box-shadow: 0 4px 18px -10px rgba(94, 65, 30, 0.35);
}

.toolkit-home__btn--primary:hover {
  background: linear-gradient(180deg, #c89a4a 0%, #aa7d34 100%);
  box-shadow: 0 8px 22px -12px rgba(94, 65, 30, 0.45);
  transform: translateY(-1px);
}

.toolkit-home__btn--ghost {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 238, 222, 0.94));
  color: #5e4329;
  border: 1px solid rgba(145, 103, 48, 0.28);
}

.toolkit-home__btn--ghost:hover {
  border-color: rgba(171, 124, 52, 0.45);
  box-shadow: 0 8px 20px -14px rgba(94, 65, 30, 0.22);
  transform: translateY(-1px);
}

.toolkit-home__btn--text {
  background: transparent;
  color: #9f742f;
  border: 1px solid transparent;
  padding-left: 10px;
  padding-right: 10px;
}

.toolkit-home__btn--text:hover {
  color: #7a5526;
  background: rgba(145, 103, 48, 0.06);
}

.toolkit-home__btn:focus-visible {
  outline: 2px solid rgba(185, 139, 59, 0.65);
  outline-offset: 3px;
}

/* Stats — match .header-stats .stat-item */
.toolkit-home__stats {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toolkit-home__stat {
  display: block;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 238, 222, 0.94));
  border-radius: 12px;
  border: 1px solid rgba(145, 103, 48, 0.22);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.toolkit-home__stat:hover {
  border-color: rgba(171, 124, 52, 0.4);
  box-shadow: 0 12px 32px -18px rgba(94, 65, 30, 0.28);
  transform: translateY(-2px);
}

.toolkit-home__stat-value {
  display: block;
  font-size: 1.42rem;
  font-weight: 800;
  color: #9f742f;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 5px;
}

.toolkit-home__stat-value span {
  font-variant-numeric: tabular-nums;
}

.toolkit-home__stat-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(94, 67, 41, 0.78);
  line-height: 1.35;
}

@media (min-width: 881px) {
  .toolkit-home__stat-label {
    font-size: 0.72rem;
  }
}

/* ——— Privacy ——— */
.toolkit-home__privacy-callout {
  margin: 0 0 clamp(1.5rem, 4vw, 2rem);
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(145, 103, 48, 0.22);
  background: linear-gradient(95deg, rgba(255, 252, 246, 0.98) 0%, rgba(248, 238, 222, 0.9) 100%);
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(88, 64, 38, 0.9);
  box-shadow: 0 10px 32px -22px rgba(94, 65, 30, 0.2);
}

.toolkit-home__privacy-callout strong {
  color: #7a5526;
  font-weight: 700;
}

.toolkit-home__privacy-callout-sub {
  display: inline;
  margin-left: 0.35em;
  color: rgba(94, 67, 41, 0.78);
  font-weight: 500;
}

@media (max-width: 520px) {
  .toolkit-home__privacy-callout-sub {
    display: block;
    margin: 6px 0 0;
  }
}

/* ——— Featured — matches .tool-card ——— */
.toolkit-home__featured {
  margin-bottom: clamp(2rem, 5vw, 2.75rem);
}

.toolkit-home__featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .toolkit-home__featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .toolkit-home__featured-grid {
    grid-template-columns: 1fr;
  }
}

.toolkit-home__feat-card {
  margin: 0;
  padding: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffaf2 0%, #f8ecd8 100%);
  border: 1px solid rgba(145, 103, 48, 0.22);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.toolkit-home__feat-card:hover {
  border-color: rgba(171, 124, 52, 0.38);
  box-shadow: 0 14px 32px -18px rgba(94, 65, 30, 0.28);
  transform: translateY(-4px);
}

.toolkit-home__feat-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 22px 20px;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
}

.toolkit-home__feat-link:focus-visible {
  outline: 2px solid rgba(185, 139, 59, 0.55);
  outline-offset: 2px;
}

.toolkit-home__feat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #b98b3b, #ab7c34);
  border: 1px solid rgba(121, 85, 40, 0.35);
  color: #fff8ef;
  font-size: 1.15rem;
  box-shadow: 0 6px 16px -10px rgba(94, 65, 30, 0.35);
}

.toolkit-home__feat-name {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 600;
  color: #5e4329;
  line-height: 1.3;
}

.toolkit-home__feat-desc {
  margin: 0 0 14px;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(88, 64, 38, 0.78);
}

.toolkit-home__feat-cta {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9f742f;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toolkit-home__feat-link:hover .toolkit-home__feat-cta {
  color: #7a5526;
}

/* ——— Section headings — like catalog ——— */
.toolkit-home__section-head {
  margin-bottom: 1.1rem;
}

.toolkit-home__section-kicker {
  margin: 0 0 8px;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(94, 67, 41, 0.88);
}

.toolkit-home__section-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #7a5526;
}

/* ——— Pillars — like .tool-category panels ——— */
.toolkit-home__pillars {
  margin-bottom: clamp(2rem, 5vw, 2.5rem);
}

.toolkit-home__pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 640px) {
  .toolkit-home__pillar-grid {
    grid-template-columns: 1fr;
  }
}

.toolkit-home__pillar {
  padding: 22px 20px;
  border-radius: 16px;
  border: 1px solid rgba(145, 103, 48, 0.2);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(248, 238, 222, 0.95));
  box-shadow: 0 14px 36px -24px rgba(94, 65, 30, 0.3);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.toolkit-home__pillar:hover {
  border-color: rgba(171, 124, 52, 0.32);
  box-shadow: 0 18px 40px -22px rgba(94, 65, 30, 0.26);
  transform: translateY(-2px);
}

.toolkit-home__pillar-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: rgba(145, 103, 48, 0.1);
  border: 1px solid rgba(145, 103, 48, 0.3);
  color: #b98b3b;
  font-size: 1.05rem;
}

.toolkit-home__pillar h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #5e4329;
}

.toolkit-home__pillar p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(88, 64, 38, 0.78);
}

/* ——— Categories ——— */
.toolkit-home__categories {
  margin-bottom: clamp(2rem, 5vw, 2.5rem);
  padding: 28px 26px;
  border-radius: 16px;
  border: 1px solid rgba(145, 103, 48, 0.2);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(248, 238, 222, 0.95));
  box-shadow: 0 14px 36px -24px rgba(94, 65, 30, 0.3);
}

.toolkit-home__categories-sub {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(94, 67, 41, 0.78);
}

.toolkit-home__category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.toolkit-home__category-tags li {
  margin: 0;
}

.toolkit-home__category-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #5e4329;
  background: linear-gradient(180deg, #fffaf2 0%, #f8ecd8 100%);
  border: 1px solid rgba(145, 103, 48, 0.22);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.toolkit-home__category-tag:hover {
  border-color: rgba(171, 124, 52, 0.4);
  box-shadow: 0 8px 20px -12px rgba(94, 65, 30, 0.25);
  transform: translateY(-1px);
}

.toolkit-home__category-tag:focus-visible {
  outline: 2px solid rgba(185, 139, 59, 0.55);
  outline-offset: 2px;
}

.toolkit-home__categories-note {
  margin: 18px 0 0;
  font-size: 0.875rem;
  color: rgba(88, 64, 38, 0.78);
}

.toolkit-home__categories-note a {
  font-weight: 600;
  color: #9f742f;
  text-decoration: none;
}

.toolkit-home__categories-note a:hover {
  text-decoration: underline;
}

/* ——— Closing ——— */
.toolkit-home__closing {
  padding: 26px 26px;
  border-radius: 16px;
  border: 1px solid rgba(145, 103, 48, 0.22);
  background: linear-gradient(168deg, rgba(255, 252, 246, 0.98) 0%, rgba(248, 236, 214, 0.92) 55%, rgba(238, 222, 196, 0.9) 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 18px 48px -30px rgba(94, 65, 30, 0.35);
}

.toolkit-home__closing-copy {
  margin: 0;
  max-width: 42ch;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: #2f2114;
}

.toolkit-home__closing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Subtle entrance — local keyframe so home does not load labs-page.css */
.toolkit-home [data-reveal] {
  animation: toolkit-home-fadeInUp 0.65s ease-out backwards;
}

.toolkit-home [data-reveal]:nth-child(1) {
  animation-delay: 0.04s;
}
.toolkit-home [data-reveal]:nth-child(2) {
  animation-delay: 0.08s;
}
.toolkit-home [data-reveal]:nth-child(3) {
  animation-delay: 0.12s;
}
.toolkit-home [data-reveal]:nth-child(4) {
  animation-delay: 0.16s;
}
.toolkit-home [data-reveal]:nth-child(5) {
  animation-delay: 0.2s;
}
.toolkit-home [data-reveal]:nth-child(6) {
  animation-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
  .toolkit-home [data-reveal] {
    animation: none;
  }

  .toolkit-home__btn--primary:hover,
  .toolkit-home__btn--ghost:hover,
  .toolkit-home__btn--text:hover {
    transform: none;
  }

  .toolkit-home__btn {
    transition: none;
  }

  .toolkit-home__feat-card:hover,
  .toolkit-home__pillar:hover,
  .toolkit-home__stat:hover {
    transform: none;
    box-shadow: none;
  }
}
