@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-weight: 500;
  font-synthesis: none;
  background: #1c242b;
  color: #e9edf0;
  --sea: #88adc4;
  --rock: #677d8c;
  --light: #e9edf0;
  --warm: #f2dc9b;
  --shadow: #0e1418;
  --link: #a9cde8;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
}

main {
  align-self: center;
  width: calc(100% - 4rem);
  max-width: 56rem;
  padding-block: 3rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.875rem, 6vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.scene {
  position: relative;
  width: 100%;
  height: clamp(16rem, 40vw, 38rem);
}

.coast,
.coast-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: pan-y;
}

.coast[hidden],
.coast-fallback[hidden],
.farmhouse[hidden] {
  display: none;
}

.farmhouse {
  position: absolute;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: default;
}

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

h1 + p {
  margin: 0.25rem 0 0;
  opacity: 0.7;
}

nav {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 0.5rem;
}

a {
  color: var(--link);
  line-height: 1.6;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.home-link {
  text-decoration: none;
  text-shadow: 0 0 0 currentColor, 0 0 0 currentColor;
  transition: text-shadow 180ms ease, color 180ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--light);
  text-shadow: -0.4px 0 0 currentColor, 0.4px 0 0 currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .home-link {
    transition: none;
  }
}

.icons a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  opacity: 0.85;
}

.icons {
  margin-left: -12px;
}

.icons a:hover {
  opacity: 1;
}

.icons svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

a:focus-visible,
.theme:focus-visible,
.farmhouse:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
  border-radius: 2px;
}

.theme {
  position: absolute;
  left: 18%;
  top: 22%;
  width: clamp(44px, calc(14vw + 12px), 80px);
  height: clamp(44px, calc(14vw + 12px), 80px);
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}

.theme:focus-visible {
  border-radius: 50%;
}

.theme[hidden] {
  display: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
  background: #e4e7e5;
  color: #243340;
  --sea: #527e9b;
  --rock: #7f939f;
  --light: #334b5d;
  --warm: #d9a441;
  --shadow: #1b2832;
  --link: #315f80;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    background: #e4e7e5;
    color: #243340;
    --sea: #527e9b;
    --rock: #7f939f;
    --light: #334b5d;
    --warm: #d9a441;
    --shadow: #1b2832;
    --link: #315f80;
  }
}
