@font-face {
  font-family: 'Lora';
  src:
    url('./fonts/lora/variable/lora-latin-wght-normal.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
  font-family: 'Geist-Mono';
  src:
    url('./fonts/geist-mono/variable/geist-mono-latin-ext-wght-normal.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root,
:root[data-theme='dark'] {
  /* https://github.com/Sequoia-Theme/color-palette/blob/main/palettes.scss */
  color-scheme: dark;

  --bg: #0f1014ff;
  --text: #e2e4edff;
  --text-muted: #999eb2ff;
  --link: #626983ff;
  --link-visited: #626983ff;
  --link-hover: #7c829dff;
  --link-active: #626983ff;
  --border: #43444dff;
  --button-bg: #1f1f24ff;
  --button-text: #868690ff;
  --button-hover-bg: #575861ff;
  --code-bg: #1a1b1fff;
  --code-text: #868690ff;
}

:root[data-theme='light'] {
  color-scheme: light;

  --bg: #fdf6e3;
  --text: #1f1f24ff;
  --text-muted: #9898a6ff; /* manatee */
  --link: #8eb6f5ff; /* french-sky-blue */
  --link-visited: #8eb6f5ff; /* french-sky-blue */
  --link-hover: #c58fffff; /* bright-lilac */
  --link-active: #f58ee0ff; /* violet-web */
  --border: #9898a6ff; /* manatee */
  --button-bg: #fdfdfeff; /* white */
  --button-text: #1f1f24ff;
  --button-hover-bg: #ffbb88ff; /* macaroni-and-cheese */
  --code-bg: #fdfdfeff; /* white */
  --code-text: #0f1014ff;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Lora', sans-serif;
}

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

a:visited {
  color: var(--link-visited);
}

a:active {
  color: var(--link-active);
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

button {
  background-color: var(--button-bg);
  color: var(--button-text);
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  padding: 0.3rem;
  font-size: 18px;
}

button:hover {
  text-decoration: none !important;
  background-color: var(--button-hover-bg);
  cursor: pointer;
}

pre {
  background-color: var(--code-bg) !important;
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 1rem;
  font-family: 'Geist-Mono', monospace;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
}

pre span {
    color: var(--code-text) !important;
}

em {
  color: var(--text-muted);
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1rem, 4vw, 2rem);
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 100%;
}

.page-content {
  width: 100%;
  max-width: 70ch;
  min-width: 0;
  overflow-wrap: break-word;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }
}

@media (max-width: 480px) {
  .wrapper {
    padding: 0.75rem;
  }

  header {
    gap: 0.4rem;
  }

  button {
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
  }
}

@media (min-width: 641px) {
  header {
    gap: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .page-content {
    max-width: 75ch;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  clip-path: circle(0% at var(--x, 50%) var(--y, 50%));
  animation: theme-reveal 2000ms ease-out forwards;
}

@keyframes theme-reveal {
  to {
    clip-path: circle(150% at var(--x, 50%) var(--y, 50%));
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}
