:root {
  --padding-sm: 1rem;
  --padding-med: 3rem;
  --padding-med-lg: 4.5rem;
  --padding-lg: 6rem;
  --text-width: 32em;
  --line-height: 1.5;
  --smaller-line-height: 1.18;
  --body-size: 18px;
  --small-size: 14px;
  --background: #c8e0e4; /* #bacfd3; */
  --background-light: #e5f5fa; /*#d5e9ef;*/
  --accent: #b66453; /* #c67969; #ddb7b0; */
  --light: #7c8587;
  --corner-w: 160px; /* these impact the media width changes so be careful */
  --corner-h: 110px;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #bacfd3;
  text-rendering: optimizeLegibility;
  font-variant-ligatures: common-ligatures;
  font-size: var(--body-size);
  line-height: var(--line-height);
}
* {
  box-sizing: border-box;
}
p {
  margin-top: 0;
}
a {
  color: var(--accent);
  text-decoration: dotted underline;
}
a:hover {
  background-color: var(--accent);
  box-shadow: 0 -2.5px 0 var(--accent);
  /* the background doesn't go far enough up */
  text-decoration: none;
  color: var(--background-light);
}
.wrapper {
  box-sizing: border-box;
  min-height: 100%;
  display: grid;
  grid-template-areas:
    "link1 empty-t link2"
    "empty-c-1 main empty-c-2"
    "link3 empty-b link4";
  grid-template-columns: var(--corner-w) auto var(--corner-w);
  grid-template-rows: var(--corner-h) auto var(--corner-h);
  gap: 1px;
  background-color: var(--background-light);
  padding: 0;
}
.wrapper > div,
main {
  background-color: var(--background);
}
main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-height: calc(100vh - 2 * var(--corner-h));
  overflow-y: auto;
}
main section {
  display: none;
  max-width: var(--text-width);
  margin: var(--padding-med-lg) var(--padding-lg);
}
main section.active {
  display: block;
}
#title,
#pane2 {
  text-align: center;
}
#pane3 {
  text-align: center;
  margin: var(--padding-med);
}

#link1 {
  grid-area: link1;
}
#link2 {
  grid-area: link2;
}
#link3 {
  grid-area: link3;
}
#link4 {
  grid-area: link4;
}
#link1,
#link2,
#link3,
#link4 {
  /* text-transform: uppercase; */
  text-align: center;
  font-variant: small-caps;
  line-height: var(--corner-h);
}
/* hover */
#link1:hover,
#link2:hover,
#link3:hover,
#link4:hover {
  background-color: var(--background-light);
  cursor: pointer;
  color: var(--accent);
  text-decoration: dotted underline;
}

#link1.active,
#link2.active,
#link3.active,
#link4.active {
  background-color: var(--background-light);
  color: var(--accent);
}

.margin-none {
  margin: 0;
}
.margin-small {
  margin: 0.5rem;
}

.newsreader-body {
  font-family: "Newsreader", serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  font-style: normal;
  /* the following two make newsreader SLIGHTLY thinner which looks nicer */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@font-face {
  font-family: Large;
  src: url("Large-Roman.otf") format("opentype");
}
.large-title {
  font-family: "Large", serif;
  font-size: xx-large;
  letter-spacing: -0.01em;
  word-spacing: 0.1em;
  font-feature-settings: "dlig", "ss01", "case";
  line-height: var(--smaller-line-height);
}

.subtitle {
  max-width: 300px;
  margin: 0 auto;
  line-height: var(--smaller-line-height);
}

sup {
  line-height: 0;
  font-family: "Noto Sans Math";
  font-size: x-small;
  font-size: 12px;
}

.accent {
  color: var(--accent);
}
.color-light {
  color: var(--light) !important;
}

.grid-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2px;
}
.credits-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0 10px;
  text-align: left;
  align-content: flex-start;
}
.credits-grid.cast {
  /* equal size side columns */
  grid-template-columns: 1fr 1fr;
}
.credits-grid > :nth-child(2n-1) {
  text-align: right;
}
.credits-grid p {
  margin: 0;
}
.credits-grid a {
  text-decoration: none;
}
.author {
  color: var(--accent);
}
.small-caps {
  font-variant: small-caps;
}

@media (max-width: 1000px) {
  /* mobile view stuff */
  .wrapper {
    grid-template-areas:
      "link1 link2 link3 link4"
      "main  main  main  main";
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    min-height: 100vh;
  }
  /* empty spacer divs no longer needed */
  #empty-t,
  #empty-c-1,
  #empty-c-2,
  #empty-b {
    display: none;
  }
  #link1,
  #link2,
  #link3,
  #link4 {
    line-height: var(--line-height);
    padding: 10px 5px;
    height: auto;
  }

  main {
    max-height: none;
    padding: var(--padding-sm);
  }
  main section {
    margin: 0;
  }
  #pane3 {
    margin: var(--padding-sm);
  }

  .large-title {
    font-size: x-large;
  }
}

@media (max-width: 680px) {
  :root {
    --body-size: 16px;
    --small-size: 12px;
  }
  .credits-grid {
    grid-template-columns: 1fr;
  }
  .credits-grid > :nth-child(2n-1) {
    text-align: left;
  }
  .credits-grid.cast > :nth-child(2n-1) {
    text-align: right;
    /* keep original formatting for cast */
  }
  .grid-1-1 {
    grid-template-columns: 1fr;
    gap: var(--padding-sm) 0;
  }
  #pane3 {
    margin: 0;
  }
}

@media (max-width: 290px) {
  .credits-grid.cast {
    grid-template-columns: 1fr;
  }
  .credits-grid.cast > :nth-child(2n-1) {
    text-align: left;
  }
}
