@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --page: light-dark(#eff4eb, #111c18);
  --ink: light-dark(#14251b, #eef4e9);
  --muted: light-dark(#435b4c, #b5c9bb);
  --rule: light-dark(#a9bfae, #405d50);
  --oval: light-dark(#cadfcf, #254539);
  --shadow: light-dark(#172d2448, #030a07a8);
  --brass: light-dark(#81632e, #bc9a56);
  --button: light-dark(#126a4a, #62e3a4);
  --button-hover: light-dark(#0d5c3f, #86efb9);
  --button-ink: light-dark(#f6fff8, #102c1f);
  --button-edge: light-dark(#094731, #29895d);
  --voted-surface: light-dark(#dae8db, #223d30);
  --voted-border: light-dark(#a4bcaa, #537763);
  --voted-ink: light-dark(#244933, #d1ead7);
  --voted-inset: light-dark(#314e362d, #090f0b78);
  --selected: light-dark(#087c54, #65e8a9);
  --switch-track: light-dark(#deeadf, #274235);
  --switch-thumb: light-dark(#fbfdf8, #6bd7a2);
  --switch-icon: #152d21;
  --gutter: clamp(1rem, 5vw, 6rem);
  font-family: "DM Sans", system-ui, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

button {
  font: inherit;
  color: inherit;
}

button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.site-shell {
  width: min(clamp(92rem, 72vw, 120rem), 100% - 2 * var(--gutter));
  margin-inline: auto;
  container-type: inline-size;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 4rem;
  border-bottom: 1px solid var(--rule);
}

.site-logo {
  display: block;
  width: 2.375rem;
  height: 2.375rem;
}

.theme-switch:not([hidden]) {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  width: 4.85rem;
  height: 2.75rem;
  padding: 0 .25rem;
  border: 1px solid var(--rule);
  border-radius: 2rem;
  background: var(--switch-track);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.theme-thumb {
  position: absolute;
  top: 50%;
  left: .25rem;
  width: 1.96rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--switch-thumb);
  translate: 0 -50%;
  transition: translate 180ms ease;
}

.theme-switch[aria-checked="true"] .theme-thumb {
  translate: 2.2rem -50%;
}

.theme-icon {
  position: relative;
  font-family: "Segoe UI Symbol", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1;
}

.theme-switch[aria-checked="false"] .theme-icon:not(.moon-icon),
.theme-switch[aria-checked="true"] .moon-icon {
  color: var(--switch-icon);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  grid-template-rows: minmax(0, 1.65fr) minmax(0, 1fr);
  grid-template-areas:
    "title art"
    "action art";
  column-gap: clamp(.5rem, 2vw, 2rem);
  row-gap: clamp(1.1rem, 1.9vw, 1.9rem);
  padding-block: .65rem 1rem;
  border-bottom: 1px solid var(--rule);
}

.hero-title {
  grid-area: title;
  align-self: end;
  margin: 0;
  font-family: "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
  font-size: clamp(3.8rem, 9.65cqi, 10.75rem);
  font-weight: 800;
  line-height: .81;
  letter-spacing: -.016em;
  text-transform: uppercase;
}

.hero-art {
  position: relative;
  grid-area: art;
  display: grid;
  place-items: center;
  isolation: isolate;
  min-width: 0;
}

.hero-art::before,
.hero-art::after {
  position: absolute;
  z-index: -1;
  content: "";
}

.hero-art::before {
  inset: 9% 1% 2%;
  border-radius: 50%;
  background: var(--oval);
}

.hero-art::after {
  top: 22%;
  right: 6%;
  width: clamp(.8rem, 1.7vw, 1.45rem);
  aspect-ratio: 1;
  background: var(--brass);
  clip-path: polygon(50% 0, 63% 37%, 100% 50%, 63% 63%, 50% 100%, 37% 63%, 0 50%, 37% 37%);
}

.hero-render {
  display: block;
  width: min(100%, clamp(20rem, 32cqi, 32rem));
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 .55rem .52rem var(--shadow));
}

.hero-action {
  grid-area: action;
  align-self: start;
}

.action-row,
.workshop-stats {
  display: flex;
  align-items: center;
}

.action-row {
  flex-wrap: wrap;
  gap: .9rem clamp(1.1rem, 2.1vw, 2rem);
}

.workshop-stats {
  gap: .9rem;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.workshop-stats > div {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.workshop-stats > div + div {
  padding-inline-start: .9rem;
  border-inline-start: 1px solid var(--rule);
}

.workshop-stats dt {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.15;
}

.workshop-stats dd {
  order: -1;
  margin: 0;
  font-size: clamp(1.4rem, 2.15vw, 1.925rem);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: .95;
}

.vote-control {
  display: inline-grid;
}

.button__login,
.vote-status {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: .75rem 2.15rem .75rem 1.45rem;
  border: 1px solid var(--button-edge);
  border-radius: .55rem;
  background: var(--button);
  box-shadow: 0 .24rem 0 var(--button-edge);
  color: var(--button-ink);
  font-size: 1.075rem;
  font-weight: 800;
  line-height: 1.15;
}

.button__login {
  position: relative;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.vote-status {
  visibility: hidden;
  gap: .5rem;
  padding-inline: 1.45rem;
  border-color: var(--voted-border);
  background: var(--voted-surface);
  box-shadow: inset 0 .17rem .3rem var(--voted-inset);
  color: var(--voted-ink);
  opacity: 1;
}

[data-voted] .button__login {
  visibility: hidden;
}

[data-voted] .vote-status {
  visibility: visible;
}

.vote-thanks,
[data-voted] .vote-prompt {
  display: none;
}

[data-voted] .vote-thanks {
  display: inline;
}

.button__login::after {
  position: absolute;
  top: .55rem;
  right: .55rem;
  width: .65rem;
  aspect-ratio: 1;
  background: currentColor;
  clip-path: polygon(31% 0, 100% 0, 100% 69%, 86% 69%, 86% 24%, 10% 100%, 0 90%, 76% 14%, 31% 14%);
  pointer-events: none;
  content: "";
}

@media (hover: hover) {
  .button__login:hover {
    background: var(--button-hover);
    box-shadow: 0 .35rem 0 var(--button-edge);
    transform: translateY(-.12rem);
  }

  .thumbnail:hover {
    border-color: var(--selected);
  }
}

.button__login:active {
  box-shadow: 0 .07rem 0 var(--button-edge);
  transform: translateY(.17rem);
}

.vote-note {
  margin: .95rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 550;
  line-height: 1.4;
}

.gallery {
  padding-block: clamp(1.05rem, 1.8vw, 1.9rem) clamp(2.5rem, 4vw, 4rem);
}

.gallery h2 {
  margin: 0 0 .9rem;
  font-size: clamp(1.45rem, 2.45vw, 2.15rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.gallery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(.75rem, 1.5vw, 1.5rem);
}

.gallery-view,
.thumbnail {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: .5rem;
  background: #14261e;
}

.gallery-view {
  aspect-ratio: 16 / 9;
  touch-action: pan-y pinch-zoom;
}

.gallery-view img,
.thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(.4rem, .8vw, .75rem);
}

.thumbnail {
  position: relative;
  grid-column: span 2;
  aspect-ratio: 1;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.thumbnail--wide {
  grid-column: span 3;
  aspect-ratio: 16 / 9;
}

.thumbnail[aria-pressed="true"] {
  border-color: var(--selected);
}

.thumbnail[aria-pressed="true"]::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--selected);
  pointer-events: none;
  content: "";
}

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

@media (max-width: 48rem) {
  .site-header {
    min-height: 3.7rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "title" "art" "action";
    row-gap: .95rem;
    padding-block: 1.8rem;
  }

  .hero-title {
    font-size: clamp(3.6rem, 14.2vw, 7rem);
  }

  .hero-render {
    width: min(85%, 24rem);
  }

  .hero-art::before {
    inset: 12% 0 3%;
  }

  .gallery-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 24rem) {
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-thumb,
  .button__login {
    transition: none;
  }
}
