@import url("https://fonts.googleapis.com/css2?family=Nunito&display=swap");

/* || RESET */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* || VARIABLES */

:root {
  /* FONTS */
  --ffPrimary: "Nunito", sans-serif;
  --fsPrimary: min(1.5rem, 3.2vh, 4vw);
  --fsQ: 1.25rem;
  --fsM: 1.5rem;
  --fsL: 2rem;
  --fsXL: 3rem;

  /* COLORS */
  --bgColor: #475569;
  --altBgColor: #1e293b;
  --lightColor: #f5f5f5;
  --darkColor: #000000;

  /* SPACING */
  --halfSpace: 0.5rem;
  --space: 1rem;
  --oneQuarterSpace: 1.25rem;
  --oneHalfSpace: 1.5rem;
  --doubleSpace: 2rem;

  /* SHADOWS */
  --boxShadow: 0 5px 5px -5px var(--darkColor);

  /* BORDER */
  --borderS: 2px solid;
}

/* || UTILITY CLASSES */
.nowrap {
  white-space: nowrap;
}

/* || GENERAL STYLES */
html {
  scroll-behavior: smooth;
}

body {
  font: var(--fsPrimary) var(--ffPrimary);
  min-height: 100vh;
  background-color: var(--bgColor);
  background-image: radial-gradient(var(--lightColor), var(--bgColor));
  display: flex;
  flex-direction: column;
}

header,
footer {
  position: sticky;
  background-color: var(--altBgColor);
  color: var(--lightColor);
  text-align: center;
  z-index: 1;
}

header {
  top: 0;
}

nav {
  background-color: var(--lightColor);
  padding: var(--halfSpace);
  border-bottom: var(--borderS) var(--darkColor);
  font-weight: bolder;
  display: flex;
  justify-content: space-evenly;
  box-shadow: var(--boxShadow);
}

nav a:any-link {
  /* font-size: var(--fsPrimary); */
  color: var(--darkColor);
}

nav :is(a:hover, a:focus) {
  color: hsla(0, 0%, 20%, 0.6);
}

nav a:active {
  color: red;
}

main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--oneHalfSpace);
  padding: var(--space);
}

footer {
  bottom: 0;
}

/* || PROFILE CARD */

.card {
  scroll-margin-top: 7.6rem;
  width: min(100%, 350px);
  background-color: #cbd5e1;
  border: var(--borderS) var(--darkColor);
  border-radius: 15px;
  padding: var(--space);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card:target {
  border: var(--borderS) rebeccapurple;
}

.card figure {
  display: flex;
  flex-flow: column nowrap;
}

.card figure img {
  border: 5px double #333;
  border-radius: 50%;
}

.card figure figcaption {
  font-weight: bolder;
  font-size: var(--fsM);
  margin: var(--space);
  text-align: center;
}

.card figure figcaption::after {
  content: "✨";
  display: block;
}

.card figure figcaption::first-letter {
  font-size: var(--fsL);
}

.card p {
  position: relative;
}

.card p::before {
  content: open-quote;
  font-size: 3em;
  position: absolute;
  top: -0.25em;
  left: -0.5em;
}

.card p::after {
  content: close-quote;
  font-size: 3em;
  position: absolute;
  top: -0.25em;
  right: -0.5em;
}

/* || SMALL */
@media screen and (min-width: 576px) {
  main {
    justify-content: center;
    flex-flow: row wrap;
    padding: var(--space);
  }

  .card {
    width: min(100%, 400px);
  }

  .card:last-child {
    order: -1;
  }
}

/* || MEDIUM */
@media screen and (min-width: 768px) {
  nav {
    display: none;
  }

  .card {
    width: min(100%, 325px);
  }

  .card figure {
    flex-flow: column-reverse;
  }

  .card p {
    margin-top: var(--space);
  }
}

/* || LARGE */
@media screen and (min-width: 992px) {
  .card {
    width: min(100%, 400px);
  }

  .card:nth-child(2) {
    order: -1;
  }
}

/* || XL  */
@media screen and (min-width: 1200px) {
  .card {
    width: min(33% - 1rem, 500px);
  }
}

/* || MOBILE DEVICE LANDSCAPE  */
@media screen and (max-height: 425px) and (min-aspect-ratio: 7/4) {
  h2 {
    font-size: var(--fsM);
  }

  nav {
    display: none;
  }

  main {
    flex-flow: row wrap;
    justify-content: space-evenly;
    align-items: stretch;
  }

  .card {
    width: min(33% - 0.25rem, 200px);
  }

  .card figure figcaption,
  .card p {
    font-size: var(--fsQ);
  }

  .card figure figcaption {
    font-size: var(--fsPrimary);
  }
}

/* || DARK MODE  */
@media (prefers-color-scheme: dark) {
  body {
    --bgColor: #000;
    --altBgColor: #333;
  }
}
