/* fonts */

@font-face {
  font-family: "IBM Plex Sans Regular";
  src: url("/fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Text";
  src: url("/fonts/IBMPlexSans-Text.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Medium";
  src: url("/fonts/IBMPlexSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Tex Gyre Hero Bold Italic";
  src: url("/fonts/texgyreheroscn-bolditalic.otf") format("opentype");
}

h1 {
  font-family: "IBM Plex Sans Medium", sans-serif;
  font-size: 32px;
  font-weight: 400;
}

h2 {
  font-family: "IBM Plex Sans Medium", sans-serif;
  font-size: 24px;
  font-weight: 400;
}

h3 {
  font-family: "IBM Plex Sans Medium", sans-serif;
  line-height: 1;
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.03rem;
}

body {
  font-family: "IBM Plex Sans Text", sans-serif;
  font-size: 16px;
  font-weight: 400;
}

.back h3 {
  font-family: 'Tex Gyre Hero Bold Italic';
  letter-spacing: 0.05rem;
}

/* resets */

body,
h1,
h2,
h3,
h4,
h5,
h6,
ul {
  margin: 0;
}

ul {
  list-style: none;
  padding-inline-start: 0;
}

a {
  /* text-decoration: none; */
  text-underline-offset: 4px;
  color: inherit;
}

/* styles */

main {
  perspective: 1000px;
  padding-bottom: env(safe-area-inset-bottom);

  @media (min-width: 720px) {
    max-width: 480px;
  }
}

.main-inner {
  position: relative;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

main[flipped] .main-inner {
  transform: rotateY(180deg);
}

.front,
.back {
  position: absolute;
  -webkit-backface-visibility: hidden; /* Safari */
  backface-visibility: hidden;
  transform: rotateX(0deg); /* fix for Firefox backface-visibility */
}

.back {
  transform: rotateY(180deg);
}

header {
  padding: 8px 20px 18px;
  text-align: right;
  cursor: pointer;
}

.back header {
  text-align: left;
}

section {
  display: grid;
  grid-auto-rows: minmax(150px, 1fr);
  row-gap: 10px;
}

footer {
  display: flex;
  position: relative;
  flex-direction: column;
  padding: 8px 20px 18px;
  color: #fff;
  background-color: #111;
  background-color: hsl(var(--hue, 180), 100%, 5%);
}

footer li:first-of-type {
  background-color: white;
  color: black;
}

footer li:last-of-type {
  background-color: black;
  color: white;
  opacity: 1;
}

footer .link--guestbook {
  display: block;
  text-align: right;
  text-transform: uppercase;
}

.back .link--guestbook {
  text-align: left;
}

article {
  display: flex;
  position: relative;
  flex-direction: column;
  padding: 8px 20px 18px;
}

article:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

article:nth-of-type(n + 6) {
  color: white;
}

h3 {
  text-align: right;
  margin-bottom: 8px;
}

.back h3 {
  text-align: left;
}

ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: 8px;
  margin-top: auto;
}

.back ul {
  flex-direction: row-reverse;
}

li {
  line-height: 1.2;
}

/* gradients */

.front article:nth-of-type(1):before {
  background-color: hsl(var(--hue, 180), 50%, 95%);
}
.front article:nth-of-type(2):before {
  background-color: hsl(var(--hue, 180), 50%, 85%);
}
.front article:nth-of-type(3):before {
  background-color: hsl(var(--hue, 180), 50%, 75%);
}
.front article:nth-of-type(4):before {
  background-color: hsl(var(--hue, 180), 50%, 65%);
}
.front article:nth-of-type(5):before {
  background-color: hsl(var(--hue, 180), 50%, 55%);
}
.front article:nth-of-type(6):before {
  background-color: hsl(var(--hue, 180), 60%, 40%);
}
.front article:nth-of-type(7):before {
  background-color: hsl(var(--hue, 180), 70%, 30%);
}
.front article:nth-of-type(8):before {
  background-color: hsl(var(--hue, 180), 80%, 20%);
}
.front article:nth-of-type(9):before {
  background-color: hsl(var(--hue, 180), 100%, 10%);
}

.back article {
  color: white;
}

.back article:nth-of-type(1),
.back article:nth-of-type(2),
.back article:nth-of-type(3),
.back article:nth-of-type(4),
.back article:nth-of-type(5) {
  color: black;
}

.back article:nth-of-type(1):before {
  background-color: hsl(0, 85%, 50%);
}
.back article:nth-of-type(2):before {
  background-color: hsl(30, 85%, 50%);
}
.back article:nth-of-type(3):before {
  background-color: hsl(50, 85%, 50%);
}
.back article:nth-of-type(4):before {
  background-color: hsl(80, 85%, 50%);
}
.back article:nth-of-type(5):before {
  background-color: hsl(170, 85%, 50%);
}
.back article:nth-of-type(6):before {
  background-color: hsl(200, 85%, 50%);
}
.back article:nth-of-type(7):before {
  background-color: hsl(240, 85%, 50%);
}
.back article:nth-of-type(8):before {
  background-color: hsl(280, 85%, 50%);
}
.back article:nth-of-type(9):before {
  background-color: hsl(320, 85%, 50%);
}

li:nth-of-type(1) {
  opacity: 1;
}
li:nth-of-type(2) {
  opacity: 0.8;
}
li:nth-of-type(3) {
  opacity: 0.7;
}
li:nth-of-type(4) {
  opacity: 0.6;
}
li:nth-of-type(5) {
  opacity: 0.5;
}
li:nth-of-type(6) {
  opacity: 0.4;
}
li:nth-of-type(7) {
  opacity: 0.3;
}
