:root {
  color-scheme: light;
  --ink: #282828;
  --muted: #737373;
  --font:
    -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', 'Yu Gothic',
    Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 3;
  background: white;
  padding: 0.75rem;
}
.skip-link:focus {
  top: 1rem;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 15rem;
  padding: 3.5rem 2.75rem;
}
.name {
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.06em;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.35rem;
  margin-top: 3.3rem;
}
.sidebar nav a {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  letter-spacing: 0.025em;
}
.sidebar nav a[aria-current] {
  color: var(--ink);
}
main {
  margin-left: 15rem;
  padding: 3.5rem 5.5vw 5rem;
  max-width: calc(15rem + 54rem);
  min-height: 100vh;
}
main:focus {
  outline: none;
}
.view {
  max-width: 44rem;
}
figure {
  margin: 0 0 6rem;
}
figure img {
  display: block;
  width: 100%;
  height: auto;
}
figcaption {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 1rem;
}
figure.portrait {
  width: 70%;
  margin-left: 0;
}
.text-page {
  max-width: 35rem;
  font-size: 1rem;
  line-height: 2;
}
.text-page h1 {
  font-size: 1rem;
  font-weight: 400;
  margin: 0 0 2rem;
}
.text-page p {
  margin: 0;
  overflow-wrap: anywhere;
}
.pending {
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 800px) {
  .sidebar {
    width: 12rem;
    padding: 2.5rem 1.75rem;
  }
  .name {
    font-size: 1.15rem;
  }
  main {
    margin-left: 12rem;
    padding: 2.5rem 4vw 4rem;
  }
  .sidebar nav {
    margin-top: 2.5rem;
  }
  figure.portrait {
    width: 82%;
  }
}

@media (max-width: 600px) {
  .sidebar {
    position: relative;
    width: 100%;
    padding: 1.8rem 1.5rem 0;
  }
  .name {
    font-size: 1.2rem;
  }
  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.8rem;
    margin-top: 1.35rem;
  }
  main {
    margin-left: 0;
    padding: 2.5rem 1.5rem 3rem;
    min-height: 0;
    max-width: none;
  }
  figure {
    margin-bottom: 3.5rem;
  }
  figure.portrait {
    width: 86%;
  }
  figcaption {
    margin-top: 0.75rem;
  }
  .text-page h1 {
    margin-bottom: 1.5rem;
  }
}

#cv {
  font-family: Arial, 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  font-size: 0.875rem;
  line-height: 1.85;
  line-break: strict;
  letter-spacing: -0.01em;
  font-weight: 400;
}
#cv > h1 {
  font-size: 1em;
  margin: 0 0 0.65rem;
  line-height: 1.8;
}
.cv-intro {
  display: block;
  margin-bottom: 1.5rem;
}
#cv .cv-intro h1 {
  font-size: 1em;
  font-weight: 400;
  margin: 0 0 0.65rem;
  line-height: 1.8;
}
.cv-portrait {
  display: block;
  float: right;
  width: 160px;
  height: auto;
  margin: 0 0 1.5rem 2rem;
}
.language-links {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.75rem;
  letter-spacing: 0;
  margin: 0 0 1.4rem !important;
}
.language-links span {
  color: var(--muted);
}
.cv-language {
  scroll-margin-top: 3.5rem;
  outline: none;
}
.cv-language + .cv-language {
  margin-top: 2.75rem;
}
.cv-language h2 {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 0.6rem;
  letter-spacing: 0;
}
.cv-group {
  margin-top: 1.5rem;
}
.cv-group + .cv-group {
  clear: both;
}
.cv-group:first-of-type {
  margin-top: 0.75rem;
}
.cv-group h3 {
  font-size: 1em;
  font-weight: 400;
  line-height: 1.8;
  margin: 0 0 0.4rem;
}
.cv-list {
  margin: 0;
}
.cv-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.3rem;
  align-items: baseline;
}
.cv-row dt {
  font-weight: 400;
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
  text-align: right;
  letter-spacing: 0;
}
.cv-row dd {
  margin: 0;
  min-width: 0;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.cv-row dd p + p {
  margin-top: 0;
}
#cv .cv-row dd p {
  overflow-wrap: break-word;
}
.cv-place {
  display: inline;
  color: inherit;
}
.cv-place:before {
  content: ' ';
  white-space: pre;
}

@media (min-width: 601px) and (max-width: 1100px) {
  .cv-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
  }
  .cv-portrait {
    float: none;
    order: 1;
    width: 140px;
    margin: 0;
  }
}

@media (max-width: 600px) {
  .cv-portrait {
    float: none;
    order: 1;
    width: 128px;
    margin: 0;
  }
  .cv-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }
  .cv-language {
    scroll-margin-top: 2rem;
  }
  .cv-row {
    grid-template-columns: 2.3rem minmax(0, 1fr);
    gap: 0.55rem;
  }
  .cv-language + .cv-language {
    margin-top: 2.5rem;
  }
  #cv > h1 {
    margin-bottom: 0.65rem;
  }
}

.works-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 1.3rem;
  margin: 0 0 1.6rem;
  font-size: 0.8125rem;
  line-height: 1.8;
}
.works-categories a {
  color: var(--muted);
}
.works-categories a[aria-current] {
  color: var(--ink);
}
.video-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.8;
}
.video-work {
  margin-bottom: 3rem;
}
.video-work iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  min-height: 200px;
  border: 0;
  background: #000;
}

#paintings > figure:last-child {
  margin-bottom: 0;
}

.photo-empty,
.gallery-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.8;
}

.subcategories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.3rem;
  margin: 0 0 1.6rem;
  font-size: 0.8125rem;
  line-height: 1.8;
}
.subcategories a {
  color: var(--muted);
}
.subcategories a[aria-current] {
  color: var(--ink);
}
.contact-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

#diary {
  font-size: 0.875rem;
  line-height: 1.8;
}
#diary h1 {
  font-size: 1em;
  margin-bottom: 1.4rem;
}
.diary-link {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

main:has(#works:not([hidden]), #archive:not([hidden])) {
  max-width: calc(15rem + 70rem);
  padding-right: 2.5vw;
}

#works,
#archive {
  max-width: none;
}
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.6rem;
}

.image-gallery > figure,
.image-gallery > figure.portrait {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  margin: 0;
}

.artwork-link {
  display: block;
  width: max-content;
  max-width: 100%;
  cursor: zoom-in;
}
.image-gallery img {
  width: auto;
  height: 10rem;
  max-width: 100%;
  object-fit: contain;
}
.artwork-link:hover img {
  opacity: 0.88;
}

#work-dialog {
  width: fit-content;
  max-width: calc(100vw - 3rem);
  max-height: calc(100dvh - 3rem);
  margin: auto;
  padding: 1.25rem;
  border: 0;
  background: #fff;
  color: var(--ink);
  overflow: auto;
}

#work-dialog::backdrop {
  background: rgba(255, 255, 255, 0.94);
}
.work-dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.8;
}
.work-dialog-top span {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

#close-work {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
#close-work:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
#close-work:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 5px;
}

#work-detail-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(60rem, calc(100vw - 5.5rem));
  max-height: calc(100dvh - 8rem);
  margin: auto;
  object-fit: contain;
}

#work-detail-heading:not(.sr-only) {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.8;
  margin: 1.2rem 0 0.5rem;
}
#work-detail-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.8;
  margin: 1rem 0 0;
}
#work-detail-info dt {
  color: var(--muted);
}
#work-detail-info dd {
  margin: 0;
}

.diary-posts {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
}
.diary-posts li + li {
  margin-top: 0.65rem;
}
.diary-posts a {
  display: grid;
  grid-template-columns: 6.1rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
}
.diary-posts time {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.diary-posts span {
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .sidebar nav {
    gap: 0.65rem 1.2rem;
  }
  .works-categories {
    gap: 0.5rem 1rem;
  }
  main:has(#works:not([hidden]), #archive:not([hidden])) {
    padding-right: 1.5rem;
  }
  .image-gallery img {
    height: 6.75rem;
  }
  #work-dialog {
    max-width: calc(100vw - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    padding: 1rem;
  }
  #work-detail-image {
    max-width: calc(100vw - 3.5rem);
    max-height: calc(100dvh - 7rem);
  }
  .diary-posts a {
    grid-template-columns: 5.25rem minmax(0, 1fr);
    gap: 0.6rem;
  }
}

@media (max-width: 360px) {
  .image-gallery img {
    height: 6.25rem;
  }
}

#contact {
  max-width: 35rem;
}
#contact > h1 {
  margin-bottom: 1.1rem;
}
.contact-intro {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.9;
  margin-bottom: 2rem !important;
}

.contact-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}
.contact-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contact-field label {
  font-size: 0.875rem;
  line-height: 1.6;
}
.contact-field label span {
  color: var(--muted);
}

.contact-field input,
.contact-field textarea {
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid #cfcfcf;
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.6;
  padding: 0.65rem 0.8rem;
}
.contact-field input {
  min-height: 2.9rem;
}
.contact-field textarea {
  min-height: 11rem;
  resize: vertical;
}
.contact-field input:focus,
.contact-field textarea:focus {
  outline: 1px solid var(--ink);
  outline-offset: 1px;
}
.contact-field input[readonly],
.contact-field textarea[readonly] {
  background: #fafafa;
}

.contact-honeypot {
  display: none;
}
.contact-form-note {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.8;
}
#contact-send {
  appearance: none;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 1.8rem;
  min-width: 7rem;
  min-height: 2.75rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.6;
  cursor: pointer;
}
#contact-send:hover {
  background: #444;
}
#contact-send:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}
#contact-send:disabled {
  opacity: 0.55;
  cursor: wait;
}

.contact-status {
  font-size: 0.875rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.contact-status:empty {
  display: none;
}
.contact-status[data-state='error'] {
  color: #8b3333;
}
#contact .contact-links {
  margin-top: 2.5rem;
  font-size: 0.875rem;
  line-height: 1.8;
}

@media (max-width: 600px) {
  .contact-intro {
    margin-bottom: 1.6rem !important;
  }
  .contact-form {
    gap: 1.1rem;
  }
  #contact .contact-links {
    margin-top: 2rem;
  }
}

/* Larger hit areas retain the desktop menu's text positions. */
.sidebar nav a {
  padding: 0.625rem 0.5rem;
  margin: -0.625rem -0.5rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
}
.works-categories a,
.subcategories a {
  padding: 0.5rem 0.35rem;
  margin: -0.5rem -0.35rem;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}
.works-categories a[aria-current],
.subcategories a[aria-current] {
  text-decoration: underline;
  text-underline-offset: 0.4em;
  text-decoration-thickness: 1px;
}
.work-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.work-navigation button {
  appearance: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  min-height: 44px;
  padding: 0.5rem;
  cursor: pointer;
}
.work-navigation button:disabled {
  opacity: 0.3;
  cursor: default;
}
.work-navigation button:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}
#close-work {
  min-height: 44px;
  padding: 0.5rem;
}
#work-detail-image {
  touch-action: pan-y pinch-zoom;
}
.preview-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: #282828;
  color: #fff;
  font: 13px/1.6 sans-serif;
  padding: 0.75rem 1rem;
  text-align: center;
}
.preview-banner a {
  margin-left: 1rem;
  text-decoration: underline;
}
@media (max-width: 600px) {
  .sidebar nav a {
    margin: 0;
    padding: 0.625rem 0.35rem;
  }
  .sidebar nav {
    gap: 0 0.5rem;
  }
  .work-dialog-top {
    gap: 1rem;
  }
  .work-navigation {
    gap: 0.4rem;
  }
}
