@font-face {
  font-family: "Pirata One";
  src: url("../fonts/pirata-one.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --background: #f4f4f1;
  --foreground: #161716;
  --muted: #62645f;
  --focus: #7b4b18;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #090a09;
    --foreground: #edede8;
    --muted: #a4a69f;
    --focus: #d9a45f;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f4f4f1;
  --foreground: #161716;
  --muted: #62645f;
  --focus: #7b4b18;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #090a09;
  --foreground: #edede8;
  --muted: #a4a69f;
  --focus: #d9a45f;
}

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

html {
  min-width: 20rem;
  background: var(--background);
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--foreground);
  background: var(--background);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 0.85rem + 0.25vw, 1.1rem);
  line-height: 1.65;
  transition: color 180ms ease, background-color 180ms ease;
}

a {
  color: inherit;
}

.site-header {
  position: fixed;
  z-index: 3;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(1.25rem, 4vw, 4rem);
  pointer-events: none;
}

.site-title {
  font-family: "Pirata One", fantasy;
  font-size: clamp(3.5rem, 8vw, 8rem);
  line-height: 0.8;
  letter-spacing: -0.025em;
  text-decoration: none;
  pointer-events: auto;
}

.theme-toggle {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.theme-toggle:hover {
  color: var(--foreground);
}

.theme-toggle:focus-visible,
.text-link:focus-visible,
.site-title:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0.3rem;
}

.theme-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.theme-icon--sun {
  display: none;
}

.theme-toggle[data-theme="dark"] .theme-icon--moon {
  display: none;
}

.theme-toggle[data-theme="dark"] .theme-icon--sun {
  display: block;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(8rem, 18vh, 13rem) clamp(1.5rem, 5vw, 5rem) clamp(3rem, 8vh, 6rem);
}

.home-copy,
.about-copy {
  width: min(100%, 52rem);
}

.home-copy p {
  margin: 0 0 1.25rem;
  font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.4rem);
}

.about-copy h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.25rem);
  font-style: italic;
}

.about-copy p {
  margin: 0 0 1.25rem;
}

.text-link {
  color: var(--muted);
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

.text-link:hover {
  color: var(--foreground);
}

.home-copy .text-link,
.about-copy .text-link {
  position: fixed;
  z-index: 2;
  bottom: clamp(1.5rem, 4vw, 4rem);
  left: clamp(1.5rem, 5vw, 5rem);
}

.guardian {
  position: fixed;
  z-index: 0;
  right: clamp(-2.5rem, -1vw, -0.5rem);
  bottom: 0;
  width: auto;
  height: min(50vh, 45rem);
  pointer-events: none;
  user-select: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 56rem) {
  .page-shell {
    padding-right: min(36vw, 38rem);
  }
}

@media (max-width: 55.999rem) {
  .site-header {
    padding: 1.5rem;
  }

  .site-title {
    font-size: clamp(3.25rem, 16vw, 5rem);
  }

  .page-shell {
    align-items: flex-start;
    padding-top: clamp(9rem, 30vh, 13rem);
    padding-bottom: 20rem;
  }

  .home-copy {
    margin-block: auto;
  }

  .home-copy .text-link,
  .about-copy .text-link {
    bottom: 1.5rem;
    left: 1.5rem;
  }

  .guardian {
    right: -2rem;
    height: min(38vh, 19rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
  }
}
