:root {
  color-scheme: dark;
  font-family: Arial, sans-serif;
  --bg: #2e3440;
  --surface: #3b4252;
  --raised: #434c5e;
  --line: #616e88;
  --text: #eceff4;
  --muted: #d8dee9;
  --ice: #88c0d0;
  --blue: #81a1c1;
  --focus: var(--text);
  --accent-text: var(--ice);
  --sun-core: #fffacd;
  --sun-mid: #f2c779;
  --sun-edge: #cf8442;
  --sun-ray: #f2c779;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #fffde9;
  --surface: #f0eadf;
  --raised: #f0dcc7;
  --line: #d3b894;
  --text: #493923;
  --muted: #755d3f;
  --ice: #a65d22;
  --blue: #cf8442;
  --accent-text: color-mix(in srgb, var(--ice) 75%, var(--text));
  --sun-ray: #88c0d0;
  --sun-core: #eceff4;
  --sun-mid: #d8dee9;
  --sun-edge: #81a1c1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
header {
  height: 120px;
  position: relative;
  display: grid;
  place-items: center;
  padding: 12px 108px;
  border-bottom: 1px solid var(--line);
  overflow: hidden; /* Contain all sunlight effects within the header rectangle. */
  isolation: isolate;
}
header .site-name {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: clamp(18px, 2.25vw, 32px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-align: center;
}
.home-link {
  position: absolute;
  z-index: 2;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 108px;
  height: 108px;
}
.mark {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ice);
  -webkit-mask: url('./fractal-hex.webp') center / contain no-repeat;
  mask: url('./fractal-hex.webp') center / contain no-repeat;
}
.sunlight {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  width: clamp(270px, 34vw, 420px);
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.96;
  /* The SVG uses `slice`, which crops its fixed-coordinate radial fade
     in narrow windows. Fade the displayed viewport as well, so its left
     edge always reaches transparency without stretching the sun/moon. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 35%);
  mask-image: linear-gradient(to right, transparent, #000 35%);
}
.sun-toggle {
  position: absolute;
  z-index: 3;
  right: 0;
  top: 0;
  width: 70px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
/* Keep the same half-disc silhouette in both states. */
.moon-disc {
  display: none;
}
:root[data-theme='light'] .sun-disc {
  display: none;
}
:root[data-theme='light'] .moon-disc {
  display: initial;
}
:root[data-theme='light'] #sun-rays {
  opacity: 0.06;
}
:root[data-theme='light'] .celestial-halo {
  opacity: 0;
}
.sun-toggle[hidden] {
  display: none;
}
.sun-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -4px;
  box-shadow: inset 0 0 0 6px var(--bg);
}
.home-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
  outline: 2px solid var(--focus);
}
:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
@media (max-width: 680px) {
  header {
    padding: 10px 108px;
  }
  header .site-name {
    font-size: clamp(16px, 2.55vw, 18px);
  }
  header .home-link {
    left: 8px;
    width: 108px;
    height: 108px;
  }
  .sunlight {
    width: min(285px, 100%);
  }
  .sun-toggle {
    width: 57px;
  }
}
