:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #20291f;
  --muted: #5a6258;
  --green: #b8d84b;
  --accent: #55701f;
  --line: rgba(32, 41, 31, 0.18);
  --font-sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --page-padding: clamp(1.25rem, 4vw, 3.5rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101a24;
  --ink: #e8eef4;
  --muted: #a3b0bc;
  --accent: #c5e063;
  --line: rgba(232, 238, 244, 0.2);
}

/* Without JavaScript there is no data-theme, so follow the system setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #101a24;
    --ink: #e8eef4;
    --muted: #a3b0bc;
    --accent: #c5e063;
    --line: rgba(232, 238, 244, 0.2);
  }
}

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

body {
  display: grid;
  min-height: 100svh;
  margin: 0;
  grid-template-rows: auto 1fr;
  padding: var(--page-padding);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
}

[hidden] {
  display: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.controls,
.language-switch {
  display: flex;
  align-items: center;
}

.controls {
  gap: 0.5rem;
}

.theme-toggle,
.language-switch a {
  display: grid;
  min-width: 2.75rem;
  min-height: 2.75rem;
  place-items: center;
  border-radius: 0.5rem;
}

.theme-toggle {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: none;
  cursor: pointer;
}

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

.theme-toggle .icon-night,
:root[data-theme="dark"] .theme-toggle .icon-day {
  display: none;
}

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

.language-switch img {
  display: block;
  border-radius: 0.2rem;
  box-shadow: 0 0 0 1px var(--line);
}

.language-switch a[aria-current="page"] img {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
}

.notice {
  align-self: center;
  width: min(100%, 70rem);
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 6rem) 0;
  animation: reveal 1s var(--ease-out) both;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(3rem, 11vw, 8rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.1em;
}

.lead {
  max-width: 32rem;
  margin: 2.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice {
    animation: none;
  }
}
