* {
  box-sizing: border-box;
}

:root {
  --font-display: "Lithops", system-ui, sans-serif;
  --font-body: "Compagnon", system-ui, sans-serif;
  --paper: #f4f1ea;
  --cyanotype-blue: #0f3463;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  background: var(--paper);
  filter: contrast(1.02) brightness(0.98);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  color: var(--cyanotype-blue);
  background: transparent;
  text-shadow:
    0 0 1px color-mix(in srgb, var(--cyanotype-blue) 60%, transparent),
    0 0 2px color-mix(in srgb, var(--cyanotype-blue) 30%, transparent),
    0 0 6px color-mix(in srgb, var(--cyanotype-blue) 10%, transparent),
    0 0 1px color-mix(in srgb, var(--cyanotype-blue) 15%, transparent);
}

/* Grain layer */
html::before {
  content: "";
  position: fixed;
  inset: 0px;
  pointer-events: none;
  z-index: 9999;

  opacity: 0.5; /* this is VERY high btw, probably too strong */
  mix-blend-mode: multiply;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* Layout */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 680px;
  max-width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Typography */

@font-face {
  font-family: "Lithops";
  src: url("./assets/fonts/Lithops-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Compagnon";
  src: url("./assets/fonts/Compagnon-Roman.woff2") format("woff2");
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 15vw, 7rem);
  max-width: 10ch;
  line-height: 1.05;
  font-weight: 400;
  text-align: center;
  margin: 0 auto 16px;
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h2 {
  font-family: var(--font-body);
  font-weight: 300;
  margin: 32px 0 12px;
}

p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 12px;
}

/* Navigation */

nav {
  font-family: var(--font-body);
  text-align: center;
  line-height: 1.8;
  margin: 0 0 32px;
}

nav a {
  text-decoration: none;
  white-space: nowrap;
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

nav a:hover:not(.current) {
  opacity: 0.6;
}

nav a.current {
  font-style: italic;
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}

/* Rules list */

.rules-list {
  counter-reset: rule;
  list-style: none;
  padding: 0;
}

.rules-list li {
  counter-increment: rule;
  position: relative;
  padding-left: 4.1rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-body);
}

.rules-list li::before {
  content: counter(rule, upper-roman) ".";

  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0;

  width: 3rem;
  text-align: right;
}

/* Schedule */

.table-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
  /* border: 1px solid #111; */

  mask-image:
    linear-gradient(
      to right,
      transparent,
      black 8px,
      black calc(100% - 16px),
      transparent
    );
}

.schedule-table {
  width: max-content;
  margin-inline: auto;
  border-collapse: collapse;
  font-family: var(--font-body);
  text-align: center;
}

.schedule-table th {
  font-family: var(--font-display);
    font-size: 1.5rem;
  font-weight: 400;
  padding: 12px 8px;
  border-bottom: 1px solid #111;
}

.schedule-table td {
  padding: 12px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.15);
}

.schedule-table td:first-child {
  white-space: nowrap;
}

/* Blocks */

.card {
  padding: 16px;
  /* border: 1px solid #111; */
  margin: 16px 0;
}

/* Mobile tweaks */

@media (max-width: 600px) {
  .page {
    padding: 16px 12px;
  }
}
