/* ==========================================================================
   v7 — cohesive tool hero, palette-reactive background, post cards,
   icon category cards, illustrations. CSS classes only (CSP: style-src 'self').
   ========================================================================== */

/* ---------- palette-reactive hero (values set by /js/v7.js via style.setProperty) ---------- */
@property --hero-c1 { syntax: '<color>'; inherits: true; initial-value: #ff4500; }
@property --hero-c2 { syntax: '<color>'; inherits: true; initial-value: #3b82f6; }
@property --hero-c3 { syntax: '<color>'; inherits: true; initial-value: #22c55e; }
@property --wheel-glow { syntax: '<color>'; inherits: true; initial-value: #ff4500; }
.studio.studio-hero {
  --hero-a1: 18%; --hero-a2: 11%; --hero-a3: 10%; --glow-a: 26%;
  background:
    radial-gradient(75% 55% at 50% -14%, color-mix(in srgb, var(--hero-c1) var(--hero-a1), transparent) 0%, transparent 100%),
    radial-gradient(46% 60% at 0% 38%, color-mix(in srgb, var(--hero-c2) var(--hero-a2), transparent) 0%, transparent 72%),
    radial-gradient(46% 60% at 72% 100%, color-mix(in srgb, var(--hero-c3) var(--hero-a3), transparent) 0%, transparent 72%),
    var(--bg);
  transition: --hero-c1 .7s ease, --hero-c2 .7s ease, --hero-c3 .7s ease, --wheel-glow .7s ease;
}
html[data-theme="dark"] .studio.studio-hero { --hero-a1: 24%; --hero-a2: 14%; --hero-a3: 12%; --glow-a: 34%; }
.studio.studio-hero.hero-mono { --hero-a1: 10%; --hero-a2: 6%; --hero-a3: 5%; --glow-a: 16%; }
.studio-hero .wheel-wrap { isolation: isolate; }
.studio-hero .wheels-row { overflow-x: clip; overflow-y: visible; }
.studio-hero .wheel-wrap::before {
  content: ""; position: absolute; inset: -7%; border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--wheel-glow) var(--glow-a), transparent) 70%, color-mix(in srgb, var(--wheel-glow) 9%, transparent) 86%, transparent 100%);
  filter: blur(6px);
}
.studio-stage:fullscreen .wheel-wrap::before, body.embed-mode .wheel-wrap::before { display: none; }
@media (prefers-reduced-motion: reduce) { .studio.studio-hero { transition: none; } }

/* ---------- tool pages: one seamless hero like the homepage ---------- */
.page.tool-hero { max-width: none; padding: 0 0 64px; }
.page.tool-hero > .below-fold { max-width: 1280px; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
.tool-hero .studio.studio-hero { margin: 0 auto; }
.tool-hero .hero-crumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 6px; margin: 0 0 6px; font-size: .8rem; line-height: 1.4; }
.tool-hero .hero-head h1 { font-size: clamp(1.45rem, 2.4vw, 2rem); }

/* ---------- post cards (blog / guides) — 3 / 2 / 1 columns ---------- */
.content-section ul.post-grid, ul.post-grid {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
}
ul.post-grid > li { margin: 0; padding: 0; display: flex; min-width: 0; }
ul.post-grid > li::before { content: none; display: none; }
@media (max-width: 1023px) { .content-section ul.post-grid, ul.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (max-width: 640px)  { .content-section ul.post-grid, ul.post-grid { grid-template-columns: 1fr; gap: 16px; } }
a.post-card {
  display: flex; flex-direction: column; width: 100%; min-width: 0;
  background: var(--panel); color: var(--text); text-decoration: none;
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
a.post-card:hover, a.post-card:focus-visible {
  transform: translateY(-4px); text-decoration: none; color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  box-shadow: 0 20px 40px -22px rgba(15, 23, 42, .32);
}
.pc-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--border); }
.pc-media img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; border: 0; border-radius: 0; transition: transform .45s ease; }
a.post-card:hover .pc-media img { transform: scale(1.04); }
.pc-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1 1 auto; }
.pc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .74rem; color: var(--text-secondary); }
.pc-topic { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; font-size: .68rem; color: var(--accent); background: var(--accent-soft); }
.pc-topic svg { width: 13px; height: 13px; flex: none; }
.pc-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.pc-title { display: block; font-size: 1.05rem; line-height: 1.35; font-weight: 750; letter-spacing: -.01em; color: var(--text); }
.pc-excerpt { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .9rem; line-height: 1.55; color: var(--text-secondary); }
.pc-more { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .86rem; color: var(--accent); }
.pc-more svg { width: 15px; height: 15px; transition: transform .2s ease; }
a.post-card:hover .pc-more svg { transform: translateX(3px); }
html[data-theme="dark"] a.post-card { background: var(--panel); }
@media (prefers-reduced-motion: reduce) { a.post-card, .pc-media img, .pc-more svg { transition: none; } a.post-card:hover { transform: none; } a.post-card:hover .pc-media img { transform: none; } }

/* ---------- category / template cards with topic icons ---------- */
.tone-1 { --tone: #ff4500; } .tone-2 { --tone: #3b82f6; } .tone-3 { --tone: #16a34a; } .tone-4 { --tone: #d97706; }
.tone-5 { --tone: #8b5cf6; } .tone-6 { --tone: #db2777; } .tone-7 { --tone: #0d9488; } .tone-8 { --tone: #475569; }
html[data-theme="dark"] .tone-8 { --tone: #94a3b8; }
.card-grid a.card.cat-card, .content-section .card-grid a.card.cat-card, .below-fold .content-section .card-grid a.card.cat-card {
  display: flex !important; align-items: center; gap: 14px; position: relative; overflow: hidden;
  padding: 16px 18px !important; min-height: 76px;
  background: var(--panel) !important; border: 1px solid var(--border) !important; border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.content-section .card-grid a.card.cat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone);
  transform: scaleY(0); transform-origin: center; transition: transform .22s ease; display: block;
}
.content-section .card-grid a.card.cat-card::after { content: none !important; }
.content-section .card-grid a.card.cat-card:hover, .content-section .card-grid a.card.cat-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tone) 42%, var(--border)) !important;
  box-shadow: 0 16px 32px -20px color-mix(in srgb, var(--tone) 60%, rgba(15, 23, 42, .5)) !important;
}
.content-section .card-grid a.card.cat-card:hover::before { transform: scaleY(1); }
.content-section .card-grid a.card.cat-card .card-icon.cat-ico, .below-fold .content-section .card-grid a.card.cat-card .card-icon.cat-ico {
  display: inline-flex !important; align-items: center; justify-content: center; flex: 0 0 44px;
  width: 44px; height: 44px; border-radius: 12px; margin: 0;
  color: var(--tone) !important; background: color-mix(in srgb, var(--tone) 13%, transparent) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 18%, transparent);
  transition: background .2s ease, color .2s ease, transform .25s ease;
}
.content-section .card-grid a.card.cat-card .card-icon.cat-ico::before, .content-section .card-grid a.card.cat-card .card-icon.cat-ico::after { content: none !important; }
.content-section .card-grid a.card.cat-card .card-icon.cat-ico svg { width: 22px; height: 22px; display: block; }
.content-section .card-grid a.card.cat-card:hover .card-icon.cat-ico { background: var(--tone) !important; color: #fff !important; transform: rotate(-6deg) scale(1.04); }
.content-section .card-grid a.card.cat-card .card-copy { padding: 0 !important; min-width: 0; }
.content-section .card-grid a.card.cat-card .card-copy strong { color: var(--text); }
.content-section .card-grid a.card.cat-card:hover .card-copy strong { color: var(--tone); }
@media (prefers-reduced-motion: reduce) {
  .content-section .card-grid a.card.cat-card, .content-section .card-grid a.card.cat-card .card-icon.cat-ico { transition: none; }
  .content-section .card-grid a.card.cat-card:hover { transform: none; }
  .content-section .card-grid a.card.cat-card:hover .card-icon.cat-ico { transform: none; }
}

/* ---------- illustrations ---------- */
.illus { margin: 0; }
.illus img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 20px; border: 1px solid var(--border); box-shadow: 0 18px 40px -26px rgba(15, 23, 42, .35); background: var(--panel); }
.illus-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; align-items: center; }
.illus-split.is-rev { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
.illus-split.is-rev > .illus { order: -1; }
.illus-split { margin-bottom: 28px; }
.illus-split:last-child { margin-bottom: 0; }
.illus-split .platform-lead, .illus-split .platform-lead p { text-align: left; margin-left: 0; margin-right: 0; max-width: none; }
.illus-split > .callout-ibox, .illus-split > .split-ibox { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
.illus-split > :first-child { margin: 0; min-width: 0; }
.illus-under { margin-top: 22px; max-width: 440px; }
html[data-theme="dark"] .illus img { filter: brightness(.92); }
@media (max-width: 860px) {
  .illus-split { grid-template-columns: 1fr; gap: 18px; }
  .illus-split.is-rev { grid-template-columns: 1fr; }
  .illus-split.is-rev > .illus { order: 0; }
  .illus-split > .illus { max-width: 520px; margin: 0 auto; width: 100%; }
}
