@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/roboto-mono-400.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --page-bg: #ffffff;
  --page-fg: #0f172a;
  --page-muted: #475569;
  --link-hover: #0369a1;
  --logo-color: #000000;
  --social-attribution-color: #6b7280;
}

[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: transparent;
  --page-fg: #f0efef;
  --page-muted: #b8b4b4;
  --link-hover: #ec625f;
  --logo-color: #f0efef;
  --social-attribution-color: var(--page-muted);
}

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

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--page-fg);
  font-family: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] body {
  background: #282a2e;
  min-height: 100vh;
}

a:hover {
  cursor: pointer;
}

.page {
  min-height: 100vh;
  background: var(--page-bg);
  display: flex;
  justify-content: center;
  padding: 0 1.5rem 3rem;
}

[data-theme="dark"] .page {
  background: transparent;
}

/* Social row */

.social-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}

.social-nav .social-link:first-child {
  padding-left: 0;
}

.social-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--page-muted);
  opacity: 0.4;
  margin: 0 0.75rem;
}

.social-attribution {
  margin-left: 0.75rem;
  font-size: 0.8125rem;
  color: var(--social-attribution-color);
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-0.35rem);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
  pointer-events: none;
  user-select: none;
}

.social-attribution__content {
  display: inline-block;
  vertical-align: bottom;
}

.social-attribution__idle {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  white-space: nowrap;
}

.social-attribution__stack {
  display: inline-grid;
  vertical-align: bottom;
}

.social-attribution__swap {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  white-space: nowrap;
}

.social-attribution__swap--out {
  z-index: 1;
  animation: social-attrib-out 0.13s ease forwards;
}

.social-attribution__swap--in {
  z-index: 2;
  animation: social-attrib-in 0.13s ease forwards;
}

.social-attribution__swap--in-only {
  z-index: 1;
}

.social-attribution__arrow {
  flex-shrink: 0;
  font-size: 1.15em;
  line-height: 1;
}

@keyframes social-attrib-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-0.35rem);
  }
}

@keyframes social-attrib-in {
  from {
    opacity: 0;
    transform: translateX(0.35rem);
  }

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

.social-row:hover .social-attribution {
  opacity: 1;
  transform: translateX(0);
}

/* Fade/slide out to the left while the row is still hovered (pointer left icon / toggle). */
.social-row:hover .social-attribution.social-attribution--concealed {
  opacity: 0;
  transform: translateX(-0.35rem);
}

/* Touch / no-hover: JS also skips attribution; this hides it if markup is present. */
@media (hover: none) {
  .social-attribution {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .social-attribution {
    transition: none;
    transform: none;
  }

  .social-row:hover .social-attribution {
    opacity: 1;
  }

  .social-attribution__swap--out,
  .social-attribution__swap--in {
    animation-duration: 0.05s;
  }
}

/* Theme toggle */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--page-muted);
  font-size: 1.125rem;
  cursor: pointer;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.theme-toggle svg {
  flex-shrink: 0;
  display: block;
}

.theme-toggle:hover {
  color: var(--link-hover);
  transform: scale(1.25);
}

.container {
  width: 100%;
  max-width: 500px;
  margin-top: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Logo */

.logo {
  margin: 0;
  width: 100%;
  font: inherit;
  line-height: 0;
  color: var(--logo-color);
}

.logo svg {
  display: block;
  /* Height from `Logo` via `--logo-wordmark-height` (viewBox 894×215). */
  width: min(100%, calc(var(--logo-wordmark-height, 3.8rem) * 894 / 215));
  height: auto;
}

/* Social nav */

.social-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--page-muted);
  text-decoration: none;
  font-size: 1.375rem;
  line-height: 1;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
  cursor: pointer;
}

.social-link svg {
  flex-shrink: 0;
  display: block;
}

.social-link:hover {
  color: var(--link-hover);
  transform: scale(1.25);
}

/* Body text */

.body-text {
  width: 100%;
  max-width: 60ch;
  text-align: left;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--page-muted);
  padding: 0.75rem 0;
}

@media (max-width: 500px) {
  .body-text {
    font-size: 0.9rem;
  }
}

.body-text p {
  margin: 0 0 1rem;
}

.body-text p:last-child {
  margin-bottom: 0;
}

.email-link {
  position: relative;
  color: var(--link-hover);
  text-decoration: none;
  transition: color 0.2s ease;
}

.email-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--page-fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.email-link:hover {
  color: var(--page-fg);
}

.email-link:hover::after {
  transform: scaleX(1);
}

/* Accessibility */

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