* {
  box-sizing: border-box;
}

:root {
  --text: #2a2f31;
  --text-soft: #5f696d;
  --bg: #f3f5f2;
  --surface: #edf1ec;
  --accent: #1f4d3a;
  --accent-soft: #cfe0d8;
  --work-detail-accent: transparent;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent);
}

::-moz-selection {
  background: var(--accent-soft);
  color: var(--accent);
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scrollbar-gutter: stable;
}

body {
  min-height: 100vh;
  font-family: "Zen Kaku Gothic Antique", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  animation: pageFadeIn 420ms ease;
}

.site-header {
  width: min(960px, 92vw);
  margin: 1.1rem auto 0;
  padding: 1.2rem 0 1.9rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.top-page .site-header {
  width: min(100%, calc(100vw - 32px));
  margin-top: 0;
  padding: 1rem 0 0;
}

.top-page .site-nav,
.top-page .site-title {
  transform: translateY(0);
}

.site-title {
  margin: 0;
  font-size: 1.72rem;
  line-height: 1;
}

.site-title a {
  color: inherit;
  text-decoration: none;
  transition: color 220ms ease;
}

.site-title a:hover {
  color: var(--accent);
}

.char-hover-ready {
  display: inline-flex;
}

.char-hover-char {
  display: inline-block;
  transition: transform 180ms ease, color 180ms ease;
}

.char-hover-char:hover {
  transform: translateY(-1px) scale(1.12);
  color: var(--accent);
}

.char-hover-content-char {
  display: inline-block;
  transform-origin: 50% 82%;
  transition: transform 190ms cubic-bezier(0.2, 0.8, 0.2, 1), color 190ms ease,
    text-shadow 190ms ease;
}

.char-hover-content-char:hover {
  transform: translateY(-2px) scale(1.13) rotate(-2deg);
  color: var(--accent);
  text-shadow: 0 4px 12px rgba(31, 77, 58, 0.25);
}

.site-nav {
  display: flex;
  gap: 1.1rem;
  align-items: baseline;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 400;
  transition: color 220ms ease, transform 220ms ease;
}

.site-nav a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.site-nav a.is-current {
  font-weight: 700;
  color: var(--accent);
}

.top-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-page-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px 20px;
}

.top-hero {
  display: block;
  width: min(92vw, 1200px);
  height: auto;
  max-height: calc(100vh - 180px);
  object-fit: contain;
}

.works {
  width: min(960px, 92vw);
  margin: 2.4rem auto 2rem;
}

.works-grid {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.35rem 1.2rem;
}

.work-card {
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  text-decoration: none;
  display: block;
  padding: 0.42rem 0.42rem 0.36rem;
  transition: transform 280ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

.work-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 4px;
  background: var(--member-accent, transparent);
  transition: right 320ms ease, left 320ms ease, opacity 220ms ease;
  opacity: 0;
}

.work-card:hover::after,
.work-card:focus-visible::after {
  left: 0;
  right: 0;
  opacity: 1;
}

.work-card:hover,
.work-card:focus-visible {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.18);
}

.work-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  display: block;
  background: var(--surface);
  transition: transform 340ms ease;
}

.work-card:hover .work-thumb {
  transform: scale(1.015);
}

.work-title-group {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.2rem;
}

.work-title {
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.work-card-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.5;
}

.work-meta {
  margin-top: 0.78rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.work-card-date {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  text-align: right;
  white-space: nowrap;
}

.work-detail {
  position: relative;
  width: min(960px, 92vw);
  margin: 2.8rem auto 4rem;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  width: 12px;
  background: var(--work-detail-accent, transparent);
  pointer-events: none;
  z-index: 999;
  opacity: 1;
  box-shadow: none;
  transform-origin: top center;
  transform: scaleY(0);
  animation: sideLineReveal 620ms cubic-bezier(0.22, 1, 0.36, 1) 500ms forwards;
}

body::before {
  left: 0;
}

body::after {
  right: 0;
}

main {
  position: relative;
  z-index: 1;
}

@keyframes sideLineReveal {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.work-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.work-detail-title {
  margin: 0;
  font-size: 1.34rem;
  line-height: 1.35;
}

.work-subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.6;
}

.work-date {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  white-space: nowrap;
}

.work-head-row {
  margin-top: 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

.work-main-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--surface);
  margin-bottom: 0;
}

.work-text {
  margin-top: 1.4rem;
  margin-bottom: 2.2rem;
  line-height: 1.9;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.work-gallery {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.work-gallery-item {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--surface);
}

.image-fade {
  opacity: 0;
  transition: opacity 240ms ease;
}

.image-fade.is-loaded {
  opacity: 1;
}

.image-fade.is-failed {
  display: none;
}

.work-list {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
}

.work-section-title {
  margin: 2rem 0 0.7rem;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.5;
}

.about,
.member {
  width: min(960px, 92vw);
  margin: 2.4rem auto 3rem;
}

.archive {
  width: min(960px, 92vw);
  margin: 3.4rem auto 4.2rem;
}

.archive-view-toggle {
  margin-bottom: 2rem;
  display: flex;
  gap: 0.6rem;
}

.archive-view-button {
  border: 1px solid rgba(42, 47, 49, 0.2);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: color 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.archive-view-button:hover {
  color: var(--accent);
  border-color: rgba(31, 77, 58, 0.45);
  transform: translateY(-1px);
}

.archive-view-button.is-active {
  color: var(--accent);
  border-color: rgba(31, 77, 58, 0.5);
}

.archive-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 19rem;
}

.archive-item {
  display: block;
  padding-bottom: 0.2rem;
}

.archive-item + .archive-item {
  padding-top: 13.6rem;
  border-top: 1px solid rgba(42, 47, 49, 0.18);
}

.archive-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  display: block;
  background: var(--surface);
}

.archive-title {
  margin: 1.1rem 0 0;
  font-size: 1.05rem;
}

.archive-text {
  margin-top: 0.9rem;
  line-height: 1.85;
  font-size: 0.94rem;
}

.archive-text p {
  margin: 0 0 0.72rem;
}

.archive-gallery {
  margin-top: 1.15rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.archive-gallery-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.archive-gallery-row.is-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.archive-gallery-cell {
  min-width: 0;
}

.archive-gallery-cell.is-portrait {
  justify-self: center;
  width: min(100%, 420px);
}

.archive-gallery-item {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--surface);
}

.archive-meta {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.archive-meta-head {
  color: var(--text);
}

.archive-list.is-card-view {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.45rem 1.2rem;
}

.archive-list.is-card-view .archive-item {
  padding: 0;
  border: 0;
  cursor: pointer;
  transition: transform 260ms ease;
}

.archive-list.is-card-view .archive-item:hover {
  transform: translateY(-4px);
}

.archive-list.is-card-view .archive-item + .archive-item {
  padding-top: 0;
  border-top: 0;
}

.archive-list.is-card-view .archive-title {
  margin-top: 0.7rem;
  font-size: 0.95rem;
}

.archive-list.is-card-view .archive-text,
.archive-list.is-card-view .archive-gallery,
.archive-list.is-card-view .archive-meta {
  display: none !important;
}

.about-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1.6rem;
}

.about-image {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
}

.about-body {
  font-size: 1.05rem;
  line-height: 1.9;
  font-weight: 500;
}

.about-body p {
  margin: 0 0 0.72rem;
}

.about-mail {
  margin-top: 1.3rem;
  font-size: 0.9rem;
}

.about-mail a {
  color: var(--accent);
  transition: opacity 220ms ease;
}

.about-mail a:hover {
  opacity: 0.72;
}

.member-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

.member-card {
  text-decoration: none;
  color: inherit;
  transition: transform 280ms ease;
}

.member-card:hover {
  transform: translateY(-4px);
}

.member-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  display: block;
  background: var(--surface);
  transition: transform 340ms ease;
}

.member-card:hover .member-image {
  transform: scale(1.015);
}

.member-name-jp {
  margin: 0.55rem 0 0;
  font-size: 1rem;
}

.member-name-en {
  margin: 0.2rem 0 0;
  font-family: "Ovo", serif;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.member-profile {
  margin: 0.5rem 0 0;
  line-height: 1.8;
  font-size: 0.9rem;
}

.site-footer {
  width: min(960px, 92vw);
  margin: 3rem auto 1.6rem;
  color: #8f979a;
  font-size: 0.74rem;
  letter-spacing: 0.01em;
}

.site-footer small {
  font-size: inherit;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 820px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .site-nav {
    gap: 0.9rem;
    flex-wrap: wrap;
  }

  .works-grid {
    grid-template-columns: 1fr;
  }
}
