/* ---------- Professions: a gallery of cards. The hovered card comes forward and shows its prompt. ---------- */
.pg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 26px; margin-top: 52px; }

.pi { position: relative; z-index: 1; will-change: transform, opacity; display: flex; flex-direction: column; gap: 14px; transition: transform 420ms var(--ease), opacity 300ms ease; }
.pi.is-active { z-index: 3; }

.pc {
  position: relative; flex: 1; display: flex; flex-direction: column; padding: 12px; border-radius: 22px; outline: none;
  background: linear-gradient(165deg, #1b2434, #121926);
  border: 1px solid var(--border-soft);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.8);
  transition: transform 420ms var(--ease);
}
/* the forward look is two pre-drawn layers that fade in, so only opacity and transform animate */
.pc::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; border: 1px solid color-mix(in srgb, var(--c2) 60%, transparent); opacity: 0; transition: opacity 320ms ease; }
.pc::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: 0 40px 70px -28px rgba(0, 0, 0, 0.85), 0 0 50px -14px color-mix(in srgb, var(--c1) 70%, transparent); opacity: 0; transition: opacity 420ms ease; }
.pc:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 4px; }
.pi.is-active .pc { transform: translateY(-10px) scale(1.045); }
.pi.is-active .pc::before, .pi.is-active .pc::after { opacity: 1; }

/* the others step back a little: smaller, dimmer, softly blurred (only where there is a real hover) */
@media (hover: hover) and (pointer: fine) {
  .pg.has-active .pi:not(.is-active) { transform: scale(0.972); opacity: 0.55; filter: blur(1.4px); }
  .pg.is-lite.has-active .pi:not(.is-active) { filter: none; opacity: 0.5; }
}

/* the profession name: the card's title, pinned top-left over the artwork AND the prompt */
.pc-name { position: absolute; z-index: 3; left: 18px; top: 15px; margin: 0; font: 700 30px/1 var(--font-head); letter-spacing: 0.2px; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55); pointer-events: none; }
.pc-name::after { content: ""; display: block; width: 28px; height: 3px; margin-top: 9px; border-radius: 2px; background: var(--c2); box-shadow: 0 0 12px color-mix(in srgb, var(--c2) 80%, transparent); }

/* thumbnail: the artwork, swapped for the prompt while the card is forward */
.pc-stage { position: relative; height: 188px; border-radius: 15px; overflow: hidden; background: #0d121b; isolation: isolate; }
.pc-art, .pc-prompt { position: absolute; inset: 0; transition: opacity 360ms ease, transform 480ms var(--ease); }
.pc-art {
  display: grid; place-items: center end; padding-right: 30px;
  background:
    radial-gradient(ellipse 70% 90% at 78% 0%, color-mix(in srgb, var(--c1) 50%, transparent), transparent 70%),
    radial-gradient(ellipse 60% 70% at 0% 100%, color-mix(in srgb, var(--c2) 22%, transparent), transparent 70%),
    linear-gradient(160deg, #141b29, #0b1018);
}
.pc-orb { position: absolute; width: 120px; height: 120px; border-radius: 50%; right: -26px; top: -40px; background: radial-gradient(circle, color-mix(in srgb, var(--c2) 45%, transparent), transparent 70%); filter: blur(6px); }
.pc-tile {
  position: relative; width: 78px; height: 78px; display: grid; place-items: center; border-radius: 22px; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c2) 55%, #0d121b), color-mix(in srgb, var(--c1) 70%, #0d121b));
  border: 1px solid color-mix(in srgb, var(--c2) 60%, transparent);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.03), 0 14px 34px -8px color-mix(in srgb, var(--c1) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: rotate(-7deg);
}
.pc-tile svg { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c2) 90%, transparent)); }
.pc-hint { position: absolute; left: 12px; bottom: 11px; padding: 5px 11px; border-radius: 999px; font: 600 12px/1 var(--font-body); color: rgba(255, 255, 255, 0.82); background: rgba(8, 12, 19, 0.55); border: 1px solid rgba(255, 255, 255, 0.12); }

.pc-prompt { display: flex; flex-direction: column; padding: 56px 18px 12px; background: #1b2231; opacity: 0; transform: translateY(14px); pointer-events: none; }
.pc-try { position: absolute; right: 16px; top: 19px; margin: 0; font-size: 12px; font-weight: 600; color: var(--accent-light); }
.pc-prompt-text, .pc-typed { margin: 0; font-size: 14px; line-height: 1.5; color: #fff; }
.pc-typed { position: absolute; left: 18px; right: 18px; top: 56px; opacity: 0; pointer-events: none; }
.pc-prompt.is-typing .pc-prompt-text { opacity: 0; }
.pc-prompt.is-typing .pc-typed { opacity: 1; }
.pc-prompt.is-typing .pc-typed::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; background: var(--accent-light); vertical-align: -2px; animation: pcCaret 900ms steps(1) infinite; }
@keyframes pcCaret { 50% { opacity: 0; } }
.pc-copy { align-self: flex-end; margin-top: auto; border: 1px solid rgba(255, 255, 255, 0.16); background: #2a3347; color: #fff; cursor: pointer; padding: 7px 15px; border-radius: 999px; font: 600 13px/1 var(--font-body); transition: background 180ms ease, border-color 180ms ease, transform 160ms ease; }
.pc-copy:hover { background: var(--accent); border-color: transparent; }
.pc-copy:active { transform: scale(0.95); }
.pc-copy.is-done { background: var(--success); border-color: transparent; color: #05231a; }

.pi.is-active .pc-art { opacity: 0; transform: translateY(-12px) scale(0.96); }
.pi.is-active .pc-prompt { opacity: 1; transform: none; pointer-events: auto; }

.pc-body { padding: 18px 10px 12px; }
.pc-body h3 { font: 700 clamp(20px, 1.8vw, 23px)/1.1 var(--font-head); color: rgba(255, 255, 255, 0.92); margin-bottom: 14px; }
.pc-points { display: grid; gap: 11px; }
.pc-points li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.5; color: rgba(236, 237, 237, 0.86); }
.pc-points i { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; font-style: normal; color: #05231a; background: var(--success); }

.pi.is-active 
/* without JS there is no hover, so the prompt shows in place of the artwork */
html:not(.js) .pc-art { display: none; }
html:not(.js) .pc-prompt { position: relative; opacity: 1; transform: none; pointer-events: auto; min-height: 188px; }
html:not(.js) .pc-stage { height: auto; }
html:not(.js) .pc-copy { display: none; }

@media (max-width: 1000px) { .pg { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .pg { grid-template-columns: 1fr; gap: 26px; max-width: 460px; margin-left: auto; margin-right: auto; }
  .pc-body h3 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .pi, .pc, .pc-art, .pc-prompt,   .pi.is-active .pc { transform: none; }
  .pg.has-active .pi:not(.is-active) { transform: none; filter: none; }
}
