/* ページ全体 */
:root {
  color: #000000;
  background: #ffffff;
  font-family: sans-serif;
  font-size: 1.125rem;
  line-height: 1.8;
  scroll-padding-top: 11rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1rem 1rem 4rem;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -1rem -1rem 0;
  padding: 1rem;
  background: #ffffff;
  --section-color: #6b21a8;
}

header a {
  text-decoration-color: var(--section-color);
}

.language-switcher {
  position: absolute;
  top: 1rem;
  right: 1rem;
  margin-top: 0;
  gap: 0.75rem;
}

/* スクロール後だけヘッダーをコンパクトに */
:root:has(header.is-compact) {
  scroll-padding-top: 7rem;
}

header.is-compact {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  column-gap: 1.5rem;
  row-gap: 0.5rem;
}

header > h1 {
  grid-column: 1;
  grid-row: 1;
}

header.is-compact > p {
  display: none;
}

header.is-compact .language-switcher {
  position: static;
  grid-column: 3;
  grid-row: 1;
}

header.is-compact > nav:not(.language-switcher) {
  grid-column: 1 / -1;
  margin-top: 0;
}


/* 文字とリンク */
h1,
h2,
h3,
p {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration-line: line-through;
    text-decoration-color: var(--section-color, currentColor);
  }
}

/* タッチでは押している間だけ斜線を見せ、タップ後に残さない。 */
@media (hover: none) {
  a:active,
  a.is-navigating {
    text-decoration-line: line-through;
    text-decoration-color: var(--section-color, currentColor);
  }
}

.work-list a,
main p > a:only-child {
  display: block;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* ページの区切り */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

section {
  margin-top: 4rem;
  padding-top: 1rem;
}

section::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 1rem;
  background: var(--section-color);
  border-radius: 999px;
}

.mark {
  color: #777777;
}

section .mark {
  color: var(--section-color);
}

.works {
  --section-color: #e64b35;
}

.profile {
  --section-color: #2f7de1;
}

.contact {
  --section-color: #b47700;
}

/* 作品一覧 */
.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
}



.name-face {
  width: 1.2em;
  height: 1.2em;
  margin-left: 0.5em;
  vertical-align: -0.2em;
}
.return-link a {
  color: var(--section-color);
  text-decoration-color: var(--section-color);
}

/* 詳細ページの文章 */
.essay-body {
  max-width: 40em;
  margin-top: 1.5rem;
}

.essay-body p + p {
  margin-top: 1em;
}

/* トップの映像 */
.hero-video {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: auto;
  margin-top: 4rem;
}

.hero-video + .works {
  margin-top: 1rem;
}

.content-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 1rem;
}

.essay-body img,
.essay-body video {
  max-width: 100%;
  height: auto;
}

/* 名前からページ先頭へ */
.name-link {
  text-decoration: none;
}

header .return-link {
  margin-top: 1rem;
}

.name-link:hover,
.name-link:active,
.name-link.is-navigating {
  text-decoration-color: #fff100;
}

.name-link:focus-visible {
  outline-color: #fff100;
}

/* 言葉は緑。プロフィールの青とは独立させる。 */
.words {
  --section-color: #258044;
}

.word-index {
  max-width: 40rem;
  margin-top: 1rem;
}

.word-group {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: 1rem;
}

.word-group + .word-group {
  margin-top: 1rem;
}

.word-initial {
  color: var(--section-color);
}

.word-items {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-wrap: anywhere;
}

.word-items li {
  display: inline;
}
