@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
  }
  address {
    font-style: normal;
  }
  img {
    display: block;
    max-width: 100%;
    height: auto;
  }
}

@layer base {
  :root {
    --color-dark-hue: 30;
    --color-dark-sat: 18%;
    --color-dark: hsl(var(--color-dark-hue), var(--color-dark-sat), 20%);
    --color-bright: hsl(26, 54%, 97%);
    --color-prim-hue: 143;
    --color-prim-sat: 20%;
    --color-prim: hsl(var(--color-prim-hue), var(--color-prim-sat), 28%);
    --color-prim-light: hsl(var(--color-prim-hue), var(--color-prim-sat), 80%);
    --color-prim-lighter: hsl(var(--color-prim-hue), var(--color-prim-sat), 85%);
    --r: 0.16rem;
    --sp-y-s: 0.8rem;
    --fs-sm: clamp(0.71rem, 0.08vi + 0.69rem, 0.75rem);
    --fs-base: clamp(0.89rem, 0.23vi + 0.84rem, 1rem);
    --fs-md: clamp(1.11rem, 0.45vi + 1.01rem, 1.33rem);
    --fs-lg: clamp(1.39rem, 0.79vi + 1.21rem, 1.78rem);
    --fs-xl: clamp(1.74rem, 1.29vi + 1.45rem, 2.37rem);
    --fs-xxl: clamp(2.17rem, 2.02vi + 1.72rem, 3.16rem);
    --fs-xxxl: clamp(2.71rem, 3.06vi + 2.03rem, 4.21rem);
  }
  @font-face {
    font-family: 'Noto Serif';
    src: local('Noto Serif Regular'), local('NotoSerif-Regular'),
      url('fonts/NotoSerif-Regular.woff2') format('woff2'),
      url('fonts/NotoSerif-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
  }
  @font-face {
    font-family: 'Noto Serif';
    src: local('Noto Serif Bold'), local('NotoSerif-Bold'),
      url('fonts/NotoSerif-Bold.woff2') format('woff2'),
      url('fonts/NotoSerif-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
  }
  @font-face {
    font-family: 'Oleo Script';
    src: local('Oleo Script'), local('OleoScript-Regular'),
      url('fonts/OleoScript-Regular.woff2') format('woff2'),
      url('fonts/OleoScript-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
  }
  html {
    font-size: 18px;
  }
  body {
    font-family: 'Noto Serif';
    font-size: var(--fs-base);
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
    color: var(--color-dark);
    background: var(--color-prim-lighter) url(img/bkg-summer.svg) repeat;
  }
  p {
    margin-block: 0 0.8rem;
  }
  a {
    font-weight: 700;
    color: var(--color-prim);
    text-underline-offset: 0.25em;

    &:hover {
      text-decoration: none;
    }
  }
  h1, h2 {
    font-family: 'Oleo Script', serif;
    font-weight: 400;
    line-height: 1;
  }
  h1 {
    font-size: var(--fs-xl);
    color: var(--color-bright);
    text-shadow: 2px 2px 0 var(--color-dark);
  }
  h2 {
    font-size: var(--fs-md);
  }
  .text-center {
    text-align: center;
  }
}

@layer layout {
  .flex {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .flex--wrap {
    flex-wrap: wrap;
  }
  .flex--gap-s {
    gap: 10vw;
  }
  main, footer {
    width: 100%;
    max-width: 1110px;
    margin: 0 auto;
  }
  main {
    margin-block: 10vw;
  }
  footer {
    margin-block-end: 10vh;
  }
}

@layer components {
  /* Buttons */
  .btn {
    display: inline-block;
    padding: 0.5em 1em;
    border: 1px solid var(--color-prim);
    border-radius: var(--r);
    background: var(--color-prim);
    color: var(--color-bright);
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;

    &:hover {
      background-color: var(--color-prim-light);
      color: var(--color-dark);
      transition: background-color 0.3s, color 0.3s;
    }
  }
  /* Hero */
  .hero {
    container-name: hero;
    container-type: inline-size;
  
    & .hero__wrapper {
      flex-direction: column;
      gap: 10vw;
    }
  
    & .hero__img,
    & .hero__txt {
      max-width: 65%;
    }
  }
  @container hero (width > 990px) {
    .hero {
      & .hero__wrapper {
        flex-direction: row;
        gap: 0;
      }
      & .hero__img {
        max-width: 50%;
        margin-inline-end: 5%;
      }
      & .hero__txt {
        max-width: 35%;
      }
    }
  }
  @container hero (width < 536px) {
    .hero {
      & .hero__wrapper {
        gap: 14vh;
      }
      & .hero__img,
      & .hero__txt {
        max-width: 90%;
      }
      & .hero__txt {
        padding-inline: 5%;
      }
    }
  }
  .postcard {
    position: relative;
    transform: rotate(-2deg);
    
    & figure {
      margin: 0;
      border: 0.8rem solid var(--color-bright);
      border-radius: var(--r);
      box-shadow: 1px 4px 8px hsla(var(--color-dark-hue), var(--color-dark-sat), 20%, 0.2), 0 0 1px hsla(var(--color-dark-hue), var(--color-dark-sat), 20%, 0.2);
    }
    & figcaption {
      position: absolute;
      top: 102%;
      right: 0;
      font-size: 0.6rem;
    }
    & h1 {
      color: var(--color-bright);
    }
  }
  @container hero (width > 535px) {
    .postcard {
      & h1 {
        position: absolute;
        top: 0.2rem;
        left: 8%;
      }
    }
  }
}