@charset "UTF-8";

:root {
  --translate-x: 200px;
  --translate-y: -28px;
}

* {
  padding: 0;
  margin: 0;
}

html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  scroll-behavior: smooth;
}

html {
  min-width: 320px;
  font-family: "Lucida Grande", Calibri, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: calc(4 * ((100vw - 320px) / (1280 - 320)) + 12px);
  line-height: 1.5;
  background-color: #212121;
}

header,
.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

aside > section {
  display: grid;
  grid-template-rows: repeat(4, auto);
  grid-template-columns: repeat(3, auto);
  gap: 12px;
  margin-top: 12px;
}

header,
aside {
  background-color: #000;
}

header > div {
  text-align: center;
}

header > a,
main > a,
aside > a {
  width: 3rem;
  height: 2rem;
  margin-top: 48px;
  overflow: hidden;
  color: #e0e;

  /* off left */
  text-indent: 100%;
  white-space: nowrap;
  text-decoration: none;
  background: linear-gradient(to top right, rgb(0 0 0 / 0%) 50%, #c000c0 50.5%) no-repeat top left/50%  100%,
              linear-gradient(to top left,  rgb(0 0 0 / 0%) 50%, #c000c0 50.5%) no-repeat top right/50% 100%;
}

main .link-playground {
  display: block;
  margin-top: 32px;
  font-size: 24px;
  color: #c000c0;
  text-decoration: none;
  transition: color ease 0.6s;
}

main .link-playground:hover {
  color: #800080;
}

aside > a {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1;
  width: 28px;
  height: 24px;
  text-align: right;
  transform: rotate(180deg);
}

nav > a {
  display: block;
  padding: 12px;
  font-size: 1.5rem;
  font-size: calc(12 * ((100vw - 320px) / (1280 - 320)) + 12px);
  text-decoration: none;
  border: 2px solid #c000c0;
  transition: all 0.4s ease;
}

footer a {
  color: #c000c0;
  text-decoration: none;
  transition: color 0.4s ease;
}

header > a:hover,
main > a:hover,
aside > a:hover {
  background: linear-gradient(to top right, rgb(0 0 0 / 0%) 50%, #800080 50.5%) no-repeat top left/50%  100%,
              linear-gradient(to top left,  rgb(0 0 0 / 0%) 50%, #800080 50.5%) no-repeat top right/50% 100%;
}

aside > img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.section > img {
  max-width: 100%;
  transform: scale(0.5);
}

h1 {
  font-family: "Lucida Grande", Calibri, Helvetica, Arial, sans-serif;
  font-size: calc(64 * ((100vw - 320px) / (1280 - 320)) + 64px);
  font-weight: lighter;
  color: #c000c0;
  text-shadow: -1px -1px 1px #000;
}

header h2 {
  font-family: "Lucida Grande", Calibri, Helvetica, Arial, sans-serif;
  font-size: calc(24 * ((100vw - 320px) / (1280 - 320)) + 16px);
  font-weight: lighter;
  color: #c000c0;
  text-shadow: -1px -1px 1px #000;
}

.section > h2 {
  font-family: "Lucida Grande", Calibri, Helvetica, Arial, sans-serif;
  font-size: 36px;
  font-weight: lighter;
  color: #c000c0;
  text-shadow: -1px -1px 1px #000;
}

.section > section > h2 {
  font-family: "Lucida Grande", Calibri, Helvetica, Arial, sans-serif;
  font-size: calc(24 * ((100vw - 320px) / (1280 - 320)) + 16px);
  font-weight: lighter;
  color: #c000c0;
  text-shadow: -1px -1px 1px #000;
}

h3 {
  font-size: 2rem;
  font-weight: 300;
  color: #c000c0;
  text-shadow: -1px -1px 1px #000;
}

header h3 {
  font-size: 1.5rem;
  font-weight: 300;
  color: #ccc;
}

h1 > span {
  display: inline-block;
}

h1 > span:first-child {
  opacity: 0;
  transform: translateX(var(--translate-x));
  animation: translate-x 0.8s linear 1 normal 0s forwards;
}

h1 > span:last-child {
  opacity: 0;
  animation: fade-in 0.6s ease 1 normal 1s forwards;
}

nav {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 12px;
  margin-top: 48px;
}

footer a:hover {
  color: #800080;
}

nav > a:first-of-type {
  color: #ccc;
  background-color: #c000c0;
}

nav > a:last-of-type {
  color: #c000c0;
  background-color: rgb(0 0 0 / 0%);
}

nav > a:first-of-type:hover {
  background-color: #800080;
  border-color: #800080;
}

nav > a:last-of-type:hover {
  color: #ccc;
  background-color: #800080;
  border-color: #800080;
}

pre {
  display: flex;
  align-items: center;
  max-width: 480px;  /* HACK */
  padding: 8px 16px;
  overflow-x: auto;
  font-size: 16px;
  color: #212121;
  background-color: #eee;
}

button[type="button"] {
  padding: 12px 16px;
  font-size: 16px;
  color: #eee;
  text-transform: uppercase;
  cursor: pointer;
  background-color: #c000c0;
  border: none;
  transition: background-color 0.4s ease;
}

button[type="button"]:hover {
  background-color: #800080;
}

button[type="button"]:focus {
  outline: 1px dotted #c000c0;
}

footer {
  padding: 48px 0;
  text-align: center;
}

footer > p {
  color: #ccc;
}

.translate-y {
  opacity: 0;
  transform: translateY(var(--translate-y));
  animation: translate-y 0.6s ease 1 normal 1.6s forwards;
}

.fade-in-first {
  opacity: 0;
  animation: fade-in 0.6s ease 1 normal 2.2s forwards;
}

.fade-in-last {
  opacity: 0;
  animation: fade-in 0.6s ease 1 normal 2.2s forwards;
}

.copy-highlight {
  animation: highlight 0.2s linear 1 normal 0s backwards;
}

@keyframes translate-x {
  /* stylelint-disable declaration-block-single-line-max-declarations */
    0% { opacity: 0; transform: translateX(var(--translate-x)); }
   50% { opacity: 1; transform: translateX(var(--translate-x)); }
  100% { opacity: 1; transform: translateX(0); }
  /* stylelint-enable declaration-block-single-line-max-declarations */
}

@keyframes translate-y {
  /* stylelint-disable declaration-block-single-line-max-declarations */
    0% { opacity: 0; transform: translateY(var(--translate-y)); }
  100% { opacity: 1; transform: translateY(0); }
  /* stylelint-enable declaration-block-single-line-max-declarations */
}

@keyframes fade-in {
    0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes highlight {
    0% { background-color: #eee; }
   50% { background-color: #c000c0; }
  100% { background-color: #eee; }
}
