@import url("extras.css");

:root {
  --font-mono: Consolas, Monaco, "Andale Mono", monospace;
  --font-body: "Oslo Sans", arial, sans-serif;
  --font-heading: var(--font-body);
  --color-yellow: hsl(50, 100%, 50%);
  --color-green: hsl(100, 60%, 50%);
  --color-aqua: hsl(190, 100%, 40%);
  --color-magenta: hsl(336, 100%, 55%);
  --color-gray-medium: hsl(200 15% 50%);

  --color-accent-1: var(--color-aqua);
  --color-accent-2: var(--color-green);
  --color-accent-3: var(--color-yellow);
  --color-accent-4: var(--color-magenta);
  --light1: hsl(200, 40%, 80%);
}

html {
  font: 300 100%/1.5 var(--font-body);
  --checkerboard: repeating-conic-gradient(
      rgb(0 0 0 / 0.06) 0 25%,
      transparent 0 50%
    )
    0 0 / 40px 40px;
  background: var(--checkerboard) hsl(220, 10%, 97%);
  font-synthesis: none;
  color-scheme: light;
}

body {
  line-height: 2;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.5;
  text-wrap: balance;
}

h1 {
  font-size: 200%;
}
h2 {
  font-size: 175%;
}
h3 {
  font-size: 150%;
}

a {
  color: inherit;
  text-decoration-color: hsla(0, 0%, 100%, 0.4);
}

strong,
b {
  font-weight: bold; /* FF is weird */
}

:focus:not(:focus-visible) {
  outline: none;
}

input:not([type="file"]),
button,
select {
  font: inherit;
  color: inherit;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"] {
  padding: 0 0.3em;
}

code,
textarea,
pre {
  margin: 0;
  font: 100%/1.5em var(--font-mono);
  font-family: var(--font-mono);
  tab-size: 4;
  color: inherit;
}

pre > code {
  font-size: inherit;
}

code mark {
  --color: hsla(190, 20%, 50%, 0.5);
  background: var(--color);
  box-shadow: 0 -0.05em 0 0.1em var(--color);
  color: inherit;
  border-radius: 1px;
  text-shadow: 0.01em 0.05em 0.2em rgba(0, 0, 0, 0.6);
  transition: 0.6s;
}

pre + pre {
  margin-top: 1.5em;
}

img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

::selection {
  background: canvas;
  color: canvastext;
  text-shadow: none;
}

.slide {
  display: flex;
  flex-flow: column;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem;
  color: canvastext;
}

@media (max-width: 1024px) {
  .slide {
    padding: 3vmin;
  }
}

.light.slide {
  background: var(--light1);
  color: black;
}

.slide > h1,
.slide > header > h1 {
  margin: 0 0 0.6em;
  font-size: 200%;
}

.slide > header > h1 + h2,
.slide > header > h1 + p {
  margin-top: 0;
}

.slide h2 {
  font-size: 120%;
}

:where(section) > header.slide {
  /* exclude cover */
  background: linear-gradient(
    to bottom right,
    var(--color-accent-3),
    var(--color-accent-2),
    var(--color-accent-1),
    var(--color-accent-2),
    var(--color-accent-3)
  );

  > h1 {
    margin: auto;
    padding: 0.5em 0.7em;
    background: black;
    color: white;
    text-align: center;
    font-size: 250%;
    line-height: 1.2;
    font-weight: 300;
  }
}

section > section > header.slide {
  background: linear-gradient(
    to bottom right,
    var(--color-accent-4),
    var(--color-accent-3),
    var(--color-accent-1),
    var(--color-accent-3),
    var(--color-accent-4)
  );
}

#indicator {
  color: canvastext;
}

/* Quotes */

blockquote {
  position: relative;
  font-style: italic;
  max-width: calc(80vw - 4.5em);
}

blockquote::before {
  content: "❝";
  position: absolute;
  right: 100%;
  top: -0.3em;
  margin-right: 0.2em;
  font-size: 300%;
  color: var(--color-accent-1);
  font-style: normal;
}

blockquote .cite {
  text-align: right;
  font-style: normal;
  font-size: 60%;
  font-weight: bold;
  color: var(--color-accent-1);
}

blockquote .cite::before {
  content: "— ";
}

blockquote .cite a:not(:hover) {
  text-decoration: none;
}

/* Tables */

.slide > table {
  border-spacing: 0;
  margin: 1em;
}

table caption {
  font-weight: bold;
  letter-spacing: -0.05em;
  color: var(--color-orange);
}

th,
td {
  vertical-align: middle;
  text-align: left;
  padding: 0.5em;
}

th {
  border: 0;
}

tbody th {
  text-align: right;
  padding-left: 0;
}

thead th {
  vertical-align: top;
  font-size: 75%;
  background: var(--color-accent-1);
  padding: 0.3em 0.5em;
}

tbody tr > * {
  border-top: 1px solid hsla(0, 0%, 100%, 0.15);
}

td:first-child {
  font-weight: 300;
}

td:first-child,
th:first-child {
  text-align: left;
}

/* Syntax highlighting */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: hsla(220, 10%, 90%, 0.5);
}

.token.punctuation {
  color: #999;
}

.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
  color: var(--color-accent-2);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin {
  color: var(--color-accent-1);
}

.token.operator,
.token.entity,
.token.url,
.language-css > .token.string,
.token.inserted,
.token.function {
  color: var(--color-accent-4); /* deep pink */
}

.token.attr-value,
.token.keyword,
.token.variable {
  color: var(--color-accent-3);
}

.token.atrule,
.token.regex,
.token.important {
  color: orange;
}

.token.important,
.token.bold {
  font-weight: bold;
}
