@import url('shared.css');
@import url("https://fonts.googleapis.com/css2?family=PT+Sans+Narrow:wght@400;700&display=swap");
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

::selection {
  color: #fff;
  background: hsl(349deg, 100%, 74%);
}

h1,
h2,
h3,
h4,
h5,
p {
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  align-self: center;
}

a, a:hover {
  text-decoration: none;
}

.flow-content > * + * {
  margin-top: 2rem;
}

li {
  list-style-type: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== BACK LINK ===== */
.back-link {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 1000;
  opacity: 0;
  animation: fadeIn 0.6s ease-out 0.2s forwards;
}

@media (max-width: 768px) {
  .back-link {
    top: 1rem;
    left: 1rem;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

body {
  background: #1F307F;
  display: grid;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "PT Sans Narrow", sans-serif;
  position: relative;
  padding-bottom: 2rem;
}

/* ===== NOISE/GRAIN TEXTURE OVERLAY ===== */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
  body {
    padding-bottom: 1.5rem;
  }
}

@media (min-width: 1000px) {
  body {
    place-content: center;
    padding-bottom: 0;
  }
}

h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: 4rem;
  margin-bottom: 0;
}

p {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  line-height: 1.6;
  width: 25ch;
  margin: auto;
  letter-spacing: 0.01em;
}

@media (max-width: 768px) {
  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-top: 2rem;
  }
  
  p {
    font-size: clamp(1rem, 4vw, 1.2rem);
    line-height: 1.65;
    width: auto;
    max-width: 30ch;
    padding: 0 1rem;
    letter-spacing: 0.015em;
  }
}

.wrapper {
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

@media (max-width: 768px) {
  .wrapper {
    gap: 1.5rem;
    padding: 1.5rem 1rem;
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .wrapper {
    gap: 1.25rem;
    padding: 1rem 0.75rem;
  }
}
@media (min-width: 1000px) {
  .wrapper {
    flex-direction: row;
    margin: 0;
  }
}
.player-card {
  display: grid;
  grid-template-rows: 20rem 20rem;
  transition: 
    transform 600ms cubic-bezier(0.4, 0, 0.2, 1),
    translate 600ms cubic-bezier(0.4, 0, 0.2, 1),
    scale 400ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 500ms cubic-bezier(0.4, 0, 0.2, 1),
    z-index 0ms;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 4px 8px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.15),
    0 16px 32px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  outline: 3px solid transparent;
  outline-offset: 3px;
  opacity: 0;
  animation: fadeInUpRotate 0.8s ease-out forwards;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}


@media (max-width: 768px) {
  .player-card {
    grid-template-rows: auto 18rem;
    min-height: auto;
    border-radius: 0.5rem;
  }
}

@media (max-width: 480px) {
  .player-card {
    grid-template-rows: auto 16rem;
  }
}

.player-card:focus-visible {
  outline-color: #fff;
  z-index: 10;
}

@media (min-width: 1000px) {
  .player-card {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    rotate: 348deg;
    height: 45vh;
    width: 40vw;
    will-change: transform, translate, scale;
    /* Ensure animation doesn't conflict with rotate property */
    animation: fadeInUpRotateDesktop 0.8s ease-out forwards;
    /* No transition on rotate to prevent spinning on resize */
    transition: 
      transform 600ms cubic-bezier(0.4, 0, 0.2, 1),
      translate 600ms cubic-bezier(0.4, 0, 0.2, 1),
      scale 400ms cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 500ms cubic-bezier(0.4, 0, 0.2, 1),
      z-index 0ms;
  }
}
.player-card .text {
  display: grid;
  place-content: center;
  gap: 1rem;
  text-align: center;
  padding: 1rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.player-card .text h1 {
  animation-delay: calc(var(--card-delay, 0.1s) + 0.3s);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  margin-bottom: 0.5rem;
}

.player-card .text p {
  animation-delay: calc(var(--card-delay, 0.1s) + 0.4s);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.6;
  letter-spacing: 0.01em;
  max-width: 26ch;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .player-card .text {
    gap: 0.75rem;
    padding: 1.5rem 1rem;
  }
  
  .player-card .text h1 {
    font-size: clamp(2rem, 7vw, 2.75rem);
    margin-bottom: 0.4rem;
  }
  
  .player-card .text p {
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
    max-width: 28ch;
  }
}

@media (max-width: 480px) {
  .player-card .text {
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
  }
  
  .player-card .text h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    margin-bottom: 0.3rem;
  }
  
  .player-card .text p {
    font-size: clamp(0.9rem, 4vw, 1rem);
    max-width: 30ch;
  }
}

.player-card::after {
  content: "";
  background: url("/images/cavs-logo.png") left top/contain no-repeat;
  position: absolute;
  width: 5rem;
  aspect-ratio: 1.1638;
  margin-left: 0.75rem;
  margin-top: 0.75rem;
  pointer-events: none;
  opacity: 0;
  animation: fadeInScale 0.5s ease-out forwards;
}

@media (max-width: 768px) {
  .player-card::after {
    width: 4rem;
    margin-left: 0.5rem;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .player-card::after {
    width: 3.5rem;
    margin-left: 0.5rem;
    margin-top: 0.5rem;
  }
}

.player-card:first-child::after {
  animation-delay: 0.5s;
}

.player-card:nth-child(2)::after {
  animation-delay: 0.7s;
}

.player-card:last-child::after {
  animation-delay: 0.9s;
}

.image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.player-card .image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  opacity: 0;
  transform: scale(1);
  animation: imageFadeIn 0.8s ease-out forwards;
  transition: transform 400ms ease-out;
}

/* ===== IMAGE ZOOM ON HOVER ===== */
.player-card:hover .image {
  transform: scale(1.15);
}

.player-card:first-child .image {
  animation-delay: 0.2s;
}

.player-card:nth-child(2) .image {
  animation-delay: 0.4s;
}

.player-card:last-child .image {
  animation-delay: 0.6s;
}

.player-card:first-child {
  background: linear-gradient(#D1C2BC, #B7A69C);
}
@media (min-width: 1000px) {
  .player-card:first-child {
    translate: 35vmin -10vmin;
    box-shadow: 
      0 4px 8px rgba(0, 0, 0, 0.15),
      0 8px 16px rgba(0, 0, 0, 0.18),
      0 16px 32px rgba(0, 0, 0, 0.22),
      0 32px 64px rgba(0, 0, 0, 0.25),
      12px -8px 24px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(0, 0, 0, 0.06);
  }
}

.player-card:nth-child(2) {
  background: linear-gradient(#FD9A5C, #EB7125);
  z-index: 2;
  color: #fff;
}

@media (min-width: 1000px) {
  .player-card:nth-child(2) {
    box-shadow: 
      0 6px 12px rgba(0, 0, 0, 0.2),
      0 12px 24px rgba(0, 0, 0, 0.22),
      0 24px 48px rgba(0, 0, 0, 0.25),
      0 48px 96px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(0, 0, 0, 0.08);
  }
}

.player-card:last-child {
  background: linear-gradient(#C9E6EC, #9BC0C6);
  color: #212529;
}
@media (min-width: 1000px) {
  .player-card:last-child {
    translate: -35vmin 10vmin;
    box-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.12),
      0 4px 8px rgba(0, 0, 0, 0.15),
      0 8px 16px rgba(0, 0, 0, 0.18),
      0 16px 32px rgba(0, 0, 0, 0.2),
      -12px 8px 24px rgba(0, 0, 0, 0.18),
      0 0 0 1px rgba(0, 0, 0, 0.05);
  }
}

.player-card:hover,
.player-card:focus-within {
  z-index: 3;
  scale: 1.05;
}

/* ===== GLOW EFFECT ON HOVER ===== */
.player-card:first-child:hover,
.player-card:first-child:focus-within {
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.2),
    0 16px 32px rgba(0, 0, 0, 0.25),
    0 32px 64px rgba(0, 0, 0, 0.3),
    0 0 25px rgba(209, 194, 188, 0.5),
    0 0 50px rgba(183, 166, 156, 0.3);
}

.player-card:nth-child(2):hover,
.player-card:nth-child(2):focus-within {
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.2),
    0 16px 32px rgba(0, 0, 0, 0.25),
    0 32px 64px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(253, 154, 92, 0.6),
    0 0 60px rgba(235, 113, 37, 0.4);
}

.player-card:last-child:hover,
.player-card:last-child:focus-within {
  box-shadow: 
    0 8px 16px rgba(0, 0, 0, 0.2),
    0 16px 32px rgba(0, 0, 0, 0.25),
    0 32px 64px rgba(0, 0, 0, 0.3),
    0 0 25px rgba(201, 230, 236, 0.5),
    0 0 50px rgba(155, 192, 198, 0.3);
}

@media (min-width: 1000px) {
  .player-card:first-child:hover,
  .player-card:first-child:focus-within {
    box-shadow: 
      0 8px 16px rgba(0, 0, 0, 0.22),
      0 16px 32px rgba(0, 0, 0, 0.28),
      0 32px 64px rgba(0, 0, 0, 0.32),
      16px -12px 32px rgba(0, 0, 0, 0.25),
      0 0 35px rgba(209, 194, 188, 0.6),
      0 0 70px rgba(183, 166, 156, 0.4);
  }
  
  .player-card:nth-child(2):hover,
  .player-card:nth-child(2):focus-within {
    box-shadow: 
      0 10px 20px rgba(0, 0, 0, 0.25),
      0 20px 40px rgba(0, 0, 0, 0.3),
      0 40px 80px rgba(0, 0, 0, 0.35),
      0 0 45px rgba(253, 154, 92, 0.7),
      0 0 90px rgba(235, 113, 37, 0.5);
  }
  
  .player-card:last-child:hover,
  .player-card:last-child:focus-within {
    box-shadow: 
      0 6px 12px rgba(0, 0, 0, 0.2),
      0 12px 24px rgba(0, 0, 0, 0.25),
      0 24px 48px rgba(0, 0, 0, 0.3),
      -16px 12px 32px rgba(0, 0, 0, 0.22),
      0 0 35px rgba(201, 230, 236, 0.6),
      0 0 70px rgba(155, 192, 198, 0.4);
  }
}

/* ===== ENTRANCE ANIMATIONS ===== */
.player-card:nth-child(1) { 
  animation-delay: 0.1s;
  --card-delay: 0.1s;
}
.player-card:nth-child(2) { 
  animation-delay: 0.3s;
  --card-delay: 0.3s;
}
.player-card:nth-child(3) { 
  animation-delay: 0.5s;
  --card-delay: 0.5s;
}

@keyframes fadeInUpRotate {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop: animation without rotation conflict */
@keyframes fadeInUpRotateDesktop {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile: subtle rotation on entrance */
@media (max-width: 999px) {
  @keyframes fadeInUpRotate {
    from {
      opacity: 0;
      transform: translateY(50px) rotate(3deg);
    }
    to {
      opacity: 1;
      transform: translateY(0) rotate(0deg);
    }
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 0.8;
    transform: scale(1);
  }
}

@keyframes imageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .player-card,
  .player-card .text,
  .player-card .image,
  .player-card::after,
  .back-link {
    opacity: 1;
    animation: none;
    transform: none;
  }
}
