/* The award badge with the laurel wreath. The plate (.aw__plate) is moved only by GSAP; inside it the brushed metal
   (.aw__metal), the light that follows the pointer (.aw__spot), the band of light that runs over it (.aw__sheen) and
   the 1px champagne rim that catches the light only near the pointer (.aw__rim) are layers of their own, under the
   wreath and the words. The votes panel opens under the head; its height is animated by GSAP. */
:root {
  --page: #0a0a0b;            /* the page */
  --metal-hi: #26262a;        /* the metal at the top */
  --metal-lo: #121214;        /* the metal at the bottom */
  --gold: #c9a35c;            /* the champagne gold of the wreath and the rim */
  --gold-hi: #f3dca6;         /* the gold where the light hits */
  --ink: #f2efe8;             /* the words */
  --muted: #8e8a82;           /* the small words */
  --track: rgba(255, 255, 255, 0.07); /* the empty part of the bars */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  isolation: isolate;
}

/* a soft warm light on the page behind the badge, and a fine grain over everything */
.stage__light {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 46% 38% at 50% 46%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(255, 255, 255, 0.035), transparent 70%);
}

.stage__grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the box the badge lives in: as tall as the badge when open, so opening it never moves the frame */
.aw {
  position: relative;
  width: min(86vw, 300px);
  height: min(292px, 72vh);
  display: grid;
  place-items: center;
}

.aw__halo {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 60px;
  margin-top: -18px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--gold) 30%, transparent), transparent);
  filter: blur(18px);
  opacity: 0.35;
  pointer-events: none;
}

.aw__plate {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  opacity: 0;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.5),
    0 8px 18px -8px rgba(0, 0, 0, 0.8),
    0 28px 56px -22px rgba(0, 0, 0, 0.9);
}

/* brushed graphite: a vertical gradient, very fine horizontal lines and the edges that take the light */
.aw__metal {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
    linear-gradient(100deg, rgba(255, 255, 255, 0.03), transparent 40%, rgba(255, 255, 255, 0.025) 70%, transparent),
    linear-gradient(180deg, var(--metal-hi), var(--metal-lo));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55);
}

/* the light under the pointer (--mx, --my set by the script) */
.aw__spot {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--gold-hi) 13%, transparent), transparent 70%);
}

/* the band of light that runs over the metal */
.aw__sheen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.aw__sheen-band {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 46%;
  transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 238, 205, 0.06) 30%, rgba(255, 242, 214, 0.17) 50%, rgba(255, 238, 205, 0.06) 70%, transparent);
  mix-blend-mode: screen;
}

/* the 1px champagne rim, lit only around the pointer: a ring cut out with a mask */
.aw__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: radial-gradient(130px circle at var(--mx, 50%) var(--my, 0%), var(--gold-hi), color-mix(in srgb, var(--gold) 35%, transparent) 45%, rgba(255, 255, 255, 0.05) 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.55;
}

.aw__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 76px;
  padding: 0 16px 0 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 18px;
  -webkit-tap-highlight-color: transparent;
}

.aw__head:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.aw__wreath {
  flex: none;
  width: 54px;
  height: 54px;
  overflow: visible;
}

.aw__wreath path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aw__stem {
  stroke: color-mix(in srgb, var(--gold) 70%, transparent);
  stroke-width: 0.8;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.aw__leaf {
  stroke: var(--gold);
  stroke-width: 0.75;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.aw__leaf-fill {
  fill: url(#aw-gold) !important;
  stroke: none;
  opacity: 0;
}

.aw__cup path {
  stroke: var(--gold-hi);
  stroke-width: 1.05;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.aw__star {
  fill: var(--gold-hi) !important;
  opacity: 0;
}

.aw__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.aw__kicker {
  font-size: 10.5px;
  font-weight: 560;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-variation-settings: 'wdth' 110;
}

/* the title catches the band of light as it passes (--sx set by the script) */
.aw__title {
  --sx: -80px;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 640;
  letter-spacing: -0.01em;
  font-variation-settings: 'wdth' 104;
  white-space: nowrap;
  background: linear-gradient(105deg, var(--ink) calc(var(--sx) - 26px), #fff6e1 var(--sx), var(--gold-hi) calc(var(--sx) + 10px), var(--ink) calc(var(--sx) + 34px));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.aw__date {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.aw__chev {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s;
}

@media (hover: hover) {
  .aw__head:hover .aw__chev {
    stroke: var(--gold-hi);
  }
}

.aw__panel {
  position: relative;
  z-index: 2;
  height: 0;
  overflow: hidden;
}

.aw__panel-rule {
  display: block;
  height: 1px;
  margin: 0 16px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0.1) 80%, transparent);
}

.aw__votes {
  list-style: none;
  margin: 0;
  padding: 14px 16px 4px;
  display: grid;
  gap: 11px;
}

.aw__vote {
  display: grid;
  grid-template-columns: 72px 1fr 34px;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.aw__vote-name {
  color: var(--muted);
}

.aw__bar {
  position: relative;
  display: block;
  height: 3px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}

.aw__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 60%, transparent), var(--gold-hi));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.aw__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 560;
}

.aw__score {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 10px 16px 0;
  padding: 12px 0 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.aw__score-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 560;
}

.aw__jury {
  font-size: 11.5px;
  font-weight: 450;
  color: var(--muted);
}

.aw__score-num {
  font-size: 30px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variation-settings: 'wdth' 96;
  font-variant-numeric: tabular-nums;
  color: var(--gold-hi);
}

.aw__of {
  margin-left: 3px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

/* a small bright tip at the end of every bar, like light on the edge of a gold rule */
.aw__fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, #fff8e6);
}
