:root {
  --bg: #f7f7f7;
  --ink: #111111;
  --muted: #6f6a62;
  --muted-strong: #727272;
  --line: #d7d1c7;
  --accent: #16af92;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(var(--max-width), calc(100vw - 40px));
  margin: 0 auto;
}

.site-header {
  padding: 20px 0 0;
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}

.site-title {
  font-size: 1.28rem;
  line-height: 1.4;
  text-align: left;
  flex: 0 0 auto;
}

.site-title strong,
.site-title strong a {
  font-weight: 600;
  color: var(--accent);
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  letter-spacing: 0.08em;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.09);
  text-decoration: none;
}

.works,
.about,
.project,
.page-content {
  padding: 28px 0 56px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 18px;
  align-items: start;
}

.work,
.work-link,
.work-body {
  display: grid;
}

.work,
.work-link,
.work-body,
.project-hero {
  gap: 10px;
}

.work {
  gap: 3px;
}

.work-year,
.project-meta,
.footer,
.timeline-year,
.skill-label,
.external-links,
.contact {
  color: var(--muted);
}

.work-year {
  font-size: 0.95rem;
  line-height: 1.5;
}

.work-image,
.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(155deg, var(--image-a, #d9ddd6), var(--image-b, #c2cbc8));
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.work-image img,
.project-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.work-link .work-image {
  filter: grayscale(0.72) brightness(1.06) contrast(0.94);
}

.work-link:hover .work-image,
.work-link:focus-visible .work-image {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.08);
  filter: grayscale(0) brightness(1) contrast(1) saturate(1.04);
}

.work-title {
  font-size: 1.08rem;
  line-height: 1.4;
  font-weight: 400;
  color: var(--muted-strong);
}

.project-back {
  margin-bottom: 16px;
}

.project-back a {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  letter-spacing: 0.03em;
  transition: color 140ms ease;
}

.project-back a:hover {
  color: var(--ink);
}

.project-title {
  font-size: 1.28rem;
  line-height: 1.4;
  font-weight: 400;
  color: #444444;
  margin-top: 10px;
}

.project-meta {
  font-size: 0.9rem;
}

.project-text,
.bio,
.skill-value,
.external-links,
.page-body {
  color: #444444;
  line-height: 1.9;
  font-size: 0.94rem;
}

.bio p,
.page-body p {
  margin: 0 0 1em;
}

.bio > :first-child,
.page-body > :first-child {
  margin-top: 0;
}

.bio p:last-child,
.page-body p:last-child {
  margin-bottom: 0;
}

.intro {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.intro-copy {
  padding-top: 26px;
}

.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #ebe6dd;
  border: 1px solid var(--line);
  overflow: hidden;
}

.portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.portrait-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.name-block {
  margin-bottom: 18px;
  color: #444444;
}

.name-block h1,
.page-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: 600;
  color: #444444;
}

.name-block h1 {
  font-size: 1.64rem;
  font-weight: 400;
}

.name-block .name-ja {
  letter-spacing: 0.08em;
}

.name-block .roman {
  font-size: 0.88em;
  margin-left: 0.5em;
}

.name-block p {
  margin: 6px 0 0;
  line-height: 1.8;
  font-size: 0.95rem;
}

.contact {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.contact a,
.contact button {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.contact-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
}

.contact svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

.contact-email {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.contact-pop {
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translateX(-50%);
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease, visibility 120ms ease;
  white-space: normal;
  z-index: 10;
}

.contact-pop strong {
  display: block;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 4px;
}

.contact-item:hover .contact-pop,
.contact-item:focus-within .contact-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.contact-pop a,
.contact-pop button {
  width: auto;
  height: auto;
  min-height: 28px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
}

.contact-pop .pop-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section {
  margin-top: 34px;
}

.about .section {
  margin-top: 52px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 0.94rem;
  text-transform: uppercase;
  color: var(--accent);
}

.project .section-title {
  font-size: 0.88rem;
  color: var(--muted);
}

.about .section-title {
  margin-bottom: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.timeline,
.skills {
  display: grid;
  gap: 8px;
}

.skills {
  gap: 12px;
}

.timeline-item,
.skill-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 18px;
}

.timeline-body {
  line-height: 1.6;
  font-size: 0.86rem;
}

.timeline-body strong {
  display: block;
  font-weight: 400;
  color: var(--muted);
}

.timeline-year {
  font-size: 0.88rem;
  line-height: 1.7;
}

.skill-label {
  font-size: 0.88rem;
  line-height: 1.7;
}

.skill-value {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.external-links {
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.9;
}

.external-links a {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.page-content__inner {
  max-width: 52rem;
}

.project-content .page-body {
  max-width: 46rem;
}

.project-content .page-body figure {
  margin: 0 0 20px;
}

.project-content .page-body img {
  max-width: 100%;
  height: auto;
}

.page-title {
  margin-bottom: 18px;
}

.footer {
  padding: 16px 0 28px;
  font-size: 0.86rem;
}

@media (max-width: 720px) {
  .container {
    width: min(var(--max-width), calc(100vw - 24px));
  }

  .works-grid,
  .timeline-item,
  .skill-item {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding-top: 16px;
  }

  .site-header__inner {
    gap: 10px;
  }

  .site-nav {
    gap: 6px;
    font-size: 0.81rem;
  }

  .site-nav a {
    min-height: 29px;
    padding: 0 11px;
  }

  .works-grid {
    gap: 20px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .timeline-item {
    gap: 4px;
  }

  .skill-item {
    gap: 2px;
  }

  .works,
  .about,
  .project,
  .page-content {
    padding-top: 20px;
    padding-bottom: 44px;
  }

  .work-year,
  .project-meta,
  .project-text,
  .bio,
  .skill-value,
  .external-links,
  .page-body {
    font-size: 0.92rem;
    line-height: 1.75;
  }

  .project-back {
    margin-bottom: 14px;
  }

  .name-block h1,
  .page-title {
    font-size: 1.28rem;
  }

  .project-title {
    font-size: 1.14rem;
  }

  .contact {
    gap: 12px;
  }

  .contact-email {
    width: 100%;
    font-size: 0.88rem;
  }

  .contact-pop {
    left: 0;
    transform: none;
    min-width: min(220px, calc(100vw - 48px));
  }
}
