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

:root {
  --font-size: 1.75rem;
  --line-height: 2.25rem;
  --margins: 1.125rem 1.125rem;
  --gap: 1.25rem;
  --base-duration: 1400ms;
  --duration-increment: 400ms;
}

html {
  font-size: 100%;
  font-family: "Libre Baskerville", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  background-color: rgb(248, 250, 250);
}

body {
  margin: var(--margins);
  font-size: var(--font-size);
  line-height: var(--line-height);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, 1fr);
  gap: var(--gap);
  height: 100svh;
  overflow: hidden;
}

h1,
strong,
b {
  font: inherit;
  font-weight: inherit;
  margin: 0;
}

p,
h1,
button,
dl,
dd {
  margin: 0;
  margin-block: 0;
  margin-inline: 0;
  padding: 0;
  padding-block: 0;
  padding-inline: 0;
}

del {
  text-decoration: none;
}

a,
button[aria-checked="false"] > * {
  position: relative;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 0.075em;
  text-underline-offset: 0.125rem;
}

@keyframes reveal {
  0% {
    color: rgb(255, 98, 0);
    opacity: 0;
    filter: sepia(1) brightness(10) blur(0.25px);
  }
  100% {
    color: inherit;
    opacity: 1;
    filter: none;
  }
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
  &:focus {
    outline: none;
  }
  &:focus:not(:active) {
    animation: reveal var(--base-duration) cubic-bezier(0.1, 0.95, 0.3, 1);
  }
}

button {
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

@media (hover: none) {
  button::after {
    content: "";
    position: absolute;
    inset: -1rem;
  }
}

button[aria-checked="true"] {
  animation: reveal var(--base-duration) cubic-bezier(0.1, 0.95, 0.3, 1)
    forwards;
}

section:nth-of-type(1) > * > *,
nav button:last-child span {
  animation: reveal calc(var(--base-duration) + 600ms * var(--index, 0))
    cubic-bezier(0.1, 0.95, 0.3, 1);
}

section {
  grid-column: 1 / -1;
  grid-row: 1 / -1;

  > * {
    transition: calc(var(--base-duration) + 600ms * var(--index, 0))
      cubic-bezier(0.1, 0.95, 0.3, 1);
    transition-property: color, opacity, filter;
  }

  &[aria-hidden="true"] > * {
    color: rgb(255, 98, 0);
    opacity: 0;
    filter: sepia(1) brightness(10) blur(0.25px);
  }
}

section:nth-of-type(1) {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, 1fr);
  gap: inherit;
}

section:nth-of-type(2) {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
}

section[aria-hidden="true"] {
  pointer-events: none;
}

nav {
  position: fixed;
  margin: var(--margins);
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  line-height: 1;
  justify-content: space-between;
}

header {
  grid-column: 2 / -1;
  grid-row: 3 / -1;
}

main {
  grid-column: 4 / span 6;
  grid-row: 7 / -1;
}

dl {
  margin-block-start: calc(var(--line-height) * 3);
}

@media (max-width: 1400px) {
  main {
    grid-column: 4 / -1;
  }
}
@media (max-width: 1200px) {
  :root {
    --font-size: 1.5rem;
    --line-height: 2rem;
    --margins: 1rem 1rem;
    --gap: 1rem;
  }

  dl {
    margin-block-start: calc(var(--line-height) * 4);
  }
}

@media (max-width: 700px) {
  :root {
    --font-size: 1.25rem;
    --line-height: 1.75rem;
    --margins: 0.75rem 0.75rem;
    --gap: 0.75rem;
  }

  header,
  main {
    grid-column: 1 / -1;
  }
}
