@font-face {
  font-family: "Accent";
  src: url("./assets/Dollar%20Bill.otf") format("opentype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  --portrait-max-width: 384.72px;
  --madi-portrait-anchor-top: 178.3125px;
  --rich-portrait-anchor-top: 167.888px;
  font-family: "placa", sans-serif;
  font-weight: 300;
  font-style: normal;
  background: #eeebc8;
  color: #0c0e12;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #eeebc8; }
main {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
}

.hero {
  display: flex;
  justify-content: center;
  padding: 32px 22px 41.6px;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 1fr 8.5fr;
  align-items: center;
  width: min(100%, 760px);
  --coin-shift-x: 0px;
}

.coin-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  appearance: none;
  font: inherit;
  background: transparent;
  cursor: pointer;
  transform: translateX(calc(-0.25em + var(--coin-shift-x))) scale(1.21);
}

.coin-button:focus-visible {
  outline: 2px solid #0c0e12;
  outline-offset: 3px;
}

.coin-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center;
  transition: transform 300ms ease-in-out;
}

.coin-shadow {
  position: absolute;
  z-index: 0;
  inset: 0;
  transform: translate(4px, 2.6px);
  background: #434741;
  opacity: 0;
  pointer-events: none;
  -webkit-mask-image: url("./assets/coin.svg");
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: url("./assets/coin.svg");
  mask-mode: alpha;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  transition: opacity 300ms ease-in-out, transform 300ms ease-in-out;
}

@media (hover: hover) and (pointer: fine) {
  .coin-button:hover .coin-image {
    transform: translateY(-8%) rotate(-10deg) scaleY(0.92);
  }

  .coin-button:hover .coin-shadow {
    opacity: 0.75;
    transform: translate(4px, 2.6px) scaleY(0.92);
  }
}

.coin-image.is-twitching-heads,
.coin-image.is-twitching-tails,
.coin-shadow.is-twitching-heads,
.coin-shadow.is-twitching-tails {
  animation-duration: 260ms;
  animation-timing-function: ease-in-out;
}

.coin-image.is-twitching-heads,
.coin-shadow.is-twitching-heads { animation-name: coin-twitch-heads; }
.coin-image.is-twitching-tails,
.coin-shadow.is-twitching-tails { animation-name: coin-twitch-tails; }

.coin-result {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  color: #eeebc8;
  font: 700 15.4px/1 "placa", sans-serif;
  font-style: normal;
  text-shadow: 0 1px 2px #434741;
  opacity: 0;
  pointer-events: none;
}

.coin-result.heads { animation: coin-heads 1s ease-out forwards; }
.coin-result.tails { animation: coin-tails 1s ease-out forwards; }

@keyframes coin-twitch-heads {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  25% { translate: -2px 0; rotate: -3deg; }
  55% { translate: -2.5px 0; rotate: -2deg; }
  80% { translate: -1px 0; rotate: -1deg; }
}

@keyframes coin-twitch-tails {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  25% { translate: 2px 0; rotate: 3deg; }
  55% { translate: 2.5px 0; rotate: 2deg; }
  80% { translate: 1px 0; rotate: 1deg; }
}

@keyframes coin-heads {
  from { opacity: 1; transform: translate(-50%, -50%); }
  to { opacity: 0; transform: translate(-50%, -350%); }
}

@keyframes coin-tails {
  from { opacity: 1; transform: translate(-50%, -50%); }
  to { opacity: 0; transform: translate(-50%, 250%); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-lockup picture {
  display: block;
  width: 100%;
}

.brand-image {
  display: block;
  width: 100%;
  height: auto;
}

.about {
  display: flex;
  flex: 1;
  flex-direction: column;
  max-width: 804px;
  margin: 0 auto;
  padding: 0 22px 1em;
  text-align: center;
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: start;
}

.about-side {
  min-width: 0;
  container-type: inline-size;
}

.about-panel {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #434741;
}

.about-panel-left,
.about-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  background: transparent;
}

.portrait-picture { display: contents; }

.about-panel-image {
  display: block;
  flex: none;
  position: relative;
  left: var(--portrait-offset-x, 0px);
  top: var(--portrait-top-offset, 0px);
  width: var(--portrait-width, var(--portrait-max-width));
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(67, 71, 65, 0.2));
}

.desktop-contact-group { display: none; }

@media (min-width: 701px) {
  .brand-lockup { transform: translateX(-1em); }
  .coin-button { z-index: 1; }
  .brand-lockup picture { position: relative; }
  .brand-lockup picture::before,
  .brand-lockup picture::after {
    position: absolute;
    left: calc(-12.5% + 5px + var(--coin-shift-x));
    width: calc(112.5% - 3px - var(--coin-shift-x));
    height: 2px;
    background: #434741;
    content: "";
  }
  .brand-lockup picture::before { top: -5px; }
  .brand-lockup picture::after { bottom: -5px; }
  .mobile-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.75em;
  }

  .about-panel-right-image {
    top: calc(var(--portrait-top-offset, 0px) - 4px);
    transform: scale(0.99);
  }

  .about-copy { top: 2em; }
}

@media (min-width: 701px) and (max-width: 960px) {
  .brand-lockup {
    --coin-shift-x: calc(111.197px - 11.583vw);
  }
}

.about-panel-caption {
  display: none;
  margin: 0;
}

.about .accent-text {
  font-family: "Accent", "placa", serif;
  font-weight: 900;
}

.about-copy {
  position: relative;
  z-index: 1;
  width: 100%;
}

.mobile-actions {
  display: flex;
  justify-content: center;
  margin-top: 0;
}

.mobile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55em 1.25em;
  border: 1px solid #434741;
  background: #434741;
  box-shadow: 0 2px 6px rgba(67, 71, 65, 0.2);
  font-family: "placa", sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.mobile-button:link,
.mobile-button:visited {
  color: #eeebc8;
}

.mobile-contact,
.desktop-contact {
  border-width: 0.5px;
  border-color: rgba(67, 71, 65, 0.5);
  background: #eeebc8;
}

@media (min-resolution: 2dppx) {
  .mobile-contact,
  .desktop-contact {
    border-color: #434741;
  }
}

.mobile-contact:link,
.mobile-contact:visited,
.desktop-contact:link,
.desktop-contact:visited {
  color: #434741;
}

.about-caption-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5em;
  width: 100%;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75em;
  margin-top: auto;
  font-size: 17px;
}

@media (min-width: 701px) {
  .about-layout { column-gap: 0.25em; }
  .about-copy { transform: translateY(3em); }
  .about-caption-actions { display: none; }
  .project-gallery {
    position: relative;
    grid-template-columns: repeat(7, 36px);
    justify-content: space-between;
    padding-top: 9em;
  }
  .desktop-contact-group {
    position: absolute;
    top: 0;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75em;
    width: min(90vw, 30em);
    transform: translate(-50%, -100%);
  }
  .project-card { width: 36px; }
  .project-card figcaption {
    position: relative;
    left: 50%;
    width: max-content;
    max-width: 85px;
    transform: translateX(-50%);
  }
}

@media (min-width: 701px) and (max-width: 950px) {
  .desktop-contact-group {
    top: calc(26.712em - 47.8vw);
  }
}

.project-card {
  min-width: 0;
  margin: 0;
  text-align: center;
}

.project-artwork {
  --project-mask: none;
  --project-scale: 1;
  position: relative;
  width: 36px;
  height: 54px;
  margin: 0 auto;
  transform: scale(var(--project-scale)) scale(var(--mobile-project-scale, 1));
  transform-origin: center;
  transition: filter 1s ease 0.5s;
}

.project-artwork::before,
.project-artwork::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  -webkit-mask-image: var(--project-mask);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: var(--project-mask);
  mask-mode: alpha;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.project-artwork::before {
  z-index: 0;
  background-color: #434741;
  transition: opacity 300ms ease;
}

.project-artwork::after {
  z-index: 1;
  opacity: 0;
  transition: opacity 300ms ease;
}

.project-card:nth-of-type(1) .project-artwork {
  --project-mask: url("./assets/lumo.svg");
  --project-scale: 1.575;
}
.project-card:nth-of-type(2) .project-artwork,
.project-card:nth-of-type(3) .project-artwork {
  --project-mask: url("./assets/creativeconscience.svg");
  --project-scale: 1.1;
}
.project-card:nth-of-type(4) .project-artwork {
  --project-mask: url("./assets/madstars.svg");
  --project-scale: 1.43;
}
.project-card:nth-of-type(5) .project-artwork,
.project-card:nth-of-type(6) .project-artwork {
  --project-mask: url("./assets/madrichtitles_studentaxis.svg");
  --project-scale: 0.855;
}
.project-card:nth-of-type(7) .project-artwork {
  --project-mask: url("./assets/ORCA.svg");
  --project-scale: 1.15;
}

@media (min-width: 701px) and (hover: hover) and (pointer: fine) {
  .project-card figcaption {
    opacity: 0.5;
    transition: opacity 300ms ease;
  }

  .project-card:nth-of-type(1) .project-artwork::after {
    background: linear-gradient(90deg, #2c0a45 0%, #ba0581 100%);
  }

  .project-artwork::after {
    background: var(--project-hover-color);
  }

  .project-artwork:hover::before { opacity: 0.5; }
  .project-artwork:hover::after { opacity: 1; }
  .project-artwork:hover + figcaption { opacity: 0.8; }

  .project-artwork:hover {
    filter: drop-shadow(0 2px 6px rgba(67, 71, 65, 0.2));
    transition-delay: 0s, 0s;
  }

  .project-card:nth-of-type(5) .project-artwork,
  .project-card:nth-of-type(6) .project-artwork {
    --project-hover-color: #c3ff85;
  }

  .project-card:nth-of-type(2) .project-artwork,
  .project-card:nth-of-type(3) .project-artwork {
    --project-hover-color: #f916ce;
  }

  .project-card:nth-of-type(4) .project-artwork {
    --project-hover-color: #c0c0c0;
  }

  .project-card:nth-of-type(4) .project-artwork:hover {
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.3));
  }

  .project-card:nth-of-type(7) .project-artwork {
    --project-hover-color: #000;
  }
}

.cursor-callout {
  position: fixed;
  z-index: 10;
  max-width: 16rem;
  padding: 0.5em 0.75em;
  border: 1px solid #434741;
  background: #eeebc8;
  color: #434741;
  font-size: 15px;
  line-height: 1.3;
  pointer-events: none;
}

.cursor-callout[hidden],
.coin-callout-stats[hidden],
.coin-callout-message[hidden],
.cursor-callout-text[hidden] {
  display: none;
}

.cursor-callout.coin-tooltip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.coin-callout-stats {
  display: flex;
  gap: 3px;
}

.coin-callout-box {
  padding: 0.5em 0.75em;
  border: 1px solid #434741;
  background: #eeebc8;
  color: #434741;
  font-size: 15px;
  line-height: 1.3;
}

.coin-callout-stats .coin-callout-box.is-last-result {
  background: #434741;
  color: #eeebc8;
}

.coin-callout-message {
  max-width: 16rem;
}

.project-card figcaption {
  margin-top: 0.5em;
  color: #434741;
  font-size: max(12px, 50%);
  line-height: 1.2;
}

.about p {
  width: 100%;
  margin: 0 auto;
  font-family: "placa", sans-serif;
  color: #434741;
  font-size: 17px;
  font-weight: 300;
  font-style: normal;
  line-height: 1.5;
}

.about-copy p:first-of-type {
  margin-bottom: 1.5em;
}

a:link,
a:visited {
  color: #434741;
}

b,
strong {
  font-family: "placa", sans-serif;
  font-weight: 700;
  font-style: normal;
}

@media (max-width: 1100px) {
  .project-gallery {
    gap: clamp(0.5em, calc(0.0625em + 1.0625vw), 0.75em);
  }
}

@media (min-width: 701px) and (max-width: 1066px) {
  .about-copy {
    width: clamp(60%, calc(103.0137vw - 722.126px), 100%);
    justify-self: center;
  }
}

@media (min-width: 701px) and (hover: hover) and (pointer: fine) {
  .mobile-button:hover,
  .mobile-button:focus-visible {
    box-shadow: 0 2px 6px rgba(67, 71, 65, 0.4);
  }
}

@media (max-width: 700px) {
  .brand-lockup { display: block; }
  .coin-button { display: none; }
  .brand-image { filter: drop-shadow(0 2px 6px rgba(67, 71, 65, 0.2)); }
  .hero { padding: 22px 22px 31.2px; }
  .about {
    min-width: 0;
    width: 100%;
    padding: 0 22px 1em;
  }
  .about-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5em;
  }
  .about-copy { order: 0; width: 80%; }
  .about-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    width: 50%;
    max-width: 190px;
  }
  .about-side-left {
    width: calc(100% + 28px);
    max-width: none;
    order: 1;
  }
  .about-side-right {
    width: calc(100% + 28px);
    max-width: none;
    margin-top: -0.5em;
    order: 2;
  }
  .about-panel {
    width: 100%;
    max-width: none;
  }
  .about-caption-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5em;
    width: 100%;
  }
  .about-panel-left,
  .about-panel-right {
    aspect-ratio: auto;
  }
  .about-panel-image {
    width: 100%;
    max-width: 100%;
  }
  .about .about-panel-caption {
    position: relative;
    top: -0.25em;
    display: block;
    width: 100%;
    margin: 0;
    color: #434741;
    line-height: 1.2;
    text-shadow: 0 2px 6px rgba(67, 71, 65, 0.2);
  }
  .about-side-left .about-panel-caption {
    font-size: 9.1cqi;
    white-space: nowrap;
  }
  .about-side-right .about-panel-caption {
    top: -0.35em;
    font-size: 9.5cqi;
    white-space: nowrap;
  }
  .about p { font-size: 15px; }
  .about-copy p:first-of-type { font-size: 22.5px; }
  .project-gallery {
    width: calc(100% + 44px);
    margin-top: 4em;
    margin-left: -22px;
    margin-bottom: -1em;
    gap: 0.5em;
    font-size: 15px;
    padding-inline: 0.5em;
    padding-block: 1em;
    align-items: start;
    background-color: #434741;
  }
  .project-artwork::before { background-color: #eeebc8; }
  .project-card figcaption {
    color: #eeebc8;
    font-size: 9px;
    font-weight: 300;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .coin-result.heads,
  .coin-result.tails {
    animation-duration: 1ms;
    animation-timing-function: step-end;
  }
  .coin-image.is-twitching-heads,
  .coin-image.is-twitching-tails,
  .coin-shadow.is-twitching-heads,
  .coin-shadow.is-twitching-tails {
    animation-duration: 1ms;
    animation-timing-function: step-end;
  }
  .coin-image,
  .coin-shadow,
  .project-artwork,
  .project-artwork::before,
  .project-artwork::after,
  .project-card figcaption {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}
