:root {
  --bg: #f9f8f4;
  --fg: #1a2030;
  --muted: #6d7280;
  --rule: #cfccbd;
  --accent: #33509e;
  --cols: 1fr;
  --grain-blend: multiply;
  --grain-opacity: 0.13;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111521;
    --fg: #dcdfe6;
    --muted: #868da0;
    --rule: #39415a;
    --accent: #93a9e3;
    --grain-blend: screen;
    --grain-opacity: 0.2;
  }
}

html[data-theme="light"] {
  --bg: #f9f8f4;
  --fg: #1a2030;
  --muted: #6d7280;
  --rule: #cfccbd;
  --accent: #33509e;
  --grain-blend: multiply;
  --grain-opacity: 0.13;
}

html[data-theme="dark"] {
  --bg: #111521;
  --fg: #dcdfe6;
  --muted: #868da0;
  --rule: #39415a;
  --accent: #93a9e3;
  --grain-blend: screen;
  --grain-opacity: 0.2;
}

@media (min-width: 700px) {
  :root { --cols: 170px 1fr; }
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(640px 420px at 82% -120px, color-mix(in oklab, var(--accent) 9%, transparent), transparent 70%);
  background-repeat: no-repeat;
  color: var(--fg);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 17.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

#grain {
  position: fixed;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='.5'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

main {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 64px 0 44px;
}

h1 {
  margin: 0;
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

header p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 19px;
  font-style: italic;
  text-wrap: pretty;
}

.theme-slot {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

#theme {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

#theme:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#theme:hover { color: var(--accent); }

#theme:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

section {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: baseline;
  column-gap: 32px;
  row-gap: 6px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--rule);
}

section h2 {
  margin: 0;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

section p { margin: 0; text-wrap: pretty; }

a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--fg);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--accent); }

footer {
  display: flex;
  justify-content: center;
  padding: 30px 0 0;
  border-top: 1px solid var(--rule);
}

.pl-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
}

.pl-ball,
.pl-hop { display: inline-flex; }

.pl-ball { animation: pl-roll 7s linear infinite; }

.pl-hop {
  position: relative;
  transform-origin: center bottom;
  color: var(--fg);
  animation: pl-hop 7s infinite;
}

.pl-panel { position: absolute; inset: 0; }

.pl-shadow {
  width: 18px;
  height: 3.5px;
  margin-top: -3px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentcolor;
  opacity: 0.5;
  animation: pl-shadow 7s infinite;
}

::selection { background: var(--accent); color: var(--bg); }

@keyframes pl-roll {
  0% { transform: rotate(0deg); animation-timing-function: linear; }
  54% { transform: rotate(32deg); animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5); }
  63% { transform: rotate(155deg); animation-timing-function: linear; }
  70% { transform: rotate(287deg); animation-timing-function: cubic-bezier(0.1, 0.5, 0.35, 1); }
  82% { transform: rotate(349deg); animation-timing-function: linear; }
  100% { transform: rotate(360deg); }
}

@keyframes pl-hop {
  0%, 52%, 100% { transform: translateY(0) scale(1); animation-timing-function: ease-in-out; }
  56% { transform: translateY(1.5px) scale(1.1, 0.86); animation-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1); }
  63% { transform: translateY(-15px) scale(0.97, 1.04); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
  70% { transform: translateY(0) scale(1); }
  72% { transform: translateY(1.5px) scale(1.14, 0.8); animation-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1); }
  77% { transform: translateY(-6px) scale(0.99, 1.02); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
  82% { transform: translateY(0) scale(1.05, 0.93); }
  85% { transform: translateY(0) scale(1); }
}

@keyframes pl-shadow {
  0%, 52% { transform: scale(1); opacity: 0.5; }
  56% { transform: scale(1.15); opacity: 0.56; animation-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1); }
  63% { transform: scale(0.55); opacity: 0.22; animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
  70% { transform: scale(1); opacity: 0.5; }
  72% { transform: scale(1.15); opacity: 0.56; animation-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1); }
  77% { transform: scale(0.82); opacity: 0.35; animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
  82%, 100% { transform: scale(1); opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-ball,
  .pl-hop,
  .pl-shadow { animation: none; }
}

@media (max-width: 420px) {
  main { padding-inline: 20px; }
  header { gap: 12px; padding-top: 48px; }
  h1 { font-size: 28px; }
}
