@font-face {
  font-family: 'PTSerif';
  src: url('/assets/PTSerif-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'PTSerif';
  src: url('/assets/PTSerif-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

:root {
  color-scheme: light dark;
  --background: light-dark(#fafafa, #101010);
  --background-light: light-dark(#e3e3e3, #212121);
  --font: light-dark(#000000, #ffffff);
  --font-light: light-dark(#a5a5a5, #767676);
  --accent: #e568a9;
  --font-accent: light-dark(#ffffff, #000000);
  --danger: #e26264;
}

html {
  background-color: var(--background);
  color: var(--font);
  font-family: PTSerif;
  font-size: 12pt;
  margin: 0 1rem;
}

body {
  width: 100%;
  max-width: 50rem;
  min-height: 100svh;
  padding-bottom: 3rem;
}

.page {
  width: 100%;
  max-width: 40rem;
}

header {
  align-items: center;
  margin-bottom: 1rem;

  & img {
    height: 6rem;
    margin: 0.5rem;
  }

  & .title {
    & h1,
    & p.subtitle {
      margin: 0;
    }

    & h1 {
      flex: 2;
    }

    & p.subtitle {
      flex: 1;
      min-height: 1em;
    }
  }
}

.flex-c {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flex-r {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

h1 {
  font-size: 24pt;
}

h2 {
  font-size: 14pt;
}

h3 {
  font-size: 12pt;
}

h4 {
  font-size: 10pt;
}

h1,
h2,
h3,
h4,
p,
details {
  margin: 0.5em 0 0.05em;
}

h2 {
  margin-top: 1.25em;
}

a {
  color: var(--accent);
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }
}

input {
  box-sizing: border-box;
  background-color: var(--background-light);
  border: none;
  outline: none;
  border-radius: 3pt;
  font-size: 1em;
  font-family: inherit;

  &[type='radio'],
  &[type='checkbox'] {
    accent-color: var(--accent);
  }

  &:active,
  &:focus {
    outline: 1px solid var(--accent);
  }

  &::placeholder {
    color: var(--font-light);
  }
}

input,
button {
  padding: 0.25em 0.5em;
  margin: 0.25em;
}

button {
  background-color: var(--accent);
  color: var(--font-accent);
  font-size: 12pt;
  font-family: inherit;
  border-radius: 3pt;
  border: none;

  &.big {
    font-size: 14pt;
  }

  &.danger {
    background-color: var(--danger);
  }

  &:hover {
    cursor: pointer;
  }
}

/* fix word wrapping on narrow screens */
* {
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

button {
  word-break: keep-all;
}
