/*
  1. Use a more-intuitive box-sizing model.
*/
:where(*, *::before, *::after) {
  box-sizing: border-box;
}
/*
  2. Remove default margin
*/
* {
  margin: 0;
}
/*
  Typographic tweaks!
  3. Add accessible line-height
  4. Improve text rendering
*/
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/*
  5. Improve media defaults
*/
:where(img, picture, video, canvas, svg) {
  display: block;
  max-width: 100%;
}
/*
  6. Remove built-in form typography styles
*/
:where(input, button, textarea, select) {
  font: inherit;
}
/*
  7. Avoid text overflows
*/
:where(p, h1, h2, h3, h4, h5, h6) {
  overflow-wrap: break-word;
}

/* 
  8. List styles
*/
:where(ul, ol) {
  list-style: none;
  padding: 0;
  margin: 0;
}
/*
  9. Remove links defaults
*/
a:is(:link, :visited) {
  display: inline-block;
  text-decoration: none;
}

html {
  scroll-behavior: smooth;
}

:root {
  /* Colors */
  --White: #ffffff;
  --Black: #000000;
  --Grey-200: #d9d9d9;

  /* Typography */
  --font-1: "Josefin Sans", sans-serif;
  --font-2: "Alata", sans-serif;

  --Preset-1: 300 72px/1 var(--font-1);
  --Preset-2: 300 48px/1 var(--font-1);
  --Preset-3: 300 40px/1 var(--font-1);
  --Preset-4: 300 32px/1 var(--font-1);
  --Preset-5: 300 24px/1 var(--font-1);
  --Preset-6: 400 15px/1.65 var(--font-2);
  --Preset-7: 400 14px/1 var(--font-2);

  /* Spacing */
  --Container-Max-Width: 37.5rem; /* 600px */
  --Container-Inline-Padding: 1.5rem; /* 24px */
  --Header-Padding-Block: 2.5rem; /* 40px */
  --Header-Title-Padding: 1.125rem 1.5rem; /* 18px 24px */
  --Into-Section-Margin: 6.125rem 6rem; /* 98px 96px */
  --Intro-Title-Margin-Bottom: 1rem; /* 16px */
  --Creations-Section-Margin-Bottom: 6.125rem; /* 98px */
  --Creations-Title-Margin-Bottom: 3rem; /* 48px */
  --Footer-Padding-Block: 3.5rem; /* 56px */

  /* Backgrounds */
  --hero-bg: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.6) 100%
    ),
    url("images/mobile/image-hero.jpg") center / cover no-repeat;

  --Card-Title-inset: auto auto 1.25rem 1.25rem;
}

/* Global Styles */
.container {
  max-width: var(--Container-Max-Width);
  margin-inline: auto;
  padding-inline: var(--Container-Inline-Padding);
}
:where(h1, h2, h3) {
  text-transform: uppercase;
}
h1 {
  color: var(--White);
  font: var(--Preset-3);
}
h2 {
  color: var(--Black);
  font: var(--Preset-4);
}
h3 {
  color: var(--White);
  font: var(--Preset-5);
}
p {
  font: var(--Preset-6);
  opacity: 0.5;
}

a {
  color: var(--White);
  font: var(--Preset-6);
  position: relative;
}
.links a::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: var(--White);

  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);

  opacity: 0;
  transition: opacity 0.3s ease;
}
.links a:hover::before {
  opacity: 1;
}

:is(a, button):focus-visible {
  outline: 2px solid var(--White);
  outline-offset: 4px;
}

/* ------------ HEADER ------------ */
/* -------------------------------- */
.header {
  background: var(--hero-bg);

  padding-block: var(--Header-Padding-Block);
  height: 40.625rem;
}
.header > div {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav__list {
  display: none;
}
.menu-toggle-btn {
  display: inline-block;
  background: transparent;
  border: none;
  cursor: pointer;
}
.header-title {
  padding: var(--Header-Title-Padding);
  border: 2px solid var(--White);
  margin-block: auto;
  pointer-events: none;
}

.overlay {
  position: absolute;
  inset: 0;
  background: var(--Black);
  z-index: 3;

  opacity: 1;
  transition: opacity 0.3s;
}
.hidden {
  z-index: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
/* Toggle Menu */
.nav.active {
  align-items: start;
  position: absolute;
  inset: 0;
  z-index: 10;

  max-width: var(--Container-Max-Width);
  padding-inline: var(--Container-Inline-Padding);
  padding-block: var(--Header-Padding-Block);
  margin-inline: auto;
}

.nav.active .nav__list {
  position: absolute;
  top: calc(var(--Header-Padding-Block) + 10rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: hidden;
}
.nav.active .nav__list a {
  font: var(--Preset-5);
  text-transform: uppercase;
}

/* ------------ INTRO ------------- */
/* -------------------------------- */
.intro {
  display: flex;
  flex-direction: column;
  place-items: center;
  gap: 3rem;
  text-align: center;

  margin-block: var(--Into-Section-Margin);
}

.intro__text h2 {
  margin-block-end: var(--Intro-Title-Margin-Bottom);
}

/* ---------- CREATIONS ----------- */
/* -------------------------------- */
.creations {
  display: flex;
  flex-direction: column;
  place-items: center;

  margin-block-end: var(--Creations-Section-Margin-Bottom);
}

.creations h2 {
  margin-block-end: var(--Creations-Title-Margin-Bottom);
}

.creations-grid {
  align-self: stretch;

  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;

  margin-block-end: 2rem;
}

.card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.card::before {
  position: absolute;
  content: "";
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
  transition: background 0.3s ease;
}
.card:hover::before {
  background: var(--White);
  opacity: 0.75;
}
.card:hover .card__title {
  color: var(--Black);
}

.card picture,
.card img {
  width: 100%;
  height: auto;
}

.card__title {
  position: absolute;
  inset: var(--Card-Title-inset);
  z-index: 2;
}
.see-all-btn {
  color: var(--Black);
  font: var(--Preset-7);
  text-transform: uppercase;
  letter-spacing: 5px;
  padding: 0.812rem 2.5rem;
  border: 1px solid var(--Black);
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.see-all-btn:hover {
  background-color: var(--Black);
  color: var(--White);
}

/* ------------ FOOTER ------------ */
/* -------------------------------- */
.footer {
  background-color: var(--Black);
  color: var(--White);
  padding-block: var(--Footer-Padding-Block);
}

.footer__container {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 2.5rem;
}

.footer__container p {
  margin-block-start: -1.5rem; /* 24px */
}

.footer__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer__socials {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Disable or reduce animations */
@media (prefers-reduced-motion: reduce) {
  :where(.see-all-btn, .card::before, a::before, .overlay) {
    animation: none;
    transition: none;
  }
}

/* ******************************** */
/*              Tablet              */
/* ******************************** */

@media (min-width: 48rem) {
  :root {
    /* Spacing */
    --Container-Max-Width: 57.625rem; /* 922px */
    --Container-Inline-Padding: 5rem; /* 80px */
    --Header-Padding-Block: 4rem; /* 64px */
    --Header-Title-Padding: 2.5rem; /* 40px */
    --Into-Section-Margin: 6rem; /* 96px */
    --Intro-Title-Margin-Bottom: 1.5rem; /* 24px */
    --Creations-Section-Margin-Bottom: 5.4375rem; /* 87px */
    --Creations-Title-Margin-Bottom: 2rem; /* 32px */
    --Footer-Padding-Block: 2.718rem; /* 43px */

    --Card-Title-inset: auto auto 1.25rem 2.315rem;
  }
  h1 {
    font: var(--Preset-1);
  }
  h2 {
    font: var(--Preset-2);
  }

  /* Footer */
  .footer__container {
    grid-template-columns: 1fr 1fr;
    place-items: start;
    gap: 1.5rem;
  }

  .footer__links {
    flex-direction: row;
    order: 2;
  }
  .footer__socials {
    justify-self: flex-end;
  }
  .footer__container p {
    justify-self: flex-end;
    margin-block-start: 0;
    order: 4;
  }
}

/* ******************************** */
/*              Desktop             */
/* ******************************** */
@media (min-width: 75rem) {
  :root {
    --hero-bg: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.6) 100%
      ),
      url("images/desktop/image-hero.jpg") top center / cover no-repeat;

    /* Spacing */
    --Container-Max-Width: 80rem; /* 1120px */
    --Header-Title-Padding: 2.625rem 2.5rem; /* 42px 40px */
    --Into-Section-Margin: 10rem 11.5rem; /* 160px 184px */
    --Creations-Section-Margin-Bottom: 11.375rem; /* 182px */
    --Creations-Title-Margin-Bottom: 5rem; /* 80px */
    --Footer-Padding-Block: 2rem; /* 32px */

    --Card-Title-inset: auto auto 2rem 2.5rem;
  }
  h3 {
    font: var(--Preset-4);
  }

  /* Header */
  .nav__list {
    display: flex;
    flex-direction: row;
    gap: 2rem;
  }
  .menu-toggle-btn {
    display: none;
  }
  .header-title {
    align-self: flex-start;
  }

  /* Intro */
  .intro {
    flex-direction: row;
    text-align: left;

    position: relative;
  }
  .intro picture {
    flex: 1;
  }
  .intro__text {
    position: absolute;
    inset: auto 0 0 auto;
    background-color: var(--White);
    padding: 6.0625rem 0 0 6rem;
    width: 50%;
  }

  /* Creations */
  .creations {
    position: relative;
    align-items: start;
  }

  .creations-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-block-end: 0;
  }

  .see-all-btn {
    position: absolute;
    inset: 0 0 auto auto;
  }

  /* Footer */
  .footer__links {
    gap: 2rem;
  }
}
