/* ==========================================================================
   Home Section — styles for homeSection.php
   ========================================================================== */

/* --------------------------------------------------------------------------
   Scramble heading
   -------------------------------------------------------------------------- */
.scramble-text {
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.75rem;
}

@media (max-width: 380px) {
  #scramble {
    margin-top: 6.5rem;
    min-height: 3.5rem;
  }
}
@media (min-width: 640px) {
  .scramble-text { min-height: 2rem; }
}
@media (min-width: 768px) {
  .scramble-text { min-height: 2.25rem; }
}
@media (min-width: 1024px) {
  .scramble-text { min-height: 3rem; }
}

/* --------------------------------------------------------------------------
   Home highlights grid
   -------------------------------------------------------------------------- */
.home-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.65rem;
  align-items: stretch;
}

.home-highlight-card {
  position: relative;
  display: flex;
  min-width: 0;
  height: 100%;
  min-height: 7.85rem;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.62);
  padding: 0.8rem;
  text-align: left;
  box-shadow: none;
  backdrop-filter: blur(10px);
  transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.home-highlight-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: rgba(0, 0, 0, 0.82);
}

.home-highlight-card:hover {
  border-color: rgba(0, 0, 0, 0.34);
  background: rgba(255, 255, 255, 0.78);
  transform: translateY(-2px);
}

.home-highlight-card:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.home-highlight-card-top,
.home-highlight-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.home-highlight-card-top {
  min-width: 0;
  align-items: flex-start;
}

.home-highlight-icon {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: #000;
  color: #fff;
  font-size: 0.72rem;
  box-shadow: none;
}

.home-highlight-label,
.home-highlight-action {
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.home-highlight-label {
  min-width: 0;
  max-width: calc(100% - 2.25rem);
  color: rgba(55, 65, 81, 0.82);
  overflow-wrap: anywhere;
  line-height: 1.25;
  text-align: right;
}

.home-highlight-copy {
  position: relative;
  z-index: 1;
  margin-top: 0.65rem;
}

.home-highlight-copy h2 {
  color: #050505;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.home-highlight-copy p {
  margin-top: 0.3rem;
  color: rgba(55, 65, 81, 0.88);
  font-size: 0.68rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.home-highlight-footer {
  justify-content: flex-start;
  margin-top: 0.7rem;
}

.home-highlight-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #050505;
  max-width: 100%;
  white-space: normal;
  transition: color 220ms ease;
}

.home-highlight-action i {
  font-size: 0.6rem;
}

@media (max-width: 720px) {
  .home-highlight-card {
    padding: 0.75rem;
  }
}

@media (max-width: 380px) {
  .home-highlights-grid {
    gap: 0.55rem;
  }
  .home-highlight-card {
    min-height: 7.5rem;
    padding: 0.7rem;
  }
}

/* Dark mode overrides */
.dark .home-highlight-card {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.58);
  box-shadow: none;
}
.dark .home-highlight-card:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(0, 0, 0, 0.72);
}
.dark .home-highlight-card::before {
  background: rgba(255, 255, 255, 0.82);
}
.dark .home-highlight-icon {
  background: #fff;
  color: #000;
  box-shadow: none;
}
.dark .home-highlight-label {
  color: rgba(209, 213, 219, 0.82);
}
.dark .home-highlight-copy h2,
.dark .home-highlight-action {
  color: #fff;
}
.dark .home-highlight-copy p {
  color: rgba(229, 231, 235, 0.82);
}

/* --------------------------------------------------------------------------
   Spotify theme overrides (activated by JS)
   -------------------------------------------------------------------------- */
#home.spotify-theme-active #spotify-link,
#home.spotify-theme-active #spotify-link-mobile,
#home.spotify-theme-active #developer-map-card,
#home.spotify-theme-active .home-highlight-card {
  border-color: var(--spotify-panel-border);
  background: var(--spotify-panel-bg);
  color: var(--spotify-panel-text);
  box-shadow: var(--spotify-shadow);
}

#home.spotify-theme-active #spotify-link:hover,
#home.spotify-theme-active #spotify-link-mobile:hover,
#home.spotify-theme-active #developer-map-card:hover,
#home.spotify-theme-active .home-highlight-card:hover {
  border-color: var(--spotify-panel-text);
  background: var(--spotify-panel-hover);
}

#home.spotify-theme-active .home-highlight-card::before {
  height: 3px;
  background: linear-gradient(90deg, var(--spotify-highlight-bar), var(--spotify-accent));
}

#home.spotify-theme-active .home-highlight-icon {
  background: var(--spotify-icon-bg);
  color: var(--spotify-icon-fg);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

#home.spotify-theme-active .home-highlight-label,
#home.spotify-theme-active .home-highlight-copy p {
  color: var(--spotify-panel-muted);
}

#home.spotify-theme-active .home-highlight-copy h2,
#home.spotify-theme-active .home-highlight-action,
#home.spotify-theme-active .developer-location-title,
#home.spotify-theme-active #spotify-widget-title,
#home.spotify-theme-active #spotify-track,
#home.spotify-theme-active #spotify-track-mobile,
#home.spotify-theme-active #progress-time,
#home.spotify-theme-active #progress-time-mobile {
  color: var(--spotify-panel-text);
}

#home.spotify-theme-active #spotify-artist,
#home.spotify-theme-active #spotify-artist-mobile {
  color: var(--spotify-panel-muted);
}

#home.spotify-theme-active #spotify-widget-title,
#home.spotify-theme-active #spotify-track,
#home.spotify-theme-active #spotify-track-mobile,
#home.spotify-theme-active #spotify-artist,
#home.spotify-theme-active #spotify-artist-mobile,
#home.spotify-theme-active #progress-time,
#home.spotify-theme-active #progress-time-mobile,
#home.spotify-theme-active #spotify-source-badge,
#home.spotify-theme-active #spotify-source-badge-mobile {
  border-color: var(--spotify-panel-border);
  background: var(--spotify-chip-bg);
}

#home.spotify-theme-active #spotify-progress-wrap,
#home.spotify-theme-active #spotify-progress-wrap-mobile {
  background: var(--spotify-chip-bg);
}

#home.spotify-theme-active #progress-bar,
#home.spotify-theme-active #progress-bar-mobile {
  background: var(--spotify-highlight-bar);
}

#home.spotify-theme-active #developer-map-card iframe {
  border: 1px solid var(--spotify-panel-border) !important;
}

/* Hero CTA spotify theme overrides */
#home.spotify-theme-active .hero-value-prop h2,
#home.spotify-theme-active .hero-value-prop p {
  color: var(--spotify-panel-text);
}
#home.spotify-theme-active .hero-cta-primary {
  background: var(--spotify-highlight-bar);
  color: var(--spotify-panel-bg);
}
#home.spotify-theme-active .hero-cta-primary:hover {
  opacity: 0.88;
}
#home.spotify-theme-active .hero-cta-secondary,
#home.spotify-theme-active .hero-cta-tertiary {
  color: var(--spotify-panel-text);
  border-color: var(--spotify-panel-border);
}
#home.spotify-theme-active .hero-cta-secondary:hover,
#home.spotify-theme-active .hero-cta-tertiary:hover {
  border-color: var(--spotify-panel-text);
  background: var(--spotify-chip-bg);
}

@media (prefers-reduced-motion: reduce) {
  .home-highlight-card,
  .home-highlight-action {
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   Flip animations (connect links + resume button)
   -------------------------------------------------------------------------- */
.flip-inner {
  display: inline-block;
  line-height: 1;
  transition: transform 0.5s ease-in-out;
}

#cv-button-wrapper a:hover .flip-front {
  transform: translateY(-120%);
}
#cv-button-wrapper a:hover .flip-back {
  transform: translateY(-120%);
}
.connect-link:hover .flip-front {
  transform: translateY(-120%);
}
.connect-link:hover .flip-back {
  transform: translateY(-120%);
}
.flip-back {
  top: 100%;
  left: 0;
}

/* --------------------------------------------------------------------------
   Memoji orbit
   -------------------------------------------------------------------------- */
.memoji-orbit {
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
.memoji-orbit:hover {
  transform: translateY(-4px) scale(1.03) rotate(-1.2deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border-color: rgba(0, 0, 0, 0.55);
}
.memoji-orbit:hover #memoji-head {
  transform: scale(1.16);
}

/* --------------------------------------------------------------------------
   Progress bars
   -------------------------------------------------------------------------- */
.progress-fill {
  width: 0%;
}

/* --------------------------------------------------------------------------
   Google Map iframe
   -------------------------------------------------------------------------- */
.map-embed {
  border: 0;
}

/* --------------------------------------------------------------------------
   Scroll-down indicator
   -------------------------------------------------------------------------- */
@keyframes scrollDot {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(1.5rem);
    opacity: 0.6;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-scroll-dot {
  animation: scrollDot 1.2s infinite ease-in-out;
}

/* --------------------------------------------------------------------------
   Effects container keyframes (snow + confetti)
   (previously injected dynamically via JS — now statically defined)
   -------------------------------------------------------------------------- */
@keyframes fall {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

.animate-fall {
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-50px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.animate-confetti {
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}