:root {
  --header-height: 76px;
  --ink: #111318;
  --paper: #fbfaf7;
  --line: rgba(17, 19, 24, 0.14);
  --caf: #e94f37;
  --per: #177e89;
  scrollbar-gutter: stable;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--paper);
  color: var(--ink);
}

body.is-modal-open {
  overflow: hidden;
}

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

.site-header {
  align-items: center;
  background: rgba(251, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  column-gap: clamp(12px, 1.4vw, 18px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: var(--header-height);
  left: 0;
  padding: 0 clamp(16px, 3vw, 42px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 20;
}

.primary-nav,
.social-nav {
  align-items: center;
  display: flex;
  gap: clamp(10px, 1.8vw, 22px);
}

.primary-nav a {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.primary-nav .nav-switch {
  background: var(--ink);
  color: #ffffff;
  padding: 9px 12px;
  transition: background 180ms ease, transform 180ms ease;
}

.caffeina-works-page .primary-nav .nav-switch:hover,
.caffeina-works-page .primary-nav .nav-switch:focus-visible {
  background: var(--per);
  transform: translateY(-2px);
}

.peristeronica-works-page .primary-nav .nav-switch:hover,
.peristeronica-works-page .primary-nav .nav-switch:focus-visible {
  background: var(--caf);
  transform: translateY(-2px);
}

.brand-logo {
  align-items: center;
  display: flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 700;
  gap: 0.22em;
  line-height: 1;
  white-space: nowrap;
}

.brand-logo span:first-child {
  color: var(--caf);
}

.brand-logo span:last-child {
  color: var(--per);
}

.social-nav {
  justify-content: flex-end;
}

.social-link {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  transition: transform 180ms ease, border-color 180ms ease;
  width: 34px;
}

.social-link:hover,
.social-link:focus-visible {
  border-color: currentColor;
  transform: translateY(-2px);
}

.social-link img {
  display: block;
  max-height: 18px;
  max-width: 18px;
  object-fit: contain;
}

.works-page {
  padding: clamp(34px, 6vw, 78px) clamp(18px, 6vw, 96px);
}

.works-hero {
  margin: 0 auto clamp(28px, 4vw, 48px);
  max-width: 1160px;
  padding: 0;
}

.section-kicker {
  color: var(--per);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 12px;
}

.works-hero h1,
.works-section h2 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  margin: 0;
}

.works-hero h1 {
  font-size: clamp(2.8rem, 7vw, 6.4rem);
}

.works-hero p {
  font-size: 1rem;
  line-height: 1.8;
  margin: 18px 0 0;
  max-width: 680px;
}

.works-section {
  margin-left: auto;
  margin-right: auto;
  max-width: 1160px;
}

.works-section + .works-section {
  margin-top: clamp(42px, 6vw, 76px);
}

.works-section h2 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  margin-bottom: clamp(18px, 3vw, 30px);
}

.works-list {
  display: grid;
  gap: clamp(28px, 4vw, 46px) clamp(18px, 3vw, 30px);
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.work-card {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: block;
  font: inherit;
  min-width: 0;
  padding: 0;
  text-align: left;
  transition: opacity 180ms ease, transform 180ms ease;
  width: 100%;
}

.peristeronica-works-page .work-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.caffeina-works-page .work-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.work-card:hover,
.work-card:focus-visible {
  opacity: 0.82;
  outline: none;
  transform: translateY(-2px);
}

.work-cover {
  aspect-ratio: 1;
  background: #ece7df;
  box-shadow: 0 1px 0 rgba(17, 19, 24, 0.08);
  margin: 0;
  overflow: hidden;
  position: relative;
}

.caffeina-works-page .work-cover {
  aspect-ratio: 16 / 9;
}

.type-music .work-cover {
  aspect-ratio: 16 / 9;
}

.work-card.aspect-square .work-cover {
  aspect-ratio: 1;
  margin-left: auto;
  margin-right: auto;
  width: 75%;
}

.type-1day-dtm .work-cover,
.type-illust .work-cover {
  aspect-ratio: 1;
  background: transparent;
  box-shadow: none;
  margin-left: auto;
  margin-right: auto;
  overflow: visible;
  width: 75%;
}

.work-cover-burst {
  isolation: isolate;
}

.burst-frame {
  background: #ece7df;
  border: 1px solid rgba(17, 19, 24, 0.2);
  box-shadow: 0 10px 24px rgba(17, 19, 24, 0.16);
  display: block;
  inset: 0;
  overflow: hidden;
  position: absolute;
}

.burst-frame-1 {
  z-index: 3;
}

.burst-frame-2 {
  transform: translateX(12%) scale(0.9);
  z-index: 2;
}

.burst-frame-3 {
  transform: translateX(24%) scale(0.8);
  z-index: 1;
}

.work-cover-burst .work-tag {
  z-index: 4;
}

.peristeronica-works-page .work-card::before {
  content: "";
  grid-area: 1 / 1;
  padding-top: 75%;
}

.caffeina-works-page .work-card::before {
  content: "";
  grid-area: 1 / 1;
  padding-top: 56.25%;
}

.peristeronica-works-page .work-cover {
  align-self: end;
  grid-area: 1 / 1;
  margin-top: 0;
}

.caffeina-works-page .work-cover {
  align-self: end;
  grid-area: 1 / 1;
  margin-top: 0;
}

.peristeronica-works-page .work-body {
  grid-area: 2 / 1;
}

.caffeina-works-page .work-body {
  grid-area: 2 / 1;
}

.peristeronica-works-page .work-card.aspect-square {
  display: grid;
}

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

.work-tag {
  background: var(--ink);
  bottom: 10px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 7px 9px;
  position: absolute;
  right: 10px;
}

.caffeina-works-page .work-tag {
  display: none;
}

.type-music .work-tag {
  background: var(--per);
}

.type-album .work-tag {
  background: var(--caf);
}

.type-game .work-tag,
.type-goods .work-tag {
  background: #6f5aa7;
}

.type-1day-dtm .work-tag,
.type-illust .work-tag,
.type-1day-movie .work-tag {
  background: #2d5f4f;
}

.work-body {
  display: grid;
  gap: 0;
  grid-template-rows: 1.45em 1.45em auto;
  padding: 14px 0 0;
}

.work-body h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.34rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  order: 3;
  overflow-wrap: anywhere;
}

.external-link-icon {
  display: inline-block;
  height: 0.78em;
  margin-left: 0.2em;
  position: relative;
  vertical-align: 0.02em;
  width: 0.78em;
}

.external-link-icon::before,
.external-link-icon::after {
  box-sizing: border-box;
  content: "";
  display: block;
  position: absolute;
}

.external-link-icon::before {
  border: 0.12em solid currentColor;
  bottom: 0;
  height: 0.58em;
  left: 0;
  width: 0.58em;
}

.external-link-icon::after {
  border-right: 0.12em solid currentColor;
  border-top: 0.12em solid currentColor;
  height: 0.48em;
  right: 0;
  top: 0;
  width: 0.48em;
}

.work-body p {
  color: rgba(17, 19, 24, 0.7);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-description {
  order: 1;
}

.work-role {
  color: rgba(17, 19, 24, 0.52);
  order: 2;
}

.work-body time {
  color: rgba(17, 19, 24, 0.58);
  display: none;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.works-modal {
  align-items: center;
  background: rgba(17, 19, 24, 0.76);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 50;
}

.works-modal.is-open {
  display: flex;
}

.works-modal-panel {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.3);
  max-height: min(780px, 90svh);
  max-width: min(980px, 94vw);
  overflow: hidden;
  width: 100%;
}

.works-modal-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
}

.works-modal-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1;
  margin: 0;
}

.works-modal-close {
  appearance: none;
  background: #ffffff;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 1.4rem;
  height: 40px;
  line-height: 1;
  width: 40px;
}

.works-modal-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 20px;
  scroll-snap-type: x mandatory;
}

.collection-slide {
  background: #ffffff;
  border: 1px solid var(--line);
  color: inherit;
  display: grid;
  flex: 0 0 min(420px, 82vw);
  scroll-snap-align: center;
  text-decoration: none;
}

.collection-slide img {
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  width: 100%;
}

.collection-slide div {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.collection-slide h3,
.collection-slide p {
  margin: 0;
}

.collection-slide time {
  color: rgba(17, 19, 24, 0.58);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.video-viewer {
  --viewer-gap: clamp(8px, 1.8vw, 24px);
  --viewer-padding: clamp(16px, 3.4vw, 42px);
  --viewer-arrow-width: clamp(42px, 5vw, 70px);
  --viewer-arrow-height: 48px;
  --viewer-close-gap: 10px;
  --viewer-close-size: 42px;
  --viewer-close-space: 0px;
  --viewer-jump-size: clamp(34px, 4vw, 52px);
  --viewer-video-width: min(
    1360px,
    calc(100vw - (var(--viewer-padding) * 2) - (var(--viewer-arrow-width) * 2) - (var(--viewer-gap) * 2)),
    calc((100svh - (var(--viewer-padding) * 2)) * 16 / 9)
  );
  --viewer-video-height: calc(var(--viewer-video-width) * 9 / 16);
  align-items: center;
  align-content: center;
  background: rgba(17, 19, 24, 0.78);
  display: none;
  gap: var(--viewer-gap);
  inset: 0;
  justify-content: center;
  padding: var(--viewer-padding);
  position: fixed;
  z-index: 70;
}

.video-viewer.is-open {
  display: flex;
}

.video-viewer-panel {
  background: #0d0f14;
  color: #ffffff;
  display: grid;
  flex: 0 1 var(--viewer-video-width);
  max-width: var(--viewer-video-width);
  min-width: 0;
  position: relative;
}

.video-viewer-frame {
  aspect-ratio: 16 / 9;
  background: #000000;
  display: grid;
  place-items: center;
  height: var(--viewer-video-height);
  width: 100%;
}

.video-viewer-frame iframe {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.video-viewer-frame a {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 12px 18px;
}

.video-viewer-close {
  appearance: none;
  background: rgba(255, 255, 255, 0.94);
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
  height: var(--viewer-close-size);
  line-height: 1;
  position: absolute;
  right: 0;
  top: 0;
  transform: translate(50%, -50%);
  width: var(--viewer-close-size);
  z-index: 1;
}

.video-viewer-controls {
  align-self: center;
  display: flex;
  flex: 0 0 var(--viewer-arrow-width);
  flex-direction: column;
  gap: var(--viewer-gap);
  height: var(--viewer-video-height);
}

.video-viewer-arrow {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  flex: 1 1 auto;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 300;
  height: auto;
  line-height: 1;
  min-height: 0;
  transition: background 180ms ease, border-color 180ms ease;
  width: 100%;
}

.video-viewer-jump {
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  display: none;
  flex: 0 0 var(--viewer-jump-size);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  font-weight: 800;
  height: var(--viewer-jump-size);
  line-height: 1;
  transition: background 180ms ease, border-color 180ms ease;
  width: 100%;
}

.video-viewer.has-jump-controls .video-viewer-jump {
  display: block;
}

.video-viewer-arrow:hover,
.video-viewer-arrow:focus-visible,
.video-viewer-jump:hover,
.video-viewer-jump:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.24);
  outline: none;
}

.video-viewer-arrow.is-disabled,
.video-viewer-jump.is-disabled {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.34);
  cursor: not-allowed;
}

.video-viewer-arrow.is-disabled:hover,
.video-viewer-arrow.is-disabled:focus-visible,
.video-viewer-jump.is-disabled:hover,
.video-viewer-jump.is-disabled:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

@media (max-aspect-ratio: 4 / 3) {
  .video-viewer {
    --viewer-close-space: calc(var(--viewer-close-size) + var(--viewer-close-gap));
    --viewer-video-width: min(
      1360px,
      calc(100vw - (var(--viewer-padding) * 2)),
      calc((100svh - (var(--viewer-padding) * 2) - var(--viewer-arrow-height) - var(--viewer-gap) - (var(--viewer-close-space) * 2)) * 16 / 9)
    );
    flex-wrap: wrap;
  }

  .video-viewer-panel {
    flex-basis: var(--viewer-video-width);
    max-width: var(--viewer-video-width);
    order: 1;
  }

  .video-viewer-close {
    right: 0;
    top: calc(-1 * var(--viewer-close-space));
    transform: none;
  }

  .video-viewer-controls {
    flex: 1 1 calc(50% - var(--viewer-gap));
    flex-direction: row;
    height: var(--viewer-arrow-height);
    order: 2;
  }

  .video-viewer-arrow {
    flex: 1 1 0;
    height: var(--viewer-arrow-height);
  }

  .video-viewer-jump {
    flex: 0 0 var(--viewer-arrow-height);
    height: var(--viewer-arrow-height);
    width: var(--viewer-arrow-height);
  }

  .video-viewer-controls-left .video-viewer-jump {
    order: 0;
  }

  .video-viewer-controls-left .video-viewer-arrow {
    order: 1;
  }

  .video-viewer-controls-right .video-viewer-arrow {
    order: 0;
  }

  .video-viewer-controls-right .video-viewer-jump {
    order: 1;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 108px;
  }

  .site-header {
    align-content: center;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: var(--header-height);
    justify-items: center;
    padding: 6px 14px;
    row-gap: 5px;
  }

  .primary-nav,
  .social-nav {
    justify-content: center;
  }

  .primary-nav {
    flex-wrap: wrap;
    grid-row: 2;
    row-gap: 4px;
  }

  .social-nav {
    flex-wrap: wrap;
    grid-row: 3;
    row-gap: 4px;
  }

  .brand-logo {
    font-size: 1.24rem;
    grid-row: 1;
  }

  .video-viewer {
    --viewer-arrow-width: 34px;
    --viewer-gap: 8px;
    --viewer-padding: 10px;
  }

  .video-viewer-panel {
    max-width: var(--viewer-video-width);
  }

  .video-viewer-arrow {
    font-size: 2rem;
  }

  .video-viewer-close {
    height: 36px;
    width: 36px;
  }
}

@media (max-width: 560px) {
  :root {
    --header-height: 102px;
  }

  .primary-nav a {
    font-size: 0.68rem;
  }

  .social-link {
    height: 26px;
    width: 26px;
  }

  .brand-logo {
    font-size: 0.94rem;
  }

  .works-list {
    gap: 24px 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-card {
    display: block;
  }

  .work-body {
    gap: 0;
    grid-template-rows: 1.45em 1.45em auto;
    padding: 10px 0 0;
  }

  .work-body h3 {
    font-size: 0.98rem;
  }

  .work-body p {
    font-size: 0.74rem;
  }

  .work-tag {
    bottom: 6px;
    font-size: 0.62rem;
    padding: 6px 7px;
    right: 6px;
  }

  .video-viewer {
    --viewer-arrow-width: 32px;
    --viewer-gap: 6px;
    --viewer-padding: 14px;
  }

  .video-viewer-panel {
    max-width: var(--viewer-video-width);
  }

  .video-viewer-arrow {
    flex-basis: auto;
  }
}

@media (max-width: 560px) and (max-aspect-ratio: 4 / 3) {
  .video-viewer-arrow {
    flex: 1 1 0;
  }
}

@media (max-width: 820px) and (orientation: landscape) {
  :root {
    --header-height: 58px;
  }

  .site-header {
    align-content: center;
    grid-template-columns: minmax(140px, 1fr) auto minmax(126px, 1fr);
    grid-template-rows: 1fr;
    height: var(--header-height);
    justify-items: stretch;
    padding: 0 12px;
  }

  .primary-nav {
    flex-wrap: nowrap;
    gap: clamp(6px, 1.4vw, 10px);
    grid-row: 1;
    justify-content: flex-start;
    min-width: 0;
    row-gap: 0;
  }

  .primary-nav a {
    font-size: 0.62rem;
    white-space: nowrap;
  }

  .primary-nav .nav-switch {
    max-width: 82px;
    overflow: hidden;
    padding: 7px 8px;
    text-overflow: ellipsis;
  }

  .brand-logo {
    font-size: clamp(0.98rem, 3vw, 1.28rem);
    grid-row: 1;
    justify-self: center;
  }

  .social-nav {
    flex-wrap: nowrap;
    gap: 6px;
    grid-row: 1;
    justify-content: flex-end;
    min-width: 0;
    row-gap: 0;
  }

  .social-link {
    height: 24px;
    width: 24px;
  }

  .social-link img {
    max-height: 14px;
    max-width: 14px;
  }
}

@media (hover: none) and (orientation: landscape) and (max-height: 560px) {
  :root {
    --header-height: 58px;
  }

  .site-header {
    align-content: center;
    column-gap: 10px;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 1fr;
    height: var(--header-height);
    justify-items: stretch;
    padding: 0 12px;
    row-gap: 0;
  }

  .brand-logo {
    font-size: clamp(0.92rem, 2.4vw, 1.18rem);
    grid-column: 2;
    grid-row: 1;
  }

  .primary-nav {
    flex-wrap: nowrap;
    gap: clamp(6px, 1.4vw, 10px);
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
    min-width: 0;
    row-gap: 0;
  }

  .primary-nav a {
    font-size: 0.62rem;
    white-space: nowrap;
  }

  .primary-nav .nav-switch {
    max-width: 82px;
    overflow: hidden;
    padding: 7px 8px;
    text-overflow: ellipsis;
  }

  .social-nav {
    flex-wrap: nowrap;
    gap: 6px;
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-end;
    row-gap: 0;
  }

  .social-link {
    height: 24px;
    width: 24px;
  }

  .social-link img {
    max-height: 14px;
    max-width: 14px;
  }
}
