/* ===========================================================
   Color4U — Homepage local styles (Merged v2)
   =========================================================== */

:root {
  --home-gap: 56px;
  --color-background-success: oklch(96% 0.045 165);
  --color-text-success:       oklch(40% 0.105 165);
  --color-border-success:     oklch(88% 0.06 165);
}

.c4-home-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin: 0 0 18px;
}
.c4-home-head h2 { margin: 0; }
.c4-home-head__sub { margin: 4px 0 0; }
.c4-home-viewall {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 14px; font-weight: 700; color: var(--primary-ink);
  white-space: nowrap;
}
.c4-home-viewall .arrow { display: inline-block; transition: transform .15s; }
.c4-home-viewall:hover { text-decoration: none; }
.c4-home-viewall:hover .arrow { transform: translateX(3px); }
.c4-home-viewall:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

.c4-home-section { margin-top: var(--home-gap); }

.c4-home-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 12px 0 48px;
}
.c4-home-hero__copy { min-width: 0; }
.c4-home-hero h1 {
  margin: 0 0 24px;
  font-size: 50px; line-height: 1.1; letter-spacing: -0.02em;
  text-wrap: balance;
}
.c4-home-hero__sub {
  margin: 0 0 40px;
  color: var(--ink-2); font-size: 18px; line-height: 1.55;
  max-width: 54ch; text-wrap: pretty;
}

.c4-home-trustpills {
  display: flex; gap: 18px; flex-wrap: wrap;
}
.c4-home-trustpill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
}
.c4-home-trustpill svg { color: var(--accent-mint); flex-shrink: 0; }

.c4-home-hero__art {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  background: var(--bg-tint);
}
.c4-home-hero__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c4-home-hero__art image-slot { width: 100%; height: 100%; display: block; }

.c4-home-team {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px; align-items: center;
}
.c4-home-team__avatars { display: flex; align-items: center; flex-shrink: 0; }
.c4-home-team__avatar {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--paper);
  background: var(--av-bg, var(--primary-soft));
  display: grid; place-items: center;
  position: relative; z-index: 2; overflow: hidden;
}
.c4-home-team__avatar--back { margin-left: -14px; z-index: 1; }
.c4-home-team__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.c4-home-team__emoji { font-size: 28px; line-height: 1; }
.c4-home-team__body { min-width: 0; }
.c4-home-team__body h2 { margin: 0 0 4px; font-size: 18px; }
.c4-home-team__body p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; max-width: 64ch; }
.c4-home-team__link {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap;
}
.c4-home-team__link .arrow { color: var(--primary-ink); display: inline-block; transition: transform .15s; }
.c4-home-team__link:hover { color: var(--ink); text-decoration: none; }
.c4-home-team__link:hover .arrow { transform: translateX(3px); }

@media (prefers-reduced-motion: no-preference) {
  body.js-fade .c4-home-fade { opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease; }
  body.js-fade .c4-home-fade.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .c4-hub-card, .c4-home-new-card__thumb, .c4-cp-related-card__arrow,
  .c4-home-viewall .arrow, .c4-home-team__link .arrow { transition: none !important; }
}

@media (max-width: 1023px) {
  .c4-home-hero { grid-template-columns: 1fr; gap: 28px; }
  .c4-home-hero h1 { font-size: 40px; }
  .c4-home-hero__art { max-width: 520px; }
}
@media (max-width: 767px) {
  .c4-home-team { grid-template-columns: auto 1fr; }
  .c4-home-team__link { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 640px) {
  .c4-home-hero h1 { font-size: 34px; }
}


/* ── Hero eyebrow + CTA row (replaces the redundant search) ── */
.c4-home-hero__eyebrow {
  margin: 0 0 16px;
  font-size: 13px; letter-spacing: 0.1em; font-weight: 500;
  text-transform: uppercase; color: var(--ink-3);
}
.c4-home-hero__cta {
  margin: 0 0 16px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.c4-home-hero__cta .c4-btn--primary { padding: 0 24px; }
.c4-home-hero__cta .c4-btn--primary svg { transition: transform .15s ease; }
.c4-home-hero__cta .c4-btn--primary:hover svg { transform: translateX(3px); }
.c4-home-hero__altlink {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 15px; font-weight: 600; color: var(--ink-2);
}
.c4-home-hero__altlink span { display: inline-block; transition: transform .15s ease; }
.c4-home-hero__altlink:hover { color: var(--primary-ink); text-decoration: none; }
.c4-home-hero__altlink:hover span { transform: translateX(3px); }

:root {
  /* Difficulty + glass tokens (mirrored from the category page) */
  --diff-easy:        var(--accent-mint);
  --diff-medium:      oklch(78% 0.13 75);
  --diff-detailed:    var(--accent-coral);
  --glass-bg:     rgba(255,255,255,.88);
  --glass-line:   rgba(20,30,60,.16);
  --glass-shadow: 0 1px 3px rgba(20,30,60,.18), 0 4px 10px rgba(20,30,60,.08);

  /* Gradient-art palette (mirrored from the category image template) */
  --cat-blue:   oklch(56% 0.18 256);
  --cat-blue-2: oklch(47% 0.17 263);
  --cat-blue-3: oklch(66% 0.15 250);
  --cat-yellow: oklch(89% 0.145 92);
  --cat-cream:  oklch(97% 0.045 95);
  --cat-mint:   oklch(82% 0.10 162);
  --cat-coral:  oklch(74% 0.16 32);
}

/* ===========================================================
   POPULAR CATEGORIES — rich gradient cards (reference 1)
   White card: gradient "poster" art on top + meta footer.
   =========================================================== */
.c4-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.c4-cat-card {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.c4-cat-card:hover {
  transform: translateY(-3px);
  border-color: oklch(86% 0.06 256);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.c4-cat-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── the gradient poster ── */
.c4-cat-art {
  position: relative;
  aspect-ratio: 1 / 1;
  container-type: size;
  overflow: hidden;
  background:
    radial-gradient(125% 75% at 50% -12%, var(--cat-blue-3), transparent 56%),
    linear-gradient(165deg, var(--cat-blue) 0%, var(--cat-blue-2) 100%);
}
.c4-cat-art__base {
  position: absolute; left: -6%; right: -6%; bottom: -10%; height: 32%;
  background:
    radial-gradient(60% 100% at 24% 0%, var(--cat-mint) 0%, transparent 72%),
    radial-gradient(64% 100% at 80% 6%, oklch(84% 0.08 150) 0%, transparent 72%),
    linear-gradient(180deg, oklch(86% 0.09 162) 0%, oklch(80% 0.10 158) 100%);
  border-radius: 50% 50% 0 0 / 18% 18% 0 0;
  opacity: .96;
}
.c4-cat-art__deco { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.c4-cat-art__dot  { position: absolute; border-radius: 50%; background: #fff; }
.c4-cat-art__spark { position: absolute; display: block; }
.c4-cat-art__spark svg { display: block; width: 100%; height: 100%; }

.c4-cat-art__head {
  position: absolute; top: 7%; left: 6%; right: 6%; text-align: center; z-index: 5;
}
.c4-cat-art__title {
  font-family: var(--font-display); font-weight: 700; line-height: .9;
  font-size: 15cqi; color: var(--cat-yellow);
  text-shadow: 0 .45cqi 0 oklch(40% 0.12 262 / .35), 0 1cqi 2.2cqi oklch(28% 0.10 262 / .45);
  white-space: nowrap; letter-spacing: .005em;
}
.c4-cat-art__sub {
  margin-top: 3.4cqi; font-family: var(--font-display); font-weight: 600;
  font-size: 4.4cqi; line-height: 1.05; color: var(--cat-cream);
  text-shadow: 0 .3cqi 1cqi oklch(28% 0.10 262 / .45);
}

/* ── the stacked coloring sheets ── */
.c4-cat-art__stack { position: absolute; left: 50%; top: 33%; width: 0; z-index: 4; }
.c4-cat-sheet {
  position: absolute; background: #fff; overflow: hidden;
  border-radius: 2.6cqi;
  box-shadow: 0 6cqi 11cqi -4cqi oklch(26% 0.10 262 / .55), 0 2cqi 4cqi oklch(26% 0.10 262 / .26);
}
.c4-cat-sheet svg, .c4-cat-sheet img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c4-cat-sheet--bl    { left: -41cqi; top: 5cqi; width: 37cqi; height: 49cqi; transform: rotate(-8deg); }
.c4-cat-sheet--br    { left: 4cqi;    top: 5cqi; width: 37cqi; height: 49cqi; transform: rotate(8deg); }
.c4-cat-sheet--front { left: -23.5cqi; top: 0; width: 47cqi; height: 61cqi; transform: rotate(-1.5deg); z-index: 2; }
.c4-cat-sheet__brand {
  position: absolute; right: 1.6cqi; bottom: 1.1cqi; z-index: 3;
  font-family: var(--font-display); font-weight: 700; font-size: 2.7cqi; color: var(--ink); opacity: .38;
}

/* ── white meta footer ── */
.c4-cat-card__meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 13px 16px 14px;
}
.c4-cat-card__name {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--ink); line-height: 1.2;
}
.c4-cat-card__count { flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }

/* ===========================================================
   MAIN HUBS — tall gradient pins (reference 3)
   Per-pin palette via --hub-a / --hub-b / --hub-glow inline.
   =========================================================== */
.c4-hub-grid2 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.c4-hub-pin {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.c4-hub-pin:hover {
  transform: translateY(-3px);
  border-color: oklch(86% 0.06 256);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.c4-hub-pin:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.c4-hub-art {
  position: relative;
  aspect-ratio: 4 / 5;
  container-type: size;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--hub-glow, var(--cat-blue-3)), transparent 55%),
    linear-gradient(165deg, var(--hub-a, var(--cat-blue)) 0%, var(--hub-b, var(--cat-blue-2)) 100%);
}
.c4-hub-art__base {
  position: absolute; left: -5%; right: -5%; bottom: -9%; height: 26%;
  background:
    radial-gradient(60% 100% at 22% 0%, var(--cat-mint) 0%, transparent 72%),
    radial-gradient(64% 100% at 80% 6%, oklch(84% 0.08 150) 0%, transparent 72%),
    linear-gradient(180deg, oklch(86% 0.09 162) 0%, oklch(80% 0.10 158) 100%);
  border-radius: 50% 50% 0 0 / 16% 16% 0 0;
  opacity: .96;
}
.c4-hub-art__deco { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.c4-hub-art__dot  { position: absolute; border-radius: 50%; background: #fff; }
.c4-hub-art__spark { position: absolute; display: block; }
.c4-hub-art__spark svg { display: block; width: 100%; height: 100%; }

.c4-hub-art__head { position: absolute; top: 6%; left: 7%; right: 7%; text-align: center; z-index: 5; }
.c4-hub-art__title {
  font-family: var(--font-display); font-weight: 700; line-height: .9;
  font-size: 12cqi; color: #fff;
  text-shadow: 0 .4cqi 0 oklch(34% 0.10 262 / .35), 0 .9cqi 2cqi oklch(28% 0.10 262 / .5);
  white-space: nowrap; letter-spacing: .01em;
}
.c4-hub-art__sub {
  margin-top: 2.6cqi; font-family: var(--font-display); font-weight: 600;
  font-size: 3.6cqi; line-height: 1.05; color: var(--cat-cream);
  text-shadow: 0 .3cqi 1cqi oklch(28% 0.10 262 / .45);
}

/* 2×2 grid of sheets */
.c4-hub-art__grid {
  position: absolute; left: 9%; right: 9%; top: 28%; bottom: 9%;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 4.5cqi; z-index: 4;
}
.c4-hub-sheet {
  background: #fff; overflow: hidden; border-radius: 2cqi; position: relative;
  box-shadow: 0 4cqi 8cqi -3cqi oklch(26% 0.10 262 / .5), 0 1.4cqi 3cqi oklch(26% 0.10 262 / .24);
}
.c4-hub-sheet svg, .c4-hub-sheet img { width: 100%; height: 100%; object-fit: cover; display: block; }

.c4-hub-pin__meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 13px 16px 14px;
}
.c4-hub-pin__metatext { display: flex; flex-direction: column; min-width: 0; }
.c4-hub-pin__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.2; }
.c4-hub-pin__count { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-top: 2px; }
.c4-hub-pin__go {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; color: var(--primary-ink); white-space: nowrap;
}
.c4-hub-pin__go .arrow { display: inline-block; transition: transform .15s; }
.c4-hub-pin:hover .c4-hub-pin__go .arrow { transform: translateX(3px); }

/* ===========================================================
   COLORING-PAGE CARDS — reference 2
   Copied verbatim from the v2 category page so the home uses
   the exact same card (difficulty + downloads + Download PDF).
   =========================================================== */
.c4-cp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.c4-cp-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: var(--shadow-sm);
}
.c4-cp-card:hover { transform: translateY(-2px); border-color: oklch(86% 0.06 256); box-shadow: var(--shadow); }
.c4-cp-card:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.c4-cp-card__media {
  position: relative; aspect-ratio: 3 / 4; background: var(--bg);
  display: block; overflow: hidden; border-bottom: 1px solid var(--line);
}
.c4-cp-card__media img, .c4-cp-card__media svg {
  width: 100%; height: 100%; display: block; object-fit: cover;
  transition: transform .35s ease;
}
.c4-cp-card:hover .c4-cp-card__media img,
.c4-cp-card:hover .c4-cp-card__media svg { transform: scale(1.035); }
.c4-cp-badge {
  position: absolute;
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-line);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  box-shadow: var(--glass-shadow);
  font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1; white-space: nowrap;
}
.c4-cp-badge--difficulty { top: 12px; left: 12px; }
.c4-cp-badge--downloads  { top: 12px; right: 12px; }
.c4-cp-badge .dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.10); }
.c4-cp-badge--easy .dot { background: var(--diff-easy); }
.c4-cp-badge--medium .dot { background: var(--diff-medium); }
.c4-cp-badge--detailed .dot { background: var(--diff-detailed); }
.c4-cp-ribbon {
  position: absolute; bottom: 12px; left: 12px;
  display: none; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: white; box-shadow: var(--glass-shadow);
}
.c4-cp-card--popular .c4-cp-ribbon--popular,
.c4-cp-card--new .c4-cp-ribbon--new { display: inline-flex; }
.c4-cp-ribbon--popular { background: var(--accent-coral); }
.c4-cp-ribbon--new { background: var(--accent-mint); }
.c4-cp-card__body { padding: 16px 18px 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.c4-cp-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.c4-cp-card__title {
  margin: 0; font-family: var(--font-display); font-size: 19px;
  line-height: 1.25; font-weight: 700; color: var(--ink); letter-spacing: -0.005em;
}
.c4-cp-card__title a {
  color: inherit; text-decoration: none;
  background-image: linear-gradient(var(--primary-ink), var(--primary-ink));
  background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .25s ease, color .15s;
}
.c4-cp-card__title a:hover { color: var(--primary-ink); background-size: 100% 1.5px; }
.c4-cp-card__title a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 3px; }
.c4-cp-card__view {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; color: var(--ink-3);
  transition: color .15s, background .15s, transform .2s; flex-shrink: 0; margin-top: 2px;
}
.c4-cp-card__view:hover { color: var(--primary-ink); background: var(--primary-soft); transform: translateX(2px); text-decoration: none; }
.c4-cp-card__desc { color: var(--ink-2); font-size: 14px; line-height: 1.5; margin: 0; }
.c4-cp-card__desc-clip {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.c4-cp-card__actions {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  padding: 10px 18px 18px; margin-top: auto; align-items: center;
}
.c4-cp-act {
  height: 44px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; padding: 0 14px; text-decoration: none;
  transition: transform .08s, box-shadow .15s, background .15s, color .15s, border-color .15s;
}
.c4-cp-act:active { transform: translateY(1px); }
.c4-cp-act--primary { background: var(--primary); color: white; box-shadow: 0 4px 12px oklch(56% 0.18 256 / .28); }
.c4-cp-act--primary:hover { background: var(--primary-ink); text-decoration: none; color: white; }
.c4-cp-act--icon {
  width: 44px; height: 44px; padding: 0; background: var(--paper);
  color: var(--ink-2); border: 1px solid var(--line); position: relative;
}
.c4-cp-act--icon:hover { color: var(--ink); border-color: var(--ink-3); text-decoration: none; }
.c4-cp-act--icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: var(--ink); color: white; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 5px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s, transform .15s;
}
.c4-cp-act--icon:hover[data-tooltip]::after,
.c4-cp-act--icon:focus-visible[data-tooltip]::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.c4-cp-act--pin:hover { color: oklch(56% 0.21 25); border-color: oklch(75% 0.15 25); }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 1023px) {
  .c4-cat-grid,
  .c4-hub-grid2,
  .c4-cp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .c4-cat-grid,
  .c4-hub-grid2,
  .c4-cp-grid { grid-template-columns: 1fr; }
  .c4-cat-grid { max-width: 420px; margin-inline: auto; }
  .c4-hub-grid2 { max-width: 360px; margin-inline: auto; }
  .c4-cp-grid { max-width: 420px; margin-inline: auto; }
}
