/*
	Some quick and dirty styling
*/

@layer init, base, content, special;

@layer init {
  @property --a {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
  }

  :root {
    --theme-color-purple: #704299;
    --theme-color-purple-light: #e6e1ff;
    --theme-color-purple-dark: #421a4e;
    --theme-color-link: var(--theme-color-purple-dark);
  }
}

@layer base {
  html {
    font-size: 16px;
    font-family: Helvetica, Arial, sans-serif;
    line-height: 1.5;
  }

  body {
    background: var(--theme-color-purple-dark);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  a {
    color: var(--theme-color-link);
  }

  h2 {
    margin-bottom: 0.5rem;
  }

  p {
    margin-top: 0.5rem;
  }

  @media (max-width: 768px) {
    body {
      align-items: stretch;
    }
  }
}

@layer content {
  .container {
    display: flex;
    background-color: var(--theme-color-purple-light);
    width: calc(100% - 2rem);
    margin: 0 1rem;
    max-width: 960px;
    border-radius: 0 2rem 0 2rem;
    overflow: hidden;
  }

  aside {
    padding: 1rem 0.75rem 1.5rem;
    background: var(--theme-color-purple);
    min-width: 54px;
  }

  .bookmark {
    writing-mode: sideways-lr;
    font-size: 2.25rem;
    color: white;
    font-weight: 400;
    letter-spacing: 2px;
    display: inline-block;
    margin: 1.25rem 0 0;
  }

  main {
    padding: 1rem 1.5rem 1.5rem;
    border-radius: 1rem;
  }

  @media (max-width: 768px) {
    .container {
      border-radius: 0;
      margin: 0;
      width: 100%;
    }

    aside {
      padding: 1rem 1.5rem 1.5rem;
    }

    .bookmark {
      position: fixed;
      margin-top: 0.5rem;
    }
  }

  @media (max-width: 480px) {
    .container {
      flex-direction: column;
    }

    .bookmark {
      position: relative;
      writing-mode: unset;
    }
  }
}

@layer special {
  .email {
    cursor: pointer;
    padding: 1rem;
    margin: -1rem;
    &:hover,
    &:focus {
      color: var(--theme-color-link);
      text-decoration: underline;
      .hint {
        display: none;
      }
    }
  }

  body {
    --a: 0%;
    background: radial-gradient(
      circle at center,
      var(--theme-color-purple-dark),
      hsl(from var(--theme-color-purple-dark) h s calc(l - 5)) var(--a),
      hsl(from var(--theme-color-purple-dark) h s calc(l - 15))
    );
    animation: 10s infinite alternate pulse;
  }

  @keyframes pulse {
    from {
      --a: 30%;
    }
    to {
      --a: 70%;
    }
  }
}
