@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap");

:root {
  color-scheme: light dark;
  --paper: light-dark(#f8f7f2, #292c28);
  --ink: light-dark(#242821, #c4c7bd);
  --muted: light-dark(#565b50, #a5aa9f);
  --line: light-dark(#d3d6cb, #444a40);
  --accent: light-dark(#436340, #a1b398);
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.7 "Noto Sans JP", system-ui, sans-serif;
}

body {
  max-width: 40rem;
  margin: auto;
  padding: 1.5rem clamp(1.25rem, 5vw, 3rem);
}

header, nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
}

header {
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

header, footer, .eyebrow {
  font: .8rem/1.5 "Noto Sans JP", system-ui, sans-serif;
}

a {
  color: inherit;
  text-underline-offset: .25em;
}

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

main {
  padding: 3rem 0 2rem;
}

.eyebrow {
  letter-spacing: .08em;
}

h1 {
  margin: .25rem 0 .75rem;
  font: 700 clamp(2.75rem, 10vw, 5rem)/1.1 "Noto Sans JP", system-ui, sans-serif;
  letter-spacing: -.06em;
}

h2 {
  margin: 2.75rem 0 .75rem;
  font-size: 1.25rem;
}

h3 {
  margin: 1rem 0 .25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}

p {
  margin: 0 0 .5rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

code {
  font-size: .8rem;
}

footer {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

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

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

header nav {
  align-items: center;
}

.theme-toggle {
  display: inline-flex;
  gap: .125rem;
  padding: .1875rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--paper);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle span {
  display: grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle[aria-checked="false"] span:first-child,
.theme-toggle[aria-checked="true"] span:last-child {
  background: var(--accent);
  color: var(--paper);
}

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

.profile {
  display: flex;
  align-items: flex-start;
  gap: clamp(.875rem, 4vw, 1.5rem);
}

.profile-avatar {
  flex: 0 0 auto;
  width: clamp(3.5rem, 13vw, 5.5rem);
  margin-top: .5rem;
}

.profile-avatar img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
}

.profile ul {
  margin: .75rem 0 0;
  padding-left: 1.25em;
  color: var(--muted);
  font-size: .875rem;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
}

@media (max-width: 480px) {
  .profile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    row-gap: .75rem;
  }

  .profile > div {
    display: contents;
  }

  .profile-avatar, .profile h1, .profile p, .profile ul {
    margin: 0;
  }

  .profile p, .profile ul {
    grid-column: 1 / -1;
  }
}
