/* ── Motion system ─────────────────────────────────────────────────────────── */
/* Mirror of src/js/animation.js — keep in sync */

:root {
  --dur-fast:  150ms;
  --dur-base:  250ms;
  --dur-slow:  500ms;   /* matches hero profile image */
  --dur-xslow: 1000ms;  /* overlay entry / exit */

  --ease-default: ease;
  --ease-in-out:  ease-in-out;
  --ease-out:     cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in:      cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

/* ── Persona module styles ── */

.collection-item {
  position: relative;
}

.case--hidden {
  display: none;
}

/* Assumes .collection-list is a flex or grid container */
.case--featured {
  order: -1;
}


/* ── Greeting overlay ─────────────────────────────────────────────────────── */

#jh-greeting {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #0c0c0c;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 10vw;
  text-align: left;
  /* visibility: visible overrides html.jh-persona-loading body { visibility: hidden }
     so the overlay is shown while everything else stays hidden behind it */
  visibility: visible;
  opacity: 1;
  transition: opacity var(--dur-xslow) var(--ease-default);
}

#jh-greeting.jh-greeting--fade {
  opacity: 0;
}

.jh-greeting-line {
  font-family: 'Inter Tight', sans-serif;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 400;
  color: #fff;
  line-height: 1.3;
  margin: 0;
  padding: 0;
  /* JS toggles inline opacity/transition for the per-line fade */
}

.jh-cursor {
  display: inline-block;
  width: 2px;
  height: 0.8em;
  background: #fff;
  margin-left: 4px;
  vertical-align: middle;
  animation: jh-blink 0.85s step-end infinite;
}

@keyframes jh-blink {
  50% { opacity: 0; }
}

.jh-greeting-proceed {
  margin-top: 3.5rem;
  padding: 14px 40px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  opacity: 0;
  transition: opacity    var(--dur-slow)  var(--ease-default),
              background var(--dur-base)  var(--ease-default),
              color      var(--dur-base)  var(--ease-default),
              border-color var(--dur-base) var(--ease-default);
}

.jh-greeting-proceed:hover {
  background: #fff;
  color: #0c0c0c;
  border-color: #fff;
}

.jh-greeting-proceed.jh-proceed--visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  #jh-greeting,
  .jh-greeting-line,
  .jh-greeting-proceed {
    transition: none;
  }
  .jh-cursor {
    animation: none;
  }
}

/* Close (X) button — top-right of the overlay, used by the card-triggered flow */
.jh-greeting-close {
  position: absolute;
  top: clamp(16px, 4vw, 40px);
  right: clamp(16px, 4vw, 40px);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-default);
}

.jh-greeting-close:hover {
  color: #fff;
}

/* ── Personalization: greeting controls (inside #jh-greeting) ─────────────── */

.jh-pz {
  margin-top: 3rem;
  max-width: 32rem;
  width: 100%;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-slow) var(--ease-default),
              transform var(--dur-slow) var(--ease-out);
}

.jh-pz.is-visible {
  opacity: 1;
  transform: none;
}

.jh-pz-choice,
.jh-pz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.jh-pz-btn {
  padding: 14px 32px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  transition: background var(--dur-base) var(--ease-default),
              color var(--dur-base) var(--ease-default),
              border-color var(--dur-base) var(--ease-default);
}

.jh-pz-primary {
  background: #fff;
  color: #0c0c0c;
  border-color: #fff;
}

.jh-pz-primary:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.85);
}

.jh-pz-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

/* Form */
.jh-pz-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.jh-pz-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.jh-pz-label {
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.85);
}

.jh-pz-label em {
  font-style: normal;
  color: rgba(255, 255, 255, 0.5);
}

.jh-pz-input {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.05rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  transition: border-color var(--dur-base) var(--ease-default),
              background var(--dur-base) var(--ease-default);
}

.jh-pz-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.jh-pz-input:focus {
  outline: none;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.jh-pz-privacy {
  margin: 0;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}

/* Loading state */
.jh-pz-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Inter Tight', sans-serif;
  font-size: 1rem;
}

.jh-pz-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: jh-spin 0.8s linear infinite;
  flex: none;
}

@keyframes jh-spin {
  to { transform: rotate(360deg); }
}

/* Rotating loading line with a Claude-Code-style shimmer sweep */
.jh-pz-loading-text {
  font-family: 'Inter Tight', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.35) 30%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 255, 255, 0.35) 70%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: jh-shimmer 2s linear infinite;
  transition: opacity var(--dur-fast) var(--ease-default);
}

.jh-pz-loading-text.is-swapping {
  opacity: 0.15;
}

@keyframes jh-shimmer {
  to { background-position: -200% 0; }
}

/* ── Personalization: on-page results ────────────────────────────────────── */

/* Personalized About: subtle "Personalised…" sub-line under the heading. The
   About heading lives in a 32px flex-gap column, so pull the line up to tuck it
   right beneath the title, and let the gap breathe down to the intro copy. */
.jh-about-meta {
  margin: -1.25rem 0 0;
  font-family: 'Inter Tight', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #666;
}

/* Case names inside the personalized About copy: bold + underlined links to
   the matching case study. Inherit the surrounding text colour so they read as
   emphasis, not as a loud accent, and lift only on hover. */
.jh-about-link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.jh-about-link:hover,
.jh-about-link:focus-visible {
  opacity: 0.6;
}

.jh-personal-spark {
  color: currentColor;
  flex: none;
}

/* Collapsible "AI Summary" at the bottom of a card, divided by a fine line */
.jh-case-summary {
  width: 100%;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--black-15);
}

.jh-case-summary-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: #555;
  font-family: 'Inter Tight', sans-serif;
}

.jh-case-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
}

.jh-case-summary-label .jh-personal-spark {
  color: currentColor;
}

.jh-case-summary-chevron {
  flex: none;
  color: #999;
  transition: transform var(--dur-base) var(--ease-out);
}

.jh-case-summary.is-open .jh-case-summary-chevron {
  transform: rotate(180deg);
}

.jh-case-summary-toggle:hover {
  color: #111;
}

.jh-case-summary-toggle:hover .jh-case-summary-chevron {
  color: #111;
}

/* Animated expand/collapse via grid-template-rows (no height measuring) */
.jh-case-summary-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-base) var(--ease-out);
}

.jh-case-summary.is-open .jh-case-summary-body {
  grid-template-rows: 1fr;
}

.jh-case-summary-text {
  overflow: hidden;
  min-height: 0;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #444;
}

.jh-case-summary.is-open .jh-case-summary-text {
  padding-top: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .jh-pz,
  .jh-case-summary-chevron,
  .jh-case-summary-body {
    transition: none;
  }
  .jh-pz-spinner {
    animation-duration: 1.6s;
  }
  .jh-pz-loading-text {
    animation: none;
    background: none;
    -webkit-text-fill-color: #fff;
    color: #fff;
  }
}