/* Annual hackathon: winning projects, 3D podium, and the "check back" note. */

.hack {
  position: relative;
  z-index: 5;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-block: clamp(64px,10vh,104px);
  padding-inline: var(--gutter);
  scroll-margin-top: 84px;
  overflow: hidden;
}

.hack .inner {
  max-width: 1180px;
  margin: 0 auto;
}

.hack h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px,5vw,64px);
  line-height: 1.02;
  letter-spacing: -.025em;
  margin: 0;
}

.podium {
  --w: clamp(160px,24vw,260px);
  --d: clamp(56px,8vw,96px);
  --f: #E7DFCF;
  --t: #F7F3EB;
  --s: #D3C7B0;
  perspective: 1400px;
  display: flex;
  justify-content: center;
  padding: clamp(140px,16vw,180px) 0 24px;
}

.stage3d {
  display: flex;
  align-items: flex-end;
  transform-style: preserve-3d;
  transform: rotateX(-16deg) rotateY(-20deg);
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}

.podium:hover .stage3d {
  transform: rotateX(-12deg) rotateY(-8deg);
}

.step {
  position: relative;
  width: var(--w);
  height: var(--h);
  transform-style: preserve-3d;
}

.step .fc {
  position: absolute;
  inset: 0;
  background: var(--f);
  transform: translateZ(calc(var(--d) / 2));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(12px,2vw,22px);
  gap: 6px;
  border: 1px solid rgba(20,20,19,.06);
}

.step .tp {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--d);
  background: var(--t);
  transform-origin: top center;
  transform: translateZ(calc(var(--d) / -2)) rotateX(90deg);
  border: 1px solid rgba(20,20,19,.05);
}

.step .sd {
  position: absolute;
  left: 100%;
  top: 0;
  width: var(--d);
  height: 100%;
  background: var(--s);
  transform-origin: left center;
  transform: translateZ(calc(var(--d) / 2)) rotateY(90deg);
}

.medal {
  width: clamp(38px,5vw,56px);
  height: clamp(38px,5vw,56px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 500 clamp(18px,2.4vw,26px)/1 var(--display);
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18),inset 0 2px 0 rgba(255,255,255,.35);
}

.m1 {
  background: radial-gradient(circle at 35% 30%,#F3DA6B,#C99A12 70%);
}

.m2 {
  background: radial-gradient(circle at 35% 30%,#E6E6E2,#9A9A95 70%);
}

.m3 {
  background: radial-gradient(circle at 35% 30%,#E8A774,#A65A27 70%);
}

.place {
  font: 500 clamp(9.5px,1.1vw,11.5px)/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6F6D66;
  text-align: center;
}

.hack-eyebrow {
  margin: 0 0 16px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.hack-intro {
  margin: 16px 0 0;
  color: var(--fg-muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 42em;
}

.hack-intro b {
  color: var(--fg);
  font-weight: 500;
}

.winner-clawd {
  position: absolute;
  bottom: calc(100% - 2px);
  left: 50%;
  width: clamp(100px,13vw,144px);
  transform: translateX(-50%) translateZ(calc(var(--d) / 2));
  pointer-events: none;
}

.winner-clawd img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 2px rgba(60,45,25,.09));
}

.step .winner-front {
  padding: 20px 18px 18px;
  text-decoration: none;
  color: var(--fg);
  text-align: center;
  gap: 8px;
}

.winner-front h3 {
  margin: 6px 0 0;
  font: 600 clamp(16px,1.8vw,21px)/1.2 var(--ui);
  letter-spacing: -.02em;
}

.podium-desc {
  margin: 0;
  font-size: clamp(12px,1.25vw,14px);
  line-height: 1.45;
  color: #5e584c;
}

.podium-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  font: 500 11px/1.3 var(--mono);
  letter-spacing: .02em;
  color: #65533a;
}

.winner-front:hover .podium-github {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.winner-front:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 4px;
}

.podium-summary {
  display: none;
}

.hack-note {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 560px;
  margin: 28px auto 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
}

.hack-note img {
  width: 84px;
  height: auto;
  image-rendering: pixelated;
  flex: none;
  margin: -14px -6px -4px -8px;
}

.hack-note p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-muted);
}

.hack-note p b {
  color: var(--fg);
  font-weight: 600;
}

@media (max-width:850px) {
  .hack {
    padding-block: 52px;
  }

  .podium {
    --w: clamp(90px,26vw,180px);
    --d: clamp(40px,8vw,60px);
    padding-top: 120px;
  }

  .step-silver { height: 175px; }
  .step-gold { height: 230px; }
  .step-bronze { height: 135px; }

  .winner-clawd {
    width: clamp(76px,19vw,114px);
  }

  .step .winner-front {
    padding: 12px 6px 10px;
    gap: 5px;
  }

  .winner-front .medal {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .winner-front .place {
    font-size: 8px;
    letter-spacing: .07em;
  }

  .winner-front h3 {
    font-size: clamp(10px,2.3vw,15px);
    margin-top: 3px;
  }

  .podium-desc {
    display: none;
  }

  .podium-github {
    padding-top: 4px;
    font-size: 9px;
  }

  .podium-summary {
    display: grid;
    gap: 18px;
    margin: 22px auto 0;
    max-width: 480px;
  }

  .podium-summary h3 {
    margin: 0;
    font: 600 15px/1.3 var(--ui);
  }

  .podium-summary h3 a {
    color: var(--fg);
    text-decoration: none;
  }

  .podium-summary h3 a:hover {
    text-decoration: underline;
  }

  .podium-summary h3 span {
    color: var(--accent-ink);
    font: 500 11px var(--mono);
    margin-right: 6px;
  }

  .podium-summary p {
    margin: 6px 0 0;
    color: var(--fg-muted);
    font-size: 13px;
    line-height: 1.5;
  }

  .hack-note {
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage3d {
    transition: none;
  }
}
