/* Student ideas — Astra editorial motion
   Skills: emilkowalski/animate, review-animations, web-motion-design, design-motion-principles
   Tokens: site --ease-out / --dur-* only. GPU: transform, opacity, clip-path. */

.ideas-section {
  --ideas-enter: var(--dur-slow, 520ms);
  --ideas-hover-in: 180ms;
  --ideas-hover-out: 120ms;
  --ideas-ease: var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
  --ideas-ease-move: var(--ease-soft, cubic-bezier(0.4, 0, 0.2, 1));
  background: #f3f6f1;
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.idea-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  padding: 26px 24px 28px;
  border: 1px solid rgba(11, 37, 38, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(184, 233, 200, 0.14), transparent 44%),
    #fff;
  box-shadow: 0 8px 22px rgba(9, 34, 34, 0.035);
  cursor: default;
  user-select: text;
  transform: translateZ(0);
  transition:
    border-color var(--ideas-hover-out) var(--ideas-ease-move),
    box-shadow var(--ideas-hover-out) var(--ideas-ease-move);
}

/* Soft mint wash — secondary action only, never a hard glow */
.idea-card::after {
  content: "";
  position: absolute;
  inset: auto -28% -42% auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 239, 211, 0.34), transparent 68%);
  opacity: 0;
  transform: translate3d(18px, 14px, 0);
  transition:
    opacity var(--ideas-hover-out) var(--ideas-ease),
    transform var(--ideas-hover-out) var(--ideas-ease);
  pointer-events: none;
  z-index: 0;
}

.idea-card > * {
  position: relative;
  z-index: 1;
}

.idea-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.idea-number {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5f7a6b;
  font-weight: 700;
  transition: color var(--ideas-hover-out) var(--ideas-ease-move);
}

.idea-direction {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(11, 37, 38, 0.05);
  color: #0b2526;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background-color var(--ideas-hover-out) var(--ideas-ease-move);
}

.idea-card h3 {
  margin: 0;
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.28;
  letter-spacing: -0.035em;
  color: #0b2526;
}

.idea-card p {
  margin: 0;
  color: #4d6357;
  font-size: 13px;
  line-height: 1.7;
  transition: color var(--ideas-hover-out) var(--ideas-ease-move);
}

.ideas-section .filters button {
  transition:
    background-color var(--dur-fast, 160ms) var(--ideas-ease-move),
    color var(--dur-fast, 160ms) var(--ideas-ease-move),
    border-color var(--dur-fast, 160ms) var(--ideas-ease-move);
}

/* Entrance: soft curtain from below + follow-through on inner pieces
   Marketing/explanatory tier — longer than micro UI, still ease-out */
@media (prefers-reduced-motion: no-preference) {
  .idea-card.will-reveal {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
    clip-path: inset(0 0 14% 0);
    transition:
      opacity var(--ideas-enter) var(--ideas-ease),
      transform var(--ideas-enter) var(--ideas-ease),
      clip-path calc(var(--ideas-enter) + 40ms) var(--ideas-ease),
      border-color var(--ideas-hover-out) var(--ideas-ease-move),
      box-shadow var(--ideas-hover-out) var(--ideas-ease-move);
    transition-delay: var(--delay, 0ms);
  }

  .idea-card.will-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    clip-path: inset(0 0 0 0);
  }

  /* Follow-through: children settle after the card shell */
  .idea-card.will-reveal .idea-number,
  .idea-card.will-reveal .idea-direction,
  .idea-card.will-reveal h3,
  .idea-card.will-reveal p {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    transition:
      opacity 340ms var(--ideas-ease),
      transform 340ms var(--ideas-ease);
  }

  .idea-card.will-reveal.is-visible .idea-number {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition-delay: calc(var(--delay, 0ms) + 70ms);
  }

  .idea-card.will-reveal.is-visible .idea-direction {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition-delay: calc(var(--delay, 0ms) + 110ms);
  }

  .idea-card.will-reveal.is-visible h3 {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition-delay: calc(var(--delay, 0ms) + 150ms);
  }

  .idea-card.will-reveal.is-visible p {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition-delay: calc(var(--delay, 0ms) + 190ms);
  }
}

/* Hover: frequent → near-imperceptible. No lift, no scale, no accent bar */
@media (hover: hover) and (pointer: fine) {
  .idea-card:hover {
    border-color: rgba(11, 37, 38, 0.13);
    box-shadow:
      0 14px 32px rgba(9, 34, 34, 0.055),
      0 0 0 1px rgba(168, 239, 211, 0.18);
    transition-duration: var(--ideas-hover-in);
  }

  .idea-card:hover::after {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition-duration: var(--ideas-hover-in);
  }

  .idea-card:hover .idea-number {
    color: #0b2526;
    transition-duration: var(--ideas-hover-in);
  }

  .idea-card:hover .idea-direction {
    background: rgba(168, 239, 211, 0.38);
    transition-duration: var(--ideas-hover-in);
  }

  .idea-card:hover p {
    color: #3f5648;
    transition-duration: var(--ideas-hover-in);
  }

  .ideas-section .filters button:hover:not(.active) {
    background: rgba(11, 37, 38, 0.04);
  }
}

/* Empty state: quiet ambient, one-shot pieces */
.ideas-empty {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 8px;
  min-height: 340px;
  padding: 64px 24px 78px;
  display: grid;
  place-items: center;
  text-align: center;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.ideas-empty__glow {
  position: absolute;
  width: min(680px, 92vw);
  height: min(420px, 70vw);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(168, 239, 211, 0.36) 0%, rgba(168, 239, 211, 0.12) 34%, transparent 72%);
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  filter: blur(2px);
  opacity: 0.92;
}

.ideas-empty__orbit {
  display: none;
}

.ideas-empty__inner {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  display: grid;
  gap: 14px;
  justify-items: center;
}

.ideas-empty__mark {
  width: 54px;
  height: 54px;
  color: #0b2526;
  opacity: 0.26;
  margin-bottom: 2px;
}

.ideas-empty__mark svg {
  width: 100%;
  height: 100%;
}

.ideas-empty .tiny-label {
  color: #6d8577;
  letter-spacing: 0.14em;
}

.ideas-empty h2 {
  margin: 0;
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.05em;
  color: #0b2526;
  font-weight: 500;
}

.ideas-empty h2 span {
  color: #5f8f78;
}

.ideas-empty p {
  margin: 0;
  max-width: 38ch;
  color: #5f7a6b;
  font-size: 14px;
  line-height: 1.75;
}

.ideas-empty .button {
  margin-top: 10px;
}

@media (prefers-reduced-motion: no-preference) {
  .ideas-empty {
    animation: ideas-empty-in 480ms var(--ideas-ease) both;
  }

  .ideas-empty__inner > * {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
    animation: ideas-empty-piece 480ms var(--ideas-ease) both;
  }

  .ideas-empty__inner > *:nth-child(1) { animation-delay: 50ms; }
  .ideas-empty__inner > *:nth-child(2) { animation-delay: 100ms; }
  .ideas-empty__inner > *:nth-child(3) { animation-delay: 150ms; }
  .ideas-empty__inner > *:nth-child(4) { animation-delay: 200ms; }
  .ideas-empty__inner > *:nth-child(5) { animation-delay: 240ms; }

  .ideas-empty__glow {
    animation: ideas-empty-glow 720ms var(--ideas-ease) both;
  }
}

@keyframes ideas-empty-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ideas-empty-piece {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes ideas-empty-glow {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }
  to {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 1100px) {
  .idea-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .idea-grid {
    grid-template-columns: 1fr;
  }

  .idea-card {
    padding: 22px 20px 24px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .idea-card,
  .idea-card::after,
  .idea-number,
  .idea-direction,
  .idea-card h3,
  .idea-card p,
  .ideas-section .filters button,
  .ideas-empty,
  .ideas-empty__glow,
  .ideas-empty__inner > * {
    transition: none !important;
    animation: none !important;
  }

  .idea-card.will-reveal,
  .idea-card.will-reveal.is-visible,
  .idea-card.will-reveal .idea-number,
  .idea-card.will-reveal .idea-direction,
  .idea-card.will-reveal h3,
  .idea-card.will-reveal p {
    opacity: 1;
    transform: none;
    clip-path: none;
  }

  .ideas-empty__glow {
    transform: translate(-50%, -50%);
    opacity: 0.85;
  }

  .ideas-empty__inner > * {
    opacity: 1;
    transform: none;
  }
}
